@import url('./assets/cursors/cursor-theme.css');

/* ============================================
   DESIGN SYSTEM - CSS Variables
   ============================================ */
:root {
  /* Landing v2 tokens */
  --bg-deep: #05060f;
  --bg-surface: #0a0c1a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-disabled: #475569;
  --border: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(99, 102, 241, 0.25);

  /* Accent palette */
  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --grad-cta: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  --grad-hero-text: linear-gradient(135deg, #c084fc, #60a5fa, #34d399);
  --grad-glow: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99, 102, 241, 0.06), transparent 40%);
  --grad-mesh-1: radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.18), transparent 55%);
  --grad-mesh-2: radial-gradient(ellipse at 80% 15%, rgba(139, 92, 246, 0.14), transparent 55%);
  --grad-mesh-3: radial-gradient(ellipse at 50% 85%, rgba(6, 182, 212, 0.12), transparent 60%);

  /* Map legacy tokens */
  --color-primary: var(--accent-indigo);
  --color-primary-hover: #7c83f7;
  --color-primary-light: rgba(99, 102, 241, 0.14);
  --color-secondary: var(--accent-violet);
  --color-gradient-primary: var(--grad-primary);
  --color-gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --diamond-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --platinum-gradient: var(--grad-primary);

  --bg-accent-top: rgba(99, 102, 241, 0.2);
  --bg-primary: var(--bg-deep);
  --bg-secondary: var(--bg-surface);
  --bg-tertiary: #111327;
  --bg-overlay: rgba(5, 6, 15, 0.72);
  --bg-overlay-hover: rgba(5, 6, 15, 0.64);
  --bg-image-overlay-opacity: 0.65;

  /* Colors - Borders */
  --border-default: var(--border);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 255, 255, 0.18);

  /* Layout */
  --max-w: 1200px;
  --section-pad: 100px;
  --gap: 24px;

  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  /* Border Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-family: 'Inter', ui-sans-serif, -apple-system, system-ui, sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Shadows */
  --shadow-sm: 0 6px 16px rgba(3, 5, 15, 0.35);
  --shadow-md: 0 16px 40px rgba(3, 5, 15, 0.45);
  --shadow-lg: 0 30px 70px rgba(3, 5, 15, 0.55);
  --shadow-glow: 0 12px 32px rgba(99, 102, 241, 0.28);
  --shadow-glow-lg: 0 20px 50px rgba(99, 102, 241, 0.35);

  /* Transitions */
  --transition-fast: 0.12s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.35s ease;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 1000;
  --z-tooltip: 10000;
}

:root.theme-midnight,
body.theme-midnight {
  --color-primary: var(--accent-indigo);
  --color-primary-hover: #7c83f7;
  --color-primary-light: rgba(99, 102, 241, 0.14);
  --color-secondary: var(--accent-violet);
  --color-gradient-primary: var(--grad-primary);
  --color-gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --diamond-gradient: var(--grad-primary);
  --platinum-gradient: var(--grad-primary);
  --shadow-glow: 0 12px 32px rgba(99, 102, 241, 0.28);
  --shadow-glow-lg: 0 20px 50px rgba(99, 102, 241, 0.35);
}

:root.theme-emerald,
body.theme-emerald {
  --accent-indigo: #10b981;
  --accent-violet: #14b8a6;
  --accent-pink: #2dd4bf;
  --accent-blue: #22d3ee;
  --accent-cyan: #06b6d4;
  --color-primary: var(--accent-indigo);
  --color-primary-hover: #34d399;
  --color-primary-light: rgba(16, 185, 129, 0.18);
  --color-secondary: var(--accent-violet);
  --color-gradient-primary: linear-gradient(135deg, #10b981 0%, #14b8a6 50%, #2dd4bf 100%);
  --color-gradient-cyan: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%);
  --grad-cta: linear-gradient(135deg, #10b981 0%, #22d3ee 100%);
  --shadow-glow: 0 12px 32px rgba(16, 185, 129, 0.28);
  --shadow-glow-lg: 0 22px 52px rgba(16, 185, 129, 0.38);
  --diamond-gradient: var(--color-gradient-primary);
  --platinum-gradient: var(--color-gradient-primary);
}

:root.theme-sunset,
body.theme-sunset {
  --accent-indigo: #f97316;
  --accent-violet: #f43f5e;
  --accent-pink: #ec4899;
  --accent-blue: #fb923c;
  --accent-amber: #f59e0b;
  --color-primary: var(--accent-indigo);
  --color-primary-hover: #fb923c;
  --color-primary-light: rgba(249, 115, 22, 0.18);
  --color-secondary: var(--accent-violet);
  --color-gradient-primary: linear-gradient(135deg, #f97316 0%, #ef4444 55%, #ec4899 100%);
  --color-gradient-cyan: linear-gradient(135deg, #fb923c 0%, #f43f5e 100%);
  --grad-cta: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  --shadow-glow: 0 12px 32px rgba(249, 115, 22, 0.3);
  --shadow-glow-lg: 0 22px 52px rgba(239, 68, 68, 0.42);
  --diamond-gradient: var(--color-gradient-primary);
  --platinum-gradient: var(--color-gradient-primary);
}

:root.theme-ocean,
body.theme-ocean {
  --accent-indigo: #0ea5e9;
  --accent-violet: #2563eb;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --color-primary: var(--accent-indigo);
  --color-primary-hover: #38bdf8;
  --color-primary-light: rgba(14, 165, 233, 0.18);
  --color-secondary: var(--accent-violet);
  --color-gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #2563eb 55%, #3b82f6 100%);
  --color-gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --grad-cta: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --shadow-glow: 0 12px 32px rgba(14, 165, 233, 0.3);
  --shadow-glow-lg: 0 22px 52px rgba(37, 99, 235, 0.4);
  --diamond-gradient: var(--color-gradient-primary);
  --platinum-gradient: var(--color-gradient-primary);
}

/* ============================================
   BASE STYLES
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg-deep);
  background-image: var(--grad-mesh-1), var(--grad-mesh-2), var(--grad-mesh-3);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Opt-in selection for whitelisted areas */
.allow-select,
.allow-select * {
  user-select: text;
  -webkit-user-select: text;
}

/* Homepage background image overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px circle at 10% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(800px circle at 90% 0%, rgba(236, 72, 153, 0.12), transparent 62%),
    radial-gradient(1000px circle at 50% 100%, rgba(6, 182, 212, 0.14), transparent 65%);
  opacity: var(--bg-image-overlay-opacity);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}

/* Ensure app content sits above the overlay */
#app {
  position: relative;
  z-index: var(--z-base);
}

/* ============================================
   STANDARDIZED COMPONENT CLASSES
   ============================================ */

/* Typography Utilities */
.text-xs {
  font-size: var(--font-size-xs);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-base {
  font-size: var(--font-size-base);
}

.text-md {
  font-size: var(--font-size-md);
}

.text-lg {
  font-size: var(--font-size-lg);
}

.text-xl {
  font-size: var(--font-size-xl);
}

.text-2xl {
  font-size: var(--font-size-2xl);
}

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

.text-secondary {
  color: var(--text-secondary);
}

.font-normal {
  font-weight: var(--font-weight-normal);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

/* Button Component System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
  will-change: transform;
  -webkit-appearance: none;
  appearance: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.45);
  outline-offset: 2px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

/* Button Variants */
.btn-primary {
  background: var(--color-gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
  border-color: transparent;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-glow-lg);
}

.btn-secondary {
  background: #374151;
  color: #fff;
  border-color: transparent;
}

.btn-secondary:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.btn-ghost:hover {
  background: var(--bg-card);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  min-height: 28px;
}

.btn-md {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-base);
  min-height: 36px;
}

.btn-lg {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-md);
  min-height: 44px;
}

/* Card Component System */
.card {
  background: rgba(255, 255, 255, 0.03);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: var(--space-lg);
  box-shadow: none;
  backdrop-filter: none;
  transition: all 0.2s ease;
}

.card-hover:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  transform: none;
}

.card-elevated {
  box-shadow: var(--shadow-lg);
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   VOICEOVER / TTS GENERATION PROGRESS (Homepage)
   ============================================ */
.vs-gen-card {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vs-gen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.vs-gen-title {
  font-weight: 800;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.vs-gen-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(99, 102, 241, 0.65));
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14), 0 10px 20px rgba(99, 102, 241, 0.18);
  flex-shrink: 0;
}

.vs-gen-meta {
  font-size: 12px;
  color: rgba(148, 163, 184, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vs-gen-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(229, 231, 235, 0.92);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.vs-progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
}

.vs-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #3b82f6, #8b5cf6);
  background-size: 220% 100%;
  transition: width .22s ease;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.vs-progress-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.00) 0%,
      rgba(255, 255, 255, 0.10) 40%,
      rgba(255, 255, 255, 0.00) 70%);
  transform: translateX(-60%);
  opacity: 0.0;
  pointer-events: none;
}

.vs-progress-track.is-active::after {
  opacity: 0.9;
  animation: vsShimmer 1.2s linear infinite;
}

@keyframes vsShimmer {
  0% {
    transform: translateX(-60%);
  }

  100% {
    transform: translateX(160%);
  }
}

.vs-gen-status {
  font-size: 12px;
  color: rgba(148, 163, 184, 1);
  line-height: 1.35;
  min-height: 16px;
}

/* Input Component System */
.input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  transition: all var(--transition-base);
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.input:hover:not(:focus) {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

.input::placeholder {
  color: var(--text-muted);
}

/* Input Sizes */
.input-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
}

.input-md {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-base);
}

.input-lg {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-md);
}

/* Layout Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.gap-xs {
  gap: var(--space-xs);
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

/* Spacing Utilities */
.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.p-sm {
  padding: var(--space-sm);
}

.p-md {
  padding: var(--space-md);
}

.p-lg {
  padding: var(--space-lg);
}

/* Display Utilities */
.hidden {
  display: none !important;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.inline-flex {
  display: inline-flex;
}

/* Hoverable side rail — frosted, macOS-inspired */
#side-rail {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  right: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-lg);
  background: var(--bg-overlay);
  border: 1px solid var(--border-hover);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px) saturate(140%);
  z-index: var(--z-modal);
  transition: background var(--transition-base), border-color var(--transition-base);
}

#side-rail:hover {
  background: var(--bg-overlay-hover);
  border-color: var(--border-active);
}

#side-rail .nav-item {
  display: grid;
  grid-template-columns: 20px auto;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  min-width: 44px;
  border: 1px solid transparent;
  position: relative;
}

#side-rail .nav-item .label {
  max-width: 0;
  overflow: hidden;
  transition: max-width .25s ease;
}

#side-rail:hover .nav-item .label {
  max-width: 180px;
}

#side-rail .nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

#side-rail .nav-item.active {
  background: var(--color-gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow-lg);
}

#side-rail .icon {
  width: 20px;
  text-align: center;
}

/* Small circular counters on side rail items */
#side-rail .count-badge {
  position: absolute;
  top: 2px;
  right: var(--space-xs);
  background: var(--color-gradient-cyan);
  color: #fff;
  font-weight: var(--font-weight-bold);
  height: 18px;
  min-width: 18px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  line-height: 1;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

#side-rail .count-badge:empty {
  display: none;
}

@media (max-width: 900px) {
  #side-rail {
    right: 10px;
  }
}

@media (max-width: 640px) {
  #side-rail {
    display: none;
  }
}

#card-monthly {
  padding-top: 46px !important;
}

main {
  overflow: auto;
}

/* Docs pages should scroll the full document, not a constrained main */
.docs main {
  max-height: none;
  overflow: visible;
}

/* Docs aesthetics — Apple-inspired minimalism */
.docs .section-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.docs article.card {
  scroll-margin-top: 86px;
}

.docs .header-inner {
  padding: 16px 28px;
}

.docs .container {
  padding: 0 32px;
}

/* Align all docs "sticky" offsets with the docs scroll-margin-top */
.docs {
  --docs-sticky-top: 86px;
}

.docs .card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: saturate(130%);
}

.docs .section-header h2 {
  font-size: 20px;
  color: #e5e7eb;
  letter-spacing: -0.01em;
}

/* Docs: sticky, high-contrast section headers (articles only; don't affect TOC card) */
.docs article.card>.section-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /* Keep the header in normal flow (no negative margins) so it never covers
     the first lines of content before you scroll. */
  /* Solid background so underlying text never shows through */
  background: #0b1120;
  backdrop-filter: none;
  margin: 0 0 14px 0;
  padding: 10px 0 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  /* lightly opaque divider */
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}

.docs article.card>.section-header h2 {
  font-size: clamp(22px, 1.4vw + 16px, 28px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #e0f2fe;
  /* brighter so headers pop */
  text-shadow: 0 10px 30px rgba(34, 211, 238, 0.12);
}

.docs article.card>.section-header h2::after {
  content: none;
}

.docs article.card>.section-header::after {
  /* A second subtle line to reinforce separation (requested "lightly opaque one") */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
      rgba(99, 102, 241, 0.00),
      rgba(99, 102, 241, 0.22),
      rgba(34, 211, 238, 0.18),
      rgba(99, 102, 241, 0.00));
  pointer-events: none;
}

.docs .content {
  font-size: 19px;
  line-height: 1.75;
  color: #cbd5e1;
}

.docs .content h3 {
  font-size: 21px;
  color: #e5e7eb;
  margin: 16px 0 10px;
  letter-spacing: -0.01em;
}

.docs .content p {
  margin: 8px 0 12px;
}

.docs .content ul,
.docs .content ol {
  padding-left: 20px;
}

.docs .content li {
  margin: 6px 0;
}

.docs .cards>.card {
  margin-bottom: 18px;
}

.docs a {
  color: #c7d2fe;
  text-decoration: none;
}

.docs a:hover {
  color: #ffffff;
}

.docs a:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Mobile-only: prevent horizontal overflow on docs */
@media (max-width: 768px) {
  body.docs {
    overflow-x: hidden;
  }

  .docs .container,
  .docs .cards,
  .docs .card,
  .docs .content,
  .docs-yt-mobile,
  .docs-yt-mobile .yt-wrap {
    max-width: 100%;
    overflow-x: hidden;
  }

  .docs iframe,
  .docs img,
  .docs .content pre,
  .docs .content code {
    max-width: 100%;
  }
}

/* Docs TOC */
#docs-toc {
  position: sticky;
  top: var(--docs-sticky-top);
  max-height: calc(100vh - (var(--docs-sticky-top) + 16px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#docs-toc nav a {
  color: #cbd5e1;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 18px;
}

#docs-toc nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Responsive docs grid */
.docs-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .docs .header-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {
  .docs .container {
    padding: 0 16px;
  }

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

  #docs-toc {
    position: static;
    top: auto;
  }

  #docs-toc nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  #docs-toc nav a {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
  }
}

@media (max-width: 480px) {
  #docs-toc nav {
    grid-template-columns: 1fr;
  }
}

.brand-title {
  font-family: var(--font-family) !important;
  font-size: var(--font-size-lg) !important;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
  text-shadow: 0 4px 24px rgba(99, 102, 241, 0.25);
}

#app {
  max-width: 1340px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 15px);
  padding: var(--space-xl);
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.divider {
  height: 1px;
  width: 100%;
  background: var(--border-default);
  margin: 0 0 var(--space-lg);
  border-radius: 1px;
}

.brand h1 {
  font-size: var(--font-size-2xl);
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-base);
}

.actions-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.grid.fill {
  flex: 1;
}

.span-2 {
  grid-column: 1 / -1;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: saturate(120%);
  max-height: 500px;
  overflow: auto;
  position: relative;
  /* enable absolute-positioned controls like fullscreen */
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  margin-bottom: var(--space-lg);

}

.section-header h2 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  position: relative;
  cursor: default;
}

.section-header h2::after {
  content: none;
}

.section-header h2:hover {
  color: var(--text-primary);
  cursor: default;
}

.section-header h2:hover::after {
  content: none;
}

.controls-inline {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.controls-inline .toolbar-divider {
  align-self: stretch;
  width: 1px;
  background: var(--border-hover);
  margin: 0 var(--space-md);
  border-radius: 1px;
}

.controls-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
}

.quick-settings-row {
  display: none;
  /* Hidden by default, only show in fullscreen */
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  position: relative;
  padding-left: 32px;
  /* Space for collapse button */
}

/* Show quick settings row only in fullscreen mode */
body.vs-card-fullscreen #create-section.fullscreen .quick-settings-row {
  display: flex !important;
  margin-bottom: 16px;
}

/* Collapse button */
.quick-settings-collapse-btn {
  background: transparent;
  border: none;
  color: #a3a9b7;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.quick-settings-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}

.quick-settings-collapse-btn .collapse-icon {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  user-select: none;
}

.quick-settings-collapse-btn.collapsed .collapse-icon {
  transform: rotate(0deg);
}

.quick-settings-collapse-btn:not(.collapsed) .collapse-icon {
  transform: rotate(0deg);
}

/* Hide collapse button in fullscreen mode */
body.vs-card-fullscreen #create-section.fullscreen .quick-settings-collapse-btn {
  display: none !important;
}

body.vs-card-fullscreen #create-section.fullscreen .quick-settings-row {
  padding-left: 0;
}

/* Content wrapper */
.quick-settings-content {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex: 1;
  transition: all 0.3s ease;
  /* Allow tooltips to extend outside without being clipped */
  overflow: visible;
  width: 100%;
  margin: 0 auto;
}

.quick-settings-row.collapsed .quick-settings-content {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  visibility: hidden;
  overflow: hidden;
}

/* Keep children side by side when not in fullscreen */
#create-section .quick-settings-row .quick-settings-content {
  flex-wrap: nowrap;
}

/* Ensure children stay side by side and remove margins */
#create-section .quick-settings-row .quick-settings-content>#quick-settings,
#create-section .quick-settings-row .quick-settings-content>#voice-library-inline,
#create-section .quick-settings-row .quick-settings-content>#quick-sliders {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0 !important;
}

/* Voice library inline can take more space but still stay inline */
#create-section .quick-settings-row .quick-settings-content>#voice-library-inline {
  flex: 1 1 auto;
  min-width: 300px;
}

/* Fullscreen only: make quick sliders and quick settings horizontal rows */
body.vs-card-fullscreen #create-section.fullscreen #quick-sliders {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
}

body.vs-card-fullscreen #create-section.fullscreen #quick-sliders label.stack {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

body.vs-card-fullscreen #create-section.fullscreen #quick-sliders label.stack>.row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

body.vs-card-fullscreen #create-section.fullscreen #quick-settings {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
}

body.vs-card-fullscreen #create-section.fullscreen #quick-settings .qs-item {
  display: inline-flex;
  align-items: center;
}

/* Hide Clips panel title and PRO badge in quick-sliders - always hidden */
#create-section #quick-sliders .panel-title,
#quick-sliders .panel-title {
  display: none !important;
}

#create-section #quick-sliders .badge-pro,
#quick-sliders .badge-pro {
  display: none !important;
}

/* PRO badge and Clips label are always hidden - removed for cleaner UI */

/* Fullscreen Create: hide Remove audio, Re-use clips, and Add motion toggles */
body.vs-card-fullscreen #create-section.fullscreen #quick-settings .qs-item {
  display: none !important;
}

/* Fullscreen Create: hide per-section end-time sliders; show only input */
body.vs-card-fullscreen #create-section.fullscreen #sections-container input[type="range"] {
  display: none !important;
}

.quick-settings {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding: var(--space-md);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  width: 100%;
  transition: all var(--transition-base);
}

/* Override general quick-settings for #quick-sliders in create section */
#create-section #quick-sliders.quick-settings {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  padding: 24px !important;
  transition: all 0.2s ease !important;
  background-image: none !important;
  box-shadow: none !important;
}

#create-section .section-header .controls-inline>.panel-title {
  display: none;
}

body.vs-card-fullscreen #create-section.fullscreen .section-header .controls-inline>.panel-title {
  display: inline-block;
}

.quick-settings.hidden {
  display: none;
}

.quick-settings .qs-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
}

/* Info tooltip styles for quick settings and sliders */
.info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1;
}

.info-wrap:hover {
  z-index: 999999;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  margin-left: 6px;
  cursor: default;
  transition: filter .15s ease, transform .15s ease;
  user-select: none;
  line-height: 1;
}

.info-icon:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.info-tooltip {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  white-space: normal;
  display: inline-block;
  background: rgba(2, 6, 23, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  z-index: 999999;
  width: max-content;
  max-width: min(130px, 85vw);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  line-height: 1.35;
}

.info-wrap:hover .info-tooltip {
  opacity: 1;
  pointer-events: auto;
}

.info-tooltip::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent rgba(255, 255, 255, 0.12) transparent transparent;
}

.info-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent rgba(2, 6, 23, 0.92) transparent transparent;
  margin-right: -1px;
}

/* Tooltip that opens to the left */
.info-wrap-left .info-tooltip {
  left: auto;
  right: calc(100% + 8px);
}

.info-wrap-left .info-tooltip::before {
  right: auto;
  left: 100%;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.12);
}

.info-wrap-left .info-tooltip::after {
  right: auto;
  left: 100%;
  margin-right: 0;
  margin-left: -1px;
  border-color: transparent transparent transparent rgba(2, 6, 23, 0.92);
}

/* Timeline styles */
.plan-timeline-wrap {
  padding: 8px 0 4px;
  overflow: auto;
}

.plan-timeline {
  position: relative;
  width: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-timeline-inner {
  position: relative;
}

.timeline-row {
  width: 100%;
  height: 52px;
}

.timeline-lane {
  position: relative;
}

/* Timeline Component Styles */
.vs-timeline-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.vs-timeline-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: auto;
}

.vs-timeline-inner {
  position: relative;
  min-width: 100%;
}

.vs-timeline-ruler {
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.vs-timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #6366f1;
  pointer-events: none;
  z-index: 100;
}

.vs-timeline-ghost-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(99, 102, 241, 0.5);
  pointer-events: none;
  z-index: 99;
}

.vs-timeline-snap-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #6366f1;
  pointer-events: none;
  z-index: 150;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.8);
  animation: vs-snap-pulse 0.3s ease-out;
}

@keyframes vs-snap-pulse {
  0% {
    opacity: 0;
    transform: scaleY(0.5);
  }

  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}

.vs-timeline-track-row {
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.vs-timeline-track-label {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #cbd5e1;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  user-select: none;
}

.vs-timeline-track-lane {
  position: absolute;
  left: 120px;
  top: 0;
  bottom: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.02);
}

.vs-timeline-clip {
  position: absolute;
  height: calc(100% - 4px);
  top: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: grab;
  display: flex;
  align-items: center;
  padding: 0 6px;
  overflow: hidden;
  user-select: none;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.vs-timeline-clip:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.vs-timeline-clip.dragging {
  cursor: grabbing;
  z-index: 50;
}

.vs-timeline-clip-label {
  font-size: 11px;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.vs-timeline-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.2s;
}

.vs-timeline-resize-handle-left {
  left: 0;
  border-radius: 4px 0 0 4px;
}

.vs-timeline-resize-handle-right {
  right: 0;
  border-radius: 0 4px 4px 0;
}

.vs-timeline-clip:hover .vs-timeline-resize-handle {
  opacity: 1;
}

.vs-timeline-clip.dragging .vs-timeline-resize-handle {
  opacity: 1;
}

.timeline-clip {
  transition: box-shadow .12s ease, outline .12s ease;
}

.timeline-clip:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* Selected clip styling - higher specificity to override hover */
.timeline-clip.timeline-clip-selected {
  outline: 2px solid #6366f1 !important;
  outline-offset: -1px !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3) !important;
}

.timeline-clip.timeline-clip-selected:hover {
  outline: 2px solid #6366f1 !important;
  outline-offset: -1px !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3) !important;
}

/* Inspector Panel */
.vc-inspector-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: rgba(17, 24, 39, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vc-inspector-panel.open {
  transform: translateX(0);
}

.vc-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.vc-inspector-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #e5e7eb;
}

.vc-inspector-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.vc-inspector-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.vc-inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.vc-inspector-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 40px 20px;
}

.vc-inspector-section {
  margin-bottom: 24px;
}

.vc-inspector-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.vc-inspector-field {
  margin-bottom: 16px;
}

.vc-inspector-field label {
  display: block;
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 6px;
  font-weight: 600;
}

.vc-inspector-field input[type="text"],
.vc-inspector-field input[type="number"],
.vc-inspector-field textarea,
.vc-inspector-field select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 14px;
  font-family: inherit;
}

/* Inspector dropdown styling */
.vc-inspector-field .vs-dd {
  width: 100%;
}

.vc-inspector-field .vs-dd-btn {
  width: 100%;
}

.vc-inspector-field .vs-dd-menu {
  z-index: 20060 !important;
  font-size: 14px;
  font-family: inherit;
}

.vc-inspector-field input[type="range"] {
  width: 100%;
}

.vc-inspector-field textarea {
  min-height: 80px;
  resize: vertical;
}

.vc-inspector-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.vc-inspector-row .vc-inspector-field {
  flex: 1;
  margin-bottom: 0;
}

.vc-inspector-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vc-inspector-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.vc-inspector-color-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.vc-inspector-color-row input[type="color"] {
  width: 50px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  background: none;
}

.vc-inspector-color-row input[type="text"] {
  flex: 1;
}

/* Timeline Zoom Controls */
.vc-timeline-zoom-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 101;
  background: rgba(17, 24, 39, 0.9);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.vc-zoom-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.vc-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.vc-zoom-slider {
  width: 120px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

.vc-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #6366f1;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
  transition: background 0.2s, transform 0.2s;
}

.vc-zoom-slider::-webkit-slider-thumb:hover {
  background: #818cf8;
  transform: scale(1.1);
}

.vc-zoom-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #6366f1;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
  transition: background 0.2s, transform 0.2s;
}

.vc-zoom-slider::-moz-range-thumb:hover {
  background: #818cf8;
  transform: scale(1.1);
}

/* Timeline Zoom Controls */
.vc-timeline-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Reusable dashed panel to separate sections (matches Create quick-settings look) */
.dashed-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.panel-title {
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* When a panel title appears inside top CTA wrapper, place it on its own row */
.section-header .controls-inline>.panel-title {
  flex: 0 0 100%;
  margin-bottom: 4px;
}

/* ============================================
   MINIMALIST CREATE SECTION STYLES
   ============================================ */

/* Create Section Header - Clean & Minimal */
#create-section .create-header {
  margin-bottom: 32px;
}

#create-section .create-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

#create-section .create-title {
  font-size: 28px;
  font-weight: 600;
  color: #f3f4f6;
  margin: 0;
  letter-spacing: -0.02em;
}

#create-section .create-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 20px;
}

#create-section .create-title-input {
  flex: 0 1 250px;
  min-width: 150px;
  max-width: 250px;
  height: 36px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  color: #e5e7eb;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
}

/* Minimalist Buttons */
#create-section .create-btn-secondary,
#create-section .create-btn-primary {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#create-section .create-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#create-section .create-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

#create-section .create-btn-primary {
  background: #6366f1;
  color: #ffffff;
  font-weight: 600;
}

/* Diamond: make primary Export Video button follow theme */
body.diamond-active #create-section .create-btn-primary,
#create-section .create-btn-primary.diamond-active {
  background: var(--diamond-gradient);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
}

#create-section .create-btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Diamond: keep Export Video button themed on hover */
body.diamond-active #create-section .create-btn-primary:hover,
#create-section .create-btn-primary.diamond-active:hover {
  background: var(--diamond-gradient);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow-lg);
}

#create-section .create-btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s ease;
}

#create-section .create-btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
}

/* Action Cards Grid - Clean Card Layout */
#create-section .create-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

#create-section .create-action-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.2s ease;
}

#create-section .create-action-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

#create-section .create-action-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

#create-section .create-action-icon {
  width: 24px;
  height: 24px;
  color: #6366f1;
  flex-shrink: 0;
}

#create-section .create-action-title {
  font-size: 18px;
  font-weight: 600;
  color: #f3f4f6;
  margin: 0;
  letter-spacing: -0.01em;
}

#create-section .create-action-desc {
  font-size: 14px;
  color: #9ca3af;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

#create-section .create-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#create-section .create-action-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#create-section .create-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

#create-section .create-action-btn-primary {
  background: #6366f1;
  border-color: #6366f1;
  color: #ffffff;
  font-weight: 600;
}

/* Diamond: make Find Videos / Find Images primary buttons follow theme */
body.diamond-active #create-section .create-action-btn-primary {
  background: var(--diamond-gradient);
  border-color: transparent;
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
}

#create-section .create-action-btn-primary:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Audio Tracks Display */
#create-section .create-audio-tracks {
  margin-bottom: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

#create-section .create-section-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: #f3f4f6;
  margin: 0 0 16px 0;
}

#create-section .create-audio-track-list {
  display: grid;
  gap: 12px;
}

/* Empty Drop Area - shown when no pages have files */
#create-empty-drop-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  margin: 40px 20px;
  padding: 60px 40px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

#create-empty-drop-area:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

#create-empty-drop-area.dragover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  border-style: solid;
}

#create-empty-drop-area.hidden {
  display: none;
}

#create-empty-drop-area .create-empty-drop-icon {
  font-size: 80px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 24px;
  animation: bounce 2s infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

#create-empty-drop-area .create-empty-drop-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#create-empty-drop-area .create-empty-drop-title {
  font-size: 24px;
  font-weight: 600;
  color: #f3f4f6;
}

#create-empty-drop-area .create-empty-drop-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
}

/* Fullscreen mode: make drop area larger and more prominent */
body.vs-card-fullscreen #create-section.fullscreen #create-empty-drop-area {
  min-height: 500px;
  margin: 60px 40px;
  padding: 80px 60px;
}

body.vs-card-fullscreen #create-section.fullscreen #create-empty-drop-area .create-empty-drop-icon {
  font-size: 120px;
  margin-bottom: 32px;
}

body.vs-card-fullscreen #create-section.fullscreen #create-empty-drop-area .create-empty-drop-title {
  font-size: 32px;
}

body.vs-card-fullscreen #create-section.fullscreen #create-empty-drop-area .create-empty-drop-subtitle {
  font-size: 18px;
}

/* Legacy dashed-panel support (for backward compatibility) */
#create-section .dashed-panel {
  position: relative;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.08);
  border-width: 1px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
}

#create-section .dashed-panel::before {
  display: none;
}

/* Homepage: Flat minimalist style for all dashed panels in cards */
.card .dashed-panel {
  position: relative;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.08);
  border-width: 1px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  transition: all 0.2s ease;
}

.card .dashed-panel:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.card .dashed-panel::before {
  display: none;
}

/* Override elevated styling for quick-sliders and quick-settings in create section */
#create-section.card #quick-sliders,
#create-section.card .quick-settings,
.card #create-section #quick-sliders,
.card #create-section .quick-settings {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  box-shadow: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
}

#create-section.card #quick-sliders::before,
#create-section.card .quick-settings::before,
.card #create-section #quick-sliders::before,
.card #create-section .quick-settings::before {
  display: none !important;
}

/* Create section: Flat minimalist Quick Settings - match action cards */
/* Quick sliders (Min/Max clip length, Total length) - flat styling */
#create-section #quick-sliders {
  display: flex !important;
  justify-content: center;
  align-items: center;
  position: relative !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  padding: 24px !important;
  margin-top: 16px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  /* Override any gradient backgrounds */
  background-image: none !important;

}

#create-section #quick-sliders:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

#create-section #quick-sliders::before {
  display: none !important;
}

/* Also override for quick-settings class when used in create section */
#create-section .quick-settings {
  position: relative !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  padding: 24px !important;
  margin-top: 16px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  /* Override any gradient backgrounds */
  background-image: none !important;
}

#create-section .quick-settings:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

#create-section .quick-settings::before {
  display: none !important;
}

/* Voice Library Styles */
#vl-list-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Custom scrollbar matching dark/blue theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Windows Custom Title Bar Styles */
.window-controls {
  display: none;
}

body.platform-win32 #app {
  padding-top: 0 !important;
  /* Move content up as native title bar is hidden */
}

body.platform-win32 .window-controls {
  position: fixed;
  top: 0;
  right: 0;
  height: 32px;
  display: flex;
  align-items: stretch;
  z-index: 10000;
  -webkit-app-region: no-drag;
}

body.platform-win32 .window-control-btn {
  width: 46px;
  height: 32px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-primary, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
}

body.platform-win32 .window-control-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.platform-win32 .window-control-btn:active {
  background: rgba(255, 255, 255, 0.16);
}

body.platform-win32 .window-control-btn.window-close:hover {
  background: #c42b1c;
  color: #ffffff;
}

body.platform-win32 .window-control-btn.window-close:active {
  background: #a61f16;
  color: #ffffff;
}

body.platform-win32 .wc-icon {
  position: relative;
  width: 12px;
  height: 12px;
  display: block;
}

body.platform-win32 .wc-minimize::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 2px;
  background: currentColor;
}

body.platform-win32 .wc-maximize::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  box-sizing: border-box;
}

body.platform-win32 #window-maximize.is-maximized .wc-maximize::before {
  width: 9px;
  height: 9px;
  left: 3px;
  top: 3px;
}

body.platform-win32 #window-maximize.is-maximized .wc-maximize::after {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  box-sizing: border-box;
  background: transparent;
}

body.platform-win32 .wc-close::before,
body.platform-win32 .wc-close::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: currentColor;
  transform: translateY(-50%) rotate(45deg);
}

body.platform-win32 .wc-close::after {
  transform: translateY(-50%) rotate(-45deg);
}

body.platform-win32 .header-bar {
  -webkit-app-region: drag;
  /* Make the whole header a handle */
  padding-top: 10px;
  /* Add some space for aesthetics */
  padding-bottom: 10px;
  padding-right: 150px;
  /* Reserve space for overlay controls (min/max/close) */
  background: var(--bg-primary);
  /* Ensure it matches the theme */
  color: #ffffff;
  /* Ensure text is white */
}

/* Exclude interactive elements from drag region */
body.platform-win32 .header-bar button,
body.platform-win32 .header-bar input,
body.platform-win32 .header-bar a,
body.platform-win32 .header-bar .brand,
body.platform-win32 .header-bar .user-profile,
body.platform-win32 .header-bar .action-btn {
  -webkit-app-region: no-drag;
}

#vl-list-container::-webkit-scrollbar {
  width: 8px;
}

#vl-list-container::-webkit-scrollbar-track {
  background: transparent;
}

#vl-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

#vl-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.vl-item:last-child {
  border-bottom: none !important;
}

/* Prompt Library Styles */
#prompt-list-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#prompt-list-container::-webkit-scrollbar {
  width: 8px;
}

#prompt-list-container::-webkit-scrollbar-track {
  background: transparent;
}

#prompt-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

#prompt-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.prompt-item:last-child {
  border-bottom: none !important;
}

.prompt-item.dragging {
  opacity: 0.5;
  background: rgba(99, 102, 241, 0.2) !important;
}

/* Override inline dashed styling on the voice library inline panel */
#voice-library-inline {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

.badge-pro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
}

/* Platinum badge style to match Create with AI button gradient */
.badge-platinum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #ffffff;
}

/* Diamond badge style */
.badge-diamond {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #e5e7eb;
}

/* Neutral badge style for Free plan */
.badge-free {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.badge-beta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #111827;
}

/* Fancy range slider matching app style */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  /* visual track height */
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.5));
  outline: none;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: 0;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 10px 30px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  margin-top: -4px;
  /* center thumb on 10px track (18-10)/2 */
}

.range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: 0;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 10px 30px rgba(99, 102, 241, 0.35);
  cursor: pointer;
}

.range::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.35));
}

.range::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.range::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.35));
}

.range::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.35));
}

.range:focus {
  filter: brightness(1.05);
}

/* Filled portion using background-size trick via JS */
.range.fillable {
  background-image: linear-gradient(90deg, #6366f1, #8b5cf6);
  background-repeat: no-repeat;
  background-size: 0% 100%;
}

.pro-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: 0;
  transition: all var(--transition-base);
}

.pro-cta .pro-cta-text {
  font-size: var(--font-size-base);
}

.pro-cta .pro-cta-note {
  font-size: var(--font-size-sm);
  opacity: 0.8;
  margin-left: auto;
}

.pro-cta .pro-cta-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: #374151;
  color: white;
  text-decoration: none;
  line-height: 1;
  transition: all var(--transition-base);
  will-change: transform;
}

.cta-button.primary {
  background: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

.cta-button:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.cta-button:active {
  transform: translateY(0) scale(0.98);
}

.ed-drop-area {
  border: 2px dashed rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  margin: 8px 0 6px;
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  font-size: 13px;
  cursor: pointer;
  transition: background-color .2s ease, box-shadow .2s ease, border-color .2s ease, transform .1s ease;
}

.ed-drop-area.dragover {
  background-color: rgba(148, 163, 184, 0.08);
}

.ed-drop-area:hover {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  transform: translateY(-1px);
}

.link-button {
  background: transparent;
  color: #93c5fd;
  text-decoration: underline;
}

#create-project-cta-paste:hover,
#create-project-cta-paste:focus,
#create-project-cta-paste:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}

/* Custom tonal select (native appearance removed, chevron added) */
.select-tonal {
  -webkit-appearance: none;
  appearance: none;
  min-width: 200px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 36px 10px 12px;
  line-height: 1.2;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}

.select-tonal:hover {
  filter: brightness(1.06);
}

.select-tonal:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
  border-color: transparent;
}

.select-tonal::-ms-expand {
  display: none;
}

/* Global custom select: apply a consistent look to all dropdowns by default.
   Opt out with .native-select. Avoid overriding explicit component styles. */
select:not(.native-select):not(.select-tonal):not(.ai-select) {
  -webkit-appearance: none;
  appearance: none;
  min-width: 140px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 36px 10px 12px;
  line-height: 1.2;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}

select:not(.native-select):not(.select-tonal):not(.ai-select):hover {
  filter: brightness(1.06);
}

select:not(.native-select):not(.select-tonal):not(.ai-select):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
  border-color: transparent;
}

select:not(.native-select):not(.select-tonal):not(.ai-select)::-ms-expand {
  display: none;
}

/* Dark dropdown list items for consistency */
select option {
  background: #0f172a;
  color: #e5e7eb;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

button {
  padding: var(--space-sm) var(--space-lg);
  border: none;
  background: #374151;
  color: #ffffff;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-base), filter var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
  -webkit-appearance: none;
  appearance: none;
  will-change: transform;
}

button:hover {
  filter: brightness(1.1);
}

.primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

/* Ensure Import button in library modal matches export button purple styling */
#library-import.primary {
  background: #6366f1 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35) !important;
}

#library-import.primary:disabled {
  background: #6366f1 !important;
  color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35) !important;
  opacity: 0.7;
  cursor: not-allowed;
}

.secondary {
  background: #374151;
  color: #ffffff;
}

/* Universal button elevation on hover/active (applies to real buttons and button-like anchors) */
:where(button, a.btn, .cta-button, .mini-btn, .fs-btn, .dup-btn, .help-like, #layout-toggle .seg-btn, .pagination button, .custom-tab) {
  transition: transform .12s ease, box-shadow .2s ease;
  will-change: transform;
}

:where(button, a.btn, .cta-button, .mini-btn, .fs-btn, .dup-btn, .help-like, #layout-toggle .seg-btn, .pagination button, .custom-tab):hover {
  transform: translateY(-2px);
}

:where(button, a.btn, .cta-button, .mini-btn, .fs-btn, .dup-btn, .help-like, #layout-toggle .seg-btn, .pagination button, .custom-tab):active {
  transform: translateY(0) scale(0.98);
}

:where(button, a.btn, .cta-button, .mini-btn, .fs-btn, .dup-btn, .help-like, #layout-toggle .seg-btn, .pagination button, .custom-tab):focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.45);
  outline-offset: 2px;
}

/* Import Library modal: avoid hover "lift" clipping inside scroll/overflow containers */
#library-modal :where(button, a.btn, .cta-button, .mini-btn, .fs-btn, .dup-btn, .help-like, #layout-toggle .seg-btn, .pagination button, .custom-tab):hover {
  transform: none !important;
}

#library-modal :where(button, a.btn, .cta-button, .mini-btn, .fs-btn, .dup-btn, .help-like, #layout-toggle .seg-btn, .pagination button, .custom-tab):active {
  transform: scale(0.99) !important;
}

/* Advanced editor play button interactivity */
#ed-toggle-btn {
  cursor: pointer;
  transition: transform .12s ease, filter .2s ease;
  will-change: transform;
  touch-action: manipulation;
}

#ed-toggle-btn:hover {
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.03);
}

#ed-toggle-btn:active {
  transform: translateY(0) scale(0.97);
  filter: brightness(0.96);
}

#ed-toggle-btn:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.5);
  outline-offset: 3px;
}

#layout-toggle.segmented {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: 12px;
  margin-left: auto;
}

#layout-toggle .seg-btn {
  background: transparent;
  color: #cbd5e1;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

#layout-toggle .seg-btn.active {
  background: #6366f1;
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

/* General segmented button styling for ideas tabs and other uses */
.segmented {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
  border-radius: 12px;
}

.seg-btn {
  background: transparent;
  width: fit-content;
  color: #cbd5e1;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.seg-btn.active {
  background: #6366f1;
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.seg-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
}

#file-list {
  display: none;
}

#sections-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.section-block {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  transition: all 0.2s ease;
}

.section-block:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.section-block::before {
  display: none;
}

.section-block.intro {
  border-color: rgba(59, 130, 246, 0.35);
}

.section-block.outro {
  border-color: rgba(168, 85, 247, 0.35);
}

.section-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-block-header h3 {
  margin: 0;
  font-size: 14px;
  color: #cbd5e1;
}

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

/* Highlight header when it is a drop target */
.section-block-header.drag-over {
  box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.45);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.10);
}

.media-list {
  list-style: none;
  padding: 0;
}

.media-list li {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin: 5px;
  position: relative;
}

.media-list li video {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Visual feedback when dragging files over a page list on the homepage */
.media-list {
  transition: background-color .15s ease, box-shadow .15s ease;
}

.media-list.drag-over {
  outline: 2px dashed rgba(99, 102, 241, 0.55);
  outline-offset: 4px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.media-list li.dragging {
  opacity: 0.6;
}

#file-list li {
  display: inline-block;
  margin: 5px;
  position: relative;
}

#file-list li video {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

#status {
  min-height: 20px;
  text-align: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#create-section .create-queue-message {
  margin-top: 8px;
  margin-bottom: 6px;
  text-align: center;
  color: #cbd5e1;
  font-weight: 600;
}

#status:empty {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#status.error {
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* Success status appearance */
#status.success {
  color: #14532d;
  background-color: #dcfce7;
  border: 1px solid #86efac;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

#status.success~#status-floating {
  background: rgba(6, 95, 70, 0.95);
  border-color: rgba(16, 185, 129, 0.35);
}

.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  /* Tinted, slightly blurred backdrop to match editor overlays */
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 12050;
  /* ensure modals are above fullscreen cards and overlays */
}

/* Ensure Homepage Hub BGM settings modal always captures clicks above the hub */
#home-bgm-settings-modal:not(.hidden) {
  z-index: 20040 !important;
  /* above homepage hub (20000) */
  position: fixed !important;
  inset: 0 !important;
  pointer-events: auto !important;
}

#home-bgm-settings-modal:not(.hidden) .modal-content {
  z-index: 20041 !important;
  pointer-events: auto !important;
}

/* Find Videos modal needs higher z-index to appear above edit panels */
#yt-modal:not(.hidden) {
  z-index: 20050 !important;
}

#yt-modal:not(.hidden) .modal-content {
  z-index: 20051 !important;
}

/* Multiple URLs modal needs even higher z-index to appear above Find Videos modal */
#yt-multiple-urls-modal:not(.hidden) {
  z-index: 20070 !important;
  display: flex !important;
  position: fixed !important;
}

#yt-multiple-urls-modal:not(.hidden) .modal-content {
  z-index: 20071 !important;
}

/* YouTube Upload modal needs high z-index */
#yt-upload-modal:not(.hidden) {
  z-index: 20060 !important;
  display: flex !important;
  position: fixed !important;
}

#yt-upload-modal:not(.hidden) .modal-content {
  z-index: 20061 !important;
}

/* When homepage hub is visible, modals should appear on top */
.vs-homepage-hub-open .modal:not(.hidden),
#settings-modal:not(.hidden) {
  z-index: 20030 !important;
  /* above homepage hub (20000) and home-return (20010) */
  display: flex !important;
  position: fixed !important;
}

.vs-homepage-hub-open #yt-modal:not(.hidden) {
  z-index: 20050 !important;
  /* even higher when homepage hub is open */
}

.vs-homepage-hub-open #yt-modal:not(.hidden) .modal-content {
  z-index: 20051 !important;
}

.vs-homepage-hub-open #yt-multiple-urls-modal:not(.hidden) {
  z-index: 20070 !important;
  /* above Find Videos modal even when homepage hub is open */
}

.vs-homepage-hub-open #yt-multiple-urls-modal:not(.hidden) .modal-content {
  z-index: 20071 !important;
}

.vs-homepage-hub-open #history-video-modal:not(.hidden) {
  z-index: 20030 !important;
  /* above homepage hub */
  display: flex !important;
  position: fixed !important;
}

/* Ensure YouTube search mode panel is a flex container for proper scrolling */
#yt-mode-search {
  /* Don't use !important here so `.hidden { display:none !important; }` can still hide it */
  display: flex;
  flex-direction: column;
  /* Fill available space in the modal instead of forcing a tall min-height (causes pre-search whitespace) */
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#yt-mode-search.hidden {
  display: none !important;
}

#yt-mode-search[style*="display: none"] {
  display: none !important;
}

/* YouTube search results - vertical scrolling grid layout */
#yt-search-results {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px;
  padding-bottom: 4px;
}

#yt-search-results>div {
  flex: 0 0 calc(50% - 6px);
  min-width: 240px;
  max-width: calc(50% - 6px);
  cursor: pointer;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  min-height: 180px;
}

@media (min-width: 600px) {
  #yt-search-results>div {
    flex: 0 0 calc(33.333% - 8px);
    max-width: calc(33.333% - 8px);
  }
}

/* YouTube search result cards: hover + selected ring without clipping.
   Use an overlay (::after) so the ring stays visible over thumbnails
   and doesn't get overridden/removed on hover. */
#yt-search-results>div::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  pointer-events: none;
}

#yt-search-results>div:hover::after {
  border: 1px solid rgba(255, 255, 255, 0.22);
}

#yt-search-results>div.yt-result-selected::after {
  border: 3px solid rgba(99, 102, 241, 0.95);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.55) inset, 0 10px 26px rgba(99, 102, 241, 0.18);
}

#yt-search-results>div.yt-result-selected:hover::after {
  border: 3px solid rgba(99, 102, 241, 0.95);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.55) inset, 0 10px 26px rgba(99, 102, 241, 0.22);
}

#yt-search-results>div img {
  pointer-events: auto;
  cursor: pointer;
}

#yt-search-results>div .ai-sub {
  pointer-events: auto;
  cursor: alias;
}

#yt-search-results>div button {
  pointer-events: auto;
  cursor: pointer;
}

#yt-search-results>div img {
  height: 140px !important;
  max-height: 140px !important;
  display: block;
  width: 100%;
}

#yt-search-results>div .ai-sub {
  font-size: 12px !important;
  padding: 6px 8px 4px 8px !important;
  line-height: 1.4 !important;
  min-height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

#yt-search-results>div .ed-p-0-8-8-8 {
  padding: 0 6px 6px 6px !important;
  font-size: 10px !important;
}

/* Ensure results container scrolls vertically */
#yt-search-results-wrap {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin-top: 0;
  height: auto;
  min-height: 0;
  max-height: none;
}

/* Video Downloader search layout: tighten spacing and prevent tall gaps */
#yt-provider-youtube .downloader-search-mode {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-height: 0;
}

#yt-provider-youtube #yt-search-results-wrap {
  flex: 0 0 auto !important;
}

/* Override global flex-fill rules so Video Downloader doesn't create tall empty space */
#yt-provider-youtube #yt-mode-search {
  flex: 0 0 auto;
  height: auto;
  overflow: visible;
}

#yt-provider-youtube #yt-duration-filter {
  margin: 0;
}

/* Reduce padding in YouTube modal for more space */
#yt-modal .modal-content {
  padding: 16px 20px;
}

#yt-modal .dashed-panel {
  padding: 12px;
}

/* Find Videos modal - Source and Mode container side by side */
#yt-modal .yt-source-mode-container {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
}

#yt-provider-youtube,
#yt-provider-yarn,
#yt-provider-facebook,
#yt-provider-dailymotion,
#yt-provider-pexels {
  /* Allow the provider panel to consume remaining modal height so search results can scroll inside */
  flex: 1 1 auto;
  min-height: 0;
}

#yt-source-panel,
#yt-mode-panel {
  flex: 1;
}

#yt-provider,
#yt-mode {
  width: 100%;
}

/* Search input and button containers */
.yt-search-input-container {
  margin-top: 8px;
  margin-bottom: 8px;
}

.yt-search-button-container {
  margin-top: 8px;
}

#yt-search-term {
  width: 100%;
  height: auto;
}

#yt-search-btn {
  width: 100%;
}

.vs-homepage-hub-open .modal:not(.hidden) .modal-content,
#settings-modal:not(.hidden) .modal-content {
  z-index: 20031 !important;
  /* above the modal backdrop */
}

.modal.hidden {
  display: none;
}

.modal-content {
  position: relative;
  background: radial-gradient(circle at top, rgba(148, 163, 184, 0.16) 0, transparent 55%) #0f172a;
  padding: 24px 24px 20px;
  border-radius: 18px;
  width: auto;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.95);
  text-align: left;
  max-width: 100%;
  box-sizing: border-box;
  /* Universal modal sizing: constrain to viewport and allow internal scrolling */
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: visible;
  -webkit-overflow-scrolling: touch;
  /* Make content stacks behave well when constrained */
  display: flex;
  flex-direction: column;
  row-gap: 10px;
  min-width: 0;
  min-height: 0;
  z-index: 12060;
  /* ensure modal content stacks above overlay internals if needed */
}

/* Multicolor animated border for Create with AI modal */
#ai-modal .modal-content {
  position: relative;
  border: 2px solid transparent;
  /* inner border to create spacing for glow */
  background-clip: padding-box;
  /* ensure inner background doesn't cover gradient ring */
}

#ai-modal .modal-content::before {
  content: '';
  position: absolute;
  inset: 0;
  /* align to edges */
  border-radius: 16px;
  /* slightly larger than content radius for smooth ring */
  padding: 2px;
  /* ring thickness */
  background: conic-gradient(from 0deg at 50% 50%, #6366f1, #0ea5e9, #22c55e, #f59e0b, #ef4444, #8b5cf6, #6366f1);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  /* Safari */
  mask-composite: exclude;
  /* Other browsers */
  pointer-events: none;
  filter: hue-rotate(0deg);
  animation: vsHueShift 14s linear infinite;
}

@keyframes vsHueShift {
  to {
    filter: hue-rotate(360deg);
  }
}

/* Voice picker styling (native select so dropdown remains OS-level/scrollable) */
#ai-voice-pick {
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
}

#ai-voice-pick:hover {
  filter: brightness(1.06);
}

#ai-voice-pick:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
  border-color: transparent;
}

/* Global modal close button (used by Thumbnail Creator modals) */
.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.modal-close:hover {
  filter: brightness(0.96);
}

.modal-close:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.45);
  outline-offset: 2px;
}

/* Activation Success Modal Styles */
.activation-success-content {
  width: min(92vw, 520px);
  text-align: center;
  padding: 40px 32px 32px;
  position: relative;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.activation-success-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 20px;
  animation: activationSuccessBounce 0.6s ease-out;
}

@keyframes activationSuccessBounce {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.activation-success-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 16px;
  color: #ffffff;
  line-height: 1.2;
}

.activation-success-title span {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.activation-success-message {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 24px;
}

.activation-success-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0 32px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.activation-feature-item {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  padding: 8px 0;
  text-align: left;
}

#activation-success-modal .modal-actions {
  margin-top: 0;
  justify-content: center;
}

#activation-success-modal .modal-actions button {
  min-width: 160px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

#activation-success-modal .modal-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

#activation-success-modal .modal-actions button:active {
  transform: translateY(0);
}

/* Dark mode support for activation modal */
.dark-mode .activation-success-content {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border-color: rgba(99, 102, 241, 0.3);
}

.dark-mode .activation-success-features {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Review prompt and share follow-up */
.review-prompt-content,
.review-share-content {
  width: min(92vw, 620px);
  max-height: min(88vh, 820px);
  overflow-y: auto;
  text-align: center;
  padding: 38px 32px 30px;
  position: relative;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.review-share-content {
  width: min(92vw, 520px);
}

.review-prompt-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 34px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  box-shadow: 0 12px 36px rgba(99, 102, 241, 0.34);
}

.review-prompt-title {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.2;
}

.review-prompt-message {
  margin: 0 auto 22px;
  max-width: 48ch;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.6;
}

.review-prompt-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.review-prompt-form label {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 700;
}

.review-prompt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.review-prompt-row--compact {
  grid-template-columns: 1fr 130px;
}

.review-prompt-form input[type="text"],
.review-prompt-form input[type="email"],
.review-prompt-form input[type="file"],
.review-prompt-form select,
.review-prompt-form textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.74);
  color: #f8fafc;
  font: inherit;
  padding: 11px 12px;
}

.review-prompt-form textarea {
  min-height: 124px;
  resize: vertical;
  line-height: 1.5;
}

.review-prompt-form input:focus,
.review-prompt-form select:focus,
.review-prompt-form textarea:focus {
  outline: 3px solid rgba(99, 102, 241, 0.36);
  border-color: rgba(129, 140, 248, 0.86);
}

.review-prompt-permission {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 10px !important;
  font-weight: 500 !important;
  line-height: 1.45;
}

.review-prompt-permission input {
  width: auto;
  margin-top: 4px;
}

.review-prompt-status {
  min-height: 20px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
  text-align: center;
}

.review-prompt-status.error {
  color: #fca5a5;
}

.review-prompt-status.success {
  color: #86efac;
}

.review-share-link {
  margin: 18px 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: rgba(255, 255, 255, 0.9);
  word-break: break-all;
}

.review-share-actions {
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .review-prompt-content,
  .review-share-content {
    padding: 34px 20px 24px;
  }

  .review-prompt-row,
  .review-prompt-row--compact {
    grid-template-columns: 1fr;
  }
}

/* Custom Popup Styles */
.custom-popup-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  color: #ffffff;
  min-width: 80px;
}

.custom-popup-btn-primary {
  background: #6366f1;
  border-color: #6366f1;
}

.custom-popup-btn-primary:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.custom-popup-btn-primary:active {
  transform: translateY(0);
}

.custom-popup-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
}

.custom-popup-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.custom-popup-btn-secondary:active {
  transform: translateY(0);
}

.custom-popup-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.custom-popup-input {
  transition: all 0.2s ease;
}

.custom-popup-input:focus {
  outline: none;
  border-color: #6366f1 !important;
  background: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Ensure Thumbnail Creator viewer close button is circular/white despite inline page styles */
#ti-viewer .modal-close,
#ti-modal .modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #111827;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Features modal styles */
#features-modal .modal-content {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

#features-modal .features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 4px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-height: calc(85vh - 120px);
  /* Account for header and actions */
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.feat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
}

.feat-title {
  margin: 0 0 6px;
  font-size: 14px;
  color: #e5e7eb;
}

.feat-desc {
  margin: 0;
  font-size: 13px;
  color: #9ca3af;
}

.modal-content.preview {
  width: min(92vw, 1000px);
  max-width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* Constrain Script Editor modal and allow inner scrolling */
#script-editor-modal .modal-content {
  width: min(92vw, 760px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#script-editor-modal .settings-grid {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

#script-editor-modal .EasyMDEContainer {
  max-height: 60vh;
  display: flex;
  flex-direction: column;
}

#script-editor-modal .EasyMDEContainer .CodeMirror,
#script-editor-modal .EasyMDEContainer .CodeMirror-scroll {
  max-height: 60vh;
}

/* Ensure bottom of editor content is visible above modal actions */
#script-editor-modal .EasyMDEContainer .CodeMirror-scroll {
  padding-bottom: 24px !important;
}

#script-editor-modal .EasyMDEContainer .CodeMirror-lines {
  padding-bottom: 24px !important;
}

#script-editor-modal .settings-grid {
  padding-bottom: 8px;
}

#script-editor-modal .EasyMDEContainer .CodeMirror {
  background: rgba(255, 255, 255, 0.02) !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-top: 0 !important;
}

#script-editor-modal .EasyMDEContainer .CodeMirror-cursor {
  border-left: 1px solid #e5e7eb !important;
}

#script-editor-modal .EasyMDEContainer .editor-statusbar {
  color: #94a3b8 !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top: 0 !important;
}

/* Constrain Settings modal and allow inner scrolling */
#settings-modal .modal-content {
  width: min(92vw, 820px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#settings-modal .index-inline-321 {
  padding-right: 160px;
}

#settings-modal #toggle-storage-view {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

#settings-modal .settings-grid {
  flex: 1;
  overflow: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* When settings-grid is inside settings-view, let settings-view handle scrolling */
#settings-view .settings-grid {
  overflow: visible;
}

#settings-modal .modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-save-status {
  min-height: 18px;
  flex: 1;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.settings-save-status.is-error {
  color: #fca5a5;
}

.settings-save-status.is-success {
  color: #86efac;
}

/* Pre-export modal: make it wider (long ways) */
#pre-export-modal .modal-content {
  width: min(92vw, 700px);
  max-width: 700px;
}

/* Pre-export modal inputs: wider, bottom border only, no border radius */
#pre-export-modal input[type="text"] {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  padding: 10px 12px;
}

/* Make sure the path input row allows full width */
#pre-export-modal .row {
  width: 100%;
}

#pre-export-modal .row input[type="text"] {
  flex: 1;
  min-width: 0;
}

/* Ensure Min/Max number inputs in Settings are left-aligned */
#settings-modal input[type="number"] {
  text-align: left;
}

/* Increase font size for Min/Max clip length inputs */
#settings-modal #min-length,
#settings-modal #max-length {
  font-size: 16px;
}

/* Settings modal header styling */
.modal-content h2 {
  font-size: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.modal-content h3 {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.settings-group {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
}

.field {
  margin: 10px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.field:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.row.two>label {
  flex: 1;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="number"] {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
}

.modal-content input.disabled {
  opacity: 0.5;
}

/* Settings modal: Custom styled inputs with increased min-width for better readability */
#settings-modal input[type="text"],
#settings-modal input[type="email"],
#settings-modal input[type="number"],
#settings-modal input[type="password"] {
  min-width: 280px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, filter .2s ease;
}

/* Reduce min-width for inputs in row containers (side-by-side inputs) */
#settings-modal .row input[type="text"],
#settings-modal .row input[type="email"],
#settings-modal .row input[type="number"],
#settings-modal .row input[type="password"] {
  min-width: 200px;
}

/* Further reduce for inputs in two-column rows */
#settings-modal .row.two input[type="text"],
#settings-modal .row.two input[type="email"],
#settings-modal .row.two input[type="number"],
#settings-modal .row.two input[type="password"] {
  min-width: 150px;
}

#settings-modal input[type="text"]:hover,
#settings-modal input[type="email"]:hover,
#settings-modal input[type="number"]:hover,
#settings-modal input[type="password"]:hover {
  filter: brightness(1.06);
  border-color: rgba(255, 255, 255, 0.18);
}

#settings-modal input[type="text"]:focus,
#settings-modal input[type="email"]:focus,
#settings-modal input[type="number"]:focus,
#settings-modal input[type="password"]:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

/* Password wrapper with eye icon */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: color 0.15s ease;
  z-index: 1;
}

.password-toggle:hover {
  color: #e5e7eb;
}

.password-toggle:focus {
  outline: none;
  color: #e5e7eb;
}

.password-toggle .eye-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.password-toggle .eye-visible {
  display: none;
}

.password-toggle.show-password .eye-hidden {
  display: none;
}

.password-toggle.show-password .eye-visible {
  display: block;
}

/* Settings modal: Custom styled select dropdowns */
#settings-modal select {
  min-width: 280px;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 36px 10px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, filter .2s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}

#settings-modal select:hover {
  filter: brightness(1.06);
  border-color: rgba(255, 255, 255, 0.18);
}

#settings-modal select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background-color: rgba(255, 255, 255, 0.04);
}

#settings-modal select::-ms-expand {
  display: none;
}

#settings-modal select option {
  background: #0f172a;
  color: #e5e7eb;
}

.settings-theme-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-theme-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.settings-theme-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-theme-option-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease, background .15s ease;
}

.settings-theme-option:hover .settings-theme-option-body {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.settings-theme-name {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

.settings-theme-label {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.settings-theme-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.settings-theme-swatch {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.settings-theme-selected {
  display: none;
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.settings-theme-option input[type="radio"]:focus-visible+.settings-theme-option-body {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.settings-theme-option input[type="radio"]:checked+.settings-theme-option-body {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light), var(--shadow-sm);
  background: rgba(255, 255, 255, 0.08);
}

.settings-theme-option input[type="radio"]:checked+.settings-theme-option-body .settings-theme-selected {
  display: inline-flex;
}

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

.settings-cursor-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.settings-cursor-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-cursor-title {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

.settings-cursor-label {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.settings-cursor-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(112px, 112px);
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
}

.settings-cursor-strip::-webkit-scrollbar {
  height: 8px;
}

.settings-cursor-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.settings-cursor-option {
  position: relative;
  display: block;
  scroll-snap-align: start;
}

.settings-cursor-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-cursor-option-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 118px;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease, background .15s ease;
}

.settings-cursor-option:hover .settings-cursor-option-body {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.settings-cursor-option input[type="radio"]:focus-visible + .settings-cursor-option-body {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.settings-cursor-option input[type="radio"]:checked + .settings-cursor-option-body {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light), var(--shadow-sm);
  background: rgba(255, 255, 255, 0.08);
}

.settings-cursor-preview {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-cursor-preview img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.settings-cursor-preview--system {
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-cursor-option-label {
  color: #dbe7ff;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
}

.settings-cursor-option-caption {
  min-width: 0;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

@media (max-width: 900px) {
  .settings-theme-picker {
    grid-template-columns: 1fr;
  }

  .settings-cursor-row {
    grid-template-columns: 1fr;
  }
}

/* Settings and Storage view styles */
#settings-view {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

#settings-view .settings-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
  padding: 2px 2px 8px;
}

#settings-view .settings-tab-btn {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06) 45%, rgba(0, 0, 0, 0.15) 75%);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease, color .12s ease;
}

#settings-view .settings-tab-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  filter: brightness(1.06);
}

#settings-view .settings-tab-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 6px 10px rgba(0, 0, 0, 0.35), inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

#settings-view .settings-tab-btn:focus-visible {
  outline: none;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#settings-view .settings-tab-btn.is-active {
  border-color: rgba(99, 102, 241, 0.65);
  color: #f8fafc;
  background: radial-gradient(circle at 35% 35%, rgba(129, 140, 248, 0.55), rgba(99, 102, 241, 0.28) 45%, rgba(67, 56, 202, 0.35) 78%);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 10px 16px rgba(30, 27, 75, 0.35), 0 0 0 2px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

#settings-view .settings-tab-btn.is-active:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 6px 10px rgba(30, 27, 75, 0.35), inset 0 2px 6px rgba(15, 23, 42, 0.4);
}

#settings-view .settings-tab-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  white-space: nowrap;
  background: rgba(2, 6, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  z-index: var(--z-tooltip);
}

#settings-view .settings-tab-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent rgba(255, 255, 255, 0.14) transparent;
}

#settings-view .settings-tab-tooltip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(1px);
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent rgba(2, 6, 23, 0.95) transparent;
}

#settings-view .settings-tab-btn:hover .settings-tab-tooltip,
#settings-view .settings-tab-btn:focus-visible .settings-tab-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#settings-view .settings-group-panel {
  display: none;
  min-height: var(--settings-panel-min-height, 0);
}

#settings-view .settings-group-panel.is-active {
  display: block;
  animation: settings-panel-fade .16s ease;
}

@keyframes settings-panel-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#storage-view {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.storage-location-section {
  margin-bottom: 20px;
}

.storage-location-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.storage-location-control input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.storage-paths-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.storage-path-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.storage-path-label {
  min-width: 140px;
  font-size: 13px;
  color: #94a3b8;
  text-align: right;
}

.storage-path-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.storage-path-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.storage-path-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.storage-path-clear {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s ease;
}

.storage-path-clear:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.storage-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.storage-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  margin-top: 12px;
}

.storage-card h3 {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 0 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.storage-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.storage-bar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.storage-bar {
  width: 100%;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 12px;
}

.storage-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #e5e7eb;
}

.storage-percent {
  font-weight: 600;
  color: #94a3b8;
}

.storage-size {
  font-size: 24px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 12px;
}

.storage-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.storage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.storage-item:last-child {
  border-bottom: none;
}

.storage-label {
  font-size: 13px;
  color: #94a3b8;
}

.storage-value {
  font-size: 13px;
  color: #e5e7eb;
  font-weight: 500;
}

.storage-size-small {
  font-size: 12px;
  color: #6b7280;
  margin-left: 8px;
}

.storage-charts {
  margin-bottom: 20px;
}

.storage-chart-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
}

.storage-chart-card h3 {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 0 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

#storage-chart {
  max-width: 100%;
  height: auto;
}

.storage-actions {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
}

.storage-actions h3 {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 0 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.storage-delete-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

button.danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

button.danger:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .storage-overview {
    grid-template-columns: 1fr;
  }

  .storage-delete-buttons {
    flex-direction: column;
  }

  .storage-delete-buttons button {
    width: 100%;
  }
}

/* Unified textarea styling — macOS-inspired */
textarea,
.modal-content textarea,
textarea.ai-input,
textarea.input-area {
  width: 100%;
  min-height: 84px;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  color: #e5e7eb !important;
  resize: vertical;
  line-height: 1.5;
  font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, filter .2s ease;
}

/* Settings: Sections ordering list */
.ui-sections-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.ui-section-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  cursor: grab;
  user-select: none;
}

.ui-section-item.dragging {
  opacity: 0.6;
}

.ui-section-item .handle {
  text-align: center;
  cursor: grab;
}

.ui-section-item .name {
  font-weight: 600;
  color: #e5e7eb;
}

.ui-section-item .actions {
  display: flex;
  gap: 6px;
}

.ui-section-item .icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}

.ui-section-item.hidden {
  /* Keep hidden rows visible in Settings editors so users can unhide them. */
  display: grid !important;
  opacity: 0.5;
}

.ui-sections-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  padding: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.ui-sections-preview .pv {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  color: #cbd5e1;
  font-size: 12px;
  text-align: center;
}

.ui-sections-preview .pv.hidden {
  opacity: 0.35;
  filter: grayscale(0.3);
}

textarea:hover,
.modal-content textarea:hover,
textarea.ai-input:hover,
textarea.input-area:hover {
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

textarea:focus,
textarea:focus-visible,
.modal-content textarea:focus,
.modal-content textarea:focus-visible,
textarea.ai-input:focus,
textarea.ai-input:focus-visible,
textarea.input-area:focus,
textarea.input-area:focus-visible {
  outline: none;
  border-color: rgba(99, 102, 241, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28);
  background: rgba(255, 255, 255, 0.05) !important;
}

textarea::placeholder {
  color: #9ca3af;
}

textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

textarea[aria-invalid="true"],
textarea.invalid {
  border-color: rgba(248, 113, 113, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.20);
  background: rgba(248, 113, 113, 0.08) !important;
  color: #fecaca !important;
}

input[aria-invalid="true"],
input.invalid,
select[aria-invalid="true"],
select.invalid,
.ai-input[aria-invalid="true"],
.ai-input.invalid {
  border-color: rgba(248, 113, 113, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.20);
  background: rgba(248, 113, 113, 0.08) !important;
  color: #fecaca !important;
}

.modal-content #adjust-audio-modal input[type="number"],
#adjust-audio-modal .modal-content input[type="number"] {
  font-size: 18px;
  padding: 10px 12px;
}

/* Increase label text size specifically for Adjust Audio modal */
#adjust-audio-modal .modal-content label,
#adjust-audio-modal .modal-content label span,
#adjust-audio-modal .modal-content .qs-item {
  font-size: 18px;
}

.modal-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 10px;
  overflow: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Ensure editor planned-clips grid items are comfortably tall */
#ed-plan-grid .clip-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
}

#ed-plan-grid .clip-video {
  height: 160px;
}

#ed-plan-grid .clip-thumb {
  height: 160px;
}

.preview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pagination-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.pagination button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 12px;
}

.pagination button.active {
  background: #6366f1;
  color: #ffffff;
  border-color: transparent;
}

.pagination-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-jump input[type="number"] {
  width: 64px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 8px;
  padding: 6px 8px;
}

/* Larger page number input in preview/pagination */
.pagination-jump input[type="number"] {
  font-size: 22px;
}

.clip-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
}

/* Planned clips list view rows and drag indicators */
.plan-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 6px;
}

.plan-list-row.dragging {
  opacity: 0.6;
}

.plan-list-row.drag-over {
  background: rgba(255, 255, 255, 0.06);
}

.plan-list-row.drop-above {
  box-shadow: 0 -3px 0 0 #8b5cf6 inset;
}

.plan-list-row.drop-below {
  box-shadow: 0 3px 0 0 #8b5cf6 inset;
}

.plan-list-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.plan-list-file {
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-list-score {
  font-size: 12px;
  color: #94a3b8;
  margin-right: 8px;
}

.clip-video {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.clip-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.clip-thumb .play-overlay {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.clip-thumb:hover .play-overlay {
  filter: brightness(1.15);
}

.clip-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 8px;
}

.clip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.clip-length {
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 6px;
}

.clip-excluded {
  opacity: 0.45;
}

/* Advanced editor: canvas interaction (hover and selection) */
#ed-player {
  border-radius: 0px;
  background: #000;
  display: block;
}

#ed-preview-canvas {
  display: block;
}

/* Ensure correct stacking order inside player stack: */
#ed-player-stack {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ed-player {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}

#ed-preview-canvas {
  position: relative;
  width: var(--ed-width, auto);
  height: var(--ed-height, auto);
  max-width: 100%;
  max-height: 100%;
  z-index: 2;
  background: #000;
}

#ed-preview-canvas.ed-width-dynamic {
  width: var(--ed-width, auto);
}

#ed-preview-canvas.ed-height-dynamic {
  height: var(--ed-height, auto);
}

#ed-player-stack {
  transition: box-shadow .15s ease;
}

/* Highlight overlay that tracks the letterboxed canvas region */
#ed-canvas-highlight {
  display: none;
}

#ed-player {
  transition: box-shadow .18s ease;
}

/* Mirror transition on canvas for consistent hover/active effects */
#ed-preview-canvas {
  transition: box-shadow .18s ease;
}

/* When WebCodecs is active, hide the legacy HTMLVideoElement */
#ed-player[data-preview="webcodecs"] {
  display: none !important;
}

/* Native preview mode: allow <video> to use the same resize CSS vars as the canvas */
#ed-player.ed-width-dynamic {
  width: var(--ed-width, auto);
}

#ed-player.ed-height-dynamic {
  height: var(--ed-height, auto);
}

#ed-player {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#ed-player-stack:hover #ed-player {
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.85), 0 8px 24px rgba(139, 92, 246, 0.20);
}

#ed-player-stack:hover #ed-preview-canvas {
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.85), 0 8px 24px rgba(139, 92, 246, 0.20);
}

#ed-player-stack.canvas-selected #ed-player {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.95), 0 12px 34px rgba(139, 92, 246, 0.28);
}

#ed-player-stack.canvas-selected #ed-preview-canvas {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.95), 0 12px 34px rgba(139, 92, 246, 0.28);
}

#ed-player-stack.canvas-selected:hover #ed-player {
  box-shadow: 0 0 0 3px #7c3aed, 0 14px 38px rgba(124, 58, 237, 0.30);
}

#ed-player-stack.canvas-selected:hover #ed-preview-canvas {
  box-shadow: 0 0 0 3px #7c3aed, 0 14px 38px rgba(124, 58, 237, 0.30);
}

#ed-player-stack:focus-visible #ed-player {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.9), 0 10px 30px rgba(139, 92, 246, 0.25);
}

#ed-player-stack:focus-visible #ed-preview-canvas {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.9), 0 10px 30px rgba(139, 92, 246, 0.25);
}

#ed-player-stack {
  cursor: default;
}

#ed-player-stack:hover #ed-canvas-highlight {
  border-color: rgba(139, 92, 246, 0.85);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25), 0 8px 24px rgba(139, 92, 246, 0.18);
}

#ed-player-stack.canvas-selected #ed-canvas-highlight {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.35), 0 10px 30px rgba(139, 92, 246, 0.25);
}

#ed-player-stack.canvas-selected:hover #ed-canvas-highlight {
  border-color: #7c3aed;
}

.modal-content label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px;
  font-size: 14px;
  font-weight: 500;
  color: #e5e7eb;
}

.modal-content label span {
  flex: 0 0 auto;
}

.modal-content input[type="email"],
.modal-content input[type="number"] {
  flex: 1;
  margin-left: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  font-size: 14px;
  box-sizing: border-box;
}

.modal-content input[type="email"]:focus-visible,
.modal-content input[type="number"]:focus-visible {
  outline: none;
  border-color: rgba(99, 102, 241, 0.85);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

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

/* Script viewer header buttons spacing */
.modal-content .header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

input[type="checkbox"] {
  margin-right: 8px;
}

.modal-content input[type="checkbox"],
.quick-settings input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-block;
  position: relative;
  cursor: pointer;
  transition: box-shadow .2s ease, filter .2s ease, background .2s ease, border-color .2s ease;
}

/* Advanced editor checkboxes: match purple gradient like Find Videos/Images */
.ed-check {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-block;
  position: relative;
  cursor: pointer;
  transition: box-shadow .2s ease, filter .2s ease, background .2s ease, border-color .2s ease;
  vertical-align: middle;
  margin: 0;
  flex-shrink: 0;
  align-self: center;
}

.ed-check:hover {
  filter: brightness(1.08);
}

.ed-check:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.ed-check:checked {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}

.ed-check:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

/* Ensure labels containing .ed-check use flexbox for proper alignment */
label:has(.ed-check) {
  display: flex;
  align-items: center;
  gap: 6px;
}

label:has(.ed-check) .ed-check {
  margin: 0;
}

.modal-content input[type="checkbox"]:hover,
.quick-settings input[type="checkbox"]:hover {
  filter: brightness(1.08);
}

.modal-content input[type="checkbox"]:focus-visible,
.quick-settings input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.modal-content input[type="checkbox"]:checked,
.quick-settings input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}

.modal-content input[type="checkbox"]:checked::after,
.quick-settings input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.modal-content input[type="checkbox"]:disabled,
.quick-settings input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Style all checkboxes in advanced editor */
.ai-muted input[type="checkbox"],
.stack input[type="checkbox"],
.dashed-panel input[type="checkbox"],
.field input[type="checkbox"],
.pill input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-block;
  position: relative;
  cursor: pointer;
  transition: box-shadow .2s ease, filter .2s ease, background .2s ease, border-color .2s ease;
  margin-right: 8px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Fix alignment for spans containing checkboxes in stack labels */
.stack>span:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stack>span:has(input[type="checkbox"]) input[type="checkbox"] {
  margin-right: 0;
}

/* Specific fix for inspector panel checkbox alignment */
.ed-right .stack>span:has(input[type="checkbox"]),
.dashed-panel .stack>span:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ed-right .stack>span:has(input[type="checkbox"]) input[type="checkbox"],
.dashed-panel .stack>span:has(input[type="checkbox"]) input[type="checkbox"] {
  margin-right: 0;
}

.ai-muted input[type="checkbox"]:hover,
.stack input[type="checkbox"]:hover,
.dashed-panel input[type="checkbox"]:hover,
.field input[type="checkbox"]:hover,
.pill input[type="checkbox"]:hover {
  filter: brightness(1.08);
}

.ai-muted input[type="checkbox"]:focus-visible,
.stack input[type="checkbox"]:focus-visible,
.dashed-panel input[type="checkbox"]:focus-visible,
.field input[type="checkbox"]:focus-visible,
.pill input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.ai-muted input[type="checkbox"]:checked,
.stack input[type="checkbox"]:checked,
.dashed-panel input[type="checkbox"]:checked,
.field input[type="checkbox"]:checked,
.pill input[type="checkbox"]:checked {
  background: var(--color-gradient-primary);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.ai-muted input[type="checkbox"]:checked::after,
.stack input[type="checkbox"]:checked::after,
.dashed-panel input[type="checkbox"]:checked::after,
.field input[type="checkbox"]:checked::after,
.pill input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.ai-muted input[type="checkbox"]:disabled,
.stack input[type="checkbox"]:disabled,
.dashed-panel input[type="checkbox"]:disabled,
.field input[type="checkbox"]:disabled,
.pill input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dark-mode {
  background: #1e1e1e;
  color: #f1f1f1;
}

.dark-mode .modal-content,
.modal.dark-mode .modal-content {
  background: #2e2e2e;
  color: #f1f1f1;
}

.dark-mode button {
  background: #374151;
  color: #ffffff;
}

.dark-mode .primary {
  background: #6366f1;
  color: #ffffff;
}

/* Settings save-location input and browse button styling */
.modal-content #save-location {
  flex: 1 1 auto;
  min-width: 0;
  /* Allow flex to shrink below min-width when needed */
  width: 100%;
}

#settings-modal #save-location {
  min-width: 320px;
  /* Wider master save location input */
}

.modal-content #browse-save-location {
  margin-left: 10px;
  padding: 5px 10px;
}

/* Settings API keys toggle */
.api-keys-toggle-row {
  display: flex;
  align-items: center;
}

.api-keys-panel.is-collapsed {
  display: none;
}

/* Style history list to match the preview visuals */
#history-list {
  list-style: none;
  padding: 12px;
  overflow-y: auto;
  margin-bottom: 20px;
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);

}

#history-list li {
  display: inline-block;
  margin: 5px;
  width: 97%;
}

#history-list li.search-focus-ring {
  border-radius: 12px;
  outline: 2px solid rgba(96, 165, 250, 0.82);
  outline-offset: 3px;
  background: rgba(37, 99, 235, 0.1);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.18);
}

#history-list li video {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Make Previous Projects container taller */
#history-section {
  max-height: 90vh;
  height: 90vh;
}

/* In grid layout, match other containers' height */
main.grid.fill>#history-section {
  max-height: 62vh;
  height: auto;
}

@media (max-height: 800px) {
  main.grid.fill>#history-section {
    max-height: 56vh;
  }
}

/* Fullscreen grid layout for Previous Projects */
#history-section.fullscreen #history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 14px;
}

#history-section.fullscreen #history-list li {
  display: block;
  width: auto;
  margin: 0;
}

#history-section.fullscreen .history-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  overflow: hidden;
  background: #0b1220;
}

#history-section.fullscreen .history-video-wrap video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

#history-section.fullscreen .history-actions {
  justify-content: flex-end;
}

.queue-table {
  font-size: 16px;
}

.queue-table th,
.queue-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.queue-table th {
  padding: 10px 12px !important;
  font-size: 14px !important;
}

.queue-table td {
  padding: 10px 12px;
  font-size: 16px;
  color: #e5e7eb;
}

.queue-progress {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
}

.queue-progress>.inner {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #60a5fa, #34d399);
  transition: width 160ms ease;
}

.queue-status {
  color: #e5e7eb;
  font-size: 16px;
  font-weight: 700;
}

.pro-large #history-list li video {
  width: 100% !important;
  height: 235px !important;
}

.history-video-wrap {
  position: relative;
  display: inline-block;
}

.history-video-wrap video {
  display: block;
}

.history-play-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  z-index: 2;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.55);
  color: #e5e7eb;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease, filter 160ms ease;
}

.history-video-wrap:hover .history-play-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.history-play-overlay:hover {
  filter: brightness(1.08);
}

.history-video-wrap.is-playing .history-play-overlay {
  opacity: 0;
  pointer-events: none;
}

/* History video modal scrubber styling */
#history-video-scrub {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  height: 6px;
  outline: none;
}

#history-video-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#history-video-scrub::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#history-video-scrub:hover::-webkit-slider-thumb {
  background: #818cf8;
  transform: scale(1.1);
}

#history-video-scrub:hover::-moz-range-thumb {
  background: #818cf8;
  transform: scale(1.1);
}

.history-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.mini-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 12px;
}

.mini-btn:hover {
  filter: brightness(1.08);
}

/* Import buttons in asset library - purple like export button */
.mini-btn[data-action="import"] {
  /* Green = "downloaded/ready to import" */
  background: #22c55e !important;
  color: #ffffff !important;
  border-color: rgba(34, 197, 94, 0.55) !important;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.28) !important;
}

.mini-btn[data-action="import"]:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.36) !important;
}

/* Ensure library modal buttons are always visible */
#library-modal [data-library-item-key] .mini-btn,
#library-modal [data-library-item-key] button.mini-btn {
  opacity: 1 !important;
  visibility: visible !important;
  display: inline-flex !important;
  pointer-events: auto !important;
  z-index: 10 !important;
}

#library-modal [data-library-item-key] .actions {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
  pointer-events: auto !important;
}

#library-modal [data-library-item-key] footer {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}

/* -------------------------------------------------------------------------- */
/* Import Library modal: keep converted dropdowns in a single row              */
/* (DropdownManager wraps <select> into .vs-dd, which otherwise expands)       */
/* -------------------------------------------------------------------------- */
#library-modal .ai-row label.ai-muted {
  white-space: nowrap;
}

#library-modal .ai-row .vs-dd {
  flex: 0 0 auto;
  width: 220px;
  max-width: 100%;
}

#library-modal .ai-row .vs-dd-btn {
  width: 100%;
}

#library-modal .vs-dd-menu {
  /* Ensure menus render above the modal content */
  z-index: 2147483005 !important;
}

/* Search input should match custom control styling */
#library-modal #library-search {
  height: 40px !important;
  width: 220px !important;
  padding: 8px 12px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #e5e7eb !important;
}

#library-modal #library-search::placeholder {
  color: rgba(148, 163, 184, 0.9) !important;
}

/* Tabs row: give hover/active glow room (prevents visual clipping) */
#library-modal [role="tablist"][aria-label="Library categories"] {
  padding-top: 8px !important;
  padding-bottom: 10px !important;
}

.badge-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.history-new-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
}

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

.actions.hidden {
  display: none;
}

#result-actions #open-folder,
#result-actions #open-clips-folder {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border-color: transparent;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}

#result-actions #open-folder:hover,
#result-actions #open-clips-folder:hover {
  filter: brightness(1.05);
}

#result-actions #open-folder::before,
#result-actions #open-clips-folder::before {
  content: none;
}

/*
  Card fullscreen toggle
  - absolute button in top-right of each card
  - fullscreen state fixes card to viewport with high z-index
*/
.fs-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.5);
  color: #e5e7eb;
  cursor: pointer;
}

.fs-btn:hover {
  filter: brightness(1.08);
}

.fs-btn i {
  pointer-events: none;
}

/* swap icons based on state */
.card.fullscreen .fs-btn .fa-expand {
  display: none;
}

.card:not(.fullscreen) .fs-btn .fa-compress {
  display: none;
}

/* Always show fullscreen buttons for PRO and PLATINUM users */
.fs-btn[data-pro-user="true"],
body[data-pro-active="true"] .fs-btn,
body[data-platinum-active="true"] .fs-btn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* fullscreen card overlay */
.card.fullscreen {
  position: fixed;
  inset: 0;
  margin: 0;
  border-radius: 0;
  max-height: none;
  height: 100vh;
  width: 100vw;
  z-index: 11000;
  overflow: auto;
  background: #0b1220 !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  transition: all 0.2s ease !important;
}

/* Create fullscreen: bump all button-like controls to at least 19px font */
body.vs-card-fullscreen #create-section.fullscreen :where(button,
  a.btn,
  .btn,
  .cta-button,
  .mini-btn,
  .fs-btn,
  .dup-btn,
  .help-like,
  #layout-toggle .seg-btn,
  .pagination button,
  .custom-tab) {
  font-size: 15px !important;
}

/* Create fullscreen: merge Quick Settings and Quick Sliders into one unified row */
body.vs-card-fullscreen #create-section.fullscreen .quick-settings-row {
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

/* Override: Flat styling for quick-sliders in quick-settings-row */
#create-section .quick-settings-row .quick-settings-content #quick-sliders {
  display: flex !important;
  justify-content: center;
  align-items: center;

  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 24px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  margin-top: 0 !important;
  flex: 1 1 auto;
  min-width: 0;
}

#create-section .quick-settings-row .quick-settings-content #quick-sliders::before {
  display: none !important;
  content: none !important;
}

/* Remove inner panel chrome so it looks like one box */
body.vs-card-fullscreen #create-section.fullscreen .quick-settings-row .quick-settings-content>#quick-settings,
body.vs-card-fullscreen #create-section.fullscreen .quick-settings-row .quick-settings-content>#quick-sliders {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  /* Flatten groups so their children participate directly in the row */
  display: contents !important;
}

/* Ensure fullscreen cards have background */
body.vs-card-fullscreen section.card.fullscreen,
body.vs-card-fullscreen .card.fullscreen {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

body.vs-card-fullscreen section.card.fullscreen:hover,
body.vs-card-fullscreen .card.fullscreen:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Lay out inner groups as a horizontal row of stacks */
body.vs-card-fullscreen #create-section.fullscreen #quick-settings,
body.vs-card-fullscreen #create-section.fullscreen #quick-sliders {
  display: flex !important;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: flex-start;
}

/* Consistent mini-column width so titles sit above values nicely */
body.vs-card-fullscreen #create-section.fullscreen #quick-sliders label.stack,
body.vs-card-fullscreen #create-section.fullscreen #quick-settings label.stack {
  min-width: auto;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

/* Ensure checkbox items don't stretch awkwardly */
body.vs-card-fullscreen #create-section.fullscreen #quick-settings .qs-item {
  min-width: auto;
}

/* Keep checkbox trio in a single row in fullscreen */
body.vs-card-fullscreen #create-section.fullscreen #quick-settings {
  flex-wrap: nowrap;
}

/* Keep min/max/total trio in a single row in fullscreen */
body.vs-card-fullscreen #create-section.fullscreen #quick-sliders {
  flex-wrap: nowrap;
}

/* Ensure fullscreen cards inherit current theme */
.dark-mode .card.fullscreen {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* Ensure fullscreen cards have flat background */
body.vs-card-fullscreen .card.fullscreen,
body.vs-card-fullscreen section.card.fullscreen {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

/* prevent background scrolling and hide side rail while fullscreen */
body.vs-card-fullscreen {
  overflow: hidden;
}

body.vs-card-fullscreen #side-rail {
  display: none !important;
}

#progress-bar {
  width: 100%;
  height: 20px;
  margin: 10px 0;
}

#time-remaining {
  text-align: center;
  font-size: 14px;
  margin-bottom: 10px;
}

/* Floating status bubble (always visible) */
#status-floating {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  background: rgba(17, 24, 39, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  max-width: 60vw;
  font-size: 16px;
  pointer-events: none;
}

#status-floating.processing {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.06)), rgba(17, 24, 39, 0.94);
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.25);
}

#status-floating .muted {
  color: #9ca3af;
}

/* Hide floating status bar in fullscreen mode, except for create section */
body.vs-card-fullscreen:not(:has(#create-section.fullscreen)) #status-floating {
  display: none !important;
}

#status.error~#status-floating {
  background: rgba(127, 29, 29, 0.95);
  border-color: rgba(248, 113, 113, 0.35);
}

/* Friendly loading message */
.loading-message {
  text-align: center;
  font-style: italic;
  color: #a1a1aa;
  margin: 8px 0 12px;
}

.dark-mode .loading-message {
  color: #ccc;
}

a {
  color: #93c5fd;
}

.dark-mode a {
  color: #c7d2fe;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Shared header & nav styles (moved from landing) so docs header renders correctly */
header.sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 17, 32, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: linear-gradient(135deg, #6366f1, #8b5cf6) padding-box, linear-gradient(135deg, #f472b6, #60a5fa, #a78bfa) border-box;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-badge span {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1;
  display: inline-block;
}

.brand-badge img {
  width: 22px;
  height: 22px;
  display: block;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 24px rgba(99, 102, 241, 0.25);
}

nav {
  display: none;
  gap: 24px;
}

@media (min-width: 768px) {
  nav {
    display: flex;
  }
}

header.sticky nav a {
  position: relative;
  display: inline-block;
  color: #94a3b8;
  transition: color .24s ease;
  text-decoration: none;
  padding-bottom: 6px;
}

header.sticky nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.95), rgba(96, 165, 250, 0.95));
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition: transform .26s ease, opacity .2s ease;
}

header.sticky nav a:hover,
header.sticky nav a:focus-visible,
header.sticky nav a.active {
  color: #e5e7eb;
}

header.sticky nav a:hover::after,
header.sticky nav a:focus-visible::after,
header.sticky nav a.active::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Global busy overlay for visible loading while adding files */
#busy-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px) saturate(120%);
}

#busy-overlay.visible {
  display: flex;
}

#busy-overlay .busy-content {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

#busy-overlay .busy-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  animation: vs-spin 0.9s linear infinite;
}

#busy-overlay #busy-text {
  color: #e5e7eb;
  font-weight: 800;
  letter-spacing: 0.01em;
}

@keyframes vs-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Header dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  text-decoration: none;
}

.dropdown-toggle:hover {
  color: #e5e7eb;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(11, 17, 32, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  z-index: 20050;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: flex;
}

.dropdown.open .dropdown-menu {
  display: flex;
}

/* Limit AI category dropdown height and enable scrolling */
#ai-category-dd .dropdown-menu,
#ai-duration-dd .dropdown-menu,
#ai-voice-dd .dropdown-menu {
  max-height: 260px;
  overflow: auto;
}

#ai-voice-dd .dropdown-menu {
  max-width: 320px;
}

#ai-voice-dd .dropdown-menu a {
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: flex;
}

.dropdown.open .dropdown-menu {
  display: flex;
}

.dropdown-menu a {
  padding: 10px 12px;
  border-radius: 10px;
  color: #cbd5e1;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.dropdown-menu-item {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: #cbd5e1;
  text-align: left;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: 8px;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.dropdown-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.dropdown-menu-item:active {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-menu-item#process-videos {
  background: transparent;
  color: #cbd5e1;
}

body.pro-active .dropdown-menu-item#process-videos,
body[data-pro-active="true"] .dropdown-menu-item#process-videos,
body[data-platinum-active="true"] .dropdown-menu-item#process-videos {
  background: var(--platinum-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

body.pro-active .dropdown-menu-item#process-videos:hover,
body[data-pro-active="true"] .dropdown-menu-item#process-videos:hover,
body[data-platinum-active="true"] .dropdown-menu-item#process-videos:hover {
  background: var(--platinum-gradient);
  color: #ffffff;
}

body.diamond-active .dropdown-menu-item#process-videos,
.dropdown-menu-item#process-videos.diamond-active {
  background: var(--diamond-gradient);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
}

body.diamond-active .dropdown-menu-item#process-videos:hover,
.dropdown-menu-item#process-videos.diamond-active:hover {
  background: var(--diamond-gradient);
  color: var(--text-primary);
}

.dropdown-menu-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.dropdown-menu-item.active:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.dropdown-menu-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 6px 0;
  border: none;
}

/* Button styles for header links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}

.bg-gradient-primary:hover {
  filter: brightness(0.95);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

.btn-ghost:hover {
  filter: brightness(1.05);
}

.dark-mode #file-list,
.dark-mode #history-list {
  border-color: rgba(255, 255, 255, 0.193);
}

/* Drag and drop area style */
.pro-active #drop-area {
  border: 2px dashed rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  margin-top: 12px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background-color .2s ease, box-shadow .2s ease, border-color .2s ease, transform .1s ease;
}

.pro-active #drop-area.dragover {
  background-color: rgba(148, 163, 184, 0.08);
}

.pro-active #drop-area:hover {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  transform: translateY(-1px);
}

.remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: none !important;
  color: #fff !important;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  width: 22px;
  height: 22px;
  text-align: center;
  line-height: 22px;
  font-weight: 800;
  z-index: 2;
  box-shadow: none;
}

/* Side action bar beside media thumbnails */
.media-actions {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
}

.media-actions .remove-btn {
  position: static;
  background: rgba(239, 68, 68, 0.16) !important;
  color: #fecaca !important;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.dup-btn {
  background: rgba(99, 102, 241, 0.16);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

/* Media card styling */
.media-card {
  position: relative;
  width: 160px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

/* Media thumbnail */
.media-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: rgba(0, 0, 0, 0.3);
}

.ed-thumb-contain {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Image thumbnail wrapper */
.ed-image-thumb-wrap {
  position: relative;
  width: 160px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.ed-image-thumb {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

/* File tag styling */
.ed-file-tag-below {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  max-width: calc(100% - 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.2;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.8);
  border: 1px solid #6366f1;
  color: #fff;
  font-weight: bold;
  z-index: 1;
}

.ed-file-tag-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  pointer-events: none;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.2;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e5e7eb;
}

/* Audio lists (Pro) */
#bgm-list,
#voice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

#bgm-list li,
#voice-list li {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 8px;
}

#bgm-list li.dragging,
#voice-list li.dragging {
  opacity: 0.5;
}

.audio-badge {
  font-size: 11px;
  color: #94a3b8;
}

.audio-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.handle {
  cursor: grab;
  user-select: none;
}

.donate-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
  max-width: 300px;
  margin: 0;

  text-decoration: none;
  color: #e5e7eb;
}

.donate-container span {
  color: #e5e7eb;
}

/* Version footer styling */
#version-footer {
  width: 100%;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 0 2px;
  min-height: 24px;
  max-height: none;
  line-height: 1.2;
  font-size: 12px;
  flex: 0 0 auto;
}

#banner {
  margin-bottom: 20px;
}

/* Keep top row (Create, Previous Projects) constrained so lower panels remain visible */
main.grid.fill>section.card:nth-of-type(1),
main.grid.fill>section.card:nth-of-type(2) {
  max-height: 62vh;
  /* keep headroom for the row below; adjust to taste */
  overflow: auto;
}

@media (max-height: 800px) {

  main.grid.fill>section.card:nth-of-type(1),
  main.grid.fill>section.card:nth-of-type(2) {
    max-height: 56vh;
  }
}

/* Script Shufflr two-column layout */
.script-shufflr-right {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  max-height: 380px;
  overflow: auto;
}

.script-preview-header {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.script-preview {
  font-size: 14px;
  line-height: 1.5;
}

#script-viewer-body.script-preview {
  font-size: 18px;
  line-height: 1.6;
}

/* Script Shufflr Requirements - Custom Multiline Input */
#script-shufflr-input.script-requirements-input,
textarea.script-requirements-input {
  width: 100% !important;
  min-height: 120px !important;
  padding: 14px 16px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08)) !important;
  color: #e5e7eb !important;
  resize: vertical !important;
  line-height: 1.6 !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

#script-shufflr-input.script-requirements-input:hover,
textarea.script-requirements-input:hover {
  border-color: rgba(255, 255, 255, 0.22) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12)) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
}

#script-shufflr-input.script-requirements-input:focus,
#script-shufflr-input.script-requirements-input:focus-visible,
textarea.script-requirements-input:focus,
textarea.script-requirements-input:focus-visible {
  outline: none !important;
  border-color: rgba(99, 102, 241, 0.75) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15)) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 4px 16px rgba(99, 102, 241, 0.2) !important;
}

#script-shufflr-input.script-requirements-input::placeholder,
textarea.script-requirements-input::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

/* Script Shufflr status styling */
#script-shufflr-status {
  min-height: 22px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  font-weight: 600;
}

#script-shufflr-status.script-status-ready {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

#script-shufflr-status.script-status-busy {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
}

#script-shufflr-status.script-status-error {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

/* Research Requirements - Custom Multiline Input */
#research-input.research-requirements-input,
textarea.research-requirements-input {
  width: 100% !important;
  min-height: 120px !important;
  padding: 14px 16px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08)) !important;
  color: #e5e7eb !important;
  resize: vertical !important;
  line-height: 1.6 !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

#research-input.research-requirements-input:hover,
textarea.research-requirements-input:hover {
  border-color: rgba(255, 255, 255, 0.22) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12)) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
}

#research-input.research-requirements-input:focus,
#research-input.research-requirements-input:focus-visible,
textarea.research-requirements-input:focus,
textarea.research-requirements-input:focus-visible {
  outline: none !important;
  border-color: rgba(99, 102, 241, 0.75) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15)) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 4px 16px rgba(99, 102, 241, 0.2) !important;
}

#research-input.research-requirements-input::placeholder,
textarea.research-requirements-input::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

/* Music Generation Input - Custom Styled Input */
#music-input.research-requirements-input,
input.research-requirements-input[type="text"],
input.research-requirements-input[type="number"] {
  width: 100% !important;
  min-height: 56px !important;
  padding: 14px 16px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08)) !important;
  color: #e5e7eb !important;
  line-height: 1.6 !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

#music-input.research-requirements-input:hover,
input.research-requirements-input[type="text"]:hover,
input.research-requirements-input[type="number"]:hover {
  border-color: rgba(255, 255, 255, 0.22) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12)) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
}

#music-input.research-requirements-input:focus,
#music-input.research-requirements-input:focus-visible,
input.research-requirements-input[type="text"]:focus,
input.research-requirements-input[type="text"]:focus-visible,
input.research-requirements-input[type="number"]:focus,
input.research-requirements-input[type="number"]:focus-visible {
  outline: none !important;
  border-color: rgba(99, 102, 241, 0.75) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15)) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 4px 16px rgba(99, 102, 241, 0.2) !important;
}

#music-input.research-requirements-input::placeholder,
input.research-requirements-input[type="text"]::placeholder,
input.research-requirements-input[type="number"]::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

.modal-content input.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Focus (flex) layout: one tall section per row */
.layout-flex main.grid.fill {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: none;
  overflow: auto;
}

.layout-flex main.grid.fill>section.card {
  height: 75vh;
  max-height: 75vh;
  overflow: auto;
}

.layout-flex main.grid.fill>section.card:nth-of-type(1),
.layout-flex main.grid.fill>section.card:nth-of-type(2) {
  max-height: 75vh;
}

.layout-flex .grid {
  grid-template-columns: 1fr;
}

/* Slide layout: horizontal, one tall section per snap */
.layout-slide main.grid.fill {
  display: flex;
  flex-direction: row;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.layout-slide main.grid.fill>section.card {
  flex: 0 0 100%;
  scroll-snap-align: center;
  height: 75vh;
  max-height: 75vh;
  overflow: auto;
}

.layout-slide main.grid.fill>section.card:nth-of-type(1),
.layout-slide main.grid.fill>section.card:nth-of-type(2) {
  max-height: 75vh;
}

/* Slide arrows via flexbox overlay */
.slide-nav {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 12000;
  /* below .modal (12050) so modals always overlay */
}

.slide-nav-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(17, 24, 39, 0.7);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  margin: 0 14px;
}

.slide-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.layout-slide #slide-nav {
  display: flex !important;
}

body.vs-card-fullscreen #slide-nav {
  display: none !important;
}

/* Hide side rail in Slide layout */
.layout-slide #side-rail {
  display: none !important;
}

/* Hide Script Shufflr, YouTube Channel (ideas-card), and Thumbnail Creator cards */
/* Show them only when they have the .fullscreen class */
section.card#script-shufflr-card:not(.fullscreen),
section.card#ideas-card:not(.fullscreen),
section.card#thumbnail-card:not(.fullscreen) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
}

/* Show Create audio + pro buttons only in Focus layout */
#focus-add-voice,
#focus-add-bgm,
#focus-find-videos,
#focus-find-images,
#focus-add-custom,
#focus-adjust-audio {
  display: none;
}

.layout-flex #focus-add-voice,
.layout-flex #focus-add-bgm,
.layout-flex #focus-find-videos,
.layout-flex #focus-find-images,
.layout-flex #focus-add-custom,
.layout-flex #focus-adjust-audio {
  display: inline-flex;
}

/* Also show these CTAs in Slide layout */
.layout-slide #focus-add-voice,
.layout-slide #focus-add-bgm,
.layout-slide #focus-find-videos,
.layout-slide #focus-find-images,
.layout-slide #focus-add-custom,
.layout-slide #focus-adjust-audio {
  display: inline-flex;
}

/* Also show them when the Create card is expanded fullscreen */
body.vs-card-fullscreen #create-section.fullscreen #focus-add-voice,
body.vs-card-fullscreen #create-section.fullscreen #focus-add-bgm,
body.vs-card-fullscreen #create-section.fullscreen #focus-find-videos,
body.vs-card-fullscreen #create-section.fullscreen #focus-find-images,
body.vs-card-fullscreen #create-section.fullscreen #focus-add-custom,
body.vs-card-fullscreen #create-section.fullscreen #focus-adjust-audio {
  display: inline-flex;
}

/* Show/hide Create subsections: only show Organize by default */
/* Legacy panel visibility - now handled by create-action-card */
#create-audio-panel,
#create-explore-panel {
  display: none;
}

.layout-flex #create-audio-panel,
.layout-flex #create-explore-panel {
  display: block;
}

/* Show Audio/Explore in Slide layout too */
.layout-slide #create-audio-panel,
.layout-slide #create-explore-panel {
  display: block;
}

body.vs-card-fullscreen #create-section.fullscreen #create-audio-panel,
body.vs-card-fullscreen #create-section.fullscreen #create-explore-panel {
  display: block;
}

/* New action cards visibility */
.layout-flex #create-section .create-action-card,
.layout-slide #create-section .create-action-card {
  display: block;
}

body.vs-card-fullscreen #create-section.fullscreen .create-action-card {
  display: block;
}

/* Responsive Design for Create Section */
@media (max-width: 768px) {
  #create-section .create-header-main {
    flex-direction: column;
    align-items: flex-start;
  }

  #create-section .create-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  #create-section .create-actions-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  #create-section .create-action-buttons {
    flex-direction: column;
  }

  #create-section .create-action-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #create-section .create-title {
    font-size: 24px;
  }

  #create-section .create-btn-secondary,
  #create-section .create-btn-primary {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Audio section fullscreen: hide Background Music, Voiceover, and Mix & Preview panels */
body.vs-card-fullscreen #audio-section.fullscreen [aria-label="Background Music"],
body.vs-card-fullscreen #audio-section.fullscreen [aria-label="Voiceover"],
body.vs-card-fullscreen #audio-section.fullscreen [aria-label="Mix & Preview"] {
  display: none !important;
}

/* Hide Generate Voiceover from Text panel unless in fullscreen mode */
#audio-section:not(.fullscreen) [aria-label="Generate Voiceover"],
#audio-section [aria-label="Generate Voiceover"] {
  display: none !important;
}

body.vs-card-fullscreen #audio-section.fullscreen [aria-label="Generate Voiceover"] {
  display: block !important;
}

/* Hide Voice Settings panel unless in fullscreen mode */
#audio-section [aria-label="Voice Settings"].hidden {
  display: none !important;
}

body.vs-card-fullscreen #audio-section.fullscreen [aria-label="Voice Settings"].hidden {
  display: block !important;
}

/* Create CTA row layout: keep Organize / Audio / Explore side-by-side */
/* Legacy create-cta-row support - now handled by create-actions-grid */
.dashed-panel.create-cta-row {
  display: none;
  /* Hidden, replaced by create-actions-grid */
}

.create-cta-row .panel-title {
  margin-bottom: 8px;
}

/* Homepage: emphasize total duration value and hide slider */
#qs-total-duration-value {
  font-size: 22px;
}

#qs-total-duration {
  display: none !important;
}

.qs-duration-value-hidden {
  display: none;
}

.qs-duration-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.qs-duration-input {
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 22px;
  padding: 0;
  margin: 0;
  -moz-appearance: textfield;
  /* Firefox */
}

/* Hide native spinner arrows (but keep ↑/↓ key stepping) */
.qs-duration-input::-webkit-outer-spin-button,
.qs-duration-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qs-duration-minutes {
  width: 4ch;
  text-align: right;
}

.qs-duration-seconds {
  width: 3ch;
  text-align: left;
}

.qs-duration-colon {
  opacity: 0.95;
}

/* Min/Max clip length inputs (homepage quick sliders) */
.qs-len-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  width: fit-content;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  overflow: hidden;
  padding: 0 10px;
}

.qs-len-input {
  width: 90px;
  border: none;
  outline: none;
  background: transparent;
  color: #e5e7eb;
  padding: 8px 10px;
  font-size: 22px;
  text-align: center;
  -moz-appearance: textfield;
  /* Firefox */
}

/* Hide native spinner arrows */
.qs-len-input::-webkit-outer-spin-button,
.qs-len-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qs-len-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.qs-len-btn:hover {
  background: transparent;
  color: #ffffff;
}

.qs-len-btn:active {
  background: transparent;
  transform: scale(0.95);
}

.qs-len-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qs-len-btn:disabled:hover {
  background: transparent;
  transform: none;
}

/* Add a bit more breathing room after the two clip-length inputs */
#qs-min-length-input,
#qs-max-length-input {
  margin-bottom: 10px;
}

/* Legacy create-cta-row panels - now handled by create-action-card */
.create-cta-row>div {
  display: none;
  /* Hidden, replaced by create-action-card */
}

/* Show legacy panels in fullscreen mode for backward compatibility */
body.vs-card-fullscreen #create-section.fullscreen .create-cta-row>div {
  display: block;
}

/* Thumbnail Creator small helpers */
.thumb-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  align-items: start;
}

/* Make thumbnail prompt + status match Script Shufflr styling */
#ti-prompt.script-requirements-input {
  /* The shared script textarea style is strong; just ensure it stays usable for thumbnails */
  min-height: 90px !important;
}

#ti-status {
  min-height: 22px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  font-weight: 600;
}

#thumbnail-card select.select-tonal {
  min-width: 180px;
}

.thumb-selected-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.thumb-img-cell {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.thumb-img-cell img {
  display: block;
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e5e7eb;
  font-size: 12px;
}

.thumb-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.thumb-history-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.thumb-history-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1220;
  cursor: zoom-in;
}

.pro-large .thumb-history-card img {
  height: 235px !important;
  width: 100% !important;
}

/* Ideas section */
#ideas-card .idea-item {
  flex: 0 0 auto;
  width: 220px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#ideas-card .idea-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1220;
}

#ideas-card .idea-title {
  font-size: 13px;
  line-height: 1.35;
  color: #e5e7eb;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#ideas-card .idea-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  font-size: 12px;
}

#ideas-card .idea-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6b7280;
}

#ideas-card .idea-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

#ideas-card .idea-create {
  padding: 6px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  border: 1px solid transparent;
  cursor: pointer;
}

.thumb-history-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Find Images (Thumbnail) */
#ti-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ti-cell {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.ti-cell img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.ti-selected {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.9);
  border: 1px solid transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: none;
}

/* Thumbnail Creator: make card and previews larger */
#thumbnail-card {
  max-height: 80vh;
}

.layout-flex #thumbnail-card {
  height: 85vh;
  max-height: 85vh;
}

#thumbnail-card .thumb-img-cell img {
  height: 260px;
}

#thumbnail-card .thumb-history-card img {
  height: 280px;
}

.pro-large #thumbnail-card .thumb-history-card img {
  height: 320px !important;
  width: 100% !important;
}

/* Make thumbnail history previews span full width of right column */
#thumbnail-card .thumb-history-list {
  grid-template-columns: 1fr;
}

/* Help section: spacing and taller focus-mode sizing (match thumbnail section) */
#help-section {
  margin-top: 16px;
  max-height: 80vh;
}

.layout-flex #help-section {
  height: 85vh;
  max-height: 85vh;
}

/* Taller previews for Previous Projects in Focus layout */
.layout-flex #history-section #history-list li video {
  height: 50vh !important;
  width: 100% !important;
}

/* Script history styles */
#script-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#script-history-list .script-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#script-history-list li.search-focus-ring .script-row {
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.25);
  padding: 10px 12px;
}

#script-history-list .script-title-input {
  flex: 1;
  max-width: 250px;
  min-width: 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #e5e7eb;
  border-radius: 0;
  padding: 6px 2px;
  margin-bottom: 10px;
  font-size: 15px;
}

#script-history-list .script-title-input:focus {
  outline: none;
  border-bottom-color: rgba(99, 102, 241, 0.75);
  box-shadow: none;
}

#script-history-list .script-actions {
  display: flex;
  gap: 8px;
}

/* Script menu dropdown styles */
#script-history-list .script-menu-wrapper {
  position: relative;
}

#script-history-list .script-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
  font-size: 18px;
}

#script-history-list .script-menu-btn:hover {
  filter: brightness(1.08);
}

#script-history-list .script-menu-dropdown {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20020;
  display: none;
  flex-direction: column;
  min-width: 160px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 17, 32, 0.95);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

#script-history-list .script-menu-dropdown.open {
  display: flex;
}

#script-history-list .script-menu-item {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: #e5e7eb;
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#script-history-list .script-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

#script-history-list .script-menu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Create with AI button - match homepage hub blue gradient */
#script-history-list .script-menu-item.create-ai-shufflr-btn,
#script-history-list .create-ai-shufflr-btn {
  background: linear-gradient(135deg, #0ea5e9, #6366f1) !important;
  border: 0 !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
  border-radius: 8px !important;
  margin: 4px 0 !important;
}

#script-history-list .script-menu-item.create-ai-shufflr-btn:hover,
#script-history-list .create-ai-shufflr-btn:hover {
  filter: brightness(0.95) !important;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45) !important;
}

/* Hide Create Voiceover button unless script-history-card is in fullscreen */
#script-history-list .voiceover-btn {
  display: none;
}

#script-history-card.fullscreen #script-history-list .voiceover-btn {
  display: block;
}

/* Remove max-width from script title input when in fullscreen and increase font-size */
#script-history-card.fullscreen #script-history-list .script-title-input {
  max-width: none;
  font-size: 17px;
}

/* YouTube section styles */
#youtube-section .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

#youtube-section .stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}

#youtube-section .stat-label {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#youtube-section .stat-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #e5e7eb;
}

#youtube-section .callout {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 110% -10%, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0) 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.06)),
    rgba(2, 6, 23, 0.31);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#youtube-section .code-row .code {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

#youtube-section,
#youtube-section .controls-stack {
  min-width: 0;
}

#youtube-section .list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: auto;
}

#youtube-section .script-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#youtube-section .ytv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

#youtube-section .ytv-title {
  flex: 1 1 auto;
  min-width: 0;
  color: #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#youtube-section .ytv-meta {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 50%;
}

/* Focus mode: make Saved Scripts list fill available height */
.layout-flex #script-history-card .section-header {
  height: 100%;
}

.layout-flex #script-history-card .section-header>.controls-stack {
  height: 100%;
  min-height: 0;
}

.layout-flex #script-history-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  max-height: none !important;
}

/* Focus mode: make script name inputs full width, wrap actions below */
.layout-flex #script-history-list .script-row {
  flex-wrap: wrap;
}

.layout-flex #script-history-list .script-title-input {
  flex: 1 1 100%;
  max-width: none;
  width: 100%;
}

/* Docs: floating/mobile YouTube walkthrough embed */
.docs-yt-float {
  position: fixed;
  right: 16px;
  top: 100px;
  width: 360px;
  z-index: 600;
  display: none;
}

@media (min-width: 1200px) {
  .docs-yt-float {
    display: block;
  }
}

.docs-yt-float .yt-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.docs-yt-float .yt-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.docs-yt-float .yt-open {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e5e7eb;
  font-size: 12px;
  text-decoration: none;
}

.docs-yt-float .yt-open:hover {
  filter: brightness(1.1);
}

/* Collapse/expand controls for floating video (desktop) */
.docs-yt-float .yt-collapse,
.docs-yt-float .yt-expand {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e5e7eb;
  font-size: 12px;
  cursor: pointer;
}

.docs-yt-float .yt-collapse:hover,
.docs-yt-float .yt-expand:hover {
  filter: brightness(1.1);
}

.docs-yt-float .yt-expand {
  display: none;
}

.docs-yt-float.collapsed {
  width: auto;
}

.docs-yt-float.collapsed .yt-wrap {
  display: none;
}

.docs-yt-float.collapsed .yt-open {
  display: none;
}

.docs-yt-float.collapsed .yt-collapse {
  display: none;
}

.docs-yt-float.collapsed .yt-expand {
  display: inline-flex;
  position: static;
}

.docs-yt-mobile {
  display: none;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .docs-yt-mobile {
    display: block;
  }
}

.docs-yt-mobile .yt-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.docs-yt-mobile .yt-iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.docs-yt-mobile .yt-caption {
  margin-top: 6px;
  font-size: 13px;
  color: #94a3b8;
}

.docs-yt-mobile .yt-caption a {
  color: #c7d2fe;
  text-decoration: none;
}

.docs-yt-mobile .yt-caption a:hover {
  color: #ffffff;
}

/* --- Ensure fullscreen cards truly fill viewport (override earlier nth-of-type rules) --- */
main.grid.fill>section.card.fullscreen {
  max-height: none !important;
  height: 100vh !important;
  width: 100vw !important;
  inset: 0 !important;
}

/* Create (homepage) fullscreen: give top CTA row a card-like background */
body.vs-card-fullscreen #create-section.fullscreen .section-header .controls-inline {
  position: relative;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

body.vs-card-fullscreen #create-section.fullscreen .section-header .controls-inline::before {
  display: none !important;
  content: none !important;
}

/* Community Help styles */
.help-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.help-categories .help-cat {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 12px;
}

.help-categories .help-cat.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.help-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1), box-shadow .25s cubic-bezier(.4, 0, .2, 1), border-color .25s ease;
  overflow: hidden;
}

.help-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  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;
  transition: opacity .25s ease;
}

.help-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.35);
}

.help-card:hover::before {
  opacity: 1;
}

.help-title {
  margin: 8px 0 4px;
  font-size: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.help-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #94a3b8;
  font-size: 12px;
}

.help-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

hr.help-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 10px 0;
}

.help-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.help-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.help-actions .secondary.help-open {
  padding: 8px 12px;
  margin: 2px 4px;
}

.help-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  cursor: pointer;
}

.help-like.liked {
  background: linear-gradient(135deg, #f472b6, #fb7185);
  border-color: transparent;
  color: #111827;
  box-shadow: 0 8px 22px rgba(236, 72, 153, 0.35);
}

.help-like .count {
  font-weight: 700;
}

/* Fancy toggle for Done */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 84px;
  height: 32px;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease, color .25s ease;
}

.toggle .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
  transition: transform .25s ease;
}

.toggle .toggle-label {
  display: none;
}

.toggle.on {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.35);
}

.toggle.on .knob {
  transform: translateX(26px);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.35);
}

.help-done-toggle {
  margin: 2px 4px;
}

.help-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.help-done input {
  margin: 0;
}

.help-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.help-progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.help-progress-bar #help-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #3b82f6);
  transition: width .25s ease;
}

/* Community Help lesson modal: stepper UI (replaces accordion/expand boxes) */
.help-stepper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.help-stepper-top {
  padding: 14px 16px 10px;
  background:
    radial-gradient(420px 180px at 20% -30%, rgba(99, 102, 241, 0.35), transparent 60%),
    radial-gradient(420px 180px at 80% -30%, rgba(34, 211, 238, 0.25), transparent 60%),
    rgba(17, 24, 39, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.help-stepper-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.help-stepper-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.01em;
  color: #e5e7eb;
}

.help-stepper-title .icon {
  color: #c7d2fe;
}

.help-stepper-close {
  position: static;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

.help-stepper-close:hover {
  filter: brightness(1.1);
}

.help-stepper-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.help-stepper-cat {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.help-stepper-count {
  font-size: 12px;
  color: rgba(229, 231, 235, 0.78);
}

.help-stepper-steps {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.help-stepper-steps::-webkit-scrollbar {
  height: 10px;
}

.help-stepper-steps::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.help-stepper-steps::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.help-stepper-stepbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--transition-base), background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), filter var(--transition-base);
}

.help-stepper-stepbtn:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.35);
}

.help-stepper-stepbtn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(139, 92, 246, 0.9));
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.28);
}

.help-stepper-dot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.help-stepper-stepbtn.active .help-stepper-dot {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.18);
}

.help-stepper-stepbtn-label {
  font-size: 12px;
  font-weight: 800;
  opacity: 0.95;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.help-stepper-bar {
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.help-stepper-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22d3ee, #3b82f6, #8b5cf6);
  background-size: 180% 100%;
  transition: width .25s ease;
  animation: help-stepper-shimmer 3s ease-in-out infinite;
}

@keyframes help-stepper-shimmer {

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

  50% {
    background-position: 100% 50%;
  }
}

.help-stepper-body {
  flex: 1;
  overflow: auto;
  padding: 14px 16px 18px;
}

.help-stepper-step-title {
  font-size: 13px;
  font-weight: 900;
  color: rgba(229, 231, 235, 0.88);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.help-stepper-step-wrap {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.help-stepper-step-content.anim-next {
  animation: help-step-in-next .20s ease both;
}

.help-stepper-step-content.anim-prev {
  animation: help-step-in-prev .20s ease both;
}

@keyframes help-step-in-next {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes help-step-in-prev {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.help-stepper-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(17, 24, 39, 0.92);
}

.help-stepper-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.help-stepper-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-stepper-done {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.help-stepper-done .muted {
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {

  .help-stepper-stepbtn,
  .help-stepper-step-content.anim-next,
  .help-stepper-step-content.anim-prev,
  .help-stepper-bar-fill {
    transition: none !important;
    animation: none !important;
  }
}

/* Research section styles */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 8px;
}

.research-video-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1), box-shadow .25s cubic-bezier(.4, 0, .2, 1), border-color .25s ease;
  overflow: hidden;
  cursor: pointer;
}

.research-video-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  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;
  transition: opacity .25s ease;
}

.research-video-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.35);
}

.research-video-card:hover::before {
  opacity: 1;
}

.research-video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 10px;
  object-fit: cover;
}

.research-video-title {
  margin: 8px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.research-video-url {
  font-size: 11px;
  color: #94a3b8;
  word-break: break-all;
  margin-top: 6px;
}

.research-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.research-progress-bar {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
}

.research-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #3b82f6, #8b5cf6, #ec4899);
  background-size: 200% 100%;
  animation: research-progress-shimmer 2s ease-in-out infinite;
  transition: width .3s ease;
  border-radius: 999px;
}

@keyframes research-progress-shimmer {

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

  50% {
    background-position: 100% 50%;
  }
}

.research-content-wrapper {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  align-items: flex-start;
}

.research-history-sidebar {
  width: 200px;
  flex-shrink: 0;
  max-height: 600px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.research-history-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.research-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.research-history-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all .2s ease;
  font-size: 12px;
  color: #cbd5e1;
}

.research-history-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(2px);
}

.research-history-item.search-focus-ring {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(96, 165, 250, 0.62);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.2);
  transform: none;
}

.research-history-item-title {
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.research-history-item-date {
  font-size: 10px;
  color: #94a3b8;
}

.research-history-item-count {
  font-size: 10px;
  color: #6366f1;
  margin-top: 2px;
}

/* Global scrollbar styling — minimal macOS-like with brand purple */
/* Default: transparent thumb; color only while the element is actively scrolling */
/* Firefox */
* {
  scrollbar-width: thin;
  /* Always-visible baseline thumb + subtle track */
  scrollbar-color: rgba(148, 163, 184, 0.45) rgba(255, 255, 255, 0.08);
}

/* Active scroll state in Firefox */
.vs-scrolling {
  scrollbar-color: #6366f1 rgba(255, 255, 255, 0.06);
}

/* WebKit (Chrome, Edge, Safari) */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  transition: background-color .25s ease;
}

*::-webkit-scrollbar-thumb {
  background-clip: padding-box;
  border: 3px solid transparent;
  /* creates slim thumb feel */
  /* Always-visible baseline thumb */
  background-color: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: background-color .25s ease, box-shadow .25s ease;
}

/* Color thumb only while element is actively scrolling */
.vs-scrolling::-webkit-scrollbar-thumb {
  background-color: #6366f1;
  /* brand purple */
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.vs-scrolling::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Emphasize horizontal scrollbar visibility specifically for the advanced editor timeline */
.plan-timeline-wrap.vs-scrolling::-webkit-scrollbar:horizontal {
  height: 12px;
}

.plan-timeline-wrap.vs-scrolling::-webkit-scrollbar-track:horizontal {
  background: rgba(255, 255, 255, 0.08);
}

.plan-timeline-wrap.vs-scrolling::-webkit-scrollbar-thumb:horizontal {
  background-color: #6366f1;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.28);
}

/* Emphasize horizontal scrollbar for .ed-timeline containers when scrolling */
.ed-timeline.vs-scrolling::-webkit-scrollbar:horizontal {
  height: 12px;
}

.ed-timeline.vs-scrolling::-webkit-scrollbar-track:horizontal {
  background: rgba(255, 255, 255, 0.08);
}

.ed-timeline.vs-scrolling::-webkit-scrollbar-thumb:horizontal {
  background-color: #6366f1;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.28);
}

/* Timeline/Grid/List label hover glow effect */
#ed-plan-view-label {
  display: none;
}

/* Add Custom modal: large colorful tabs */
.custom-tabs-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  width: max-content;
}

.custom-tabs-bar {
  display: flex;
  gap: 8px;
}

.custom-tab {
  background: transparent;
  border: 1px solid transparent;
  color: #e5e7eb;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .02em;
  transition: filter .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.custom-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.custom-tab.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}

.custom-tab[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.custom-tab[disabled]:hover {
  background: transparent;
  border-color: transparent;
}

.custom-panels-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Panels are hidden by default */
.custom-panel {
  display: none;
  width: 100%;
  flex: 1;
}

/* Show panels when they have the active class - this MUST override hidden */
.custom-panel.active {
  display: flex !important;
  flex-direction: row;
  width: 100%;
  gap: 16px;
  align-items: flex-start;
}

/* Ensure hidden class never affects active panels */
.custom-panel.active.hidden {
  display: flex !important;
  flex-direction: row;
  width: 100%;
  gap: 16px;
  align-items: flex-start;
}

/* Add Custom modal questionnaire: Apple/Shopify/Airbnb‑inspired spacing & typography */
#custom-modal .dashed-panel {
  padding: 14px 16px;
  gap: 12px;
  border-radius: 12px;
}

#custom-modal .panel-title {
  font-size: 15px;
  color: #e5e7eb;
  letter-spacing: -0.005em;
  text-transform: none;
  font-weight: 700;
}

#custom-modal #cw-step-indicator {
  font-size: 14px;
}

#custom-modal #cw-steps {
  gap: 16px;
}

#custom-modal .cw-step {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.02);
}

#custom-modal .cw-step+.cw-step {
  margin-top: 0;
}

#custom-modal .cw-step .ai-row {
  gap: 12px;
  margin-top: 6px;
}

#custom-modal .ai-sub {
  font-size: 14px;
}

#custom-modal textarea.ai-input {
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 12px;
}

#custom-modal .ai-input,
#custom-modal .ai-select {
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 12px;
}

#custom-modal label.stack {
  gap: 8px;
}

#custom-modal .ai-row {
  gap: 12px;
}

/* Custom scrollbar for wizard steps */
#custom-modal #cw-steps::-webkit-scrollbar {
  width: 8px;
}

#custom-modal #cw-steps::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

#custom-modal #cw-steps::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

#custom-modal #cw-steps::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Make action buttons comfortably large inside the modal without affecting icon grid dots */
#custom-modal button:not(.icon-btn):not(.custom-tab):not(.modal-close) {
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
}

#custom-modal .ellipse-btn {
  padding: 10px 18px;
  border-radius: 999px;
}

/* --- AI common elements (Apple-inspired minimal) --- */
.ai-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex-direction: row !important;
}

/* Fix custom select wrappers in flex rows - use inline-block to stay in row flow */
.ai-row>[data-vs-custom-select="1"] {
  display: inline-block !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
}

.ai-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Library Filter Bar - Clean CSS-only styling */
.library-filter-bar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
  padding: 12px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  flex-wrap: wrap !important;
}

.library-filter-bar>div {
  flex: 1 !important;
  flex-shrink: 0 !important;
}

.library-filter-bar>div:last-child {
  display: flex !important;
  justify-content: flex-end !important;
  min-width: 200px !important;
}

.library-filter-bar label {
  margin: 0 !important;
  color: #94a3b8 !important;
  font-size: 13px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.library-filter-bar select {
  min-width: 140px !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  flex-shrink: 0 !important;
}

.library-filter-bar select#library-cat-home {
  min-width: 160px !important;
}

.library-filter-bar input[type="text"] {
  width: 100% !important;
  max-width: 280px !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
}

/* Ensure custom select wrappers work properly in filter bar */
.library-filter-bar [data-vs-custom-select="1"] {
  display: inline-flex !important;
  flex-shrink: 0 !important;
}

@media (max-width: 768px) {
  .library-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .library-filter-bar>div {
    width: 100% !important;
  }

  .library-filter-bar>div:last-child {
    justify-content: stretch !important;
  }

  .library-filter-bar input[type="text"] {
    max-width: 100% !important;
  }
}

.ai-title {
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 8px 0;
}

.ai-sub {
  color: #94a3b8;
  font-size: 13px;
}

/* Inputs styled to match app tone */
input.ai-input,
textarea.ai-input,
select.ai-select,
input[type="text"].ai-input,
input[type="password"].ai-input,
input[type="number"].ai-input {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
}

textarea.ai-input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

input.ai-input:hover,
textarea.ai-input:hover,
select.ai-select:hover {
  filter: brightness(1.06);
}

input.ai-input:focus-visible,
textarea.ai-input:focus-visible,
select.ai-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
  border-color: transparent;
}

select.ai-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}

/* Create with AI (Story setup): Outro skip seconds input */
.vc-outro-seconds-input {
  max-width: 160px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-align: center;
}

/* --- Runware Model Library --- */
.rw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.rw-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.rw-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  border-color: rgba(99, 102, 241, 0.35);
}

.rw-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1220;
}

.rw-title {
  font-weight: 700;
  margin: 4px 0 2px;
  color: #e5e7eb;
  letter-spacing: -0.01em;
  font-size: 14px;
}

.rw-meta {
  color: #94a3b8;
  font-size: 12px;
}

.rw-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

/* Hide Create section inline status and progress bar */
#create-section #status,
#create-section #progress-bar {
  display: none !important;
}

/* Select Files pulse: single-run multicolor glow; JS triggers at random intervals when empty */
#select-files.vs-pulse-run {
  position: relative;
  animation: vsPulseMulti 2.4s ease-out 1 both;
}

@keyframes vsPulseMulti {
  0% {
    box-shadow: none;
    transform: translateY(0);
  }

  12% {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.55), 0 12px 28px rgba(99, 102, 241, 0.35);
  }

  28% {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.55), 0 12px 28px rgba(14, 165, 233, 0.35);
  }

  44% {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.55), 0 12px 28px rgba(34, 197, 94, 0.35);
  }

  60% {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.55), 0 12px 28px rgba(245, 158, 11, 0.35);
  }

  76% {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.55), 0 12px 28px rgba(239, 68, 68, 0.35);
  }

  88% {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.55), 0 12px 28px rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
  }

  100% {
    box-shadow: none;
    transform: translateY(0);
  }
}

/* Global button radius increase */
:where(button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  a.btn,
  .btn,
  .cta-button,
  .mini-btn,
  .fs-btn,
  .dup-btn,
  .link-button,
  .help-like,
  #layout-toggle .seg-btn,
  .pagination button,
  .custom-tab):not(.ellipse-btn):not(.modal-close):not(.icon-btn) {
  border-radius: 20px !important;
}

/* Subtle white outline on hover without overriding keyboard focus ring */
:where(button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  a.btn,
  .btn,
  .cta-button,
  .mini-btn,
  .fs-btn,
  .dup-btn,
  .link-button,
  .help-like,
  #layout-toggle .seg-btn,
  .pagination button,
  .custom-tab):not(.ellipse-btn):not(.modal-close):not(.icon-btn):hover:not(:focus-visible) {
  outline: .3px solid rgba(255, 255, 255, 0.65);
  outline-offset: .3px;
}

/* Remove hover outline for specific link buttons */
#ti-prompt-from-image:hover:not(:focus-visible) {
  outline: none !important;
}

/* ==========================
   HOMEPAGE HUB (new)
   ========================== */
.homepage-hub {
  position: fixed;
  inset: 0;
  z-index: 20000;
  /* Fully opaque, subtle brand backdrop (reduced color shift) */
  background:
    radial-gradient(900px 360px at 50% -18%, #101a33 0%, #0b1220 60%),
    linear-gradient(180deg, #0b1220 0%, #0b1220 100%);
  display: none;
  /* hidden by default; shown via .visible */
  overflow: hidden;
  /* no scrolling on overlay */
  /* Flex layout with left sidebar when visible */
  gap: 24px;
  padding: 16px;
  height: 100vh;
  /* lock viewport */
}

.homepage-hub.visible {
  display: flex;
  contain: strict;
}

.vs-homepage-hub-open {
  overflow: hidden;
}

.home-hub-main {
  display: flex;
  gap: 24px;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  align-self: stretch;
  contain: layout paint style;
}

.home-content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1400px;
  margin: 0 16px 0 0;
  padding: 8px 24px 16px;
  max-height: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  contain: layout style;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.home-side,
.home-right,
.home-hero,
.home-flowboard-tool,
.home-tiles,
.home-tile,
.home-tools,
.home-projects,
.home-tools-grid,
.home-tools-grid .tool,
.home-projects-grid {
  contain: layout style;
}

.home-projects {
  content-visibility: auto;
  contain-intrinsic-size: 1px 420px;
}

.home-tools {
  content-visibility: visible;
}

.home-content.vs-scrolling .home-flowboard-tool,
.home-content.vs-scrolling .home-tile,
.home-content.vs-scrolling .home-tools-grid .tool,
.home-content.vs-scrolling .home-proj {
  transition: none !important;
}

.home-content::-webkit-scrollbar {
  width: 6px;
}

.home-content::-webkit-scrollbar-track {
  background: transparent;
}

.home-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.home-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.home-hub-search {
  position: sticky;
  top: 0;
  z-index: 20026;
  margin-bottom: 16px;
  padding-top: 4px;
}

.home-hub-search-field {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 28px;
  align-items: center;
  column-gap: 12px;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 10, 20, 0.86);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  padding: 0 12px 0 14px;
}

.home-hub-search-field:focus-within {
  border-color: rgba(139, 92, 246, 0.72);
  box-shadow: 0 22px 50px rgba(124, 58, 237, 0.22);
}

.home-hub-search-field-icon {
  color: #94a3b8;
  font-size: 18px;
  pointer-events: none;
}

.home-hub-search-input {
  min-width: 0;
  width: 100%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #f8fafc;
  padding: 15px 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0 !important;
  min-height: 0;
}

.home-hub-search-input::placeholder {
  color: #7c8aa5;
}

.home-hub-search-input:focus,
.home-hub-search-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
  background: transparent !important;
  filter: none !important;
}

.home-hub-search-clear {
  justify-self: end;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
  box-shadow: none;
  filter: none;
  transform: scale(1);
  margin: 0;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.home-hub-search-clear.is-hidden {
  opacity: 0;
  transform: scale(0.72);
  pointer-events: none;
}

.home-hub-search-clear:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  filter: none;
  transform: scale(1.08);
}

.home-hub-search-clear:active,
.home-hub-search-clear:focus-visible {
  transform: scale(0.96);
  outline: none;
  box-shadow: none;
}

.home-hub-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: none;
  max-height: min(60vh, 520px);
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 12, 24, 0.96);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(20px);
  z-index: 20027;
}

.home-hub-search-panel.is-open {
  display: block;
}

.home-hub-search-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.home-hub-search-empty {
  padding: 18px 16px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

.home-hub-search-result {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #e5e7eb;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.home-hub-search-result:hover,
.home-hub-search-result.is-active {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(96, 165, 250, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(8, 15, 30, 0.22);
}

.home-hub-search-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.18);
  color: #93c5fd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  margin-top: 1px;
}

.home-hub-search-result-icon iconify-icon {
  font-size: 18px;
}

.home-hub-search-result-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-hub-search-result-title {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.home-hub-search-result-breadcrumb {
  color: #93c5fd;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.home-hub-search-result-subtitle {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-side {
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 230px;
  flex: 0 0 230px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  contain: layout paint style;
  padding: 12px 4px 8px 4px;
}

.home-right {
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  width: 230px;
  flex: 0 0 230px;
  height: 100%;
  min-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  contain: layout paint style;
  border-radius: 14px;
  align-items: center;
  justify-content: flex-start;
  padding: 4px;
}

.home-divider {
  width: 1px;
  background: rgba(255, 255, 255, 0.10);
  align-self: stretch;
  border-radius: 1px;
}

/* Homepage Hub: Visibility settings helpers */
#homepage-hub.hub-hide-left .home-side {
  display: none !important;
}

#homepage-hub.hub-hide-left .home-divider {
  display: none !important;
}

#homepage-hub.hub-hide-right .home-right {
  display: none !important;
}

#homepage-hub.hub-hide-right .home-content {
  margin-right: 0 !important;
  max-width: none;
}

#homepage-hub.hub-hide-more-tools .home-tools {
  display: none !important;
}

#homepage-hub.hub-hide-flowboard #home-flowboard-btn,
#homepage-hub.hub-hide-channel #home-channel-panel,
#homepage-hub.hub-hide-channel #home-channel-goals,
#homepage-hub.hub-hide-points #gamification-points-display {
  display: none !important;
}

/* Hub fallback Settings button (only visible when left sidebar is hidden) */
#homepage-hub .hub-fab-settings {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 20020;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(17, 24, 39, 0.85);
  color: #e5e7eb;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

#homepage-hub.hub-hide-left .hub-fab-settings {
  display: inline-flex;
}

#homepage-hub .hub-fab-settings:hover {
  filter: brightness(1.08);
}

#homepage-hub .hub-fab-settings:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
}

.home-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b1220;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.home-logo img {
  width: 26px;
  height: 26px;
}

/* Homepage Hub: Changelog modal */
.hub-changelog-modal {
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(10px);
  z-index: 2147483000;
}

.hub-changelog-card {
  width: min(92vw, 820px);
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(700px 280px at 50% -10%, rgba(99, 102, 241, 0.18) 0%, rgba(15, 23, 42, 0.85) 60%),
    linear-gradient(180deg, rgba(11, 18, 32, 0.96) 0%, rgba(10, 16, 30, 0.96) 100%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
}

.hub-changelog-modal .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.hub-changelog-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.hub-changelog-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hub-changelog-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.hub-changelog-logo img {
  width: 30px;
  height: 30px;
}

.hub-changelog-brand-name {
  font-size: 18px;
  font-weight: 800;
  color: #f8fafc;
}

.hub-changelog-brand-tag {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.hub-changelog-release {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-changelog-release-title {
  font-size: 20px;
  font-weight: 800;
  color: #e2e8f0;
}

.hub-changelog-release-date {
  font-size: 12px;
  color: #94a3b8;
}

.hub-changelog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #e5e7eb;
  font-size: 14px;
  line-height: 1.55;
}

.hub-changelog-body p {
  margin: 0;
  color: #e5e7eb;
}

.hub-changelog-body ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.hub-changelog-body li {
  color: #e5e7eb;
}

.hub-changelog-release-block {
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hub-changelog-release-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hub-changelog-release-name {
  font-weight: 700;
  font-size: 15px;
  color: #f8fafc;
}

.hub-changelog-release-meta {
  font-size: 12px;
  color: #94a3b8;
}

.hub-changelog-release-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.html-to-markdown {
  color: inherit;
}

.html-to-markdown :is(p, ul, ol, pre) {
  margin: 0;
}

.html-to-markdown ul {
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.html-to-markdown ol {
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.html-to-markdown code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

.html-to-markdown pre {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.html-to-markdown blockquote {
  padding: 10px 12px;
  border-left: 3px solid rgba(129, 140, 248, 0.6);
  background: rgba(15, 23, 42, 0.6);
  border-radius: 10px;
  color: #cbd5e1;
}

.hub-changelog-release-content :is(h1, h2, h3, h4) {
  margin: 0;
  color: #f8fafc;
}

.hub-changelog-release-content h1 {
  font-size: 18px;
}

.hub-changelog-release-content h2 {
  font-size: 16px;
}

.hub-changelog-release-content h3,
.hub-changelog-release-content h4 {
  font-size: 14px;
}

.hub-changelog-release-content a {
  color: #c7d2fe;
  text-decoration: underline;
}

.hub-changelog-release-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

.hub-changelog-release-content pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.hub-changelog-release-content blockquote {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(129, 140, 248, 0.6);
  background: rgba(15, 23, 42, 0.6);
  border-radius: 10px;
  color: #cbd5e1;
}

.hub-changelog-release-content ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.hub-changelog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hub-changelog-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hub-changelog-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #cbd5f5;
}

.hub-changelog-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #818cf8;
  cursor: pointer;
}

.hub-changelog-modal .primary {
  min-width: 120px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.25);
}

/* Homepage Hub: top background music player */
.home-bgm-player {
  flex: 0 0 auto;
  min-height: 84px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(11, 17, 32, 0.82);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  overflow: visible;
}

.home-right-bottom {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  contain: layout style;
}

.home-bgm-player-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.home-bgm-title {
  color: #e5e7eb;
  font-weight: 800;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  position: relative;
  --marquee-gap: 24px;
  --marquee-duration: 14s;
}

.home-bgm-title-track {
  display: inline-flex;
  align-items: center;
  gap: var(--marquee-gap);
  white-space: nowrap;
  will-change: transform;
}

.home-bgm-title-text {
  display: inline-block;
  white-space: nowrap;
}

.home-bgm-title-clone {
  display: none;
}

.home-bgm-title.is-overflowing .home-bgm-title-clone {
  display: inline-block;
}

.home-bgm-title.is-overflowing .home-bgm-title-track {
  animation: homeBgmMarquee var(--marquee-duration) linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .home-bgm-title.is-overflowing .home-bgm-title-track {
    animation: none;
  }

  .home-bgm-title-clone {
    display: none !important;
  }
}

@keyframes homeBgmMarquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-1 * var(--marquee-shift, 0px)));
  }
}

.home-bgm-player-bottom {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  max-width: 100%;
  width: 100%;
  margin: -4px;
  padding: 4px;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  box-sizing: border-box;
}

.home-bgm-btn {
  width: 40px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  position: relative;
}

/* Force Iconify icons to be truly centered and smaller (avoid default 24px `.icon`) */
.home-bgm-btn :is(iconify-icon, .icon) {
  font-size: 14px;
  width: 1em;
  height: 1em;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  line-height: 1;
  pointer-events: none;
}

.home-bgm-btn:hover {
  filter: brightness(1.06);
  background: rgba(255, 255, 255, 0.09);
}

.home-bgm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.home-bgm-btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.25);
}

.home-bgm-btn--primary:hover {
  filter: brightness(0.98);
}

.home-side-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.home-side-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.home-side-text {
  font-weight: 800;
  color: #e5e7eb;
}

.home-join-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  margin-bottom: 6px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  width: 100%;
}

.home-join-btn:hover {
  filter: brightness(0.95);
}

.home-side-section-title {
  color: #a3a9b7;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 6px 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  cursor: default;
  transition: text-shadow 0.2s ease, color 0.2s ease;
}

.home-side-section-title:hover {
  color: #e5e7eb;
  text-shadow: 0 0 8px rgba(163, 169, 183, 0.4), 0 0 12px rgba(163, 169, 183, 0.2);
}

.home-side-collapse-btn {
  background: transparent;
  border: none;
  color: #a3a9b7;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.home-side-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}

.home-side-collapse-btn .collapse-icon {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  user-select: none;
}

.home-side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.2s ease, max-height 0.3s ease;
  overflow: visible;
}

.home-side-nav.collapsed {
  max-height: 0 !important;
  opacity: 0;
  margin: 0;
  padding: 0;
  visibility: hidden;
  overflow: hidden;
}

.home-side-nav:not(.collapsed) {
  max-height: 500px;
}

.home-side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: #e5e7eb;
  text-align: left;
  cursor: pointer;
}

.home-side-item:hover {
  background: rgba(255, 255, 255, 0.05);
  filter: brightness(1.04);
}

.home-side-item .side-ico {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.home-side-grow {
  flex: 1;
}

.home-side-activate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: transparent;
  border: 0;
  color: #c7d2fe;
  text-decoration: underline;
  font-weight: 800;
  padding: 6px 0;
  margin-bottom: 6px;
}

.home-side-activate:hover {
  filter: brightness(1.08);
}

.home-right-activate-wrap {
  width: 100%;
  margin: 4px 0 8px;
}

.home-right-activate {
  margin-bottom: 0;
}

.home-side-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  margin-top: auto;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.05);
}

.home-side-settings:hover {
  filter: brightness(0.95);
}

/* Right sidebar slider - horizontal, minimal wrappers */
.home-right-promo {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px;
}

.home-right-track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: rgba(11, 17, 32, 0.78);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-right-track::-webkit-scrollbar {
  display: none;
}

.home-right-track img {
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  max-height: 248px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1220;
  scroll-snap-align: center;
}

.home-right-tour-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
}

.tour-entry-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  font-weight: 900;
  cursor: pointer;
}

.tour-entry-btn:hover {
  filter: brightness(1.06);
}

.tour-entry-btn:focus {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.tour-entry-badge {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  font-size: 12px;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.95), rgba(99, 102, 241, 0.95));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22);
}

/* Current channel summary (right sidebar) */
.home-views-aggregate {
  position: relative;
  width: 100%;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 10px 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  background: linear-gradient(145deg, rgba(5, 46, 22, 0.74), rgba(10, 12, 26, 0.92));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.58);
  cursor: default;
  z-index: 4;
}

.home-views-aggregate.hidden {
  display: none !important;
}

.home-views-aggregate-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.home-views-aggregate-label {
  min-width: 0;
  color: rgba(220, 252, 231, 0.86);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.home-views-aggregate-value,
.home-views-aggregate-popover-value {
  color: #22c55e;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 18px rgba(34, 197, 94, 0.3);
  white-space: nowrap;
}

.home-views-aggregate-subtitle {
  margin-top: 5px;
  color: rgba(187, 247, 208, 0.7);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-views-aggregate-popover {
  position: absolute;
  top: 0;
  right: calc(100% + 12px);
  width: min(420px, calc(100vw - 40px));
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(8, 10, 22, 0.98);
  box-shadow: 0 22px 50px rgba(2, 6, 23, 0.72);
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  backdrop-filter: blur(18px);
}

.home-views-aggregate:hover .home-views-aggregate-popover,
.home-views-aggregate:focus-within .home-views-aggregate-popover,
.home-views-aggregate.is-popover-open .home-views-aggregate-popover,
.home-views-aggregate-popover.is-floating-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.home-views-aggregate-popover.is-floating {
  position: fixed;
  top: var(--home-views-popover-top, 16px);
  left: var(--home-views-popover-left, 16px);
  right: auto;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  z-index: 20090;
}

.home-views-aggregate-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.home-views-aggregate-popover-label {
  color: rgba(148, 163, 184, 0.86);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-views-aggregate-popover-title {
  margin-top: 2px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.home-views-aggregate-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.home-views-aggregate-stat {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.72);
}

.home-views-aggregate-stat span {
  display: block;
  color: rgba(148, 163, 184, 0.82);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-views-aggregate-stat strong {
  display: block;
  margin-top: 2px;
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-views-aggregate-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.home-views-chart {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.54);
}

.home-views-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 11px;
  font-weight: 800;
}

.home-views-chart-head strong {
  color: #22c55e;
  font-size: 11px;
  font-weight: 900;
}

.home-views-chart svg {
  display: block;
  width: 100%;
  height: 54px;
  overflow: visible;
}

.home-views-chart path.home-views-chart-area {
  fill: rgba(34, 197, 94, 0.16);
}

.home-views-chart path.home-views-chart-line {
  fill: none;
  stroke: #22c55e;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.home-views-chart circle {
  fill: #bbf7d0;
  stroke: rgba(8, 10, 22, 0.96);
  stroke-width: 2;
}

.home-right-channel {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 10px 10px 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.22), rgba(15, 23, 42, 0.96));
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.66);
}

.home-right-channel.hidden {
  display: none !important;
}

.home-channel-goals {
  width: 100%;
  margin: 0 0 8px 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.86));
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.52);
}

.home-channel-goals.hidden {
  display: none !important;
}

.home-channel-goals-top {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: center;
}

.home-channel-goal-nav {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.home-channel-goal-nav:hover {
  border-color: rgba(191, 219, 254, 0.85);
  background: rgba(37, 99, 235, 0.75);
}

.home-channel-goal-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.home-channel-goal-copy {
  min-width: 0;
}

.home-channel-goal-label {
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.9);
}

.home-channel-goal-title {
  margin-top: 2px;
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-channel-goal-progress-shell {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.home-channel-goal-progress {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #06b6d4, #8b5cf6, #f59e0b);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
  transition: width 0.25s ease;
}

.home-channel-goal-meta {
  margin-top: 7px;
  color: rgba(203, 213, 225, 0.82);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-right-channel-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.home-right-channel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #0b1120;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  border: 2px solid rgba(15, 23, 42, 0.85);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.home-right-channel-avatar-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.home-right-channel-refresh-btn {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(226, 232, 240, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
  padding: 0;
}

.home-right-channel-refresh-btn:hover {
  color: rgba(191, 219, 254, 0.95);
  transform: translateY(-1px);
}

.home-right-channel-refresh-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.home-right-channel-refresh-btn iconify-icon {
  font-size: 11px;
}

.home-right-channel-refresh-btn.is-refreshing iconify-icon {
  animation: homeChannelRefreshSpin 0.85s linear infinite;
}

@keyframes homeChannelRefreshSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.home-right-channel-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.home-right-channel-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.75);
}

.home-right-channel-name {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-right-channel-subtitle {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-right-channel-views-48h {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-right-channel-views-48h iconify-icon {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--color-primary) 72%, #ffffff 28%);
}

.home-right-channel-views-48h span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-right-channel-views-48h.hidden {
  display: none !important;
}

.home-right-channel-niche {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(191, 219, 254, 0.85);
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.home-right-channel-niche.hidden {
  display: none !important;
}

.home-right-channel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.home-right-channel-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.home-right-channel-btn.secondary {
  background: rgba(15, 23, 42, 0.75);
}

.home-right-channel-btn:hover {
  background: rgba(30, 64, 175, 0.95);
  border-color: rgba(191, 219, 254, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.55);
}

.home-right-channel-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.home-right-channel-manage {
  margin-top: 6px;
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(191, 219, 254, 0.9);
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.home-right-channel-manage:hover {
  color: #e5e7eb;
}

.home-channel-switch-modal {
  z-index: 30050;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(10px);
}

.home-channel-switch-modal:not(.hidden) {
  display: flex;
  z-index: 30050 !important;
  position: fixed !important;
}

#home-channel-switch-modal:not(.hidden) {
  z-index: 30050 !important;
}

.home-channel-switch-dialog {
  position: relative;
  z-index: 30051 !important;
  width: min(520px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 36px));
  overflow: visible;
  padding: 22px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#home-channel-switch-modal:not(.hidden) .home-channel-switch-dialog {
  z-index: 30051 !important;
}

.home-channel-switch-x {
  top: 14px;
  right: 14px;
}

.home-channel-switch-head {
  padding-right: 34px;
}

.home-channel-switch-kicker,
.home-channel-switch-field > span,
.home-channel-switch-current-copy span {
  color: rgba(148, 163, 184, 0.92);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-channel-switch-head h2 {
  margin: 6px 0 6px;
  color: #f8fafc;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
}

.home-channel-switch-head p {
  margin: 0;
  color: rgba(203, 213, 225, 0.82);
  font-size: 14px;
  line-height: 1.45;
}

.home-channel-switch-current {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
}

.home-channel-switch-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
  background: linear-gradient(135deg, #60a5fa, #f97316);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.home-channel-switch-current-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.home-channel-switch-current-copy strong {
  color: #e5e7eb;
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-channel-switch-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.home-channel-switch-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0) !important;
}

.home-channel-account-dd {
  position: relative;
  width: 100%;
}

.home-channel-account-dd-btn {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.64);
  color: #f8fafc;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.home-channel-account-dd-btn:hover,
.home-channel-account-dd-btn:focus-visible,
.home-channel-account-dd.is-open .home-channel-account-dd-btn {
  border-color: rgba(249, 115, 22, 0.58);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.home-channel-account-dd-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
}

.home-channel-account-dd-btn iconify-icon {
  flex: 0 0 auto;
  color: rgba(203, 213, 225, 0.8);
  transition: transform 0.16s ease;
}

.home-channel-account-dd.is-open .home-channel-account-dd-btn iconify-icon {
  transform: rotate(180deg);
}

.home-channel-account-dd-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-channel-account-dd-menu {
  position: absolute;
  z-index: 30080;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  max-height: min(280px, 38vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 12px;
  background: rgba(11, 18, 32, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.home-channel-account-dd.is-open .home-channel-account-dd-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-channel-account-dd-option {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(226, 232, 240, 0.9);
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  text-align: left;
}

.home-channel-account-dd-option:hover,
.home-channel-account-dd-option:focus-visible {
  background: rgba(96, 165, 250, 0.12);
  color: #f8fafc;
}

.home-channel-account-dd-option[aria-selected="true"] {
  background: rgba(249, 115, 22, 0.16);
  color: #fff7ed;
}

.home-channel-account-dd-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(135deg, #60a5fa, #f97316);
  background-size: cover;
  background-position: center;
}

.home-channel-account-dd-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-channel-account-dd-check {
  color: #fb923c;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.home-channel-account-dd-empty {
  padding: 12px 10px;
  color: rgba(203, 213, 225, 0.72);
  font-size: 13px;
}

.home-channel-switch-status {
  min-height: 20px;
  margin-top: 10px;
  color: rgba(203, 213, 225, 0.82);
  font-size: 12px;
  line-height: 1.35;
}

.home-channel-switch-status.is-error {
  color: #fecaca;
}

.home-channel-switch-status.is-success {
  color: #bbf7d0;
}

.home-channel-switch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.home-channel-switch-btn {
  min-width: 112px;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.home-channel-switch-btn.secondary {
  background: rgba(15, 23, 42, 0.74);
}

.home-channel-switch-btn.primary {
  border-color: rgba(249, 115, 22, 0.68);
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff7ed;
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.22);
}

.home-channel-switch-btn:hover:not(:disabled),
.home-channel-switch-btn:focus-visible:not(:disabled) {
  transform: translateY(-1px);
}

.home-channel-switch-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 560px) {
  .home-channel-switch-modal {
    padding: 14px;
  }

  .home-channel-switch-dialog {
    width: calc(100vw - 28px);
    padding: 18px;
  }

  .home-channel-switch-actions {
    flex-direction: column-reverse;
  }

  .home-channel-switch-btn {
    width: 100%;
  }
}

/* Version display in right sidebar */
.home-right-version {
  margin-top: 0;
  padding-top: 16px;
  padding-bottom: 20px;
  text-align: center;
  margin-bottom: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.home-right-version a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.home-right-version a:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
}

.home-right-version span {
  color: rgba(255, 255, 255, 0.5);
}

/* Gamification Points Display */
.gamification-points-display {
  margin-top: auto;
  margin-bottom: 16px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.gamification-points-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.gamification-points-display:hover::before {
  left: 100%;
}

.gamification-points-display:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
  border-color: rgba(255, 255, 255, 0.25);
}

.gamification-unread-badge {
  position: absolute;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff7ed;
  background: linear-gradient(135deg, #fb923c, #ef4444);
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.28);
  z-index: 2;
}

.gamification-unread-badge.hidden {
  display: none;
}

.gamification-points-unread-badge {
  top: 10px;
  left: 10px;
}

.gamification-points-value {
  font-size: 36px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

.gamification-points-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Diamonds micro-line under points */
.gamification-diamonds-line {
  margin-top: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0.95;
}

.gamification-diamonds-line .muted {
  font-weight: 700;
  opacity: 0.85;
}

/* Diamonds section inside the Points modal */
.gamification-diamonds-panel {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
}

.gamification-diamonds-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
}

.gamification-diamonds-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.gamification-diamonds-actions button {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
}

.gamification-diamonds-actions button.primary {
  border: 0;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0b1120;
}

.gamification-diamonds-actions #diamond-refresh-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gamification-diamonds-actions #diamond-refresh-btn iconify-icon {
  font-size: 17px;
}

.gamification-diamonds-actions input {
  width: 90px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.92);
}

.gamification-diamonds-note {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(148, 163, 184, 1);
  line-height: 1.35;
}

/* Gamification Modal */
.vs-gamification-modal-open {
  overflow: hidden;
}

.gamification-modal-content {
  width: min(92vw, 900px);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #0b1220 0%, #101a33 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Points-earned toast */
.vs-gamification-points-toast {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 20070;
  width: min(460px, calc(100vw - 24px));
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  box-shadow: 0 18px 44px rgba(76, 29, 149, 0.45);
  backdrop-filter: blur(8px);
  color: #ffffff;
}

.vs-gamification-points-toast.animate-in {
  animation: vsGamificationToastIn 260ms ease-out both;
}

.vs-gamification-points-toast.out {
  animation: vsGamificationToastOut 360ms ease-in both;
}

.vs-gamification-points-toast-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vs-gamification-points-toast-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.vs-gamification-points-toast-icon iconify-icon {
  font-size: 30px;
}

.vs-gamification-points-toast-copy {
  min-width: 0;
}

.vs-gamification-points-toast-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  margin-bottom: 4px;
}

.vs-gamification-points-toast-sub {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
}

@keyframes vsGamificationToastIn {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }

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

@keyframes vsGamificationToastOut {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  to {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
}

/* ============================================
   LEADERBOARDS (Points Competition)
   ============================================ */

.vs-leaderboards-modal-content {
  width: min(92vw, 980px);
  max-height: 90vh;
  overflow-y: auto;
}

.vs-leaderboards-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.vs-leaderboards-subtitle {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.vs-leaderboards-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.vs-leaderboards-toolbar input[type="text"] {
  flex: 1 1 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 38px;
}

.vs-lb-you-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.vs-leaderboards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 66vh;
  overflow: auto;
  padding-right: 4px;
}

.vs-lb-row {
  display: grid;
  grid-template-columns: 92px 1fr 160px;
  gap: 12px;
  align-items: center;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.vs-lb-row:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.vs-lb-row.top {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.10));
  border-color: rgba(99, 102, 241, 0.30);
}

.vs-lb-row.me {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.18);
}

.vs-lb-rank {
  font-weight: 900;
  color: #e2e8f0;
  letter-spacing: 0.02em;
}

.vs-lb-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.vs-lb-user-meta {
  min-width: 0;
}

.vs-lb-username {
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-lb-mini {
  font-size: 12px;
}

.vs-lb-points {
  text-align: right;
  font-size: 15px;
}

.vs-lb-you-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.22);
  font-size: 11px;
  font-weight: 900;
  color: #a5f3fc;
}

.vs-lb-plan-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(226, 232, 240, 0.95);
  vertical-align: 1px;
}

.vs-lb-plan-badge.plan-free {
  /* Free: gray */
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.14);
  color: rgba(226, 232, 240, 0.95);
}

.vs-lb-plan-badge.plan-pro {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.16);
  color: rgba(224, 231, 255, 0.98);
}

.vs-lb-plan-badge.plan-platinum {
  /* Platinum: purple */
  border-color: rgba(168, 85, 247, 0.42);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(99, 102, 241, 0.12));
  color: rgba(250, 245, 255, 0.98);
}

.vs-lb-plan-badge.plan-diamond {
  /* Diamond: gold */
  border-color: rgba(245, 158, 11, 0.52);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.26), rgba(250, 204, 21, 0.12));
  color: rgba(255, 251, 235, 0.98);
}

.vs-lb-plan-badge.plan-unknown {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.35);
  color: rgba(148, 163, 184, 0.95);
}

.vs-lb-avatar {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  display: inline-block;
  flex: 0 0 auto;
}

.vs-lb-avatar.lg {
  width: 34px;
  height: 34px;
}

.vs-lb-empty {
  padding: 18px 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.vs-leaderboards-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vs-leaderboard-profile-modal-content {
  width: min(92vw, 980px);
  max-height: 90vh;
  overflow-y: auto;
}

.vs-lb-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.vs-lb-profile-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vs-lb-profile-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vs-lb-profile-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vs-lb-totals-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.vs-lb-totals-title {
  font-weight: 900;
  margin-bottom: 10px;
}

.vs-lb-channels-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 920px) {
  .vs-lb-row {
    grid-template-columns: 84px 1fr 130px;
  }

  .vs-lb-channels-grid {
    grid-template-columns: 1fr;
  }
}

.vs-lb-channel-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.vs-lb-channel-title {
  font-weight: 900;
  margin-bottom: 10px;
}

.vs-lb-channel-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 620px) {
  .vs-lb-channel-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gamification-header {
  margin-bottom: 24px;
}

.gamification-header h2 {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  font-size: 28px;
}

.gamification-username-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gamification-username-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.gamification-username-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.gamification-username-input:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Current Level Card */
.gamification-current-level {
  margin-bottom: 32px;
}

.gamification-level-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.2s ease;
}

.gamification-level-card.current {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.gamification-level-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.gamification-level-number {
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
}

.gamification-level-name {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.gamification-level-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.gamification-stat {
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.gamification-stat-value {
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 4px;
}

.gamification-stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gamification-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.gamification-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.gamification-next-level {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 16px;
  font-weight: 600;
}

.gamification-reward-preview {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.gamification-reward-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.gamification-reward-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

/* Journey Section */
.gamification-journey-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.gamification-levels-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gamification-level-card.journey {
  cursor: pointer;
  padding: 16px;
}

.gamification-level-card.journey:hover {
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.gamification-level-card.journey.unlocked {
  opacity: 1;
}

.gamification-level-card.journey.locked {
  opacity: 0.5;
}

.gamification-level-card.journey.completed {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.gamification-level-card.journey.current {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  border-color: rgba(99, 102, 241, 0.4);
}

.gamification-level-points {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.gamification-level-reward {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
}

.gamification-level-reward-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.3;
  margin-bottom: 8px;
}

.gamification-reward-icon {
  font-size: 18px;
}

.gamification-level-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
}

.gamification-level-status.status-completed {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.gamification-level-status.status-current {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

.gamification-level-status.status-locked {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* Activity log in points modal */
.gamification-log-toggle,
.gamification-log-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gamification-log-toggle iconify-icon,
.gamification-log-back iconify-icon {
  font-size: 15px;
}

.gamification-log-toggle.active {
  border-color: rgba(129, 140, 248, 0.85);
  background: rgba(99, 102, 241, 0.25);
}

.gamification-notification-wrap {
  position: relative;
}

.gamification-notifications-btn {
  position: relative;
}

.gamification-bell-unread-badge {
  top: -8px;
  right: -8px;
}

.gamification-activity-section {
  margin-bottom: 6px;
}

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

.gamification-log-header .gamification-journey-title {
  margin: 0;
  padding: 0;
  border: 0;
}

.gamification-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gamification-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(129, 140, 248, 0.18);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(15, 23, 42, 0.32));
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  appearance: none;
  color: inherit;
}

.gamification-log-item:hover {
  transform: translateY(-1px);
  border-color: rgba(129, 140, 248, 0.34);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
}

.gamification-log-item:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.8);
  outline-offset: 2px;
}

.gamification-log-item.is-unread {
  border-color: rgba(129, 140, 248, 0.38);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.1));
}

.gamification-log-item.is-read {
  opacity: 0.82;
}

.gamification-log-item.is-compact {
  padding: 12px 14px;
}

.gamification-log-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gamification-log-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.gamification-log-action {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.gamification-log-state {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(226, 232, 240, 0.9);
  background: rgba(15, 23, 42, 0.38);
}

.gamification-log-item.is-unread .gamification-log-state {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.3);
}

.gamification-log-meta {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.86);
}

.gamification-log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gamification-log-action-btn {
  white-space: nowrap;
}

.gamification-log-side {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 54px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gamification-log-side.is-points {
  font-size: 24px;
  font-weight: 900;
  color: #c4b5fd;
  text-shadow: 0 0 12px rgba(196, 181, 253, 0.35);
}

.gamification-log-side.is-icon {
  color: rgba(226, 232, 240, 0.94);
}

.gamification-log-side iconify-icon {
  font-size: 24px;
}

.gamification-notifications-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, 82vw);
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.98), rgba(16, 26, 51, 0.98));
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.44);
  z-index: 4;
}

.gamification-notifications-panel.hidden {
  display: none;
}

.gamification-notification-empty {
  font-size: 13px;
}

.gamification-log-item.is-compact .gamification-log-action {
  font-size: 16px;
}

.gamification-log-item.is-compact .gamification-log-side {
  min-width: 46px;
  min-height: 46px;
  padding: 6px 8px;
}

.gamification-log-item.is-compact .gamification-log-side.is-points {
  font-size: 18px;
}

.gamification-log-item.is-compact .gamification-log-side iconify-icon {
  font-size: 20px;
}

.gamification-log-item.is-compact .gamification-log-actions {
  margin-top: 8px;
}

.gamification-log-item.is-compact .gamification-log-action-btn {
  padding: 6px 10px;
  font-size: 11px;
}

.gamification-log-item.is-compact .gamification-log-state {
  font-size: 9px;
}

.gamification-log-item.is-compact .gamification-log-meta {
  font-size: 11px;
}

.gamification-log-empty {
  padding: 22px 16px;
  border-radius: 14px;
  border: 1px dashed rgba(129, 140, 248, 0.3);
  background: rgba(99, 102, 241, 0.08);
  color: rgba(226, 232, 240, 0.88);
  font-size: 16px;
  font-weight: 700;
}

@media (max-width: 680px) {
  .vs-gamification-points-toast {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 12px;
    padding: 14px;
  }

  .vs-gamification-points-toast-icon {
    width: 44px;
    height: 44px;
  }

  .vs-gamification-points-toast-icon iconify-icon {
    font-size: 24px;
  }

  .vs-gamification-points-toast-title {
    font-size: 20px;
  }

  .vs-gamification-points-toast-sub {
    font-size: 12px;
  }

  .gamification-log-item {
    padding: 12px;
    align-items: flex-start;
  }

  .gamification-log-action {
    font-size: 16px;
  }

  .gamification-log-side {
    min-width: 44px;
    min-height: 44px;
  }

  .gamification-log-side.is-points {
    font-size: 20px;
  }

  .gamification-log-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .gamification-notifications-panel {
    right: -8px;
    width: min(360px, calc(100vw - 32px));
  }
}

.home-hero {
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: none;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid transparent;
  cursor: pointer;
}

.home-hero-inner {
  text-align: center;
  padding: 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.home-hero-title {
  color: #e5e7eb;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 22px;
  margin: 0;
  text-transform: none;
}

.home-hero:hover {
  border-color: rgba(255, 255, 255, 0.85);
}

/* Plus icon block to the left of the title */
.home-hero-inner::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.home-create-btn {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.home-create-btn:hover {
  filter: brightness(1.05);
}

/* Flowboard tool button - shown only when wide enough for 4 cards */
.home-flowboard-tool {
  display: none;
  /* Hidden by default */
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  padding: 20px 24px;
  margin-top: 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.home-flowboard-tool:hover {
  filter: brightness(1.06);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.3);
}

.home-flowboard-tool-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-flowboard-tool .icon {
  flex-shrink: 0;
  color: #8b5cf6;
}

.home-flowboard-tool-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.home-flowboard-tool-title {
  font-weight: 800;
  font-size: 18px;
  color: #e5e7eb;
  letter-spacing: -0.01em;
}

.home-flowboard-tool-sub {
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.4;
}

/* Show Flowboard tool button when window is wide enough for 4 cards per row */
/* 4 cards * 260px min + 3 gaps * 14px + padding ≈ 1100px */
.home-tile--wide-only {
  display: none;
}

@media (min-width: 1100px) {
  .home-flowboard-tool {
    display: block;
  }

  .home-tile--wide-only {
    display: block;
  }
}

.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.home-tile {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: #e5e7eb;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.home-tile:hover {
  filter: brightness(1.04);
  background: rgba(255, 255, 255, 0.05);
}

.home-tile .tile-title {
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.home-tile .tile-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.home-tile .tile-row .icon {
  padding: 0;
  margin: 0;
}

.home-tile .tile-text {
  display: flex;
  flex-direction: column;
  padding-left: 8px;
}

.home-tile .tile-sub {
  font-size: 12px;
  color: #9ca3af;
  display: block;
  margin-top: 4px;
}

.home-tools {
  margin-top: 14px;
}

.home-tools .tools-title {
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  margin-bottom: 8px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.home-tools .home-side-section-title {
  padding-bottom: 10px;
}

.home-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: -4px;
  padding: 4px;
  transition: opacity 0.2s ease, max-height 0.3s ease;
  overflow: visible;
}

.home-tools-grid.collapsed {
  max-height: 0 !important;
  opacity: 0;
  margin: 0;
  padding: 0;
  visibility: hidden;
  overflow: hidden;
}

.home-tools-grid:not(.collapsed) {
  max-height: 500px;
}

.home-tools-grid .tool {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: #e5e7eb;
  padding: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-tools-grid .tool:hover {
  background: rgba(255, 255, 255, 0.05);
  filter: brightness(1.04);
}

.home-tools-grid .tool .icon {
  flex-shrink: 0;
}

.home-return {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 20010;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--platinum-gradient);
  color: #fff;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
}

.home-return:hover {
  filter: brightness(0.95);
}

.home-return.diamond-active {
  background: var(--diamond-gradient);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow-lg);
}

.home-return.hidden {
  display: none;
}

/* Hide return button when homepage hub is visible */
body.vs-homepage-hub-open .home-return {
  display: none !important;
}

/* Responsive: keep center content wide by compressing right rail */
@media (max-width: 1100px) {
  #homepage-hub {
    gap: 16px;
  }

  #homepage-hub .home-hub-main {
    gap: 14px;
  }

  #homepage-hub .home-content {
    margin: 0;
    max-height: 100%;
    overflow-y: auto;
  }

  #homepage-hub .home-right {
    width: 88px;
    min-width: 88px;
    flex: 0 0 88px;
    min-height: 0;
    padding: 10px 6px;
    gap: 8px;
  }

  #homepage-hub .home-right-promo {
    gap: 6px;
    margin-bottom: 4px;
  }

  #homepage-hub .home-right-track {
    border-radius: 12px;
  }

  #homepage-hub .home-right-track img {
    border-radius: 10px;
  }

  #homepage-hub .home-right-dots {
    display: none;
  }

  #homepage-hub .home-right-channel {
    margin: 0;
    padding: 8px 6px;
  }

  #homepage-hub .home-views-aggregate {
    margin: 0;
    padding: 8px 6px;
  }

  #homepage-hub .home-views-aggregate-main {
    justify-content: center;
  }

  #homepage-hub .home-views-aggregate-label,
  #homepage-hub .home-views-aggregate-subtitle {
    display: none;
  }

  #homepage-hub .home-views-aggregate-value {
    font-size: 15px;
  }

  #homepage-hub .home-views-aggregate-popover {
    right: calc(100% + 8px);
    width: min(360px, calc(100vw - 112px));
  }

  #homepage-hub .home-views-aggregate-popover.is-floating {
    right: auto;
    width: min(360px, calc(100vw - 24px));
  }

  #homepage-hub .home-channel-goals {
    display: none !important;
  }

  #homepage-hub .home-right-channel-header {
    justify-content: center;
    margin-bottom: 0;
  }

  #homepage-hub .home-right-channel-info,
  #homepage-hub .home-right-channel-actions {
    display: none;
  }

  #homepage-hub .home-right-tour-entry {
    margin: 0;
    width: 100%;
  }

  #homepage-hub .tour-entry-btn {
    width: 100%;
    justify-content: center;
    padding: 8px 6px;
    gap: 0;
  }

  #homepage-hub .tour-entry-btn>span:not(.tour-entry-badge) {
    display: none;
  }

  #homepage-hub .home-right-bottom {
    margin-top: 8px;
    align-items: center;
    gap: 8px;
  }

  #homepage-hub .home-bgm-player {
    width: 100%;
    padding: 8px 6px;
    align-items: center;
  }

  #homepage-hub .home-bgm-player-top {
    display: none;
  }

  #homepage-hub .home-bgm-player-bottom {
    width: auto;
    flex-direction: column;
    overflow: visible;
    gap: 6px;
  }

  #homepage-hub .home-bgm-btn {
    width: 34px;
    height: 30px;
  }

  #homepage-hub .gamification-points-display {
    width: 100%;
    margin-bottom: 8px;
    padding: 10px 6px;
    border-radius: 10px;
  }

  #homepage-hub .gamification-points-label,
  #homepage-hub .gamification-diamonds-line {
    display: none;
  }

  #homepage-hub .gamification-points-value {
    font-size: 16px;
    line-height: 1.15;
  }

  #homepage-hub .home-right-version {
    width: 100%;
    margin-bottom: 0;
    padding: 6px 0 0;
    border-top: 0;
    font-size: 11px;
  }
}

/* Projects preview grid */
.home-projects {
  margin-top: 14px;
  min-height: 0;
  position: relative;
}

.home-projects .tools-title {
  padding-top: 10px;
  padding-bottom: 10px;
}

.home-proj-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-proj-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.home-proj-actions .icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.home-proj-actions .icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.home-proj-search {
  width: 0;
  opacity: 0;
  pointer-events: none;
  transition: width .18s ease, opacity .18s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
}

.home-proj-actions.open .home-proj-search {
  width: 220px;
  opacity: 1;
  pointer-events: auto;
}

.home-projects-empty {
  display: none;
  text-align: center;
  margin-top: 10px;
  padding: 16px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
  color: #94a3b8;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.home-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-height: 40vh;
  height: 40vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  align-content: start;
  margin-top: 10px;
  padding: 4px 0;
}

.home-proj-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.home-proj {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: transparent;
}

.home-proj:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.home-proj video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0b1220;
}

.home-proj .proj-menu-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.home-proj .proj-menu-btn:hover {
  filter: brightness(1.08);
}

.home-proj .proj-menu-dropdown {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20020;
  display: none;
  flex-direction: column;
  min-width: 160px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 17, 32, 0.95);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.home-proj .proj-menu-dropdown.open {
  display: flex;
}

.home-proj .proj-menu-item {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: #e5e7eb;
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
}

.home-proj .proj-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.home-proj .proj-menu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.home-proj .remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.home-proj .remove-btn:hover {
  filter: brightness(1.08);
}

.home-proj-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-proj-name {
  font-size: 12px;
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-proj-size {
  font-size: 11px;
  color: #94a3b8;
}

/* Projects settings dropdown */
.home-proj-settings-dropdown {
  position: relative;
}

.home-proj-settings-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: auto;
  right: 0;
  z-index: 20025;
  display: none;
  flex-direction: column;
  min-width: 160px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 17, 32, 0.95);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.home-proj-settings-dropdown.open .home-proj-settings-menu {
  display: flex;
}

.home-proj-view-option {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: #e5e7eb;
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.home-proj-view-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.home-proj-view-option.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.home-proj-view-option .icon {
  flex-shrink: 0;
}

/* List view layout */
.home-projects-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 40vh;
  height: 40vh;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  align-content: start;
  margin-top: 10px;
  min-height: 0;
}

.home-projects-grid.list-view .home-proj-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.home-projects-grid.list-view .home-proj-wrap:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.home-projects-grid.list-view .home-proj {
  width: 120px;
  min-width: 120px;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
}

.home-projects-grid.list-view .home-proj-caption {
  flex: 1;
  min-width: 0;
}

.home-projects-grid.list-view .home-proj-name {
  font-size: 13px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Homepage hub: always show pointer for clickable controls and their contents */
.homepage-hub :is(button, .home-hero, .home-tile, .home-flowboard-tool, .home-tools-grid .tool, .home-side-item, .home-side-settings, .home-join-btn, .home-return, .home-proj) {
  cursor: var(--vs-cursor-pointer) !important;
}

.homepage-hub :is(button, .home-hero, .home-tile, .home-flowboard-tool, .home-tools-grid .tool, .home-side-item, .home-side-settings, .home-join-btn, .home-return, .home-proj) * {
  cursor: var(--vs-cursor-pointer) !important;
}

/* RSS Library (Homepage Hub > Library tab) */
.rss-library-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rss-library-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.rss-library-row .ai-input {
  flex: 1 1 240px;
  min-width: 200px;
  font-size: 16px;
}

.rss-library-row button {
  font-size: 14px;
  padding: 9px 12px;
}

.rss-library-status {
  font-size: 12px;
  line-height: 1.4;
}

.rss-library-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 14px 0;
}

.rss-library-list-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
}

.rss-library-title {
  font-size: 15px;
  font-weight: 700;
  color: #e5e7eb;
}

.rss-library-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.rss-library-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.rss-library-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rss-library-item-title {
  font-size: 18px;
  font-weight: 700;
  color: #e5e7eb;
}

.rss-library-item-url {
  font-size: 13px;
  color: #94a3b8;
  word-break: break-all;
}

.rss-library-item-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.rss-library-item-actions button {
  font-size: 12px;
  padding: 6px 10px;
}

.rss-library-empty {
  text-align: center;
  padding: 28px 12px;
  font-size: 14px;
}

.rss-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.rss-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.rss-search-result-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rss-search-result-title {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

.rss-search-result-url {
  font-size: 11px;
  color: #94a3b8;
  word-break: break-all;
}

.rss-search-result-snippet {
  font-size: 11px;
  color: #94a3b8;
}

.rss-search-result-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.rss-view {
  margin-top: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.6);
  padding: 12px;
}

.rss-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rss-view-title {
  font-size: 18px;
  font-weight: 700;
  color: #e5e7eb;
}

.rss-view-subtitle {
  font-size: 12px;
}

.rss-view-body {
  display: grid;
  grid-template-columns: minmax(220px, 34%) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  min-height: 320px;
}

.rss-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.rss-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.rss-item.is-active {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.rss-item-title {
  color: #e5e7eb;
  font-weight: 600;
  font-size: 13px;
}

.rss-item-meta {
  color: #94a3b8;
  font-size: 11px;
  margin-top: 4px;
}

.rss-item-viewer {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  background: rgba(2, 6, 23, 0.6);
  min-height: 320px;
}

.rss-item-viewer .rss-item-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.rss-item-link {
  display: inline-block;
  margin: 6px 0 10px;
  color: #93c5fd;
  font-size: 12px;
  text-decoration: none;
}

.rss-item-body {
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
  white-space: pre-wrap;
}

.rss-view-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#library-rss-content.rss-view-active .rss-library-toolbar,
#library-rss-content.rss-view-active .rss-library-row,
#library-rss-content.rss-view-active .rss-library-divider,
#library-rss-content.rss-view-active .rss-library-list-header,
#library-rss-content.rss-view-active .rss-library-list,
#library-rss-content.rss-view-active .rss-library-empty {
  display: none;
}

#library-rss-content.rss-view-active .rss-view {
  margin-top: 0;
}

@media (max-width: 900px) {
  .rss-view-body {
    grid-template-columns: 1fr;
  }

  .rss-item-list {
    max-height: 200px;
  }
}

/* Homepage hub: points card should still feel clickable */
.homepage-hub .gamification-points-display {
  cursor: var(--vs-cursor-pointer) !important;
}

/* Ensure buttons in homepage hub have space to transform on hover without clipping */
.homepage-hub button,
.homepage-hub .home-hero,
.homepage-hub .home-tile,
.homepage-hub .home-flowboard-tool,
.homepage-hub .home-tools-grid .tool,
.homepage-hub .home-side-item,
.homepage-hub .home-side-settings,
.homepage-hub .home-join-btn,
.homepage-hub .gamification-points-display {
  position: relative;
  z-index: 1;
}

/* Ensure hero and Join Pro use current theme gradient regardless of other button styles */
.homepage-hub #home-create-btn.home-hero {
  background: var(--color-gradient-primary) !important;
  border-color: transparent !important;
}

.homepage-hub #home-join-btn {
  background: var(--color-gradient-primary) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.homepage-hub #home-create-btn.home-hero.diamond-active {
  background: var(--diamond-gradient) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

/* Diamond: Change Join Pro button to match theme gradient when diamond is active */
.homepage-hub #home-join-btn.diamond-active {
  background: var(--diamond-gradient) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-glow) !important;
}

/* Ensure bottom Settings pill tracks current theme gradient inside hub */
.homepage-hub .home-side-settings {
  background: var(--color-gradient-primary) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* Diamond: Change Settings pill to gold when diamond is active */
.homepage-hub .home-side-settings.diamond-active {
  background: var(--diamond-gradient) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

/* Diamond: Make gear icon black when diamond is active */
.homepage-hub .home-side-settings.diamond-active .side-ico,
.homepage-hub .home-side-settings.diamond-active .side-ico iconify-icon,
.homepage-hub .home-side-settings.diamond-active iconify-icon {
  color: #e5e7eb !important;
}

/* Create With AI (hub tile) — match creator homepage blue + star */
.homepage-hub .home-tile[data-action="create-ai"] {
  background: var(--color-gradient-cyan) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: var(--shadow-glow-lg);
}

.homepage-hub .home-tile[data-action="create-ai"]:hover {
  filter: brightness(0.95);
}

.homepage-hub .home-tile[data-action="create-ai"]:hover .tile-title {
  text-shadow: 0 0 8px var(--color-primary), 0 0 12px var(--color-secondary);
  transition: text-shadow 0.2s ease;
}

.homepage-hub .home-tile[data-action="create-ai"] .tile-title {
  transition: text-shadow 0.2s ease;
}

.homepage-hub .home-tile[data-action="create-ai"] .tile-title::after {
  content: ' ✦';
}

/* Create With AI tile: dark gray subtext for contrast */
.homepage-hub .home-tile[data-action="create-ai"] .tile-sub {
  color: #ffffff !important;
}

/* Create With AI (left sidebar quick link) — match blue + star */
.homepage-hub .home-side-item[data-action="create-ai"] {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: #e5e7eb !important;
  box-shadow: none !important;
}

.homepage-hub .home-side-item[data-action="create-ai"]:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  filter: brightness(1.04) !important;
}

.homepage-hub .home-side-item[data-action="create-ai"]::after {
  content: ' ✦';
}

/* Force ALL sidebar items (except Join Pro and Settings) to match More tools styling */
.homepage-hub .home-side .home-side-item {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: #e5e7eb !important;
  box-shadow: none !important;
}

.homepage-hub .home-side .home-side-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  filter: brightness(1.04) !important;
}

/* Icon system tokens and utilities (Phosphor via Iconify) */
:root {
  /* Sizes on a 24px base grid */
  --icon-size-1: 16px;
  --icon-size-2: 20px;
  --icon-size-3: 24px;
  /* default */
  --icon-size-4: 32px;

  /* Colors */
  --icon-color: #1f2937;
  /* gray-800 */
  --icon-color-muted: #6b7280;
  /* gray-500 */
  --icon-color-danger: #ef4444;
  --icon-color-success: #10b981;
  --icon-color-warning: #f59e0b;

  /* Interaction */
  --icon-opacity-disabled: 0.4;
  --icon-bg-hover: rgba(0, 0, 0, 0.06);
  --icon-bg-active: rgba(0, 0, 0, 0.10);

  /* Focus ring */
  --focus-ring: 0 0 0 2px rgba(59, 130, 246, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root {
    --icon-color: #e5e7eb;
    /* gray-200 */
    --icon-color-muted: #9ca3af;
    /* gray-400 */
    --icon-bg-hover: rgba(255, 255, 255, 0.08);
    --icon-bg-active: rgba(255, 255, 255, 0.14);
    --focus-ring: 0 0 0 2px rgba(96, 165, 250, 0.6);
  }
}

/* Ensure dark theme uses light icons even if system prefers light mode. */
.dark-mode {
  --icon-color: #e5e7eb;
  /* gray-200 */
  --icon-color-muted: #9ca3af;
  /* gray-400 */
  --icon-bg-hover: rgba(255, 255, 255, 0.08);
  --icon-bg-active: rgba(255, 255, 255, 0.14);
  --focus-ring: 0 0 0 2px rgba(96, 165, 250, 0.6);
}

/* Base inline SVG icon */
.icon {
  font-size: var(--icon-size-3);
  /* icon size defaults to 24px via font-size */
  width: 1em;
  /* ensure element scales with font-size */
  height: 1em;
  display: inline-block;
  color: white;
  vertical-align: middle;
  line-height: 1;
}

.icon--muted {
  color: var(--icon-color-muted);
}

.icon--danger {
  color: var(--icon-color-danger);
}

.icon--success {
  color: var(--icon-color-success);
}

/* Video Creator selection styles - solid line instead of dotted, thinner */
.homepage-hub #vc-asset-items [data-item-id]:focus,
.homepage-hub #vc-asset-items [data-item-id]:focus-visible,
.homepage-hub #vc-asset-items>div:focus,
.homepage-hub #vc-asset-items>div:focus-visible {
  outline: 1px solid rgba(99, 102, 241, 0.7) !important;
  outline-offset: 2px;
  outline-style: solid !important;
}

.homepage-hub #vc-asset-items [data-item-id].selected,
.homepage-hub #vc-asset-items [data-item-id][aria-selected="true"],
.homepage-hub #vc-asset-items>div.selected {
  outline: 1px solid rgba(99, 102, 241, 0.7) !important;
  outline-offset: 2px;
  outline-style: solid !important;
}

/* Override any dotted/dashed outlines in video creator when accessed from homepage hub */
.homepage-hub #vc-editor *:focus,
.homepage-hub #vc-editor *:focus-visible,
.homepage-hub #vc-edit-panel *:focus,
.homepage-hub #vc-edit-panel *:focus-visible {
  outline-style: solid !important;
  outline-width: 1px !important;
}

.icon--warning {
  color: var(--icon-color-warning);
}

.icon--s-16 {
  font-size: 16px;
}

.icon--s-20 {
  font-size: 20px;
}

.icon--s-24 {
  font-size: 24px;
}

.icon--s-32 {
  font-size: 32px;
}

/* Larger sizes for feature tiles */
.icon--s-40 {
  font-size: 40px;
}

.icon--s-48 {
  font-size: 48px;
}

.icon--s-64 {
  font-size: 64px;
}

.icon--s-72 {
  font-size: 72px;
}

/* Accessible icon button pattern */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 36px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
  color: white;
  cursor: pointer;
  border: 0;
}

.icon-button:hover {
  background: var(--icon-bg-hover);
}

.icon-button:active {
  background: var(--icon-bg-active);
}

.icon-button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.icon-button[disabled] {
  opacity: var(--icon-opacity-disabled);
  cursor: not-allowed;
}

.icon-button.is-active {
  color: var(--icon-color);
  background: var(--icon-bg-active);
}

/* Flowboard Styles */
#flowboard-section {
  max-height: none;
  overflow: visible;
}

#flowboard-section.fullscreen {
  overflow: hidden;
}

#flowboard-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#flowboard-mindmap {
  position: relative;
  overflow: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#flowboard-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#flowboard-nodes {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 600px;
  z-index: 2;
}

.flowboard-node {
  position: absolute;
  cursor: move;
  user-select: none;
  transition: opacity 0.2s, box-shadow 0.2s;
}

.flowboard-node:hover {
  opacity: 0.9;
}

.flowboard-node:active {
  opacity: 0.7;
}

.flowboard-inspector {
  overflow-y: auto;
}

#flowboard-timeline {
  overflow-x: auto;
  overflow-y: auto;
}

/* Flowboard Button Styles */
.flowboard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.flowboard-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.flowboard-btn:hover::before {
  opacity: 1;
}

.flowboard-btn-primary {
  background: var(--color-gradient-primary);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.flowboard-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-lg);
  filter: brightness(1.05);
}

.flowboard-btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.flowboard-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.flowboard-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.flowboard-btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

.flowboard-btn-accent {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.flowboard-btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  filter: brightness(1.05);
}

.flowboard-btn-accent:active {
  transform: translateY(0) scale(0.98);
}

.flowboard-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.flowboard-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e5e7eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.flowboard-btn-ghost:active {
  transform: translateY(0) scale(0.98);
}

.flowboard-btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.flowboard-btn:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* Flowboard Title Input */
.flowboard-title-input {
  outline: none;
}

.flowboard-title-input:focus {
  border-bottom-color: rgba(99, 102, 241, 0.6);
  background: rgba(255, 255, 255, 0.03);
}

.flowboard-title-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Flowboard Files List */
#fb-files-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

#fb-files-list::-webkit-scrollbar {
  width: 8px;
}

#fb-files-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

#fb-files-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

#fb-files-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.fb-file-item {
  transition: all 0.2s ease;
}

.fb-file-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.fb-play-video:hover {
  background: rgba(0, 0, 0, 0.5) !important;
}

.fb-view-image:hover {
  opacity: 0.9;
}

.fb-remove-file:hover {
  transform: scale(1.2);
  color: #dc2626 !important;
}

/* File input label hover */
label[for="fb-files"]:hover {
  border-color: rgba(255, 255, 255, 0.3) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

label[for="fb-files"]:active {
  transform: scale(0.98);
}

/* Connection mode active state */
#flowboard-connect-mode.active {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

#flowboard-connect-mode.active:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* Flowboard Toggle Switch */
.flowboard-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.flowboard-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.flowboard-toggle.active {
  background: var(--color-gradient-primary);
  border-color: transparent;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.flowboard-toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.flowboard-toggle.active .flowboard-toggle-slider {
  left: 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Flowboard Zoom Slider - Custom styled */
#flowboard-zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.2s;
}

#flowboard-zoom-slider:hover {
  background: rgba(255, 255, 255, 0.15);
}

#flowboard-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), 0 0 0 2px rgba(59, 130, 246, 0.15);
  transition: all 0.2s;
  margin-top: -6px;
}

#flowboard-zoom-slider::-webkit-slider-thumb:hover {
  background: linear-gradient(135deg, #60a5fa, #818cf8);
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.5), 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#flowboard-zoom-slider::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

#flowboard-zoom-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), 0 0 0 2px rgba(59, 130, 246, 0.15);
  transition: all 0.2s;
}

#flowboard-zoom-slider::-moz-range-thumb:hover {
  background: linear-gradient(135deg, #60a5fa, #818cf8);
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.5), 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#flowboard-zoom-slider::-moz-range-thumb:active {
  transform: scale(1.1);
}

#flowboard-zoom-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#flowboard-zoom-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

#flowboard-zoom-slider:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#flowboard-timeline-content {
  position: relative;
  height: 100%;
}

#flowboard-timeline-ruler {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#flowboard-timeline-segments {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100px;
}

.flowboard-segment {
  position: absolute;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.flowboard-segment:hover {
  opacity: 0.9;
}

#flowboard-playhead {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

#flowboard-playhead-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #3b82f6;
  pointer-events: none;
  z-index: 5;
}

/* Fullscreen Flowboard adjustments */
body.vs-card-fullscreen #flowboard-section.fullscreen #flowboard-container {
  height: calc(100vh - 120px);
}

body.vs-card-fullscreen #flowboard-section.fullscreen #flowboard-mindmap {
  min-height: 500px;
}

/* Flowboard Library Styles */
.flowboard-library-card {
  background: rgba(54, 54, 54, 0.521);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flowboard-library-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#flows-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 8px 0;
}

/* Trim modal ignore list styles */
.trim-ignore-presets {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trim-ignore-presets-label,
.trim-ignore-custom-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.trim-ignore-presets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trim-ignore-preset-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trim-ignore-preset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.trim-ignore-preset-btn:active {
  transform: translateY(0);
}

.trim-ignore-preset-btn .preset-time {
  color: #94a3b8;
  font-weight: 600;
}

.trim-ignore-custom {
  margin-top: 4px;
}

.trim-ignore-list-container {
  margin-top: 8px;
}

.trim-ignore-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.trim-ignore-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
  gap: 12px;
}

.trim-ignore-list-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.trim-ignore-list-item-empty {
  padding: 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  font-style: italic;
}

.trim-ignore-list-item-label {
  flex: 1;
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trim-ignore-list-item-label:hover {
  color: #fff;
}

.trim-ignore-list-item-time {
  color: #94a3b8;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.trim-ignore-list-item-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.trim-ignore-list-item .icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.trim-ignore-list-item .icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.trim-ignore-list-item .secondary {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* ============================================
   CRITICAL: Flat styling for quick-sliders - MUST override all other rules
   ============================================ */
#create-section #quick-sliders.quick-settings,
#create-section #quick-sliders,
#create-section .quick-settings-row .quick-settings-content #quick-sliders,
#create-section .quick-settings-row .quick-settings-content .quick-settings#quick-sliders {
  display: flex !important;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 24px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  margin-top: 0 !important;
}

#create-section #quick-sliders.quick-settings::before,
#create-section #quick-sliders::before,
#create-section .quick-settings-row .quick-settings-content #quick-sliders::before {
  display: none !important;
  content: none !important;
}

#create-section #quick-sliders.quick-settings:hover,
#create-section #quick-sliders:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Override fullscreen elevated styling */
body.vs-card-fullscreen #create-section.fullscreen #quick-sliders.quick-settings,
body.vs-card-fullscreen #create-section.fullscreen #quick-sliders {
  display: flex !important;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 24px !important;
  box-shadow: none !important;
}

body.vs-card-fullscreen #create-section.fullscreen #quick-sliders::before {
  display: none !important;
  content: none !important;
}

/* ============================================
   CRITICAL: Flat styling for section-block - MUST override all other rules
   ============================================ */
#create-section .section-block,
#create-section #sections-container .section-block,
.section-block {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

#create-section .section-block:hover,
#create-section #sections-container .section-block:hover,
.section-block:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

#create-section .section-block::before,
#create-section #sections-container .section-block::before,
.section-block::before {
  display: none !important;
  content: none !important;
}

/* Keep intro/outro border colors but with flat background */
#create-section .section-block.intro,
.section-block.intro {
  border-color: rgba(59, 130, 246, 0.2) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

#create-section .section-block.outro,
.section-block.outro {
  border-color: rgba(168, 85, 247, 0.2) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

/* ============================================
   CRITICAL: Override ALL elevated styling in create section
   ============================================ */
/* Quick settings row - all variants */
#create-section .quick-settings-row,
body.vs-card-fullscreen #create-section.fullscreen .quick-settings-row {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

/* Section header controls inline */
#create-section .section-header .controls-inline,
body.vs-card-fullscreen #create-section.fullscreen .section-header .controls-inline {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

#create-section .section-header .controls-inline::before,
body.vs-card-fullscreen #create-section.fullscreen .section-header .controls-inline::before {
  display: none !important;
  content: none !important;
}

/* Voice library inline */
#create-section #voice-library-inline,
#voice-library-inline {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

/* Any dashed-panel in create section */
#create-section .dashed-panel {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

#create-section .dashed-panel::before {
  display: none !important;
  content: none !important;
}

/* Hide PRO badge and Clips label in quick-sliders */
#create-section #quick-sliders .panel-title,
#create-section #quick-sliders .badge-pro,
#quick-sliders .panel-title,
#quick-sliders .badge-pro,
body.vs-card-fullscreen #create-section.fullscreen #quick-sliders .panel-title,
body.vs-card-fullscreen #create-section.fullscreen #quick-sliders .badge-pro {
  display: none !important;
  visibility: hidden !important;
}

/* Hide ALL PRO badges in fullscreen mode */
body.vs-card-fullscreen .badge-pro,
body.vs-card-fullscreen .card.fullscreen .badge-pro,
body.vs-card-fullscreen section.card.fullscreen .badge-pro {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* ============================================
   HOMEPAGE: Apply flat styling to ALL cards and sections
   ============================================ */
/* All card sections - flat minimalist styling */
main.grid.fill>section.card,
section.card {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

main.grid.fill>section.card:hover,
section.card:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* All dashed panels in homepage cards - flat styling */
.card .dashed-panel,
main.grid.fill .card .dashed-panel {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

.card .dashed-panel:hover,
main.grid.fill .card .dashed-panel:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.card .dashed-panel::before,
main.grid.fill .card .dashed-panel::before {
  display: none !important;
  content: none !important;
}

/* Section headers - flat styling */
.card .section-header,
section.card .section-header {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Docs exception: docs section headers should be sticky and readable (opaque bar + divider) */
body.docs article.card>.section-header {
  background: #0b1120 !important;
  /* solid so text never shows through */
  backdrop-filter: none !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
  /* lightly opaque divider */
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16) !important;
  padding-left: 10px !important;
}

/* Override any elevated callout styling */
#youtube-section .callout,
.card .callout {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

#youtube-section .callout::before,
.card .callout::before {
  display: none !important;
  content: none !important;
}

/* Ensure fullscreen cards always have solid background color */
body.vs-card-fullscreen section.card.fullscreen,
body.vs-card-fullscreen .card.fullscreen,
main.grid.fill>section.card.fullscreen {
  background: #0b1220 !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  transition: all 0.2s ease !important;
}

/* Ensure section blocks in fullscreen have background */
body.vs-card-fullscreen .section-block,
body.vs-card-fullscreen #sections-container .section-block {
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

/* FINAL OVERRIDE: Ensure fullscreen cards have solid background color */
body.vs-card-fullscreen section.card.fullscreen,
body.vs-card-fullscreen .card.fullscreen,
body.vs-card-fullscreen main.grid.fill>section.card.fullscreen,
body.vs-card-fullscreen main.grid.fill section.card.fullscreen,
body.vs-card-fullscreen .dark-mode .card.fullscreen,
body.vs-card-fullscreen .dark-mode section.card.fullscreen,
body.vs-card-fullscreen #create-section.fullscreen,
body.vs-card-fullscreen #audio-section.fullscreen,
body.vs-card-fullscreen #history-section.fullscreen,
body.vs-card-fullscreen #script-history-card.fullscreen,
body.vs-card-fullscreen #flowboard-section.fullscreen,
body.vs-card-fullscreen #script-shufflr-card.fullscreen,
body.vs-card-fullscreen #ideas-card.fullscreen,
body.vs-card-fullscreen #thumbnail-card.fullscreen,
body.vs-card-fullscreen #help-section.fullscreen,
body.vs-card-fullscreen #research-section.fullscreen,
body.vs-card-fullscreen #music-section.fullscreen,
body.vs-card-fullscreen #prompt-generator-section.fullscreen {
  background: #0b1220 !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* ULTIMATE OVERRIDE: Force background on fullscreen cards - must be last */
html body.vs-card-fullscreen section.card.fullscreen,
html body.vs-card-fullscreen .card.fullscreen,
html body.vs-card-fullscreen main.grid.fill>section.card.fullscreen,
html body.vs-card-fullscreen main.grid.fill section.card.fullscreen,
html body.vs-card-fullscreen #create-section.fullscreen,
html body.vs-card-fullscreen #audio-section.fullscreen,
html body.vs-card-fullscreen #history-section.fullscreen,
html body.vs-card-fullscreen #script-history-card.fullscreen,
html body.vs-card-fullscreen #flowboard-section.fullscreen,
html body.vs-card-fullscreen #script-shufflr-card.fullscreen,
html body.vs-card-fullscreen #ideas-card.fullscreen,
html body.vs-card-fullscreen #thumbnail-card.fullscreen,
html body.vs-card-fullscreen #help-section.fullscreen,
html body.vs-card-fullscreen #research-section.fullscreen,
html body.vs-card-fullscreen #music-section.fullscreen,
html body.vs-card-fullscreen #prompt-generator-section.fullscreen {
  background: rgba(255, 255, 255, 0.03) !important;
  background-color: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* Ensure body doesn't interfere */
html body.vs-card-fullscreen {
  background: #0b1220 !important;
}

/* ABSOLUTE FINAL OVERRIDE: Use maximum specificity with html element - solid color only */
html>body.vs-card-fullscreen>main.grid.fill>section.card.fullscreen,
html>body.vs-card-fullscreen section.card.fullscreen.card,
html>body.vs-card-fullscreen .card.fullscreen.card {
  background: #0b1220 !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* Also target by ID for maximum specificity */
html>body.vs-card-fullscreen #create-section.card.fullscreen,
html>body.vs-card-fullscreen #audio-section.card.fullscreen,
html>body.vs-card-fullscreen #history-section.card.fullscreen,
html>body.vs-card-fullscreen #script-history-card.card.fullscreen,
html>body.vs-card-fullscreen #flowboard-section.card.fullscreen,
html>body.vs-card-fullscreen #script-shufflr-card.card.fullscreen,
html>body.vs-card-fullscreen #ideas-card.card.fullscreen,
html>body.vs-card-fullscreen #thumbnail-card.card.fullscreen,
html>body.vs-card-fullscreen #help-section.card.fullscreen,
html>body.vs-card-fullscreen #research-section.card.fullscreen,
html>body.vs-card-fullscreen #music-section.card.fullscreen,
html>body.vs-card-fullscreen #library-section.card.fullscreen,
html>body.vs-card-fullscreen #prompt-generator-section.card.fullscreen {
  background: #0b1220 !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* PREVENT INLINE STYLE OVERRIDES: Use attribute selector to override inline styles */
body.vs-card-fullscreen section.card.fullscreen[style*="background"],
body.vs-card-fullscreen .card.fullscreen[style*="background"],
body.vs-card-fullscreen #create-section.fullscreen[style*="background"],
body.vs-card-fullscreen #library-section.fullscreen[style*="background"],
body.vs-card-fullscreen #prompt-generator-section.fullscreen[style*="background"] {
  background: #0b1220 !important;
  background-color: #0b1220 !important;
  background-image: none !important;
}

/* Force background even if inline style sets it to transparent */
body.vs-card-fullscreen section.card.fullscreen[style*="transparent"],
body.vs-card-fullscreen .card.fullscreen[style*="transparent"],
body.vs-card-fullscreen #library-section.fullscreen[style*="transparent"],
body.vs-card-fullscreen #prompt-generator-section.fullscreen[style*="transparent"] {
  background: #0b1220 !important;
  background-color: #0b1220 !important;
}

/* --- Diamonds rewarded popup (Homepage Hub) --- */
.vs-diamonds-reward-popup {
  position: fixed;
  right: 22px;
  bottom: 112px;
  z-index: 20060;
  width: min(360px, calc(100vw - 36px));
  padding: 14px 14px 12px 14px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(129, 140, 248, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  cursor: pointer;
  user-select: none;
  animation: vsDiamondsPopIn 280ms ease-out both;
}

.vs-diamonds-reward-popup.out {
  animation: vsDiamondsPopOut 420ms ease-in both;
}

.vs-diamonds-reward-title {
  font-size: 13px;
  font-weight: 800;
  color: #e5e7eb;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}

.vs-diamonds-reward-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vs-diamonds-reward-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.28);
  font-size: 18px;
  animation: vsDiamondsPulse 900ms ease-in-out infinite;
}

.vs-diamonds-reward-count {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #e5e7eb;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.vs-diamonds-reward-from {
  color: rgba(229, 231, 235, 0.65);
  font-weight: 800;
}

.vs-diamonds-reward-arrow {
  color: rgba(129, 140, 248, 0.9);
  font-weight: 900;
}

.vs-diamonds-reward-to {
  color: #a5b4fc;
  text-shadow: 0 0 16px rgba(129, 140, 248, 0.35);
}

.vs-diamonds-reward-hint {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.95);
  line-height: 1.35;
}

@keyframes vsDiamondsPopIn {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }

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

@keyframes vsDiamondsPopOut {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  to {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
}

@keyframes vsDiamondsPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

/* --- Diamonds pill (Create With AI modal) --- */
.vc-diamonds-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.10);
  border: 1px solid rgba(129, 140, 248, 0.22);
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.vc-diamonds-pill .vc-diamonds-pill__muted {
  color: rgba(148, 163, 184, 0.95);
  font-weight: 800;
}

.vc-diamonds-pill .vc-diamonds-pill__old {
  color: #ef4444;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(239, 68, 68, 0.9);
}

.vc-diamonds-pill .vc-diamonds-pill__new {
  color: #22c55e;
  font-weight: 900;
}

.vc-diamonds-pill .vc-diamonds-pill__arrow {
  color: rgba(129, 140, 248, 0.95);
  font-weight: 900;
}

/* --- Homepage Create: Beat details --- */
.section-beat-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
}

.section-beat-edit:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
}

.section-beat-edit .icon {
  pointer-events: none;
}

#create-project-ai-loading .modal-actions {
  justify-content: flex-end;
}

#create-project-beat-modal .panel-title {
  margin-bottom: 8px;
}

/* ============================================
   LANDING V2 UI OVERRIDES
   ============================================ */
body,
.homepage-hub {
  color: var(--text-primary);
}

.homepage-hub {
  background: var(--bg-deep);
  background-image: var(--grad-mesh-1), var(--grad-mesh-2), var(--grad-mesh-3);
}

.home-hub-main {
  max-width: none;
  margin: 0;
  width: 100%;
}

.home-content {
  max-width: none;
  margin: 0;
  background: rgba(5, 6, 15, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  box-shadow: var(--shadow-md);
}

.home-side,
.home-right {
  background: rgba(10, 12, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.home-divider {
  background: rgba(255, 255, 255, 0.08);
}

.home-join-btn {
  background: var(--grad-cta);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
}

.home-side-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s ease;
}

.home-side-item:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.home-side-settings {
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glow);
}

.home-hero {
  background: var(--grad-cta);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-glow-lg);
}

.home-hero-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
}

.home-hero-inner::before {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.home-flowboard-tool,
.home-tile,
.home-tools-grid .tool {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s ease, background 0.2s ease;
}

.home-flowboard-tool:hover,
.home-tile:hover,
.home-tools-grid .tool:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.home-tools .tools-title,
.home-side-section-title {
  color: rgba(148, 163, 184, 0.85);
}

.home-projects-grid,
.home-projects-grid.list-view {
  background: rgba(5, 6, 15, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px;
}

.home-proj {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(3, 5, 15, 0.35);
}

.home-proj:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.home-proj-actions .icon-btn,
.home-proj .proj-menu-btn,
.home-proj .remove-btn {
  background: rgba(5, 6, 15, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.home-right-channel,
.home-channel-goals,
.home-bgm-player,
.home-right-tour-entry .tour-entry-btn {
  background: rgba(10, 12, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* Buttons */
:where(button, .btn, .primary, .secondary, .btn-primary, .btn-secondary, .btn-ghost) {
  font-family: var(--font-family);
  border-radius: var(--radius-md);
  letter-spacing: -0.01em;
}

button,
.btn,
.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.2s ease, border-color 0.2s ease;
}

button:hover,
.btn:hover,
.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow-md);
}

.primary,
.btn-primary {
  background: var(--grad-cta);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.primary:hover,
.btn-primary:hover {
  filter: brightness(1.02);
  box-shadow: var(--shadow-glow-lg);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  box-shadow: none;
  padding: 0;
}

.link-button:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select,
.ai-input,
.input-style,
.textarea-style,
.native-select,
.ai-select,
.select-tonal {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.ai-input:focus-visible,
.input-style:focus-visible,
.textarea-style:focus-visible,
.native-select:focus-visible,
.ai-select:focus-visible,
.select-tonal:focus-visible {
  outline: none;
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.qs-duration-input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
  border-radius: 0 !important;
}

.quick-settings-content input[type="text"],
.quick-settings-content input[type="number"],
.quick-settings-content select,
.quick-settings-content .native-select {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: inherit !important;
}

/* Cards & panels */
.card,
.dashed-panel {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.88), rgba(8, 12, 22, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
}

.panel-bg-blue {
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.16), rgba(10, 12, 26, 0.92));
}

.panel-bg-purple {
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.18), rgba(10, 12, 26, 0.92));
}

/* Modals */
.modal {
  background: rgba(5, 6, 15, 0.82);
  backdrop-filter: blur(14px);
}

.modal-content {
  background: linear-gradient(160deg, rgba(10, 12, 26, 0.96), rgba(6, 7, 16, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Segmented controls */
.segmented {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
}

.segmented .seg-btn.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* Dropdown menu items should not inherit button drop shadows */
.dropdown-menu .dropdown-menu-item,
.dropdown-menu button,
.dropdown-menu [role="menuitem"] {
  box-shadow: none !important;
  filter: none !important;
}

/* Homepage hub library tabs should stay in a row */
.home-library-tabs {
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
}

/* ============================================
   LIBRARY HUB-SHELL REFRESH
   ============================================ */
#library-section.card {
  --library-bg: #05080b;
  --library-panel: rgba(13, 16, 22, 0.94);
  --library-panel-2: rgba(24, 27, 34, 0.9);
  --library-line: color-mix(in srgb, var(--color-primary) 22%, transparent);
  --library-line-strong: color-mix(in srgb, var(--color-primary) 38%, transparent);
  --library-text: #f7f1f1;
  --library-muted: rgba(241, 245, 249, 0.72);
  --library-dim: rgba(241, 245, 249, 0.48);
  --library-red: var(--color-primary);
  --library-red-2: var(--color-secondary);
  --library-gradient: var(--color-gradient-primary);
  --library-glow: var(--shadow-glow);
  --library-pink: color-mix(in srgb, var(--color-primary) 42%, #ffffff 58%);
  min-height: calc(100vh - 112px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
  border-radius: 14px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.12) 1px, transparent 0),
    linear-gradient(135deg, rgba(5, 8, 11, 0.98) 0%, rgba(9, 12, 16, 0.98) 100%);
  background-size: 18px 18px, 100% 100%;
  color: var(--library-text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

#library-section .section-header {
  display: block;
  min-height: calc(100vh - 112px);
  margin: 0;
  padding: 24px;
  overflow: auto;
  scrollbar-color: color-mix(in srgb, var(--color-primary) 28%, transparent) transparent;
}

#library-section .controls-stack {
  gap: 20px;
}

#library-section .controls-stack > div:first-child {
  min-height: 154px;
  align-items: center;
  justify-content: center;
  padding: 30px 28px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 24%, transparent);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.16), transparent 38%),
    var(--color-gradient-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 22px 52px color-mix(in srgb, var(--color-primary) 28%, transparent);
}

#library-section .section-header h2 {
  color: #fff;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-align: center;
}

#library-section .home-library-tabs,
#library-assets-content > .ai-row[role="tablist"] {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100%;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid var(--library-line);
  border-radius: 12px;
  background: rgba(15, 18, 24, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  scrollbar-width: none;
}

#library-section .home-library-tabs::-webkit-scrollbar,
#library-assets-content > .ai-row[role="tablist"]::-webkit-scrollbar {
  display: none;
}

#library-section .custom-tab {
  min-height: 42px;
  flex: 0 0 auto;
  padding: 0 16px;
  border: 1px solid transparent !important;
  border-radius: 8px;
  background: transparent !important;
  color: var(--library-muted) !important;
  box-shadow: none !important;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  transform: none !important;
}

#library-section .custom-tab:hover {
  border-color: color-mix(in srgb, var(--color-primary) 14%, transparent) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
  filter: none;
}

#library-section .custom-tab.active,
#library-section .custom-tab[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--color-primary) 28%, transparent) !important;
  background: var(--color-gradient-primary) !important;
  color: #fff !important;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--color-primary) 28%, transparent) !important;
}

#library-section #narrators-info-open {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  border: 1px solid var(--library-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--library-muted);
}

#library-section .library-content {
  min-width: 0;
}

#library-section .library-filter-bar {
  display: grid !important;
  grid-template-columns: minmax(170px, 0.72fr) minmax(190px, 0.82fr) minmax(260px, 1.4fr);
  align-items: end !important;
  gap: 14px !important;
  margin: 0 0 14px !important;
  padding: 16px !important;
  border: 1px solid var(--library-line) !important;
  border-radius: 12px !important;
  background: var(--library-panel) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#library-section .library-filter-bar > div {
  min-width: 0;
  display: grid !important;
  gap: 7px;
}

#library-section .library-filter-bar > div:last-child {
  min-width: 0 !important;
  justify-content: stretch !important;
}

#library-section .library-filter-bar label {
  color: var(--library-dim) !important;
  font-size: 11px !important;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#library-section :is(input.ai-input, textarea.ai-input, select.ai-select),
#library-section .library-filter-bar .vs-dd-btn {
  min-height: 46px;
  width: 100% !important;
  max-width: none !important;
  border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent) !important;
  border-radius: 999px !important;
  background-color: rgba(18, 21, 27, 0.96) !important;
  color: var(--library-text) !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 750;
}

#library-section :is(input.ai-input, textarea.ai-input, select.ai-select):focus,
#library-section :is(input.ai-input, textarea.ai-input, select.ai-select):focus-visible,
#library-section .library-filter-bar .vs-dd-btn:focus-visible {
  outline: none !important;
  border-color: color-mix(in srgb, var(--color-primary) 50%, transparent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 13%, transparent) !important;
}

#library-section input.ai-input::placeholder,
#library-section textarea.ai-input::placeholder {
  color: rgba(241, 245, 249, 0.38);
}

#library-section .library-filter-bar [data-vs-custom-select="1"],
#library-section .library-filter-bar .vs-dd {
  width: 100% !important;
}

#library-grid-home {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
  gap: 16px !important;
  padding: 18px 0 4px;
}

#library-grid-home [data-library-item-key] {
  min-height: 292px !important;
  overflow: hidden !important;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 292px 230px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 16%, transparent) !important;
  border-radius: 12px !important;
  background: rgba(24, 27, 34, 0.92) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

#library-grid-home [data-library-item-key]:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--color-primary) 34%, transparent) !important;
  background: rgba(31, 34, 42, 0.98) !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.055) !important;
}

#library-grid-home [data-library-item-key] > div:first-child {
  background: #040609 !important;
}

#library-grid-home [data-library-item-key] > div:first-child > div {
  padding: 10px 12px !important;
  color: #fff !important;
  font-size: 13px !important;
  letter-spacing: 0 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72);
  -webkit-text-stroke: 0 !important;
  text-stroke: 0 !important;
}

#library-grid-home [data-library-item-key] .mini-btn {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent) !important;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055) !important;
  color: var(--library-text) !important;
  box-shadow: none !important;
  font-size: 12px;
  font-weight: 850;
}

#library-grid-home [data-library-item-key] .mini-btn:hover {
  border-color: color-mix(in srgb, var(--color-primary) 34%, transparent) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  filter: none;
  transform: none;
}

#library-grid-home [data-library-item-key] .mini-btn[data-action="import"] {
  border-color: color-mix(in srgb, var(--color-primary) 28%, transparent) !important;
  background: var(--color-gradient-primary) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--color-primary) 22%, transparent) !important;
}

#library-status-home,
#prompt-library-empty-home,
#flows-library-empty,
#library-section [data-narrators-empty],
#library-section .rss-library-empty {
  display: block;
  margin-top: 12px;
  padding: 28px 16px;
  border: 1px dashed color-mix(in srgb, var(--color-primary) 22%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--library-muted) !important;
  text-align: center;
  font-weight: 700;
}

#library-status-home:empty {
  display: none;
}

#prompt-library-list-home,
#library-section [data-narrators-list] {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

#library-section .dashed-panel,
#library-section .flowboard-library-card {
  border: 1px solid color-mix(in srgb, var(--color-primary) 16%, transparent) !important;
  border-radius: 12px !important;
  background: var(--library-panel-2) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
  color: var(--library-text);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

#library-section .dashed-panel:hover,
#library-section .flowboard-library-card:hover {
  transform: translateY(-2px) !important;
  border-color: color-mix(in srgb, var(--color-primary) 34%, transparent) !important;
  background: rgba(31, 34, 42, 0.98) !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.055) !important;
}

#library-section .dashed-panel h3 {
  color: var(--library-text);
  font-size: 16px !important;
  font-weight: 900;
}

#library-section .pg-prompt-text-home textarea {
  min-height: 180px !important;
  border-color: color-mix(in srgb, var(--color-primary) 18%, transparent) !important;
  border-radius: 10px !important;
  background: rgba(4, 8, 11, 0.84) !important;
  color: var(--library-text) !important;
}

#flows-library-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 16px !important;
  padding: 0;
}

#library-section :is(button.primary, button.secondary, .dashed-panel .primary, .dashed-panel .secondary) {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 850;
  transform: none;
}

#library-section button.primary,
#library-rss-add-btn,
#library-rss-close,
#library-section .narrator-chat-btn {
  border: 1px solid color-mix(in srgb, var(--color-primary) 28%, transparent) !important;
  background: var(--color-gradient-primary) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--color-primary) 24%, transparent) !important;
}

#library-section button.secondary,
#library-section .dashed-panel .secondary {
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  color: var(--library-text) !important;
  box-shadow: none !important;
}

#library-section :is(button.primary, button.secondary, .mini-btn):hover {
  filter: brightness(1.04);
}

#library-section .rss-library-toolbar,
#library-section .rss-library-row,
#library-section .rss-library-list-header,
#library-section .rss-view {
  border: 1px solid var(--library-line);
  border-radius: 12px;
  background: var(--library-panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#library-section .rss-library-toolbar,
#library-section .rss-library-row,
#library-section .rss-library-list-header {
  padding: 16px;
}

#library-section .rss-library-divider {
  height: 1px;
  margin: 18px 0;
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
}

#library-section .rss-library-title,
#library-section .rss-view-title,
#library-section .rss-item-viewer .rss-item-title,
#library-section .rss-library-item-title,
#library-section .rss-search-result-title {
  color: var(--library-text);
  font-weight: 900;
}

#library-section .rss-library-status,
#library-section .rss-library-item-url,
#library-section .rss-search-result-url,
#library-section .rss-search-result-snippet,
#library-section .rss-item-meta,
#library-section .rss-item-body,
#library-section .muted {
  color: var(--library-muted);
}

#library-section .rss-library-item,
#library-section .rss-search-result,
#library-section .rss-item,
#library-section .rss-item-viewer {
  border: 1px solid color-mix(in srgb, var(--color-primary) 16%, transparent);
  border-radius: 12px;
  background: rgba(24, 27, 34, 0.9);
}

#library-section .rss-item.is-active {
  border-color: color-mix(in srgb, var(--color-primary) 46%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 14%, transparent);
}

#library-section .rss-item-link {
  color: var(--library-pink);
  font-weight: 850;
}

@media (max-width: 980px) {
  #library-section .library-filter-bar {
    grid-template-columns: 1fr !important;
  }

  #library-grid-home,
  #prompt-library-list-home,
  #library-section [data-narrators-list],
  #flows-library-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  #library-section.card {
    min-height: calc(100vh - 80px);
    border-radius: 10px;
  }

  #library-section .section-header {
    min-height: calc(100vh - 80px);
    padding: 14px;
  }

  #library-section .controls-stack > div:first-child {
    min-height: 116px;
    padding: 22px 16px;
  }

  #library-section .section-header h2 {
    font-size: 36px;
  }

  #library-section .rss-library-row,
  #library-section .rss-library-list-header,
  #library-section .rss-library-item,
  #library-section .rss-search-result,
  #library-section .rss-view-header,
  #library-section .rss-view-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Library left-rail layout */
#library-section.card {
  background:
    radial-gradient(circle at 18% 12%, rgba(75, 93, 255, 0.26), transparent 30%),
    radial-gradient(circle at 82% 0%, color-mix(in srgb, var(--color-primary) 22%, transparent), transparent 28%),
    radial-gradient(circle at 72% 88%, rgba(25, 186, 214, 0.16), transparent 30%),
    linear-gradient(135deg, #070a18 0%, #0b1020 50%, #090b12 100%);
  height: calc(100vh - 112px);
  max-height: calc(100vh - 112px);
  min-height: 0;
}

#library-section .section-header {
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

#library-section .library-shell {
  display: grid !important;
  grid-template-columns: minmax(260px, 312px) minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#library-section .library-sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 22px;
  border-right: 1px solid color-mix(in srgb, var(--color-primary) 16%, transparent);
  background:
    linear-gradient(180deg, rgba(7, 9, 20, 0.92), rgba(6, 8, 15, 0.96)),
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--color-primary) 16%, transparent), transparent 34%);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--color-primary) 26%, transparent) transparent;
}

#library-section .library-sidebar,
#library-section .library-sidebar * {
  box-sizing: border-box;
}

#library-section .library-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

#library-section .library-sidebar-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--color-gradient-primary);
  color: #fff;
  box-shadow: 0 18px 34px color-mix(in srgb, var(--color-primary) 24%, transparent);
}

#library-section .library-sidebar h2 {
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
  text-align: left;
}

#library-section .library-sidebar-kicker,
#library-section .library-main-kicker,
#library-section .library-sidebar-label {
  color: var(--library-dim);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#library-section .library-sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

#library-section .library-sidebar-assets {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#library-section:not([data-active-library-tab="assets"]) .library-sidebar-assets {
  display: none;
}

#library-section .home-library-tabs,
#library-section #library-asset-tabs-home {
  display: grid !important;
  grid-template-columns: 1fr;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100%;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#library-section .home-library-tabs .custom-tab,
#library-section #library-asset-tabs-home .custom-tab {
  width: 100%;
  min-height: 48px;
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  column-gap: 14px;
  padding: 0 18px;
  border-radius: 12px;
  text-align: left;
}

#library-section .home-library-tabs .custom-tab .icon,
#library-section #library-asset-tabs-home .custom-tab .icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  grid-column: 1;
  justify-self: center;
  color: currentColor;
  line-height: 1;
}

#library-section .home-library-tabs .custom-tab span,
#library-section #library-asset-tabs-home .custom-tab span {
  min-width: 0;
  grid-column: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#library-section .library-filter-bar {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  min-width: 0 !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#library-section .library-filter-bar > div {
  gap: 8px;
  min-width: 0 !important;
  width: 100%;
}

#library-section :is(input.ai-input, textarea.ai-input, select.ai-select),
#library-section .library-filter-bar .vs-dd-btn {
  min-height: 44px;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 12px !important;
}

#library-section .library-sidebar .vs-dd,
#library-section .library-sidebar [data-vs-custom-select="1"] {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

#library-section .library-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: color-mix(in srgb, var(--color-primary) 28%, transparent) transparent;
}

#library-section .library-main-hero {
  min-height: 150px;
  display: flex;
  align-items: center;
  padding: 28px 30px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 24%, transparent);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.16), transparent 38%),
    var(--color-gradient-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 22px 52px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

#library-section .library-main-hero h2 {
  color: #fff;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-align: left;
}

#library-section .library-main-kicker {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.72);
}

#library-section .library-content {
  min-width: 0;
  padding: 0;
}

#library-section #narrators-info-open {
  width: 100%;
  justify-content: flex-start;
  border-radius: 12px;
}

@media (max-width: 980px) {
  #library-section .library-shell {
    grid-template-columns: 1fr;
  }

  #library-section .library-sidebar {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 16%, transparent);
  }

  #library-section .library-main {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  #library-section.card {
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
  }

  #library-section .library-sidebar {
    padding: 18px;
  }

  #library-section .library-main {
    padding: 14px;
  }

  #library-section .library-main-hero {
    min-height: 112px;
    padding: 22px 18px;
  }
}

/* ============================================
   HOMEPAGE HUB APP-SHELL REFACTOR
   ============================================ */
#homepage-hub.homepage-hub {
  --home-side-width: 288px;
  --home-side-collapsed-width: 92px;
  --home-side-max-width: 380px;
  --hub-bg: #05080b;
  --hub-panel: #12151b;
  --hub-panel-2: #191c23;
  --hub-panel-3: #0c1015;
  --hub-line: color-mix(in srgb, var(--color-primary) 22%, transparent);
  --hub-line-strong: color-mix(in srgb, var(--color-primary) 34%, transparent);
  --hub-text: #f7f1f1;
  --hub-muted: rgba(241, 245, 249, 0.72);
  --hub-dim: rgba(241, 245, 249, 0.48);
  --hub-red: var(--color-primary);
  --hub-red-2: var(--color-secondary);
  --hub-red-3: var(--color-secondary);
  --hub-gradient: var(--color-gradient-primary);
  --hub-glow: var(--shadow-glow);
  --hub-pink: color-mix(in srgb, var(--color-primary) 42%, #ffffff 58%);
  --hub-purple: #ba63e8;
  --hub-button-gap-ring: rgba(226, 232, 240, 0.12);
  --hub-button-gap-ring-hover: color-mix(in srgb, var(--color-primary) 58%, transparent);
  --hub-button-gap-size: 6px;
  --hub-button-radius: 22px;
  display: none;
  padding: 0;
  overflow: hidden;
  color: var(--hub-text);
  background-color: #05060f;
  background-image:
    radial-gradient(900px circle at 16% -8%, rgba(99, 102, 241, 0.24), transparent 58%),
    radial-gradient(760px circle at 88% 8%, rgba(139, 92, 246, 0.2), transparent 56%),
    radial-gradient(680px circle at 50% 92%, rgba(6, 182, 212, 0.14), transparent 58%),
    radial-gradient(520px circle at 82% 74%, rgba(236, 72, 153, 0.09), transparent 54%),
    linear-gradient(180deg, rgba(5, 6, 15, 0.92) 0%, rgba(7, 10, 22, 0.98) 58%, #05060f 100%);
  background-size: 100% 100%;
  height: 100vh;
}

#homepage-hub.homepage-hub.visible {
  display: block;
  contain: layout paint style;
}

#homepage-hub .home-hub-main {
  display: grid;
  grid-template-columns: minmax(var(--home-side-collapsed-width), var(--home-side-width)) minmax(0, 1fr);
  gap: 0;
  width: 100%;
  height: 100vh;
  max-width: none;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(900px circle at 34% 6%, rgba(99, 102, 241, 0.18), transparent 58%),
    radial-gradient(760px circle at 92% 20%, rgba(236, 72, 153, 0.12), transparent 54%),
    radial-gradient(700px circle at 50% 92%, rgba(6, 182, 212, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(9, 12, 30, 0.6) 0%, rgba(6, 10, 24, 0.72) 100%),
    rgba(8, 12, 26, 0.56);
  transition: grid-template-columns 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

#homepage-hub.home-sidebar-collapsed .home-hub-main {
  grid-template-columns: var(--home-side-collapsed-width) minmax(0, 1fr);
}

#homepage-hub.home-sidebar-resizing .home-hub-main {
  transition: none;
}

#homepage-hub.home-sidebar-resizing,
#homepage-hub.home-sidebar-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

#homepage-hub .home-side {
  position: relative;
  top: auto;
  width: auto;
  flex: initial;
  height: 100vh;
  min-height: 0;
  padding: 28px 22px 24px;
  gap: 18px;
  overflow-y: hidden;
  overflow-x: hidden;
  border: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(10, 12, 26, 0.86), rgba(7, 10, 22, 0.9)),
    rgba(10, 13, 17, 0.88);
  box-shadow: 10px 0 34px rgba(2, 6, 23, 0.2);
  backdrop-filter: blur(18px);
}

#homepage-hub .home-side-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  z-index: 8;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}

#homepage-hub .home-side-resizer::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.18), rgba(96, 165, 250, 0.18), rgba(52, 211, 153, 0.14));
  opacity: 0;
  transition: opacity 0.16s ease, width 0.16s ease, box-shadow 0.16s ease;
}

#homepage-hub .home-side-resizer:hover::before,
#homepage-hub .home-side-resizer:focus-visible::before,
#homepage-hub.home-sidebar-resizing .home-side-resizer::before {
  width: 3px;
  opacity: 1;
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.34);
}

#homepage-hub .home-side-brand {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
}

#homepage-hub .home-side-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-gradient-primary);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--color-primary) 28%, transparent);
}

#homepage-hub .home-side-brand-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

#homepage-hub .home-side-brand-copy {
  min-width: 0;
}

#homepage-hub .home-side-brand-name {
  color: #fff;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#homepage-hub .home-side-brand-plan {
  margin-top: 8px;
  color: var(--hub-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

#homepage-hub .home-side-toggle {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--color-primary) 14%, transparent);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055) !important;
  color: var(--hub-muted);
  box-shadow: none !important;
}

#homepage-hub .home-side-toggle:hover,
#homepage-hub .home-side-toggle:focus-visible {
  color: #fff;
  border-color: color-mix(in srgb, var(--color-primary) 28%, transparent);
  background: rgba(255, 255, 255, 0.1) !important;
  filter: none;
}

#homepage-hub .home-side-nav {
  gap: 9px;
}

#homepage-hub .home-side-nav--primary {
  margin-bottom: 18px;
}

#homepage-hub .home-side-section-title {
  margin: 8px 0 2px;
  padding: 0 6px;
  color: var(--hub-dim);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#homepage-hub .home-side-tools-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  margin-right: -4px;
  scrollbar-width: none;
}

#homepage-hub .home-side-tools-block::-webkit-scrollbar {
  display: none;
}

#homepage-hub .home-side-tools-title {
  min-height: 32px;
  margin-top: 2px;
  padding: 0 4px 0 6px;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

#homepage-hub .home-side-tools-search-toggle {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent !important;
  color: var(--hub-dim);
  box-shadow: none !important;
}

#homepage-hub .home-side-tools-search-toggle:hover,
#homepage-hub .home-side-tools-search-toggle[aria-expanded="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.06) !important;
  filter: none;
}

#homepage-hub .home-side-tools-search-wrap {
  display: none;
  grid-template-columns: 18px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0 0 4px;
  padding: 0 8px 0 12px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
  border-radius: 10px;
  background: rgba(18, 21, 27, 0.96);
  color: var(--hub-dim);
}

#homepage-hub .home-side-tools-search-wrap.is-open {
  display: grid;
}

#homepage-hub .home-side-tools-search {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--hub-text);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

#homepage-hub .home-side-tools-search::placeholder {
  color: rgba(241, 245, 249, 0.4);
}

#homepage-hub .home-side-tools-search-clear {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent !important;
  color: var(--hub-dim);
  box-shadow: none !important;
}

#homepage-hub .home-side-tools-search-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07) !important;
  filter: none;
}

#homepage-hub .home-side-tools-nav {
  gap: 7px;
  max-height: none;
  overflow: visible;
}

#homepage-hub .home-side-tools-nav.is-collapsed:not(.is-searching) .home-side-tool-extra {
  display: none !important;
}

#homepage-hub .home-side-tools-nav .home-side-item.is-filtered-out {
  display: none !important;
}

#homepage-hub .home-side-tools-more {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  text-align: left;
  gap: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent !important;
  color: var(--hub-dim);
  box-shadow: none !important;
  font-size: 15px;
  font-weight: 850;
}

#homepage-hub .home-side-tools-more:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055) !important;
  filter: none;
}

#homepage-hub .home-side-tools-more[hidden] {
  display: none !important;
}

#homepage-hub .home-side-tools-empty {
  padding: 12px 14px;
  color: var(--hub-dim);
  font-size: 13px;
  font-weight: 800;
}

#homepage-hub .home-side-tools-empty[hidden] {
  display: none !important;
}

#homepage-hub.home-sidebar-collapsed .home-side {
  align-items: center;
  padding: 24px 16px;
  gap: 16px;
  overflow: visible;
}

#homepage-hub.home-sidebar-collapsed .home-side-brand {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

#homepage-hub.home-sidebar-collapsed .home-side-brand-copy {
  display: none;
}

#homepage-hub.home-sidebar-collapsed .home-side-brand-mark {
  width: 48px;
  height: 48px;
  box-shadow: none;
}

#homepage-hub.home-sidebar-collapsed .home-side-toggle {
  width: 48px;
  height: 48px;
  min-height: 48px;
}

#homepage-hub.home-sidebar-collapsed .home-side-nav,
#homepage-hub.home-sidebar-collapsed .home-side-tools-block {
  width: 100%;
  align-items: center;
}

#homepage-hub.home-sidebar-collapsed .home-side-nav--primary {
  margin: 0 0 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#homepage-hub.home-sidebar-collapsed .home-side-tools-block {
  flex: 1 1 auto;
  padding: 16px 0;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 0;
  overflow-y: auto;
  overflow-x: visible;
}

#homepage-hub.home-sidebar-collapsed .home-side-tools-title {
  display: none;
}

#homepage-hub.home-sidebar-collapsed .home-side-tools-search-wrap {
  display: none !important;
}

#homepage-hub.home-sidebar-collapsed .home-side-item,
#homepage-hub.home-sidebar-collapsed .home-side .home-side-item,
#homepage-hub.home-sidebar-collapsed .home-side-tools-more,
#homepage-hub.home-sidebar-collapsed .home-side-settings,
#homepage-hub.home-sidebar-collapsed #home-join-btn.home-join-btn {
  width: 58px;
  min-width: 58px;
  height: 58px;
  min-height: 58px;
  justify-content: center;
  padding: 0;
  gap: 0;
  border-radius: 14px;
}

#homepage-hub.home-sidebar-collapsed .home-side-item > span:not(.side-ico),
#homepage-hub.home-sidebar-collapsed .home-side-settings > span:not(.side-ico),
#homepage-hub.home-sidebar-collapsed .home-side-tools-more > span {
  display: none;
}

#homepage-hub.home-sidebar-collapsed .home-side-item .side-ico,
#homepage-hub.home-sidebar-collapsed .home-side-settings .side-ico {
  margin: 0;
}

#homepage-hub.home-sidebar-collapsed .home-side-tools-more {
  color: var(--hub-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#homepage-hub.home-sidebar-collapsed .home-side-tools-more .home-side-tools-more-icon {
  margin: 0;
}

#homepage-hub.home-sidebar-collapsed #home-join-btn.home-join-btn {
  position: relative;
  margin: 0 0 8px;
  font-size: 0;
  box-shadow: none !important;
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent) !important;
}

#homepage-hub.home-sidebar-collapsed #home-join-btn.home-join-btn::before {
  content: "+";
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 350;
}

#homepage-hub.home-sidebar-collapsed .home-side-grow {
  min-height: 0;
  flex: 0 0 auto;
}

#homepage-hub .home-side-item,
#homepage-hub .home-side .home-side-item {
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid transparent !important;
  border-radius: 8px;
  background: transparent !important;
  color: var(--hub-muted) !important;
  box-shadow: none !important;
  font-size: 15px;
  font-weight: 800;
  transform: none;
}

#homepage-hub .home-side-item:hover,
#homepage-hub .home-side .home-side-item:hover,
#homepage-hub .home-side-item.is-active {
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: color-mix(in srgb, var(--color-primary) 12%, transparent) !important;
  color: #fff !important;
  filter: none !important;
  transform: none;
}

#homepage-hub .home-side-item.is-active {
  background: var(--color-gradient-primary) !important;
  color: #fff !important;
}

#homepage-hub .home-side-item .side-ico {
  color: currentColor;
}

#homepage-hub .home-side-collapse-btn {
  color: var(--hub-dim);
  border: 1px solid transparent;
  box-shadow: none;
}

#homepage-hub .home-side-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

#homepage-hub .home-side-grow {
  min-height: 18px;
}

#homepage-hub #home-join-btn.home-join-btn {
  width: 100%;
  min-height: 48px;
  margin: 16px 0 12px;
  border-radius: 8px;
  background: var(--color-gradient-primary) !important;
  color: #fff !important;
  box-shadow: 0 18px 38px color-mix(in srgb, var(--color-primary) 38%, transparent) !important;
}

#homepage-hub .home-side-settings {
  min-height: 48px;
  margin: 0;
  border-radius: 8px;
  background: transparent !important;
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent) !important;
  color: var(--hub-muted) !important;
  box-shadow: none !important;
}

#homepage-hub .home-side-settings:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06) !important;
  filter: none;
}

.home-side-tooltip {
  position: fixed;
  z-index: 2147483100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(280px, calc(100vw - 32px));
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  background: rgba(245, 245, 245, 0.96);
  color: #171717;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px) scale(0.98);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.home-side-tooltip::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 2px;
  background: rgba(245, 245, 245, 0.96);
}

.home-side-tooltip.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.home-side-tooltip.has-shortcut::after {
  content: "⌘ B";
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-left: 4px;
  padding: 0 8px;
  border-radius: 7px;
  background: rgba(23, 23, 23, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

#homepage-hub .home-content {
  height: 100vh;
  max-height: none;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 18px 20px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(900px circle at 8% 0%, rgba(99, 102, 241, 0.18), transparent 54%),
    radial-gradient(780px circle at 96% 8%, rgba(139, 92, 246, 0.2), transparent 52%),
    radial-gradient(700px circle at 48% 72%, rgba(6, 182, 212, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(4, 6, 16, 0.28), rgba(4, 6, 16, 0.52)),
    linear-gradient(180deg, rgba(13, 16, 36, 0.56), rgba(8, 12, 26, 0.7));
  box-shadow: none;
  scrollbar-color: color-mix(in srgb, var(--color-primary) 28%, transparent) transparent;
}

#homepage-hub .home-topbar {
  position: sticky;
  top: 0;
  z-index: 20028;
  display: grid;
  grid-template-columns: minmax(280px, 620px) minmax(0, auto);
  align-items: center;
  gap: 18px;
  min-height: 56px;
  padding-bottom: 18px;
  background: transparent;
  isolation: isolate;
}

#homepage-hub .home-topbar::before {
  content: "";
  position: absolute;
  inset: -18px -20px 0;
  z-index: 0;
  background: #111520;
  border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 16%, transparent);
  box-shadow: 0 18px 34px rgba(3, 5, 12, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

#homepage-hub .home-content.is-hub-scrolled .home-topbar::before {
  opacity: 1;
}

#homepage-hub .home-hub-search {
  position: relative;
  top: auto;
  z-index: 1;
  margin: 0;
  padding: 0;
}

#homepage-hub .home-hub-search-field {
  min-height: 54px;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--color-primary) 24%, transparent);
  background: rgba(18, 21, 27, 0.96);
  box-shadow: none;
}

#homepage-hub .home-hub-search-field:focus-within {
  border-color: color-mix(in srgb, var(--color-primary) 50%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

#homepage-hub .home-hub-search-input {
  color: var(--hub-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

#homepage-hub .home-hub-search-input::placeholder {
  color: rgba(241, 245, 249, 0.36);
}

#homepage-hub .home-hub-search-panel {
  top: calc(100% + 10px);
  border-color: color-mix(in srgb, var(--color-primary) 18%, transparent);
  background: rgba(13, 16, 22, 0.98);
}

#homepage-hub .home-topbar-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-width: 0;
}

#homepage-hub .home-topbar button:hover:not(:focus-visible),
#homepage-hub .home-side button:hover:not(:focus-visible) {
  outline: none !important;
  outline-offset: 0 !important;
}

#homepage-hub .home-topbar-link {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--hub-muted);
  box-shadow: none;
  padding: 8px 0 9px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

#homepage-hub .home-topbar-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

#homepage-hub .home-topbar-link:hover,
#homepage-hub .home-topbar-link:focus-visible {
  color: #fff;
  background: transparent;
  box-shadow: none;
}

#homepage-hub .home-topbar-link:hover::after,
#homepage-hub .home-topbar-link:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

#homepage-hub .home-topbar-create {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  border-color: color-mix(in srgb, var(--color-primary) 28%, transparent);
  background:
    var(--color-gradient-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 16px 38px color-mix(in srgb, var(--color-primary) 26%, transparent);
}

#homepage-hub .home-topbar-create:hover {
  filter: brightness(1.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 18px 42px color-mix(in srgb, var(--color-primary) 34%, transparent);
}

.home-project-dialog-modal {
  z-index: 20080;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 34px);
  background:
    radial-gradient(900px circle at 18% 0%, rgba(99, 102, 241, 0.22), transparent 58%),
    radial-gradient(720px circle at 88% 18%, rgba(139, 92, 246, 0.18), transparent 56%),
    rgba(3, 6, 18, 0.72);
  backdrop-filter: blur(18px);
}

.home-project-dialog-modal:not(.hidden) {
  display: flex !important;
}

.home-project-dialog-card {
  position: relative;
  width: min(96vw, 1580px);
  height: min(91vh, 980px);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(220px, 282px) minmax(0, 1fr);
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(12, 16, 31, 0.98), rgba(7, 10, 22, 0.98)),
    #080c18;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.45);
}

.home-project-dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 48px;
  height: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.home-project-dialog-close:hover,
.home-project-dialog-close:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.home-project-dialog-side {
  min-width: 0;
  padding: 28px 18px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

.home-project-dialog-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 6px 28px;
}

.home-project-dialog-brand-icon,
.home-project-dialog-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--color-gradient-primary);
  color: #fff;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

.home-project-dialog-brand-icon {
  width: 46px;
  height: 46px;
}

.home-project-dialog-title {
  color: #fff;
  font-size: 19px;
  line-height: 1;
  font-weight: 950;
}

.home-project-dialog-subtitle {
  margin-top: 6px;
  color: rgba(226, 232, 240, 0.62);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.home-project-dialog-side-section {
  margin-top: 22px;
}

.home-project-dialog-section-title {
  margin: 0 8px 8px;
  color: rgba(226, 232, 240, 0.56);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.home-project-dialog-nav,
.home-project-dialog-recent-item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(226, 232, 240, 0.82);
  font-size: 14px;
  font-weight: 850;
  text-align: left;
  box-shadow: none;
}

.home-project-dialog-nav:hover,
.home-project-dialog-nav:focus-visible,
.home-project-dialog-nav.is-active,
.home-project-dialog-recent-item:hover,
.home-project-dialog-recent-item:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.home-project-dialog-recent-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-project-dialog-recent-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-project-dialog-main {
  min-width: 0;
  overflow-y: auto;
  padding: 30px clamp(28px, 4vw, 56px) 44px;
}

.home-project-dialog-header {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(280px, 1fr);
  gap: 28px;
  align-items: center;
  padding-right: 58px;
}

.home-project-dialog-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
}

.home-project-dialog-search {
  min-height: 56px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(226, 232, 240, 0.68);
}

.home-project-dialog-search:focus-within {
  border-color: color-mix(in srgb, var(--color-primary) 42%, transparent);
  background: rgba(255, 255, 255, 0.085);
}

.home-project-dialog-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0 !important;
  outline-offset: 0 !important;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  box-shadow: none !important;
}

.home-project-dialog-search input:focus,
.home-project-dialog-search input:focus-visible {
  border: 0 !important;
  outline: none !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}

.home-project-dialog-section {
  margin-top: 36px;
}

.home-project-dialog-section-heading {
  margin-bottom: 18px;
  color: #fff;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 900;
}

.home-project-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 3vw, 40px);
}

.home-project-dialog-action {
  width: 118px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(226, 232, 240, 0.9);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.home-project-dialog-action:hover,
.home-project-dialog-action:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.home-project-dialog-action-icon {
  width: 64px;
  height: 64px;
}

.home-project-dialog-grid,
.home-project-dialog-template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 18px;
  align-items: start;
  justify-items: stretch;
}

.home-project-dialog-project,
.home-project-dialog-template {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 0 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(226, 232, 240, 0.9);
  text-align: left;
  box-shadow: none;
}

.home-project-dialog-project:hover .home-project-dialog-project-art,
.home-project-dialog-template:hover .home-project-dialog-template-art,
.home-project-dialog-project:focus-visible .home-project-dialog-project-art,
.home-project-dialog-template:focus-visible .home-project-dialog-template-art {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--color-primary) 28%, transparent);
  background: rgba(255, 255, 255, 0.1);
}

.home-project-dialog-project-art,
.home-project-dialog-template-art {
  width: 100%;
  min-width: 0;
  min-height: 156px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.065);
  color: #fff;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.home-project-dialog-project-name,
.home-project-dialog-template-name {
  padding: 0 2px;
  color: #fff;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-project-dialog-project-meta,
.home-project-dialog-template-meta {
  padding: 0 2px;
  color: rgba(226, 232, 240, 0.62);
  font-size: 13px;
  font-weight: 750;
}

.home-project-dialog-empty {
  padding: 24px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: rgba(226, 232, 240, 0.7);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

@media (max-width: 1080px) {
  .home-project-dialog-card {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .home-project-dialog-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-project-dialog-grid,
  .home-project-dialog-template-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .home-project-dialog-modal {
    padding: 10px;
  }

  .home-project-dialog-card {
    height: 94vh;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .home-project-dialog-side {
    display: none;
  }

  .home-project-dialog-main {
    padding: 24px 18px 32px;
  }

  .home-project-dialog-header {
    padding-right: 52px;
  }

  .home-project-dialog-grid,
  .home-project-dialog-template-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

#homepage-hub #home-create-btn.home-hero {
  min-height: clamp(260px, 32vh, 420px);
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent) !important;
  background:
    var(--color-gradient-primary) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 22px 46px color-mix(in srgb, var(--color-primary) 32%, transparent) !important;
  overflow: hidden;
}

#homepage-hub #home-create-btn.home-hero:hover {
  border-color: rgba(255, 226, 226, 0.52) !important;
  filter: brightness(1.02);
}

#homepage-hub .home-hero-inner {
  width: 100%;
  min-height: inherit;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 42px 28px;
}

#homepage-hub .home-hero-inner::before {
  content: none;
}

#homepage-hub .home-hero-plus {
  position: relative;
  width: clamp(52px, 6.2vw, 88px);
  height: clamp(52px, 6.2vw, 88px);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
}

#homepage-hub .home-hero-plus::before,
#homepage-hub .home-hero-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

#homepage-hub .home-hero-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

#homepage-hub .home-hero-copy {
  max-width: 1160px;
  text-align: center;
}

#homepage-hub .home-hero-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 24px);
  white-space: nowrap;
  color: #fff;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: 0;
}

#homepage-hub .home-hero-subtitle {
  max-width: 720px;
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(15px, 1.55vw, 19px);
  line-height: 1.45;
  font-weight: 700;
}

#homepage-hub .home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 330px);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

#homepage-hub .home-main-stack {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#homepage-hub .home-flowboard-tool,
#homepage-hub .home-tile,
#homepage-hub .home-tools-grid .tool,
#homepage-hub .home-tools-page-btn,
#homepage-hub .home-proj,
#homepage-hub .home-topbar-create,
#homepage-hub .home-right-channel-btn,
#homepage-hub .home-side-activate.home-right-activate,
#homepage-hub .home-right-tour-entry .tour-entry-btn,
#homepage-hub .home-bgm-btn,
#homepage-hub .home-projects,
#homepage-hub .home-right-channel,
#homepage-hub .home-channel-goals,
#homepage-hub .home-bgm-player,
#homepage-hub .home-views-aggregate,
#homepage-hub .home-right-tour-entry .tour-entry-btn {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(26, 29, 36, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#homepage-hub .home-flowboard-tool,
#homepage-hub .home-tile,
#homepage-hub .home-tools-grid .tool,
#homepage-hub .home-proj,
#homepage-hub .home-topbar-create,
#homepage-hub .home-right-channel-btn,
#homepage-hub .home-side-activate.home-right-activate,
#homepage-hub .home-right-tour-entry .tour-entry-btn {
  border-radius: var(--hub-button-radius) !important;
}

#homepage-hub .home-tools-page-btn {
  --hub-button-radius: 999px;
}

#homepage-hub .home-bgm-btn {
  --hub-button-radius: 8px;
}

#homepage-hub .home-flowboard-tool,
#homepage-hub .home-tile,
#homepage-hub .home-tools-grid .tool,
#homepage-hub .home-tools-page-btn,
#homepage-hub .home-proj,
#homepage-hub .home-topbar-create,
#homepage-hub .home-right-channel-btn,
#homepage-hub .home-side-activate.home-right-activate,
#homepage-hub .home-right-tour-entry .tour-entry-btn,
#homepage-hub .home-bgm-btn {
  position: relative;
  border-color: transparent !important;
  outline: none !important;
  outline-offset: 0 !important;
  overflow: visible;
}

#homepage-hub .home-flowboard-tool:hover,
#homepage-hub .home-flowboard-tool:focus-visible,
#homepage-hub .home-tile:hover,
#homepage-hub .home-tile:focus-visible,
#homepage-hub .home-tools-grid .tool:hover,
#homepage-hub .home-tools-grid .tool:focus-visible,
#homepage-hub .home-tools-page-btn:hover,
#homepage-hub .home-tools-page-btn:focus-visible,
#homepage-hub .home-proj:hover,
#homepage-hub .home-proj:focus-visible,
#homepage-hub .home-topbar-create:hover,
#homepage-hub .home-topbar-create:focus-visible,
#homepage-hub .home-right-channel-btn:hover,
#homepage-hub .home-right-channel-btn:focus-visible,
#homepage-hub .home-side-activate.home-right-activate:hover,
#homepage-hub .home-side-activate.home-right-activate:focus-visible,
#homepage-hub .home-right-tour-entry .tour-entry-btn:hover,
#homepage-hub .home-right-tour-entry .tour-entry-btn:focus-visible,
#homepage-hub .home-bgm-btn:hover,
#homepage-hub .home-bgm-btn:focus-visible {
  border-color: transparent !important;
  outline: none !important;
  outline-offset: 0 !important;
}

#homepage-hub .home-flowboard-tool::before,
#homepage-hub .home-tile::before,
#homepage-hub .home-tools-grid .tool::before,
#homepage-hub .home-tools-page-btn::before,
#homepage-hub .home-proj::before,
#homepage-hub .home-topbar-create::before,
#homepage-hub .home-right-channel-btn::before,
#homepage-hub .home-side-activate.home-right-activate::before,
#homepage-hub .home-right-tour-entry .tour-entry-btn::before,
#homepage-hub .home-bgm-btn::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--hub-button-gap-size));
  border: 2px solid var(--hub-button-gap-ring);
  border-radius: calc(var(--hub-button-radius) + var(--hub-button-gap-size));
  pointer-events: none;
  opacity: 1;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

#homepage-hub .home-flowboard-tool:hover::before,
#homepage-hub .home-flowboard-tool:focus-visible::before,
#homepage-hub .home-tile:hover::before,
#homepage-hub .home-tile:focus-visible::before,
#homepage-hub .home-tools-grid .tool:hover::before,
#homepage-hub .home-tools-grid .tool:focus-visible::before,
#homepage-hub .home-tools-page-btn:hover::before,
#homepage-hub .home-tools-page-btn:focus-visible::before,
#homepage-hub .home-proj:hover::before,
#homepage-hub .home-proj:focus-visible::before,
#homepage-hub .home-topbar-create:hover::before,
#homepage-hub .home-topbar-create:focus-visible::before,
#homepage-hub .home-right-channel-btn:hover::before,
#homepage-hub .home-right-channel-btn:focus-visible::before,
#homepage-hub .home-side-activate.home-right-activate:hover::before,
#homepage-hub .home-side-activate.home-right-activate:focus-visible::before,
#homepage-hub .home-right-tour-entry .tour-entry-btn:hover::before,
#homepage-hub .home-right-tour-entry .tour-entry-btn:focus-visible::before,
#homepage-hub .home-bgm-btn:hover::before,
#homepage-hub .home-bgm-btn:focus-visible::before {
  border-color: var(--hub-button-gap-ring-hover);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

#homepage-hub .home-flowboard-tool,
#homepage-hub .home-tile,
#homepage-hub .home-tools-grid .tool {
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

#homepage-hub .home-flowboard-tool:hover,
#homepage-hub .home-tile:hover,
#homepage-hub .home-tools-grid .tool:hover {
  transform: translateY(-1px);
  border-color: transparent !important;
  background: rgba(31, 34, 42, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  filter: none;
}

#homepage-hub .home-flowboard-tool {
  display: block;
  width: 100%;
  margin: 0;
  padding: 18px 20px;
}

#homepage-hub .home-flowboard-tool .icon {
  color: var(--hub-pink);
}

#homepage-hub .home-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

#homepage-hub .home-tile,
#homepage-hub .home-tile--wide-only {
  display: block;
}

#homepage-hub .home-tile {
  min-height: 188px;
  padding: 24px;
  color: var(--hub-text);
}

#homepage-hub .home-tile .tile-row {
  height: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

#homepage-hub .home-tile .tile-row .icon {
  width: 42px;
  height: 42px;
  font-size: 42px;
  color: var(--hub-pink);
}

#homepage-hub .home-tile .tile-text {
  padding-left: 0;
  gap: 8px;
}

#homepage-hub .home-tile .tile-title {
  color: #f5f3f3;
  font-size: clamp(22px, 2vw, 31px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

#homepage-hub .home-tile .tile-sub {
  max-width: 420px;
  color: var(--hub-muted);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 650;
}

#homepage-hub .home-tile[data-action="create-ai"] {
  color: #fff !important;
  border-color: color-mix(in srgb, var(--color-primary) 28%, transparent) !important;
  background:
    var(--color-gradient-primary) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 16px 38px color-mix(in srgb, var(--color-primary) 26%, transparent);
}

#homepage-hub .home-tile[data-action="create-ai"] .tile-row .icon,
#homepage-hub .home-tile[data-action="create-ai"] .tile-title,
#homepage-hub .home-tile[data-action="create-ai"] .tile-sub {
  color: #fff !important;
}

#homepage-hub .home-tile[data-action="create-ai"] .tile-title::after,
#homepage-hub .home-side-item[data-action="create-ai"]::after {
  content: none;
}

#homepage-hub .home-topbar-create {
  background:
    var(--color-gradient-primary) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 16px 38px color-mix(in srgb, var(--color-primary) 26%, transparent) !important;
}

#homepage-hub .home-topbar-create:hover,
#homepage-hub .home-topbar-create:focus-visible {
  background:
    var(--color-gradient-primary) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 18px 42px color-mix(in srgb, var(--color-primary) 34%, transparent) !important;
}

#homepage-hub .home-tools {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0 0 24px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

#homepage-hub .home-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 22px;
  padding: 0;
  color: rgba(247, 241, 241, 0.82);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
}

#homepage-hub .home-tools-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

#homepage-hub .home-tools-head .icon,
#homepage-hub .home-tools-title .icon {
  width: 22px;
  height: 22px;
  color: rgba(247, 241, 241, 0.86);
}

#homepage-hub .home-tools-pager {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#homepage-hub .home-tools-page-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 28%, transparent);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(247, 241, 241, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

#homepage-hub .home-tools-page-btn:hover,
#homepage-hub .home-tools-page-btn:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--color-primary) 48%, transparent);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

#homepage-hub .home-tools-page-btn:disabled {
  cursor: default;
  pointer-events: none;
  opacity: 0.34;
}

#homepage-hub .home-tools-page-btn .icon {
  width: 22px;
  height: 22px;
  font-size: 22px;
}

#homepage-hub .home-tools-grid {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  margin: -8px -18px -2px;
  padding: 8px 22px 14px;
  max-height: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow-x: auto;
  overflow-y: visible;
  scroll-padding-inline: 22px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

#homepage-hub .home-tools-grid::-webkit-scrollbar {
  display: none;
}

#homepage-hub .home-tools-grid.collapsed,
#homepage-hub .home-tools-grid:not(.collapsed) {
  max-height: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  margin: -8px -18px -2px;
  padding: 8px 22px 14px;
  overflow-x: auto;
  overflow-y: visible;
}

#homepage-hub.home-sidebar-collapsed .home-tools-grid,
#homepage-hub.home-sidebar-collapsed .home-tools-grid.collapsed,
#homepage-hub.home-sidebar-collapsed .home-tools-grid:not(.collapsed) {
  margin-left: 0;
  padding-left: 8px;
}

#homepage-hub .home-tools-grid .tool {
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 82px;
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: transparent;
  color: rgba(247, 241, 241, 0.92);
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  box-shadow: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  transform: none;
}

#homepage-hub .home-tools-grid .tool:hover,
#homepage-hub .home-tools-grid .tool:focus-visible {
  transform: none;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  filter: none;
}

#homepage-hub .home-tools-grid .tool::before {
  inset: 0;
  border-width: 1px;
  border-radius: inherit;
}

#homepage-hub .home-tools-grid .tool:hover::before,
#homepage-hub .home-tools-grid .tool:focus-visible::before {
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#homepage-hub .home-tools-grid .tool .icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
  color: #fff;
  font-size: 29px;
  background: linear-gradient(135deg, #2859f2 0%, #78baff 100%);
  box-shadow: 0 12px 28px rgba(40, 89, 242, 0.22);
}

#homepage-hub .home-tools-grid .tool:nth-child(n + 6) .icon {
  background: linear-gradient(135deg, #6f93a6 0%, #c3e2ef 100%);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(149, 189, 205, 0.16);
}

#homepage-hub .home-tools-grid .tool span {
  white-space: nowrap;
}

#homepage-hub .home-projects {
  margin: 0;
  padding: 20px;
  min-height: 0;
  background: rgba(7, 10, 14, 0.8);
}

#homepage-hub .home-projects .tools-title {
  padding: 0;
  color: var(--hub-text);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

#homepage-hub .home-proj-head {
  margin-bottom: 14px;
}

#homepage-hub .home-projects-grid,
#homepage-hub .home-projects-grid.list-view {
  height: min(38vh, 420px);
  max-height: min(38vh, 420px);
  margin-top: 0;
  padding: var(--hub-button-gap-size);
  border: 0;
  border-radius: 0;
  background: transparent;
}

#homepage-hub .home-proj {
  border-radius: 8px;
  background: #0f1318;
}

#homepage-hub .home-right {
  position: sticky;
  top: 76px;
  align-self: start;
  width: auto;
  flex: initial;
  min-width: 0;
  height: auto;
  max-height: calc(100vh - 94px);
  padding: var(--hub-button-gap-size);
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

#homepage-hub .home-right-channel,
#homepage-hub .home-channel-goals,
#homepage-hub .gamification-points-display,
#homepage-hub .home-bgm-player,
#homepage-hub .home-views-aggregate {
  width: 100%;
  margin: 0;
  padding: 16px;
}

#homepage-hub .home-right-channel-label,
#homepage-hub .home-channel-goal-label,
#homepage-hub .home-views-aggregate-label {
  color: var(--hub-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

#homepage-hub .home-right-channel-name,
#homepage-hub .home-channel-goal-title {
  color: var(--hub-text);
}

#homepage-hub .home-right-channel-avatar {
  border-radius: 8px;
}

#homepage-hub .home-right-channel-actions {
  flex-direction: column;
  gap: 10px;
}

#homepage-hub .home-right-channel-btn {
  min-height: 42px;
  border-radius: 8px;
  border-color: color-mix(in srgb, var(--color-primary) 18%, transparent);
  background: transparent;
  font-size: 14px;
}

#homepage-hub .home-right-channel-btn::before {
  inset: 0;
  border-width: 1px;
  border-radius: inherit;
}

#homepage-hub .home-right-channel-btn:hover {
  border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  transform: none;
}

#homepage-hub .gamification-points-display {
  border-radius: 8px;
}

#homepage-hub .home-right-activate-wrap,
#homepage-hub .home-right-tour-entry,
#homepage-hub .home-right-bottom {
  width: 100%;
}

#homepage-hub .home-right-tour-entry {
  padding: 2px;
  overflow: visible;
}

#homepage-hub .home-side-activate.home-right-activate {
  min-height: 42px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
  color: var(--hub-muted);
  text-decoration: none;
}

#homepage-hub .tour-entry-btn {
  width: 100%;
  min-height: 44px;
  justify-content: center;
  border-radius: 8px;
}

#homepage-hub .tour-entry-btn:hover:not(:focus-visible) {
  outline: none !important;
  outline-offset: 0 !important;
}

#homepage-hub .tour-entry-badge {
  background: var(--color-gradient-primary);
}

#homepage-hub .home-bgm-player {
  min-height: 96px;
}

#homepage-hub .home-bgm-btn {
  display: inline-grid;
  place-items: center;
  align-items: center;
  justify-items: center;
  padding: 0;
  line-height: 0;
}

#homepage-hub .home-bgm-btn::before {
  inset: 0;
  border-width: 1px;
  border-radius: inherit;
}

#homepage-hub .home-bgm-btn > iconify-icon {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 1;
  margin: 0;
  place-self: center;
}

#homepage-hub .home-bgm-btn > iconify-icon svg {
  display: block;
  margin: auto;
}

#homepage-hub .home-bgm-btn--primary {
  background: var(--color-gradient-primary);
  box-shadow: none;
}

#homepage-hub .home-right-version {
  margin: 0;
  padding: 12px 0 0;
  border-top-color: color-mix(in srgb, var(--color-primary) 14%, transparent);
}

#homepage-hub .hub-fab-settings {
  border-radius: 8px;
  background: var(--color-gradient-primary);
  color: #fff;
}

#homepage-hub.hub-hide-left .home-hub-main {
  grid-template-columns: minmax(0, 1fr);
}

#homepage-hub.hub-hide-right .home-dashboard {
  grid-template-columns: minmax(0, 1fr);
}

#homepage-hub.hub-hide-right .home-right {
  display: none !important;
}

#homepage-hub.hub-hide-flowboard #home-flowboard-btn,
#homepage-hub.hub-hide-channel #home-channel-panel,
#homepage-hub.hub-hide-channel #home-channel-goals,
#homepage-hub.hub-hide-points #gamification-points-display {
  display: none !important;
}

#homepage-hub.hub-hide-more-tools .home-tools {
  display: block !important;
}

@media (max-width: 1280px) {
  #homepage-hub .home-hub-main {
    grid-template-columns: minmax(var(--home-side-collapsed-width), var(--home-side-width)) minmax(0, 1fr);
  }

  #homepage-hub .home-side-brand {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  #homepage-hub .home-side-brand-name {
    font-size: 23px;
  }

  #homepage-hub .home-topbar {
    grid-template-columns: minmax(260px, 1fr);
  }

  #homepage-hub .home-topbar-actions {
    justify-content: flex-start;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
}

@media (max-width: 1120px) {
  #homepage-hub .home-dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  #homepage-hub .home-right {
    position: relative;
    top: auto;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  #homepage-hub .home-right-bottom {
    grid-column: 1 / -1;
  }

  #homepage-hub .home-bgm-player-bottom {
    flex-direction: row;
  }
}

@media (max-width: 860px) {
  #homepage-hub.homepage-hub {
    overflow-y: auto;
  }

  #homepage-hub .home-hub-main {
    min-height: 100vh;
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  #homepage-hub .home-side {
    position: relative;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
    padding: 18px;
  }

  #homepage-hub .home-side-resizer {
    display: none;
  }

  #homepage-hub .home-content {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 16px;
  }

  #homepage-hub .home-topbar {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
  }

  #homepage-hub .home-topbar-actions {
    flex-wrap: wrap;
  }

  #homepage-hub .home-hero-title {
    gap: clamp(8px, 2.6vw, 14px);
    font-size: clamp(26px, 8vw, 44px);
  }

  #homepage-hub .home-tiles,
  #homepage-hub .home-right {
    grid-template-columns: minmax(0, 1fr);
  }

  #homepage-hub .home-projects-grid,
  #homepage-hub .home-projects-grid.list-view {
    height: auto;
    max-height: none;
  }
}

@media (max-width: 560px) {
  #homepage-hub .home-side-brand-name {
    font-size: 21px;
  }

  #homepage-hub .home-side-brand-plan {
    letter-spacing: 0.18em;
  }

  #homepage-hub .home-topbar-create,
  #homepage-hub .home-topbar-link {
    flex: 1 1 auto;
    justify-content: center;
  }

  #homepage-hub #home-create-btn.home-hero {
    min-height: 300px;
  }

  #homepage-hub .home-hero-plus {
    width: clamp(38px, 12vw, 52px);
    height: clamp(38px, 12vw, 52px);
    border-width: 1.5px;
  }

  #homepage-hub .home-hero-plus::before,
  #homepage-hub .home-hero-plus::after {
    height: 3px;
  }

  #homepage-hub .home-tile {
    min-height: 162px;
  }
}

/* Final cursor override: clickable UI should always read as clickable */
:where(
  button:not(:disabled),
  [role="button"]:not([aria-disabled="true"]),
  a[href],
  summary,
  label[for],
  select:not(:disabled),
  input[type="button"]:not(:disabled),
  input[type="submit"]:not(:disabled),
  input[type="reset"]:not(:disabled),
  input[type="checkbox"]:not(:disabled),
  input[type="radio"]:not(:disabled),
  [data-action]:not([disabled]):not([aria-disabled="true"]),
  [onclick]
),
:where(
  button:not(:disabled),
  [role="button"]:not([aria-disabled="true"]),
  a[href],
  summary,
  label[for],
  select:not(:disabled),
  input[type="button"]:not(:disabled),
  input[type="submit"]:not(:disabled),
  input[type="reset"]:not(:disabled),
  input[type="checkbox"]:not(:disabled),
  input[type="radio"]:not(:disabled),
  [data-action]:not([disabled]):not([aria-disabled="true"]),
  [onclick]
) * {
  cursor: var(--vs-cursor-pointer) !important;
}

:where(
  button:disabled,
  [role="button"][aria-disabled="true"],
  select:disabled,
  input:disabled,
  textarea:disabled,
  [disabled],
  [aria-disabled="true"]
),
:where(
  button:disabled,
  [role="button"][aria-disabled="true"],
  select:disabled,
  input:disabled,
  textarea:disabled,
  [disabled],
  [aria-disabled="true"]
) * {
  cursor: not-allowed !important;
}

/* Product range sliders: thin white active track, dark remaining track. */
:root {
  --vs-slider-track-height: 4px;
  --vs-slider-thumb-size: 14px;
  --vs-slider-active: #f4f4f5;
  --vs-slider-rest: rgba(255, 255, 255, 0.09);
  --vs-slider-thumb: #ffffff;
  --vs-slider-thumb-border: rgba(255, 255, 255, 0.72);
  --vs-slider-focus: rgba(255, 255, 255, 0.18);
  --vs-slider-progress: 0%;
}

body input[type="range"]:not([data-vs-slider-unstyled]) {
  -webkit-appearance: none !important;
  appearance: none !important;
  height: var(--vs-slider-thumb-size) !important;
  min-height: var(--vs-slider-thumb-size);
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  accent-color: var(--vs-slider-thumb);
}

body input[type="range"]:not([data-vs-slider-unstyled]):focus {
  outline: none !important;
  filter: none !important;
}

body input[type="range"]:not([data-vs-slider-unstyled])::-webkit-slider-runnable-track {
  width: 100%;
  height: var(--vs-slider-track-height) !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(
    90deg,
    var(--vs-slider-active) 0%,
    var(--vs-slider-active) var(--vs-slider-progress),
    var(--vs-slider-rest) var(--vs-slider-progress),
    var(--vs-slider-rest) 100%
  ) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

body input[type="range"]:not([data-vs-slider-unstyled])::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: var(--vs-slider-thumb-size) !important;
  height: var(--vs-slider-thumb-size) !important;
  margin-top: calc((var(--vs-slider-track-height) - var(--vs-slider-thumb-size)) / 2) !important;
  border: 1px solid var(--vs-slider-thumb-border) !important;
  border-radius: 999px !important;
  background: var(--vs-slider-thumb) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45) !important;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

body input[type="range"]:not([data-vs-slider-unstyled]):hover::-webkit-slider-thumb,
body input[type="range"]:not([data-vs-slider-unstyled]):focus-visible::-webkit-slider-thumb {
  border-color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.52), 0 0 0 4px var(--vs-slider-focus) !important;
}

body input[type="range"]:not([data-vs-slider-unstyled])::-moz-range-track {
  height: var(--vs-slider-track-height) !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--vs-slider-rest) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

body input[type="range"]:not([data-vs-slider-unstyled])::-moz-range-progress {
  height: var(--vs-slider-track-height) !important;
  border-radius: 999px !important;
  background: var(--vs-slider-active) !important;
}

body input[type="range"]:not([data-vs-slider-unstyled])::-moz-range-thumb {
  width: var(--vs-slider-thumb-size) !important;
  height: var(--vs-slider-thumb-size) !important;
  border: 1px solid var(--vs-slider-thumb-border) !important;
  border-radius: 999px !important;
  background: var(--vs-slider-thumb) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45) !important;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

body input[type="range"]:not([data-vs-slider-unstyled]):hover::-moz-range-thumb,
body input[type="range"]:not([data-vs-slider-unstyled]):focus-visible::-moz-range-thumb {
  border-color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.52), 0 0 0 4px var(--vs-slider-focus) !important;
}

body input[type="range"]:not([data-vs-slider-unstyled]):disabled {
  opacity: 0.48;
  cursor: not-allowed !important;
}
