@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --bg-dark: #0a0b0e;
  --bg-sidebar: #0f1115;
  --bg-card: #14161d;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-active: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-dimmed: #6b7280;
  
  /* High contrast minimal accents (solid, no glow) */
  --accent-arrest: #ef4444; /* Crisp red */
  --accent-lawsuit: #f59e0b; /* Amber */
  --accent-milestone: #3b82f6; /* Blue */
  --accent-win: #10b981; /* Emerald */
  --accent-link: #7dd3fc; /* Accessible link blue on dark */
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-medium: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variable Overrides */
body.light-theme {
  --bg-dark: #f8f9fa;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --border-subtle: #e9ecef;
  --border-active: #dee2e6;
  
  --text-primary: #12141c;
  --text-secondary: #495057;
  --text-dimmed: #868e96;
  --accent-link: #075985;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  display: flex;
}

/* 1. Split Screen Layout */

/* Left Sidebar (Fixed) */
.sidebar {
  width: 360px;
  min-width: 360px;
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  z-index: 10;
}

.brand-section {
  margin-bottom: 20px;
}

.brand-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--accent-arrest);
  padding: 4px 12px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-arrest);
  border-radius: 50%;
  animation: dot-pulse 1.8s infinite ease-in-out;
}

@keyframes dot-pulse {
  0% { transform: scale(0.85); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.5; }
  100% { transform: scale(0.85); opacity: 1; }
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.theme-toggle-btn:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
}
.theme-toggle-btn svg {
  fill: currentColor;
  width: 16px;
  height: 16px;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 15px;
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 25px;
}

.donation-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 9999px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  width: 100%;
  justify-content: center;
  transition: var(--transition-fast);
}

.donation-btn:hover {
  background: var(--text-primary);
  color: var(--bg-dark);
  transform: translateY(-1px);
}

.donation-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

body.light-theme .donation-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .donation-btn:hover {
  background: var(--text-primary);
  color: var(--bg-sidebar);
}

.campaign-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.02));
}

.campaign-card-header,
.campaign-amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.campaign-card-header {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.campaign-live {
  color: var(--accent-win);
  font-size: 0.6rem;
}

.campaign-amount {
  margin-top: 8px;
}

.campaign-amount strong {
  color: var(--text-primary);
  font-size: 1.35rem;
}

.campaign-amount span {
  color: var(--text-dimmed);
  font-size: 0.72rem;
}

.campaign-progress {
  height: 5px;
  margin: 9px 0 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

.campaign-progress span {
  display: block;
  width: 6.37%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-lawsuit);
}

.campaign-card p {
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.45;
}

.campaign-card > a {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent-lawsuit);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.campaign-card > a:hover {
  text-decoration: underline;
}

/* Audio Player Wrapper */
.audio-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}

.audio-header {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dimmed);
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
}

.audio-player-container {
  background-color: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

audio {
  display: none; /* We hide the native audio bar to style it cleanly */
}

/* Custom Mini Audio UI controls */
.audio-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.play-main-btn {
  background: var(--text-primary);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex: 0 0 42px;
  aspect-ratio: 1;
  padding: 0;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.play-main-btn:hover {
  transform: scale(1.05);
}

.play-main-btn svg {
  fill: var(--bg-dark);
  width: 14px;
  height: 14px;
}

.audio-skip-btn {
  min-width: 50px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border-active);
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font: 700 0.7rem var(--font-mono);
  cursor: pointer;
  transition: var(--transition-fast);
}
.audio-skip-btn:hover,
.audio-skip-btn:focus-visible {
  border-color: var(--accent-link);
  color: var(--accent-link);
  transform: translateY(-1px);
}

.audio-info {
  flex-grow: 1;
}

.track-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.time-display {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Progress bar */
.progress-bar-container {
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
body.light-theme .progress-bar-container {
  background: rgba(0, 0, 0, 0.05);
}
.progress-bar-fill {
  height: 100%;
  background: var(--text-primary);
  width: 0%;
  border-radius: 2px;
  pointer-events: none;
}

/* Filters in Sidebar */
.filter-section {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  text-align: left;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}
.filter-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}
body.light-theme .filter-btn:hover {
  background: rgba(0, 0, 0, 0.03);
}
.filter-btn.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  font-weight: 700;
}

.playlist-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 6px;
  color: var(--accent-arrest);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.playlist-link:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-arrest);
}
body.light-theme .filter-btn.active {
  background: rgba(0, 0, 0, 0.04);
}

.sidebar-footer {
  margin-top: 20px;
  padding-bottom: 24px;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dimmed);
  line-height: 1.4;
}

.sidebar-footer a {
  color: var(--accent-link);
  text-decoration: none;
  border-bottom: 1px solid var(--text-dimmed);
}
.sidebar-footer a:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.disclaimer-panel {
  margin-top: 12px;
  color: var(--text-dimmed);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  line-height: 1.45;
}

/* 2. Right Timeline Panel (Horizontal scrolling) */
.timeline-container {
  flex-grow: 1;
  height: 100vh;
  overflow-x: auto;
  overflow-y: auto;
  white-space: nowrap;
  position: relative;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: auto;
}

/* Custom Scrollbar for timeline container */
.timeline-container::-webkit-scrollbar {
  height: 8px;
}
.timeline-container::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
.timeline-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
body.light-theme .timeline-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}
.timeline-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
body.light-theme .timeline-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

.timeline-track {
  display: inline-flex;
  align-items: flex-start;
  min-height: 100%;
  height: auto;
  padding: 100px 100px 80px;
  position: relative;
}

/* Timeline Horizontal Axis Line */
.timeline-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 72px;
  height: 1px;
  background-color: var(--border-subtle);
  z-index: 1;
}

/* Timeline Node / Card Container */
.timeline-node {
  display: inline-flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  width: 420px;
  margin: 0 50px;
  z-index: 2;
  white-space: normal; /* Restore normal wrap inside cards */
}

/* Filtered nodes are removed from flex flow so scrollWidth shrinks correctly */
.timeline-node.is-filtered-out {
  display: none !important;
}

/* End spacer: reserves trailing room so the last card can fully enter view */
.timeline-end-spacer {
  flex: 0 0 auto;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Date marker on the timeline line */
.node-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--bg-dark);
  border: 2px solid var(--text-dimmed);
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  transition: var(--transition-fast);
  z-index: 5;
}

.timeline-node.active .node-marker {
  background-color: var(--text-primary);
  border-color: var(--text-primary);
  transform: translateY(-50%) scale(1.4);
}

/* Keep every card on the same top-aligned reading row. */
.timeline-node .node-marker {
  top: -32px;
  transform: translateX(0);
}

.timeline-node.active .node-marker {
  transform: translateX(0) scale(1.4);
}

/* Alternate connection lines from dot to card */
.timeline-node::after {
  content: '';
  position: absolute;
  left: 34px;
  width: 1px;
  background-color: var(--border-subtle);
  height: 24px;
  z-index: 1;
}
.timeline-node::after {
  top: -24px;
}

.timeline-node.active::after {
  background-color: rgba(255,255,255,0.2);
}
body.light-theme .timeline-node.active::after {
  background-color: rgba(0,0,0,0.1);
}

/* Card Styling (Editorial, flat, crisp) */
.timeline-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 24px;
  width: 100%;
  transition: var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.event-dismissed .timeline-card {
  border: 2px solid var(--accent-win);
  background: linear-gradient(145deg, var(--bg-card), rgba(16, 185, 129, 0.1));
}

.event-dismissed .node-marker {
  background: var(--accent-win);
  border-color: var(--accent-win);
}

.event-sentencing .timeline-card {
  border-color: var(--border-subtle);
  background: var(--bg-card);
}
.event-sentencing .card-title,
.event-sentencing .date-text { color: var(--text-primary); }

.event-state-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -24px -24px 18px;
  padding: 12px 18px;
  color: #06130e;
  background: var(--accent-win);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.event-state-banner strong,
.event-state-banner small { display: block; }
.event-state-banner strong { font-family: var(--font-mono); font-size: 0.88rem; }
.event-state-banner small { margin-top: 2px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em; text-transform: none; }
.state-icon { font-size: 1.6rem; font-weight: 800; line-height: 1; }

.recording-cutaway {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 18px 0;
  padding: 22px 18px;
  background: #030405;
  border: 1px solid #272a30;
  color: #f7f7f7;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.recording-cutaway .cutaway-kicker {
  color: #e5e7eb;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}
.recording-cutaway strong { font-size: 1rem; }
.recording-cutaway span:last-child { color: #9ca3af; font-size: 0.74rem; }

.video-trail {
  margin-top: 14px;
  padding: 11px 12px;
  border-left: 3px solid #ff0033;
  background: rgba(255, 0, 51, 0.06);
}
.video-trail-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dimmed);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.youtube-mark { color: #ff0033; font-size: 0.85rem; }
.video-trail-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.video-trail-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 0, 51, 0.35);
  background: transparent;
  color: var(--text-primary);
  font: 700 0.7rem var(--font-sans);
  cursor: pointer;
}
.video-trail-link:hover { background: rgba(255, 0, 51, 0.13); border-color: #ff0033; }

.dismissal-stamp {
  position: absolute;
  top: 28px;
  right: 18px;
  z-index: 3;
  padding: 5px 10px;
  border: 2px solid var(--accent-win);
  border-radius: 4px;
  color: var(--accent-win);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  transform: rotate(-9deg);
  opacity: 0.92;
  pointer-events: none;
}

.timeline-node.active .timeline-card {
  border-color: var(--border-active);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
body.light-theme .timeline-node.active .timeline-card {
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

/* Card Illustration Image style */
.card-illustration {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

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

.date-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dimmed);
}

.category-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid transparent;
}

/* Minimal Category Borders */
.timeline-node[data-category="Arrests"] .category-tag {
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--accent-arrest);
}
.timeline-node[data-category="Lawsuits"] .category-tag {
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--accent-lawsuit);
}
.timeline-node[data-category="Milestones"] .category-tag {
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--accent-milestone);
}
.timeline-node[data-category="Wins"] .category-tag {
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-win);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 15px;
}

/* Play Audio Button inside Card */
.play-node-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.play-node-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-active);
}
body.light-theme .play-node-btn:hover {
  background: rgba(0, 0, 0, 0.02);
}

.play-node-btn svg {
  fill: currentColor;
  width: 8px;
  height: 8px;
}

/* Expandable content area */
.card-details {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 15px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.card-details p,
.detail-section p,
.modal-body p {
  margin: 0 0 0.9rem;
}

.card-details p:last-child,
.detail-section p:last-child,
.modal-body p:last-child {
  margin-bottom: 0;
}

.card-source {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.card-source span {
  color: var(--text-dimmed);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-source a {
  color: var(--accent-link);
  text-decoration: none;
}

.card-source a:hover {
  text-decoration: underline;
}

.detail-section {
  margin-bottom: 10px;
}
.detail-section:last-child {
  margin-bottom: 0;
}
.detail-section strong {
  color: var(--text-primary);
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.detail-section a {
  color: var(--accent-link);
  text-decoration: none;
}
.detail-section a:hover {
  text-decoration: underline;
}

/* Actions footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.expand-btn {
  background: transparent;
  border: none;
  color: var(--text-dimmed);
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
}
.expand-btn:hover {
  color: var(--text-primary);
}

/* 3. Global Info overlay for scrolling */
.scroll-indicator {
  position: absolute;
  bottom: 178px;
  right: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dimmed);
  background: var(--bg-sidebar);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  z-index: 5;
  pointer-events: none;
}

.mobile-archive-link {
  display: none;
}

.scroll-indicator svg {
  fill: currentColor;
  width: 12px;
  height: 12px;
}

/* Hopping mascot that travels with horizontal timeline progress. */
.scroll-kangaroo {
  position: fixed;
  left: 30px;
  bottom: 18px;
  z-index: 101;
  font-size: 2.15rem;
  line-height: 1;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.24));
  pointer-events: none;
  transform: scaleX(-1);
}

.scroll-kangaroo.hopping {
  animation: kangaroo-hop 0.42s ease-out;
}

@keyframes kangaroo-hop {
  0% { transform: translateY(0) scaleX(-1) rotate(0deg); }
  45% { transform: translateY(-34px) scaleX(-1) rotate(-5deg); }
  100% { transform: translateY(0) scaleX(-1) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-kangaroo.hopping { animation: none; }
}

/* 4. Gamified HUD Panel - 3x2 Compact Layout */
.hud-panel {
  position: fixed;
  top: auto;
  bottom: 24px;
  right: 40px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 24px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  pointer-events: none; /* Let clicks pass through */
}
body.light-theme .hud-panel {
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
}

/* Borders between items */
.hud-item:not(:nth-child(3n)) {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  padding-right: 12px;
}
body.light-theme .hud-item:not(:nth-child(3n)) {
  border-right-color: rgba(0, 0, 0, 0.04);
}

.hud-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dimmed);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  white-space: nowrap;
}

.hud-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  transition: var(--transition-fast);
}

/* Specific color highlight based on metrics */
.hud-item.filed-active .hud-value { color: var(--text-primary); }
.hud-item.dropped-active .hud-value { color: var(--accent-win); }
.hud-item.charges-active .hud-value { color: var(--accent-arrest); }
.hud-item.jail-active .hud-value { color: var(--accent-lawsuit); }
.hud-item.felonies-active .hud-value { color: var(--accent-arrest); }
.hud-item.probation-active .hud-value { color: var(--accent-milestone); }

/* Pulse animation for HUD when numbers tick */
@keyframes hud-tick {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); filter: brightness(1.3); }
  100% { transform: scale(1); }
}

.hud-value.tick {
  animation: hud-tick 0.25s ease-out;
}

.hud-helper {
  display: none;
}

.youtube-unavailable {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-dimmed);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

/* Timeline Year Markers */
.timeline-year-marker {
  position: absolute;
  top: 30px;
  height: calc(100% - 60px);
  border-left: 1px dashed var(--border-active);
  padding-left: 15px;
  z-index: 1;
  pointer-events: none;
}

.timeline-year-marker span {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  opacity: 0.15;
  letter-spacing: 0.05em;
  position: sticky;
  top: 30px;
  display: block;
}

body.light-theme .timeline-year-marker span {
  opacity: 0.1;
}

/* Media Query for small viewports */
@media (max-width: 900px) {
  body {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 30px 20px;
  }
  
  .timeline-container {
    height: calc(100svh - 300px);
    min-height: 500px;
    overflow-x: auto;
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: none;
  }
  
  .timeline-track {
    padding: 84px 6vw 60px;
    padding-inline-end: max(5vw, 48px);
    scroll-snap-type: none;
  }
  
  .timeline-node {
    width: min(78vw, 380px);
    margin: 0 3vw;
    scroll-snap-align: center;
    scroll-snap-stop: normal;
  }

  .timeline-card { padding: 18px; }
  .event-state-banner { margin: -18px -18px 16px; padding: 11px 14px; }
  .card-illustration { height: 135px; }
  .scroll-indicator { right: 12px; bottom: 14px; max-width: calc(100vw - 24px); font-size: 0.62rem; }
  .scroll-kangaroo { bottom: 46px; font-size: 2rem; }

  .hud-panel {
    position: relative;
    top: 0;
    bottom: auto;
    right: 0;
    box-shadow: none;
    width: 100%;
    border: none;
    border-top: 1px solid var(--border-subtle);
    border-radius: 0;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px 10px;
  }

  .hud-item:not(:nth-child(3n)) {
    border-right: none;
    padding-right: 0;
  }
}

@media (max-width: 600px) {
  /* Legacy mobile tweaks — do NOT hide campaign/footer/player chrome (GROK rules win) */
  .sidebar { padding: 18px 16px; }
  .brand-section { margin-bottom: 12px; }
  h1 { font-size: 1.65rem; }
  .tagline { margin-bottom: 14px; font-size: 0.82rem; }
  .filter-section { margin: 14px 0; gap: 4px; }
  .filter-btn, .playlist-link { padding: 8px 12px; font-size: 0.72rem; }
  .audio-info { min-width: 0; }
  .hud-panel { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 8px 8px; }
  .hud-panel .hud-item:nth-child(3),
  .hud-panel .hud-item:nth-child(5),
  .hud-panel .hud-item:nth-child(6) { display: none; }
  .hud-helper {
    display: block;
    grid-column: 1 / -1;
    color: var(--text-dimmed);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .hud-label { font-size: 0.55rem; }
  .hud-value { font-size: 1rem; }
  .timeline-container {
    height: auto;
    min-height: 430px;
    overflow-y: hidden;
    overflow-x: auto;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: auto;
    scroll-snap-type: none;
  }
  .timeline-track {
    padding-top: 72px;
    padding-inline-end: max(5vw, 48px);
    scroll-snap-type: none;
  }
  .timeline-node { width: 78vw; }
  .audio-controls-row { flex-wrap: wrap; }
  .play-node-btn { font-size: 0.68rem; padding: 6px 8px; }
  .scroll-indicator { display: none; }
  .mobile-archive-link {
    /* Out of flex flow so showing/hiding never changes scrollWidth */
    position: absolute;
    right: max(5vw, 12px);
    top: 56%;
    transform: translateY(-50%);
    display: inline-flex;
    z-index: 6;
    margin: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 160ms ease;
  }
  .timeline-container.timeline-at-end .mobile-archive-link {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
}

/* ==========================================
   CASE DETAILS MODAL STYLING
   ========================================== */

/* Clickable trigger links inside timeline text */
.case-trigger {
  color: var(--accent-link);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 700;
  transition: var(--transition-fast);
}

.case-records {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.case-records-label {
  margin-bottom: 8px;
  color: var(--text-dimmed);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.case-record-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.case-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 4px;
  padding: 5px 7px;
  background: rgba(125, 211, 252, 0.06);
  color: var(--accent-link);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-decoration: none;
}

.case-link:hover {
  background: rgba(125, 211, 252, 0.14);
  border-color: var(--accent-link);
}

.case-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.case-disposition {
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.68rem;
}
.case-trigger:hover {
  color: var(--text-primary);
  opacity: 0.85;
}

/* Modal dialog container */
.case-modal {
  width: 90%;
  max-width: 850px;
  max-height: 85vh;
  border-radius: 12px;
  border: 1px solid var(--border-active);
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  padding: 0;
  overflow: hidden;
  margin: auto;
  z-index: 1000;
}

.modal-disclaimer {
  margin-top: 18px;
  color: var(--text-dimmed);
  font-size: 0.72rem;
  line-height: 1.45;
}

/* Backdrop overlay */
.case-modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header style */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-sidebar);
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0 4px;
}
.close-modal-btn:hover {
  color: var(--accent-arrest);
}

/* Modal Body */
.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 80px);
}

.youtube-modal {
  width: min(900px, calc(100vw - 32px));
}

.youtube-modal-body {
  padding: 0;
  background: #000;
}

.youtube-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.youtube-fallback {
  padding: 32px;
  background: var(--bg-card);
  color: var(--text-secondary);
}

.youtube-fallback a {
  color: var(--accent-link);
}

/* Loading and Error States */
.loading-state, .error-state {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 40px 0;
}
.error-state {
  color: var(--accent-arrest);
}

/* Court metadata layout */
.case-info-block {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 25px;
  background-color: var(--bg-dark);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.case-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.case-info-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dimmed);
  text-transform: uppercase;
}
.case-info-value {
  font-size: 0.92rem;
  font-weight: 600;
}
.case-caption {
  grid-column: span 2;
}

/* Sections inside modal */
.modal-section {
  margin-bottom: 30px;
}
.modal-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
}

/* Table layouts in modal */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-dark);
}

.modal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}
.modal-table th, .modal-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.modal-table th {
  background-color: var(--bg-sidebar);
  font-weight: 700;
  color: var(--text-primary);
}
.modal-table tr:last-child td {
  border-bottom: none;
}

/* Highlight the guilty/conviction row */
.modal-table tr.guilty-row {
  background-color: rgba(16, 185, 129, 0.08); /* Soft win green highlight */
}
.modal-table tr.guilty-row td {
  color: var(--text-primary);
  font-weight: 600;
}
.badge-guilty {
  background-color: var(--accent-win);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-dismissed {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}
body.light-theme .badge-dismissed {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Document List styling */
.doc-list {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background-color: var(--bg-dark);
}
.doc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.88rem;
}
.doc-item:last-child {
  border-bottom: none;
}
.doc-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  padding-right: 15px;
}
.doc-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}
body.light-theme .doc-badge {
  background-color: rgba(0, 0, 0, 0.05);
}
.doc-caption {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.doc-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dimmed);
}

/* Custom Scrollbars inside modal elements */
.modal-body::-webkit-scrollbar,
.doc-list::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.modal-body::-webkit-scrollbar-track,
.doc-list::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.modal-body::-webkit-scrollbar-thumb,
.doc-list::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 3px;
}

/* Responsive modal formatting */
@media (max-width: 600px) {
  .case-info-block {
    grid-template-columns: 1fr;
  }
  .case-caption {
    grid-column: span 1;
  }
  .modal-body {
    padding: 16px;
  }
}

/* ==========================================
   🖨️ PRINT RULES (Resolves cutoff dockets)
   ========================================== */
@media print {
  /* Hide the rest of the application completely */
  body > * {
    display: none !important;
  }

  /* Force display only the modal, taking up the full page size */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    overflow: visible !important;
  }

  .case-modal, dialog[open] {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
  }

  .modal-content, .modal-body {
    overflow: visible !important;
    max-height: none !important;
    padding: 0 !important;
  }

  .modal-header {
    border-bottom: 2px solid #000000 !important;
    padding: 10px 0 !important;
    background: transparent !important;
  }
  .close-modal-btn {
    display: none !important; /* Hide close button in printout */
  }

  .case-info-block {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #000000 !important;
  }

  .table-wrapper, .doc-list {
    overflow: visible !important;
    max-height: none !important;
    border: none !important;
    background: transparent !important;
  }

  .modal-table {
    page-break-inside: avoid !important;
  }
  .modal-table th {
    background-color: #f1f3f5 !important;
    color: #000000 !important;
    border-bottom: 2px solid #dee2e6 !important;
  }
  .modal-table td {
    border-bottom: 1px solid #dee2e6 !important;
    color: #000000 !important;
  }

  .doc-item {
    page-break-inside: avoid !important;
    border-bottom: 1px solid #dee2e6 !important;
  }
  
  .badge-guilty {
    border: 1px solid #000000 !important;
    background: transparent !important;
    color: #000000 !important;
    padding: 1px 4px !important;
  }
}
.builder-link { margin-top: 18px; font: 700 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.builder-link a { color: var(--text-secondary); }
.builder-link a:hover { color: var(--accent-arrest); }


/* === Grok Build enhancements: live campaign, share, virality, mobile === */
.campaign-card {
  position: relative;
  overflow: hidden;
}
.campaign-card.live-updating .campaign-amount strong {
  animation: amount-pulse 0.6s ease;
}
@keyframes amount-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); color: var(--accent-win); }
  100% { transform: scale(1); }
}
.campaign-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.campaign-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: live-dot 1.6s infinite;
}
@keyframes live-dot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.campaign-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dimmed);
}
.campaign-percent {
  color: var(--accent-win);
  font-weight: 700;
}
.share-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-active);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
  min-height: 44px;
}
.share-btn:hover {
  border-color: var(--accent-link);
  background: rgba(125, 211, 252, 0.08);
  color: var(--accent-link);
}
.share-btn.primary-share {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(239,68,68,0.18), rgba(245,158,11,0.12));
  border-color: rgba(239,68,68,0.35);
}
.share-btn.primary-share:hover {
  border-color: var(--accent-arrest);
  color: var(--text-primary);
}
.viral-strip {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.08);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.viral-strip strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.sister-site-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--accent-link);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.sister-site-link:hover { text-decoration: underline; }
.keyboard-hint {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dimmed);
  margin-top: 8px;
  letter-spacing: 0.02em;
}
.timeline-jump-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(15, 17, 21, 0.88);
  border: 1px solid var(--border-active);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.timeline-jump-bar button {
  min-width: 44px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 12px;
}
.timeline-jump-bar button:hover,
.timeline-jump-bar button.active {
  color: var(--text-primary);
  border-color: var(--border-active);
  background: rgba(255,255,255,0.06);
}
body.light-theme .timeline-jump-bar {
  background: rgba(255,255,255,0.92);
}
@media (max-width: 900px) {
  body {
    overflow: auto;
    height: auto;
    display: block;
  }
  .sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 20px 16px 16px;
  }
  .hud-panel {
    position: sticky;
    top: 0;
    right: auto;
    left: 0;
    width: 100%;
    margin: 0;
    border-radius: 0;
    z-index: 30;
  }
  .timeline-container {
    width: 100%;
    height: auto;
    min-height: 70vh;
  }
  .timeline-jump-bar {
    bottom: 12px;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
  }
  .share-bar {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .campaign-live::before,
  .campaign-card.live-updating .campaign-amount strong {
    animation: none;
  }
}


/* === GROK MOBILE + PLAY + NETWORK v2 === */

.archive-app {
  display: contents;
}

/* Prominent play control */
.play-main-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%) !important;
  color: #fff !important;
  border: none !important;
  width: auto !important;
  min-width: 56px;
  height: 56px !important;
  min-height: 56px !important;
  border-radius: 999px !important;
  flex: 0 0 auto !important;
  aspect-ratio: auto !important;
  padding: 0 18px 0 14px !important;
  gap: 10px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 0 rgba(239, 68, 68, 0.45),
    0 10px 28px rgba(239, 68, 68, 0.28);
  animation: play-pulse 2.4s ease-out infinite;
}
.play-main-btn:hover {
  transform: scale(1.04);
  filter: brightness(1.05);
}
.play-main-btn.is-playing {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.28);
  animation: none;
}
.play-main-btn .play-icon-wrap {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.play-main-btn svg,
.play-main-btn #play-icon,
.play-main-btn #pause-icon {
  fill: #fff !important;
  width: 16px !important;
  height: 16px !important;
  display: block;
}
.play-main-btn .play-label {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #fff;
}
@keyframes play-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5), 0 10px 28px rgba(239, 68, 68, 0.28); }
  70% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0), 0 10px 28px rgba(239, 68, 68, 0.22); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 10px 28px rgba(239, 68, 68, 0.28); }
}

.audio-player-container {
  border-color: rgba(239, 68, 68, 0.25) !important;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.1), rgba(10, 11, 14, 0.92)) !important;
}
.audio-controls { gap: 12px; }

/* Sister network */
.sister-network {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}
.sister-network-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dimmed);
}
.sister-network a {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none !important;
  transition: var(--transition-fast);
  min-height: 44px;
}
.sister-network a:hover {
  border-color: rgba(125, 211, 252, 0.45);
  background: rgba(125, 211, 252, 0.08);
}
.sister-name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.84rem;
}
.sister-desc {
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.35;
}

/* ===== Aggressive mobile: flatten sidebar, timeline first after play ===== */
@media (max-width: 900px) {
  html {
    overflow-x: hidden;
  }
  body,
  body.archive-active {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100%;
  }

  /* Flatten sidebar so children participate in body order */
  .sidebar {
    display: contents !important;
  }

  .brand-section {
    order: 2;
    padding: 10px 12px 8px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
  }
  /* Keep first screen focused: hide secondary promo chrome in the hero */
  /* Keep multi-platform share panel visible on mobile */
  .brand-section .sister-site-link {
    display: none !important;
  }
  .brand-section .donation-btn {
    display: none; /* campaign card already has donate CTA */
  }
  .brand-meta { margin-bottom: 8px; }
  h1 { font-size: 1.45rem !important; margin: 0 0 6px; line-height: 1.15; }
  .tagline {
    font-size: 0.78rem !important;
    margin-bottom: 10px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .donation-btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
    margin-bottom: 8px;
  }
  .campaign-card {
    display: block !important;
    margin: 0;
    padding: 8px 10px;
  }
  .campaign-card p { display: none; }
  .campaign-meta-row { font-size: 0.62rem; }
  .campaign-amount strong { font-size: 1.05rem; }
  .campaign-amount span { font-size: 0.7rem; }

  /* Fixed full-width PLAY dock — always on screen on mobile */
  .audio-section {
    order: 1;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 12px 12px !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(239, 68, 68, 0.35);
    background: #0a0b0e !important;
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  }
  body.light-theme .audio-section {
    background: #ffffff !important;
  }
  /* Push content below compact fixed player */
  .brand-section {
    scroll-margin-top: 132px;
    padding-top: 132px !important;
  }
  .audio-header {
    margin-bottom: 4px !important;
    font-size: 0.58rem;
  }
  .audio-player-container {
    padding: 8px !important;
    gap: 6px !important;
    border-radius: 12px;
  }
  .audio-controls {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "play play"
      "info skip";
    gap: 10px !important;
    align-items: center;
  }
  .play-main-btn {
    grid-area: play;
    width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    padding: 0 12px !important;
    justify-content: center;
    gap: 8px;
    animation: none !important;
  }
  .play-main-btn .play-label {
    font-size: 0.88rem !important;
    font-weight: 800;
  }
  .play-main-btn .play-icon-wrap {
    width: 26px;
    height: 26px;
  }
  .play-main-btn svg {
    width: 14px !important;
    height: 14px !important;
  }
  .audio-info { grid-area: info; min-width: 0; }
  .track-name { max-width: none !important; font-size: 0.88rem; }
  .audio-skip-btn {
    grid-area: skip;
    min-height: 46px;
    min-width: 66px;
    border-radius: 12px;
    font-size: 0.8rem;
  }
  .progress-bar-container,
  #prog-container {
    height: 10px !important;
    border-radius: 99px;
    background: rgba(255,255,255,0.1);
  }
  .keyboard-hint { display: none !important; }

  /* Chip filters right above timeline */
  .sidebar-top {
    display: contents;
  }
  .filter-section {
    order: 3;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 8px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-section::-webkit-scrollbar { display: none; }
  .filter-btn,
  .playlist-link {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 14px !important;
    min-height: 42px;
    font-size: 0.74rem !important;
    border-radius: 999px !important;
  }
  .filter-section > .playlist-link { display: inline-flex !important; }

  .hud-panel {
    order: 4;
    position: sticky !important;
    top: 0; /* under audio if both sticky — audio wins with higher z */
    z-index: 40;
    width: 100% !important;
    right: auto !important;
    left: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    box-shadow: none;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
    padding: 8px 8px 6px !important;
    background: #0f1115 !important;
    backdrop-filter: none;
  }
  body.light-theme .hud-panel { background: #ffffff !important; }
  .hud-panel .hud-item:nth-child(5),
  .hud-panel .hud-item:nth-child(6) { display: none; }
  .hud-helper {
    display: block !important;
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.58rem !important;
  }
  .hud-label { font-size: 0.5rem !important; }
  .hud-value { font-size: 0.95rem !important; }

  .timeline-container {
    order: 5;
    width: 100% !important;
    height: auto !important;
    min-height: 68vh !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: auto;
    /* proximity still traps some engines short of max scrollLeft; none is freest on touch */
    scroll-snap-type: none;
    scroll-behavior: auto;
    padding-bottom: 96px;
    /* Edge fades as scroll affordance (stay pinned to viewport edges) */
    background:
      linear-gradient(to right, var(--bg-dark) 0%, transparent 100%) left center / 36px 100% no-repeat,
      linear-gradient(to left, var(--bg-dark) 0%, transparent 100%) right center / 36px 100% no-repeat,
      var(--bg-dark);
  }
  .timeline-track {
    padding: 48px 0 80px !important;
    padding-inline-start: 5vw !important;
    /* End padding sized so the last card can fully enter / roughly center */
    padding-inline-end: max(5vw, calc((100vw - min(76vw, 340px)) / 2)) !important;
    scroll-snap-type: none;
  }
  .timeline-node {
    width: min(76vw, 340px) !important;
    margin: 0 2.5vw !important;
    scroll-snap-align: center;
    scroll-snap-stop: normal;
    flex: 0 0 auto;
  }
  .timeline-card { padding: 14px !important; }
  .card-illustration { height: 118px !important; }
  .timeline-end-spacer {
    width: 1px;
    height: 1px;
    visibility: hidden;
  }
  /* Keep swipe helper visible under HUD on mobile */
  .scroll-indicator {
    display: flex !important;
    position: sticky;
    left: auto;
    right: 12px;
    bottom: 12px;
    float: right;
    margin: 0 12px 8px 0;
    max-width: calc(100vw - 24px);
    font-size: 0.62rem;
  }

  .sidebar-footer {
    order: 6;
    display: block !important;
    padding: 16px 12px 100px;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-subtle);
  }
  .sidebar-footer > p,
  .sidebar-footer .disclaimer-panel {
    font-size: 0.72rem;
    color: var(--text-secondary);
  }
  .sidebar-footer .builder-link { margin-top: 10px; }
  .sister-network {
    margin-bottom: 14px;
  }

  .timeline-jump-bar {
    bottom: 10px !important;
    max-width: calc(100vw - 16px);
    overflow-x: auto;
    z-index: 90;
  }
  .share-bar {
    grid-template-columns: 1fr 1fr !important;
  }
  .share-btn.primary-share { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .play-main-btn {
    min-height: 42px !important;
    height: 42px !important;
  }
  .play-main-btn .play-label { font-size: 0.84rem !important; }
  .brand-section {
    padding-top: 124px !important;
    scroll-margin-top: 124px;
  }
  .hud-panel .hud-item:nth-child(3) { display: none; }
  .timeline-node { width: min(78vw, 320px) !important; }
  .timeline-track {
    padding-inline-end: max(5vw, calc((100vw - min(78vw, 320px)) / 2)) !important;
  }
  /* Collapse campaign detail on very small screens but keep amount */
  .campaign-card-header span:first-child { display: none; }
}

@media (min-width: 901px) {
  .archive-app {
    display: contents;
  }
}

@media (prefers-reduced-motion: reduce) {
  .play-main-btn { animation: none !important; }
}

/* Compact mobile audio dock overrides */
@media (max-width: 900px) {
  .audio-section {
    padding: 6px 10px 8px !important;
  }
  .audio-controls {
    grid-template-columns: auto 1fr auto !important;
    grid-template-areas: "play info skip" !important;
    gap: 8px !important;
    align-items: center !important;
  }
  .play-main-btn {
    width: auto !important;
    min-width: 132px !important;
    max-width: 52vw;
  }
  .audio-skip-btn {
    min-height: 40px !important;
    min-width: 48px !important;
    height: 40px;
    font-size: 0.7rem !important;
    padding: 0 8px !important;
  }
  .track-name { font-size: 0.75rem !important; }
  .time-display { font-size: 0.68rem !important; }
  .progress-bar-container,
  #prog-container {
    height: 6px !important;
    margin-top: 2px;
  }
  .brand-section {
    padding-top: 118px !important;
    scroll-margin-top: 118px;
  }
}
@media (max-width: 600px) {
  .brand-section {
    padding-top: 112px !important;
    scroll-margin-top: 112px;
  }
  .play-main-btn {
    min-width: 118px !important;
  }
  .play-main-btn .play-label {
    font-size: 0.8rem !important;
  }
}



/* === MOBILE SCROLL + COMPACT PLAYER FINAL === */
@media (max-width: 900px) {
  .timeline-container {
    scroll-snap-type: none !important;
    scroll-behavior: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: auto;
    touch-action: pan-x pan-y;
    /* Edge fades as scroll affordance */
    background:
      linear-gradient(to right, var(--bg-dark) 0%, transparent 100%) left center / 36px 100% no-repeat,
      linear-gradient(to left, var(--bg-dark) 0%, transparent 100%) right center / 36px 100% no-repeat,
      var(--bg-dark);
  }
  .timeline-track {
    scroll-snap-type: none !important;
    /* Enough end padding to fully show / near-center last card — not so much it scrolls off */
    padding-inline-end: max(5vw, calc((100vw - min(78vw, 320px)) / 2)) !important;
  }
  .timeline-node {
    scroll-snap-align: none !important;
    scroll-snap-stop: normal !important;
    width: min(78vw, 320px) !important;
    flex: 0 0 auto;
  }
  .timeline-end-spacer {
    flex: 0 0 1px;
    width: 1px;
    height: 1px;
    pointer-events: none;
    visibility: hidden;
  }
  .mobile-archive-link {
    position: absolute !important;
    right: max(5vw, 12px) !important;
    top: 56% !important;
    transform: translateY(-50%);
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }

  /* Compact fixed audio dock */
  .audio-section {
    padding: 6px 10px 7px !important;
  }
  .audio-header {
    display: flex !important;
    margin-bottom: 4px !important;
    font-size: 0.55rem !important;
  }
  .audio-player-container {
    padding: 6px 8px !important;
    gap: 5px !important;
  }
  .audio-controls {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-areas: none !important;
    gap: 8px !important;
    align-items: center !important;
  }
  .play-main-btn {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 12px 0 10px !important;
    border-radius: 999px !important;
    gap: 6px !important;
    animation: none !important;
    flex: 0 0 auto !important;
  }
  .play-main-btn .play-label {
    font-size: 0.78rem !important;
  }
  .play-main-btn .play-icon-wrap {
    width: 22px !important;
    height: 22px !important;
  }
  .play-main-btn svg {
    width: 12px !important;
    height: 12px !important;
  }
  .audio-skip-btn {
    min-height: 36px !important;
    min-width: 44px !important;
    height: 36px !important;
    font-size: 0.65rem !important;
  }
  .track-name { font-size: 0.72rem !important; max-width: 42vw !important; }
  .time-display { font-size: 0.65rem !important; }
  #prog-container, .progress-bar-container { height: 5px !important; }
  .brand-section {
    padding-top: 108px !important;
    scroll-margin-top: 108px !important;
  }
  .timeline-jump-bar {
    bottom: 8px !important;
  }
  /* Prev/next affordance buttons if present */
  .timeline-nav-fab {
    position: fixed;
    bottom: 56px;
    z-index: 95;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-active);
    background: rgba(15,17,21,0.92);
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  }
  .timeline-nav-fab.prev { left: 10px; }
  .timeline-nav-fab.next { right: 10px; }
  body.light-theme .timeline-nav-fab {
    background: rgba(255,255,255,0.95);
  }
}
@media (max-width: 600px) {
  .brand-section {
    padding-top: 102px !important;
    scroll-margin-top: 102px !important;
  }
  .play-main-btn .play-label { font-size: 0.74rem !important; }
}


/* === MOBILE QA P0 POLISH === */
@media (max-width: 900px) {
  /* Cap timeline height so vertical page scroll doesn't fight horizontal swipe */
  .timeline-container {
    min-height: 0 !important;
    height: min(62vh, 520px) !important;
    max-height: min(62vh, 520px) !important;
    touch-action: pan-x !important;
  }
  .timeline-track {
    min-height: 100%;
    align-items: stretch;
  }
  .timeline-node {
    max-height: calc(min(62vh, 520px) - 48px);
  }
  .timeline-card {
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Footer clears fixed jump bar + FABs */
  .sidebar-footer {
    padding-bottom: 140px !important;
  }
  .sister-network a {
    scroll-margin-bottom: 80px;
  }

  /* Hide year jump bar when not near timeline (JS toggles .jump-bar-hidden) */
  .timeline-jump-bar.jump-bar-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(12px);
  }
  .timeline-jump-bar {
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .timeline-nav-fab:disabled {
    pointer-events: none;
  }
  body.timeline-offscreen .timeline-nav-fab,
  body.timeline-offscreen .timeline-jump-bar {
    opacity: 0 !important;
    pointer-events: none !important;
  }
}



/* === SHARE PANEL === */
.share-panel {
  margin: 12px 0 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.06), rgba(255,255,255,0.02));
}
.share-panel-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dimmed);
  margin-bottom: 10px;
}
.share-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-active);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}
.share-btn:hover {
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(125, 211, 252, 0.1);
  transform: translateY(-1px);
}
.share-btn.primary-share {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 50%, #0ea5e9 100%);
  color: #0a0b0e;
  border-color: transparent;
  font-size: 0.86rem;
  min-height: 46px;
}
.share-btn.primary-share:hover {
  filter: brightness(1.05);
  color: #0a0b0e;
}
.viral-strip {
  margin: 10px 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.viral-strip strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 2px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.viral-strip a { color: var(--accent-link); }
body.light-theme .share-panel {
  background: #f4f8fb;
}
body.light-theme .share-btn {
  background: #fff;
}
@media (max-width: 900px) {
  .share-panel {
    margin-top: 8px;
    padding: 10px;
  }
  .share-bar {
    grid-template-columns: 1fr 1fr;
  }
  .share-btn {
    min-height: 40px;
    font-size: 0.7rem;
  }
}
