/* ==========================================================================
   PulseTube 360™ - Apple & Google Design System
   Architected by Hari Narayanan (https://www.harinarayanan.co.in/)
   Fully Responsive Across All Devices (Mobile, Tablet, Desktop)
   ========================================================================== */

:root {
  /* Surface & Canvas (Warm Midnight Feel-Good Theme) */
  --bg-canvas: #08090e;
  --bg-surface: #0f1118;
  --bg-card: rgba(18, 21, 30, 0.75);
  --bg-card-elevated: #161924;
  --bg-card-hover: rgba(28, 32, 46, 0.85);
  --bg-input: #12141c;
  --bg-glass: rgba(255, 255, 255, 0.04);

  /* Borders & Specular Lines */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-active: #0071e3;
  --border-focus-glow: rgba(0, 113, 227, 0.35);

  /* Typography Colors */
  --text-main: #f5f5f7;
  --text-secondary: #9898a0;
  --text-muted: #5e5e66;
  --text-dim: #3a3a42;

  /* Curated System Accents */
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-cyan: #2997ff;
  --apple-green: #30d158;
  --apple-red: #ff453a;
  --apple-amber: #ff9f0a;
  --apple-purple: #bf5af2;

  /* Typography Stacks */
  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "SFProText-Medium", Menlo, Monaco, Consolas, monospace;

  /* Geometry */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 980px;

  /* Shadows */
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 10px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-floating: 0 24px 60px -10px rgba(0, 0, 0, 0.75);
}

/* Base Reset & Global Rules */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-stack);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient Feel-Good Lighting Gradients */
.ambient-glow {
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  max-width: 100vw;
  height: 600px;
  background: radial-gradient(ellipse at 50% 25%, rgba(0, 113, 227, 0.2) 0%, rgba(139, 92, 246, 0.1) 35%, rgba(41, 151, 255, 0.04) 60%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-bottom {
  position: fixed;
  bottom: -200px;
  right: -100px;
  width: 850px;
  height: 650px;
  background: radial-gradient(circle, rgba(48, 209, 88, 0.06) 0%, rgba(0, 113, 227, 0.03) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.site-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 20px 72px 20px;
}

@media (min-width: 768px) {
  .site-wrapper {
    padding: 24px 32px 80px 32px;
  }
}

/* ==========================================================================
   Navigation Bar (Apple Frosted Capsule)
   ========================================================================== */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: rgba(14, 14, 18, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  margin-bottom: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
}

@media (min-width: 768px) {
  .site-header {
    padding: 12px 24px;
    margin-bottom: 56px;
  }
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

/* ==========================================================================
   Precision PulseTube Telemetry Device (Left Side Brand)
   ========================================================================== */

.pulse-tube-device {
  position: relative;
  width: 36px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tube-capsule {
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tube-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  height: 12px;
  z-index: 2;
}

.tube-bar {
  width: 2.5px;
  background: linear-gradient(180deg, #2997ff 0%, #30d158 100%);
  border-radius: 1px;
  opacity: 0.85;
  transition: height 0.2s ease;
}

.tube-bar.bar-1 {
  height: 6px;
  animation: barHarmonic 2.2s ease-in-out infinite alternate;
}

.tube-bar.bar-2 {
  height: 11px;
  animation: barHarmonic 1.7s ease-in-out infinite alternate 0.3s;
}

.tube-bar.bar-3 {
  height: 8px;
  animation: barHarmonic 2.0s ease-in-out infinite alternate 0.6s;
}

.tube-bar.bar-4 {
  height: 5px;
  animation: barHarmonic 1.8s ease-in-out infinite alternate 0.15s;
}

@keyframes barHarmonic {
  0% { transform: scaleY(0.5); opacity: 0.6; }
  50% { transform: scaleY(1.0); opacity: 0.95; }
  100% { transform: scaleY(0.7); opacity: 0.75; }
}

.tube-light-streak {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
  animation: streakGlide 4s ease-in-out infinite;
}

@keyframes streakGlide {
  0%, 75% { left: -100%; }
  100% { left: 100%; }
}

.nav-brand:hover .tube-capsule {
  border-color: rgba(41, 151, 255, 0.4);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 12px rgba(41, 151, 255, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  transform: translateY(-0.5px);
}

.pulse-tube-device.scraping-active .tube-capsule {
  border-color: rgba(48, 209, 88, 0.5);
  box-shadow: 0 0 16px rgba(48, 209, 88, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.pulse-tube-device.scraping-active .tube-bar {
  animation-duration: 0.8s;
  background: linear-gradient(180deg, #64d2ff 0%, #30d158 100%);
  opacity: 1;
}

.brand-title-accent {
  background: linear-gradient(135deg, #2997ff 0%, #30d158 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* ==========================================================================
   Executive Architect Identity Card: Hari Narayanan (Luxury High-End Engineering)
   ========================================================================== */

.executive-author-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 6px 16px 6px 8px;
  text-decoration: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.executive-author-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, rgba(0, 113, 227, 0.4), rgba(48, 209, 88, 0.4), rgba(100, 210, 255, 0.4));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.author-monogram-shield {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0071e3 0%, #30d158 55%, #64d2ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 113, 227, 0.45);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.monogram-text {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.author-meta-block {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.author-name-lead {
  font-size: 0.90rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.author-site-link {
  font-size: 0.68rem;
  font-weight: 500;
  color: #a1a1aa;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.executive-author-card:hover .author-site-link {
  color: #30d158;
}

.author-link-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.25s ease;
  margin-left: 2px;
}

.executive-author-card:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(48, 209, 88, 0.45);
  box-shadow: 0 8px 30px rgba(0, 113, 227, 0.25), 0 0 20px rgba(48, 209, 88, 0.2);
  transform: translateY(-1.5px);
}

.executive-author-card:hover::before {
  opacity: 1;
}

.executive-author-card:hover .author-monogram-shield {
  transform: scale(1.06) rotate(3deg);
  box-shadow: 0 4px 16px rgba(48, 209, 88, 0.5);
}

.executive-author-card:hover .author-name-lead {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.executive-author-card:hover .author-link-pill {
  background: #30d158;
  color: #000;
  border-color: #30d158;
  transform: translate(1px, -1px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  text-align: center;
  max-width: 860px;
  margin: 32px auto 48px auto;
}

@media (min-width: 768px) {
  .hero {
    margin-top: 48px;
    margin-bottom: 64px;
  }
}

.hero-headline {
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: #f5f5f7;
  margin-bottom: 16px;
}

.headline-sub {
  color: #86868b;
  font-weight: 500;
  display: block;
  letter-spacing: -0.025em;
}

.hero-subhead {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.55;
  letter-spacing: -0.01em;
  max-width: 640px;
  margin: 0 auto 36px auto;
  padding: 0 10px;
}

/* ==========================================================================
   Search Capsule (Omnibox)
   ========================================================================== */

.search-capsule {
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.25s ease;
  text-align: left;
}

@media (min-width: 768px) {
  .search-capsule {
    border-radius: var(--radius-xl);
    padding: 16px 20px;
  }
}

.search-capsule:focus-within {
  border-color: rgba(41, 151, 255, 0.6);
  box-shadow: 0 0 36px rgba(0, 113, 227, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.input-shell {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 5px 6px 5px 16px;
  transition: all 0.2s ease;
  gap: 8px;
}

@media (max-width: 600px) {
  .input-shell {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-md);
    padding: 8px 10px;
  }
}

.input-shell:focus-within {
  border-color: var(--apple-blue);
  background: #17171c;
}

.input-prefix {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#channel-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-stack);
  font-size: 0.96rem;
  padding: 8px 0;
  letter-spacing: -0.01em;
  min-width: 0;
}

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

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-stack);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

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

.btn-primary {
  background: var(--apple-blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 113, 227, 0.35);
}

.btn-primary:hover {
  background: var(--apple-blue-hover);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.btn-comments-excel {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.08));
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.btn-comments-excel:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.18));
  border-color: rgba(16, 185, 129, 0.65);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

.btn-icon {
  padding: 10px 14px;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.76rem;
}

#submit-btn {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  #submit-btn {
    width: 100%;
    padding: 12px 16px;
  }
}

/* Sample Channels Chips */
.sample-channels {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 14px;
  padding-left: 2px;
}

.sample-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sample-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: var(--font-stack);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
}

.sample-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* Settings Disclosure (Accordion) */
.settings-disclosure {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

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

.settings-pane {
  margin-top: 12px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  animation: fadeIn 0.2s ease;
}

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

@media (min-width: 600px) {
  .settings-row {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

.field-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.field-item label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.field-item select {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-stack);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.field-item select:focus {
  border-color: var(--apple-blue);
}

/* ==========================================================================
   Progress Section
   ========================================================================== */

.progress-section {
  max-width: 860px;
  margin: 0 auto 36px auto;
  animation: fadeIn 0.25s ease;
}

.progress-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.progress-bar-rail {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--apple-blue), var(--apple-green));
  border-radius: var(--radius-pill);
  transition: width 0.35s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.progress-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pulsing-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0071e3;
  box-shadow: 0 0 10px #0071e3, 0 0 16px rgba(48, 209, 88, 0.4);
  animation: pulse 1.8s infinite ease-in-out;
  flex-shrink: 0;
  display: inline-block;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.status-primary {
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
}

.status-secondary {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-number {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.progress-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.velocity-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 199, 190, 0.12);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.35);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-family: var(--font-mono);
  box-shadow: 0 0 10px rgba(48, 209, 88, 0.15);
  animation: pulseVelocity 2s infinite ease-in-out;
}

@keyframes pulseVelocity {
  0%, 100% { border-color: rgba(48, 209, 88, 0.35); }
  50% { border-color: rgba(48, 209, 88, 0.8); box-shadow: 0 0 14px rgba(48, 209, 88, 0.35); }
}

.velocity-bolt {
  font-size: 0.82rem;
  animation: boltFlicker 1.8s infinite alternate;
}

@keyframes boltFlicker {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 1; }
}

.live-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(48, 209, 88, 0.12);
  color: var(--apple-green);
  border: 1px solid rgba(48, 209, 88, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-family: var(--font-mono);
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 8px var(--apple-green);
  animation: pulse 1s infinite;
}

.harvest-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.telemetry-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.progress-elapsed {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.catalog-coverage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #64d2ff;
  background: rgba(100, 210, 255, 0.1);
  border: 1px solid rgba(100, 210, 255, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.coverage-bar-mini {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  display: inline-block;
}

.coverage-fill-mini {
  display: block;
  height: 100%;
  background: #64d2ff;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.active-streams-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.stream-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}

.stream-pill.active {
  color: #e2e8f0;
  border-color: rgba(41, 151, 255, 0.3);
  background: rgba(41, 151, 255, 0.08);
}

.stream-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 6px #30d158;
  animation: pulse 1.2s infinite;
}

.btn-finish-early {
  background: linear-gradient(135deg, #0071e3 0%, #2997ff 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
  padding: 7px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 14px rgba(0, 113, 227, 0.45);
  position: relative;
  overflow: hidden;
}

.btn-finish-early::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: all 0.5s;
}

.btn-finish-early:hover::before {
  left: 100%;
}

.btn-finish-early:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 20px rgba(41, 151, 255, 0.65);
}

.pipeline-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

@media (max-width: 500px) {
  .pipeline-track {
    gap: 4px;
  }
}

.pipeline-node {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  padding: 5px 6px;
  border-radius: var(--radius-xs);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
}

.pipeline-node.active {
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-cyan);
  border-color: rgba(0, 113, 227, 0.35);
  font-weight: 500;
}

.pipeline-node.done {
  background: rgba(48, 209, 88, 0.12);
  color: var(--apple-green);
  border-color: rgba(48, 209, 88, 0.35);
}

/* Error Banner */
.error-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 860px;
  margin: 0 auto 28px auto;
  background: rgba(255, 69, 58, 0.08);
  border: 1px solid rgba(255, 69, 58, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  gap: 12px;
}

.error-lead {
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-symbol {
  color: var(--apple-red);
  font-weight: 700;
  font-size: 1.1rem;
}

.error-lead h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.error-lead p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Dashboard Results Section
   ========================================================================== */

.results-container {
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Channel Overview Card */
.channel-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 850px) {
  .channel-card {
    flex-direction: column;
    align-items: stretch;
  }
}

.channel-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.channel-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  object-fit: cover;
  background: #1c1c1e;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .channel-avatar {
    width: 68px;
    height: 68px;
  }
}

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

.channel-name-row h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.verified-tag {
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-cyan);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 113, 227, 0.25);
}

.channel-meta-subrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.channel-handle {
  font-size: 0.86rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.subscribers-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(48, 209, 88, 0.1);
  color: var(--apple-green);
  border: 1px solid rgba(48, 209, 88, 0.25);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.subscribers-badge svg {
  color: var(--apple-green);
}

.channel-description {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

.channel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 850px) {
  .channel-actions {
    width: 100%;
  }
  .channel-actions button {
    flex: 1;
    min-width: 130px;
  }
}

/* Executive Summary Box */
.clarity-box {
  background: linear-gradient(180deg, #131317 0%, #0d0d10 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .clarity-box {
    padding: 26px 30px;
  }
}

.clarity-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.clarity-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clarity-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--apple-cyan);
  box-shadow: 0 0 10px var(--apple-cyan);
}

.clarity-title-group h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.score-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.score-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.score-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--apple-green);
  font-family: var(--font-mono);
}

.clarity-summary {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #d1d1d6;
  margin-bottom: 18px;
}

.clarity-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.accent-text {
  color: var(--apple-green);
}

/* ==========================================================================
   KPI Tiles Row (Fully Responsive Grid)
   ========================================================================== */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

@media (min-width: 900px) {
  .kpi-row {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
  }
}

.highlight-tile {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.12) 0%, rgba(15, 17, 24, 0.95) 100%);
  border-color: rgba(41, 151, 255, 0.3);
}

.highlight-tile .kpi-num {
  color: var(--apple-cyan);
}

.kpi-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-tile:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.kpi-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.kpi-num {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.kpi-footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ==========================================================================
   Segmented Navigation Tabs
   ========================================================================== */

.segment-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.segment-nav::-webkit-scrollbar {
  display: none;
}

.segment-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-stack);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.segment-tab:hover {
  color: #fff;
}

.segment-tab.active {
  color: #fff;
  border-bottom-color: var(--apple-blue);
  font-weight: 600;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   Toolbar & Reactive Filter Controls
   ========================================================================== */

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

@media (min-width: 960px) {
  .toolbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.search-field {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  width: 100%;
}

@media (min-width: 960px) {
  .search-field {
    width: 260px;
  }
}

.search-field input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-stack);
  font-size: 0.86rem;
  margin-left: 8px;
  width: 100%;
}

.date-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.segmented-pills {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px;
  border-radius: var(--radius-xs);
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-stack);
  font-size: 0.74rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn:hover {
  color: #fff;
}

.seg-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 600;
}

.date-range-pickers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.date-range-pickers input[type="date"] {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 4px 6px;
  border-radius: 4px;
  outline: none;
}

.date-sep {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.select-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

@media (min-width: 960px) {
  .select-group {
    width: auto;
  }
}

.select-group select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-stack);
  font-size: 0.82rem;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  flex: 1;
}

@media (min-width: 960px) {
  .select-group select {
    flex: initial;
  }
}

/* ==========================================================================
   Data Table & Stream Grid (Non-Cropping & Responsive)
   ========================================================================== */

.table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.data-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.data-grid th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #111115;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-grid td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-grid tbody tr {
  transition: background 0.15s ease;
}

.data-grid tbody tr:hover {
  background: rgba(255, 255, 255, 0.028);
}

/* Column Specific Rules */
.col-rank {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  width: 45px;
  white-space: nowrap;
}

.col-preview {
  width: 105px;
  padding: 8px 10px !important;
}

/* Interactive Thumbnail Frame with Play Overlay */
.thumb-frame {
  position: relative;
  display: block;
  width: 84px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.thumb-frame:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
  border-color: rgba(41, 151, 255, 0.5);
}

.table-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-duration {
  position: absolute;
  bottom: 2px;
  right: 3px;
  background: rgba(0, 0, 0, 0.85);
  color: #f5f5f7;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.2;
}

.thumb-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 24px;
  height: 24px;
  background: rgba(0, 113, 227, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.thumb-frame:hover .thumb-play-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Video Main Info (Headline + Inline Badges) */
.col-title {
  min-width: 250px;
}

.video-main-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.video-title-link {
  color: #f5f5f7;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.video-title-link:hover {
  color: var(--apple-cyan);
}

.video-badges-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.72rem;
}

.badge-date {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.72rem;
}

.badge-topic {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(0, 113, 227, 0.12);
  color: #8ac0ff;
  border: 1px solid rgba(0, 113, 227, 0.25);
  white-space: nowrap;
}

.badge-format {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.badge-format.short {
  background: rgba(255, 69, 58, 0.12);
  color: #ff8b85;
  border-color: rgba(255, 69, 58, 0.25);
}

.desc-trigger {
  color: var(--apple-cyan);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
}

.desc-trigger:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Views & Engagement Columns */
.col-views {
  text-align: right;
  width: 125px;
  white-space: nowrap;
}

.col-engagement {
  text-align: right;
  width: 145px;
  white-space: nowrap;
}

.metric-main {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.metric-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.eng-rate-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--apple-green);
  background: rgba(48, 209, 88, 0.12);
  border: 1px solid rgba(48, 209, 88, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* Action Play Stream Button (Prominent & Non-Cropping) */
.col-action {
  text-align: center;
  width: 105px;
  white-space: nowrap;
}

.btn-play-stream {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(0, 113, 227, 0.14);
  color: #2997ff;
  border: 1px solid rgba(0, 113, 227, 0.35);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.btn-play-stream:hover {
  background: var(--apple-blue);
  color: #fff;
  border-color: var(--apple-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.45);
}

/* ==========================================================================
   Pagination Bar (Responsive Layout)
   ========================================================================== */

.pagination-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .pagination-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.pagination-info {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

@media (min-width: 768px) {
  .pagination-info {
    text-align: left;
  }
}

.pagination-size {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pagination-size select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-stack);
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.pagination-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-stack);
  font-size: 0.78rem;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.page-btn.active {
  background: var(--apple-blue);
  color: #fff;
  border-color: var(--apple-blue);
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
}

.pagination-jump {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

#jump-page-input {
  width: 54px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 6px;
  border-radius: 4px;
  outline: none;
  text-align: center;
}

/* ==========================================================================
   Analytics Charts & Breakdown
   ========================================================================== */

.charts-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 900px) {
  .charts-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.chart-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.chart-panel h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.bar-sequence {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.bar-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.bar-metric {
  font-family: var(--font-mono);
  color: #fff;
}

.bar-groove {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.bar-lead {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--apple-blue), var(--apple-cyan));
  transition: width 0.4s ease;
}

.bar-lead-alt {
  background: linear-gradient(90deg, var(--apple-green), #5ee6a2);
}

/* ==========================================================================
   Modal Dialog (Apple Sheet / Dialog)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}

.modal-dialog {
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  animation: modalSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
}

.modal-sub {
  display: flex;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.76rem;
  margin-top: 4px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-content {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: var(--font-stack);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #d1d1d6;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 22px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
  gap: 8px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  text-align: center;
  margin-top: 96px;
  padding: 36px 0 56px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-apple-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 860px;
  margin: 0 auto;
}

.footer-brand-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-brand-name {
  font-weight: 600;
  color: #f5f5f7;
  letter-spacing: -0.01em;
}

.footer-divider {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
}

.footer-author-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #86868b;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.footer-author-link:hover {
  color: var(--apple-cyan);
}

.footer-apple-copy {
  font-size: 0.74rem;
  color: #86868b;
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.4;
}

/* Sleek custom scrollbars for table wrapper and modal */
.table-wrapper::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.table-wrapper::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

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

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

/* ==========================================================================
   Mobile & Cross-Device Responsive Master Suite
   ========================================================================== */

.mobile-table-hint {
  display: none;
}

@media (max-width: 820px) {
  .mobile-table-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.72rem;
    color: var(--apple-cyan);
    background: rgba(0, 113, 227, 0.08);
    border: 1px dashed rgba(41, 151, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease;
  }
}

@media (max-width: 768px) {
  html, body {
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
    overflow-x: hidden;
    width: 100%;
  }

  .site-wrapper {
    padding: 12px 14px 56px 14px;
    overflow-x: hidden;
  }

  /* Compact Mobile Header */
  .site-header {
    padding: 8px 12px;
    margin-bottom: 24px;
    border-radius: var(--radius-pill);
    gap: 8px;
  }

  .nav-brand {
    gap: 8px;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .brand-tag {
    display: none;
  }

  .executive-author-card {
    padding: 4px 12px 4px 6px;
    gap: 8px;
  }

  .author-monogram-shield {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }

  .monogram-text {
    font-size: 0.68rem;
  }

  .author-site-link {
    font-size: 0.58rem;
  }

  .author-name-lead {
    font-size: 0.78rem;
  }

  /* Hero Section */
  .hero {
    padding: 12px 0 24px 0;
  }

  .hero-kicker {
    font-size: 0.68rem;
    padding: 3px 10px;
    margin-bottom: 12px;
  }

  .hero-headline {
    font-size: clamp(1.75rem, 7.5vw, 2.35rem);
    line-height: 1.15;
    margin-bottom: 12px;
  }

  .hero-subhead {
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 22px;
    padding: 0 4px;
  }

  .search-capsule {
    padding: 10px 12px;
    border-radius: 14px;
  }

  .input-shell {
    padding: 6px 10px;
    flex-direction: column;
    align-items: stretch;
    border-radius: 12px;
    gap: 6px;
  }

  /* 16px font-size prevents iOS Safari from automatically zooming into the viewport */
  #channel-input {
    font-size: 16px !important;
    padding: 8px 4px;
  }

  #submit-btn {
    width: 100%;
    margin-top: 4px;
    padding: 12px 16px;
    font-size: 0.92rem;
    border-radius: 10px;
  }

  .sample-channels {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 6px 2px 8px 2px;
    scrollbar-width: none;
  }

  .sample-channels::-webkit-scrollbar {
    display: none;
  }

  .sample-chip {
    flex-shrink: 0;
    font-size: 0.74rem;
    padding: 4px 10px;
  }

  /* Progress Section */
  .progress-card {
    padding: 14px 16px;
    border-radius: 14px;
  }

  .progress-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
  }

  .progress-right-group {
    width: 100%;
    justify-content: space-between;
  }

  .harvest-control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .telemetry-left {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .btn-finish-early {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 10px 14px;
    font-size: 0.84rem;
  }

  .pipeline-track {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .pipeline-track::-webkit-scrollbar {
    display: none;
  }

  .pipeline-node {
    flex: 0 0 auto;
    min-width: 92px;
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  /* Channel Overview Card */
  .channel-card {
    padding: 16px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    gap: 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .channel-main {
    gap: 12px;
  }

  .channel-avatar {
    width: 52px;
    height: 52px;
  }

  .channel-name-row h2 {
    font-size: 1.15rem;
  }

  .channel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
  }

  #download-excel-btn {
    grid-column: span 2;
    width: 100%;
    justify-content: center;
    padding: 11px;
    font-size: 0.88rem;
  }

  #view-html-btn,
  #download-html-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  #download-csv-btn {
    display: none;
  }

  /* Executive Brand Clarity Box */
  .clarity-box {
    padding: 16px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
  }

  .clarity-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .clarity-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-pill {
    padding: 7px 10px;
    font-size: 0.76rem;
  }

  /* KPI Grid */
  .kpi-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
  }

  .highlight-tile {
    grid-column: span 2;
  }

  .kpi-tile {
    padding: 12px 14px;
    border-radius: 12px;
  }

  .kpi-label {
    font-size: 0.68rem;
  }

  .kpi-num {
    font-size: 1.35rem;
  }

  /* Tabs Navigation */
  .segment-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .segment-nav::-webkit-scrollbar {
    display: none;
  }

  .segment-tab {
    padding: 8px 12px;
    font-size: 0.82rem;
    flex-shrink: 0;
  }

  /* Toolbar & Filter Bar */
  .toolbar {
    gap: 10px;
    margin-bottom: 14px;
  }

  .search-field {
    width: 100%;
    border-radius: 10px;
  }

  .search-field input {
    font-size: 16px !important;
  }

  .date-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
  }

  .segmented-pills {
    width: 100%;
    justify-content: space-between;
  }

  .date-range-pickers {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .date-range-pickers input[type="date"] {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    padding: 6px 8px;
  }

  .select-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  #filter-sort-select {
    grid-column: span 2;
    width: 100%;
  }

  .select-group select {
    font-size: 14px;
    padding: 9px 10px;
    border-radius: 10px;
  }

  /* Master Table on Mobile */
  .table-wrapper {
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-grid {
    min-width: 650px;
  }

  .col-title {
    min-width: 200px;
  }

  .video-title-link {
    font-size: 0.84rem;
  }

  .pagination-bar {
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
  }

  .pagination-controls {
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
  }

  .pagination-jump {
    display: none;
  }

  /* Mobile Bottom Sheet Modal */
  .modal-dialog {
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    animation: sheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-header {
    padding: 14px 18px;
  }

  .modal-content {
    max-height: 52vh;
    padding: 14px 18px;
  }

  .modal-actions {
    padding: 12px 18px;
    gap: 10px;
  }

  /* Mobile Sentiment Adaptations */
  .sentiment-kpi-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .sentiment-stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    text-align: left;
  }

  .sentiment-stat-card .stat-pct {
    font-size: 1.1rem;
  }

  .comments-stream {
    max-height: 48vh;
  }

  .sentiment-filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .sent-filter-chip {
    flex-shrink: 0;
  }
}

/* ==========================================================================
   Audience Sentiment & Comment Reactions (Linear / Apple Dark Mode)
   ========================================================================== */

.sentiment-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ff9f0a;
  background: rgba(255, 159, 10, 0.12);
  border: 1px solid rgba(255, 159, 10, 0.28);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.70rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.sentiment-trigger:hover {
  background: rgba(255, 159, 10, 0.22);
  border-color: rgba(255, 159, 10, 0.5);
  color: #ffb340;
  transform: translateY(-1px);
}

.btn-reactions-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 159, 10, 0.14);
  color: #ffb340;
  border: 1px solid rgba(255, 159, 10, 0.35);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  margin-bottom: 4px;
  white-space: nowrap;
}

.btn-reactions-pill:hover {
  background: #ff9f0a;
  color: #000;
  border-color: #ff9f0a;
  box-shadow: 0 4px 14px rgba(255, 159, 10, 0.4);
  transform: translateY(-1px);
}

.modal-dialog-lg {
  max-width: 760px;
  width: 100%;
}

.sentiment-modal-heading {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sentiment-mood-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.sentiment-mood-pill.pos {
  background: rgba(48, 209, 88, 0.15);
  color: #30d158;
  border-color: rgba(48, 209, 88, 0.35);
  box-shadow: 0 0 16px rgba(48, 209, 88, 0.15);
}

.sentiment-mood-pill.neu {
  background: rgba(142, 142, 147, 0.18);
  color: #d1d1d6;
  border-color: rgba(142, 142, 147, 0.35);
}

.sentiment-mood-pill.neg {
  background: rgba(255, 69, 58, 0.16);
  color: #ff453a;
  border-color: rgba(255, 69, 58, 0.35);
  box-shadow: 0 0 16px rgba(255, 69, 58, 0.15);
}

.sentiment-scorecard {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.sentiment-spectrum-bar {
  height: 10px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 14px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.spectrum-segment {
  height: 100%;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.spectrum-segment.pos {
  background: linear-gradient(90deg, #28cd41, #30d158);
}

.spectrum-segment.neu {
  background: linear-gradient(90deg, #636366, #8e8e93);
}

.spectrum-segment.neg {
  background: linear-gradient(90deg, #ff453a, #ff3b30);
}

.sentiment-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.sentiment-stat-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.sentiment-stat-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.stat-sign {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.pos-stat .stat-sign { color: #30d158; }
.neu-stat .stat-sign { color: #a1a1aa; }
.neg-stat .stat-sign { color: #ff453a; }

.stat-pct {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.stat-count {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sentiment-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sent-filter-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.sent-filter-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sent-filter-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sent-filter-chip.active {
  background: var(--apple-blue);
  border-color: var(--apple-blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.35);
}

.comments-stream {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 14px 2px;
}

.comment-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: background 0.2s ease;
}

.comment-card:hover {
  background: rgba(255, 255, 255, 0.045);
}

.comment-card.sent-positive {
  border-left-color: #30d158;
}

.comment-card.sent-neutral {
  border-left-color: #8e8e93;
}

.comment-card.sent-negative {
  border-left-color: #ff453a;
}

.comment-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.comment-author-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.comment-avatar-fallback {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.70rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comment-author-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.comment-author-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comment-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.comment-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sign-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.sign-tag.sign-positive {
  background: rgba(48, 209, 88, 0.14);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.sign-tag.sign-neutral {
  background: rgba(142, 142, 147, 0.15);
  color: #d1d1d6;
  border: 1px solid rgba(142, 142, 147, 0.3);
}

.sign-tag.sign-negative {
  background: rgba(255, 69, 58, 0.14);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.comment-likes-pill {
  font-family: var(--font-mono);
  font-size: 0.70rem;
  background: rgba(255, 45, 85, 0.12);
  color: #ff6482;
  border: 1px solid rgba(255, 45, 85, 0.25);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.comment-text {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #e5e5ea;
  word-break: break-word;
  white-space: pre-wrap;
}

.comments-loading-state,
.comments-empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.comments-modal-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--apple-blue);
  border-right-color: var(--apple-green);
  animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   Interactive Audience Sentiment & Deep Telemetry Toggle
   ========================================================================== */

.sentiment-toggle-shell {
  margin: 18px 0 14px 0;
  width: 100%;
}

.sentiment-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(18, 21, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.sentiment-toggle-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.sentiment-toggle-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 50%, rgba(48, 209, 88, 0.08), transparent 40%),
              radial-gradient(circle at 90% 50%, rgba(0, 113, 227, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.sentiment-toggle-card.active-deep-mode {
  border-color: rgba(48, 209, 88, 0.4);
  background: rgba(20, 26, 38, 0.85);
  box-shadow: 0 8px 32px rgba(48, 209, 88, 0.15), 0 0 20px rgba(0, 113, 227, 0.15);
  transform: translateY(-1px);
}

.sentiment-toggle-card.active-deep-mode::before {
  opacity: 1;
}

.toggle-card-left {
  flex: 1;
  min-width: 0;
  padding-right: 18px;
}

.toggle-headline-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-status-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  position: relative;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.sentiment-toggle-card.active-deep-mode .toggle-status-icon-wrap {
  background: rgba(48, 209, 88, 0.15);
  border-color: rgba(48, 209, 88, 0.4);
  box-shadow: 0 0 16px rgba(48, 209, 88, 0.3);
  transform: rotate(5deg) scale(1.05);
}

.toggle-pulse-ring {
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  border: 2px solid transparent;
  pointer-events: none;
  opacity: 0;
}

.sentiment-toggle-card.active-deep-mode .toggle-pulse-ring {
  border-color: rgba(48, 209, 88, 0.4);
  opacity: 1;
  animation: pulseRing 2s infinite ease-out;
}

@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.toggle-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toggle-main-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.96rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  flex-wrap: wrap;
}

.toggle-mode-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  transition: all 0.3s ease;
}

.toggle-mode-badge.standard-mode {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.toggle-mode-badge.deep-mode {
  background: rgba(48, 209, 88, 0.2);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.4);
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.25);
  animation: badgeBreathe 2s infinite ease-in-out;
}

@keyframes badgeBreathe {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

.toggle-caption {
  font-size: 0.81rem;
  color: var(--text-secondary);
  line-height: 1.35;
  transition: color 0.3s ease;
}

.sentiment-toggle-card.active-deep-mode .toggle-caption {
  color: #d1d1d6;
}

/* Apple-style Animated Glow Switch */
.switch-glow {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 32px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.switch-glow input,
.switch-glow input[type="checkbox"] {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  z-index: 10 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease;
  pointer-events: none;
}

.switch-glow input:checked ~ .switch-track,
.switch-glow input:checked + .switch-track {
  background: linear-gradient(135deg, #0071e3 0%, #30d158 100%);
  border-color: rgba(48, 209, 88, 0.6);
  box-shadow: 0 0 16px rgba(48, 209, 88, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.switch-glow input:checked ~ .switch-track .switch-thumb,
.switch-glow input:checked + .switch-track .switch-thumb {
  transform: translateX(26px);
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5), 0 0 10px rgba(48, 209, 88, 0.7);
}

/* Feature Badges expanded view */
.toggle-expanded-features {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 0 6px;
  animation: fadeInDown 0.3s ease;
  flex-wrap: wrap;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.feature-chip .chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.feature-chip .chip-dot.green { background: var(--apple-green); box-shadow: 0 0 6px rgba(48, 209, 88, 0.7); }
.feature-chip .chip-dot.blue { background: var(--apple-cyan); box-shadow: 0 0 6px rgba(41, 151, 255, 0.7); }
.feature-chip .chip-dot.purple { background: var(--apple-purple); box-shadow: 0 0 6px rgba(191, 90, 242, 0.7); }

/* Table Sentiment Badges */
.badge-sentiment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.badge-sentiment.pos {
  background: rgba(48, 209, 88, 0.14);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.35);
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.15);
}

.badge-sentiment.neg {
  background: rgba(255, 69, 58, 0.14);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.35);
  box-shadow: 0 0 8px rgba(255, 69, 58, 0.15);
}

.badge-sentiment.neu {
  background: rgba(255, 255, 255, 0.06);
  color: #aeaeb2;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sentiment-sub-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.engagement-breakdown-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.engagement-breakdown-chips span {
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sentiment-kpi-tile {
  border-color: rgba(48, 209, 88, 0.3) !important;
  background: rgba(48, 209, 88, 0.05) !important;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.comment-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
