/* ============================================
   CRASH DASH - Brand Stylesheet
   "When the Market Breaks, You Don't."
   ============================================ */

:root {
  /* Brand Colors */
  --electric-blue: #0A84FF;
  --navy: #0B1B33;
  --navy-2: #0F2838; /* slightly different navy for page background */
  --mobile-header-blue: #062034; /* darker blue for mobile header */
  --crash-red: #FF3355;
  --recovery-green: #11CC77;
  --split-yellow: #FFDD55;
  --purple-combo: #9D4EDD;
  --orange-extreme: #FF8C42;
  
  /* Grayscale */
  --white: #FFFFFF;
  --light-gray: #E8EBF0;
  --gray: #8E9AAF;
  --dark-gray: #2C3E50;
  
  /* UI Elements */
  --shadow: 0 4px 6px rgba(11, 27, 51, 0.1);
  --shadow-lg: 0 10px 25px rgba(11, 27, 51, 0.15);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

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

html {
  background-color: var(--navy-2);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #E8EBF0;
  color: var(--dark-gray);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */

header {
  background: var(--navy);
  color: var(--white);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Modern search box (desktop + mobile safe) */
.search-box {
  position: relative;
  flex: 1 1 640px; /* wider base so input has more room */
  max-width: 920px;
  min-width: 180px;
  margin: 0 1rem;
}

.search-box input {
  width: 100%;
  padding: 0.6rem 1rem;
  padding-left: 3.2rem; /* keep desktop padding modest; mobile will increase */
  border-radius: 999px;
  border: none;
  background: var(--white);
  box-shadow: 0 6px 20px rgba(2,6,23,0.08), inset 0 -1px 0 rgba(0,0,0,0.02);
  font-size: 1rem;
  color: var(--dark-gray);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.search-box input::placeholder { color: #9aa6b3; }

.search-box input:focus {
  outline: none;
  box-shadow: 0 10px 30px rgba(10,132,255,0.12);
  transform: translateY(-1px);
}

/* magnifier icon as pseudo-element */
.search-box::before {
  content: "";
  position: absolute;
  left: 12px; /* modest left offset for desktop */
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394A3B8'><path d='M10.5 3a7.5 7.5 0 105.303 12.803l4.197 4.197a1 1 0 001.414-1.414l-4.197-4.197A7.5 7.5 0 0010.5 3zm0 2a5.5 5.5 0 110 11 5.5 5.5 0 010-11z'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.95;
  pointer-events: none;
}

@media (max-width: 768px) {
  .search-box { flex: 0 1 60%; margin: 0 0.6rem; max-width: none; }
  /* increase input left padding on tablet/narrow so the icon doesn't overlap text */
  .search-box input { padding-left: 5.6rem; }
  .search-box::before { left: 24px; width: 22px; height: 22px; }
  .header-content { gap: 0.5rem; }
}

/* Keep header items on one line on small viewports, allow search to grow while preserving hamburger/time */
@media (max-width: 640px) {
  .header-content {
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
  }

  .logo-section { flex: 0 0 auto; margin-right: 6px; }

  .search-box {
    flex: 1 1 80%; /* even wider search box on mobile */
    min-width: 140px;
    margin: 0 0.6rem;
  }

  .header-last-update {
    flex: 0 0 auto;
    margin-left: 6px; /* nudge time a bit to the right */
    order: 2;
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .hamburger-menu {
    flex: 0 0 40px; /* slightly smaller fixed size to make more room for search */
    margin-left: 6px;
    order: 3;
  }

  /* ensure search placeholder doesn't overflow header controls */
  .search-box input { font-size: 0.95rem; padding-left: 5.6rem; }

  /* keep the decorative magnifier/hourglass visible on mobile (padding increased to avoid overlap) */
  /* Hide the pseudo-element icon on mobile so the placeholder '⏳ Search' is the sole indicator */
  .search-box::before { display: none !important; }
}

/* Desktop-optimized layout (1200px+) */
@media (min-width: 1200px) {
  .header-content {
    gap: 2rem;
  }
  
  .logo-section {
    order: 1;
  }
  
  .logo {
    height: 65px;
  }
  
  .search-box {
    order: 2;
    flex: 1;
    max-width: 500px;
  }
  
  .header-last-update {
    order: 3;
  }
  
  .nav-and-filters {
    justify-content: center;
  }
  
  .nav-tabs {
    margin-left: 0;
  }
}

/* Hero Section - Desktop Only */
.hero-section {
  display: none;
}

@media (min-width: 1024px) {
  .hero-section {
    display: block;
    text-align: center;
    padding: 3rem 2rem 2rem 2rem;
    background: linear-gradient(135deg, rgba(11, 27, 51, 0.95), rgba(45, 53, 97, 0.95));
    border-bottom: 2px solid rgba(10, 132, 255, 0.3);
  }
  
  .hero-section h1 {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    margin: 0 0 1rem 0;
    background: linear-gradient(135deg, var(--white), var(--electric-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .hero-tagline {
    font-size: 1.3rem;
    color: var(--split-yellow);
    font-style: italic;
    margin: 0.5rem 0;
    font-weight: 500;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
    color: var(--electric-blue);
    font-style: italic;
    margin: 0.5rem 0 0 0;
  }
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  height: 50px;
  width: auto;
}

.brand-text h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin: 0;
}

.tagline {
  font-size: 0.9rem;
  color: var(--electric-blue);
  font-style: italic;
  margin-top: 0.25rem;
}

.tagline-primary {
  font-size: 2.6rem;
  cursor: pointer;
  padding: 0;
  background: var(--white);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

/* ============================================
   HAMBURGER MENU (Mobile Only)
   ============================================ */

.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  flex-shrink: 0;
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-nav-overlay {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 380px; /* widened per user request */
  height: 100%;
  background: linear-gradient(180deg, #14171a 0%, #0f1316 100%);
  box-shadow: -8px 0 40px rgba(2, 6, 23, 0.7);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-nav-overlay.active .mobile-nav-content {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: none;
  background: var(--mobile-header-blue); /* darker mobile header blue */
}

.mobile-nav-logo { display:flex; align-items:center; gap:0.6rem; }
.mobile-logo { display: none; }
.mobile-brand { display: block; color: var(--white); font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }

.mobile-nav-close {
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 2.6rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  transform: translateX(-14px); /* nudge further left to avoid overlapping hamburger */
  z-index: 1003;
}

.mobile-nav-close:hover {
  color: var(--electric-blue);
  transform: translateX(-14px) rotate(90deg);
}

.mobile-nav-content .mobile-nav-links a {
  /* Use a uniform, compact font-size similar to CoinMarketCap */
  font-size: 1.1rem !important;
  line-height: 1.2 !important;
  padding: 0.9rem 1.2rem !important;
  font-weight: 700 !important;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.mobile-nav-links a {
  padding: 0.9rem 1.2rem;
  color: var(--white);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.18s cubic-bezier(.2,.9,.2,1), box-shadow 0.18s ease, background 0.18s ease;
  border-left: 3px solid transparent;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0.45rem 0.55rem; /* spacing so items feel like cards */
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.03));
  box-shadow: 0 4px 10px rgba(2,6,23,0.45), inset 0 -1px 0 rgba(255,255,255,0.02);
}

.mobile-nav-links a:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(2,6,23,0.6);
  background: linear-gradient(180deg, rgba(10,132,255,0.05), rgba(0,0,0,0.04));
  border-left-color: rgba(10,132,255,0.14);
  color: var(--electric-blue);
}

/* separators and chevron like CMC */
.mobile-nav-links a + a { border-top: 1px solid rgba(255,255,255,0.02); }
.mobile-nav-links a::after { content: '›'; position: absolute; right: 20px; color: rgba(255,255,255,0.55); font-size: 0.95rem; }

/* hide inline emoji icons in mobile overlay */
.mobile-nav-content .icon { display: none !important; }
.mobile-nav-content svg { display: none !important; } /* hide inline svg icons inside mobile overlay (Follow on X icon etc) */

/* contact button style */
.mobile-nav-links .contact-button {
  display: block;
  margin: 0.9rem 0.9rem 1.25rem 0.9rem;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(180deg, #0A84FF, #0066CC);
  color: #fff;
  text-align: center;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(10,132,255,0.28), inset 0 -2px 0 rgba(255,255,255,0.06);
}
.mobile-nav-links .contact-button:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(10,132,255,0.36); }

/* ensure menu labels remain one line and readable */
.mobile-nav-links .label { display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.1rem; }

/* make first mobile link smaller (teaser) */
.mobile-nav-links a:first-child { padding: 0.8rem 1.4rem; }
.mobile-nav-links a:first-child .label { font-size: 1.1rem; font-weight: 700; color: rgba(255,255,255,0.95); }

/* ============================================
   NAVIGATION AND FILTERS BAR
   ============================================ */

.nav-and-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  background: var(--navy);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 2rem;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-tabs a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-tabs a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.header-filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: nowrap;
}

.filters-popup-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #0A84FF 0%, #0066CC 100%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

.filters-popup-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
}

.reset-filters-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #FF4D6D 0%, #C9184A 100%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(255, 77, 109, 0.3);
}

.reset-filters-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 77, 109, 0.4);
}

.how-to-use-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.how-to-use-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* COMPACT VIEW MODE TOGGLE */
.view-mode-compact {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.view-toggle-label-compact {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toggle-switch-compact {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  user-select: none;
}

.toggle-track-compact {
  position: relative;
  width: 36px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.toggle-slider-compact {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--electric-blue);
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider-compact.active {
  left: 18px;
  background: var(--electric-blue);
}

.toggle-icon {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.toggle-icon.active {
  color: var(--electric-blue);
  font-weight: 700;
}

/* COMPACT AI TEASER BUTTON */
.ai-teaser-wrapper {
  width: 100%;
  max-width: 600px;
}

.ai-teaser-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  width: 100%;
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
  border: 2px solid #9333EA;
  border-radius: 12px;
  cursor: not-allowed;
  opacity: 1;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.ai-teaser-button .ai-icon {
  font-size: 2rem;
  filter: grayscale(20%);
  flex-shrink: 0;
}

.ai-teaser-button .ai-teaser-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.ai-teaser-button .ai-teaser-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}

.ai-teaser-button .ai-teaser-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: #E9D5FF;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ai-teaser-button .ai-badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* RESPONSIVE TEXT */
.responsive-text {
  font-size: clamp(0.875rem, 2vw, 1rem);
  line-height: 1.6;
}

.responsive-text h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.responsive-text h3 {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.education-panel h2.responsive-text {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.education-panel h3.responsive-text {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
}

/* Global responsive text for all content sections */
.about-section p, .about-section li,
.guide-section p, .guide-section li,
.faq-item p, .faq-item li,
.phase-card p, .phase-card li,
.audience-card p,
.vision-statement p,
.disclaimer-box p,
.disclaimer-highlight p,
.warning-box p,
.tip-box p,
.goal-box,
.quote-box,
.evolution-timeline p {
  font-size: clamp(0.9rem, 2vw, 1.05rem) !important;
  line-height: 1.8;
}

/* Headings responsive */
.about-section h2, .guide-section h2, .faq-item h3, .phase-card h2 {
  font-size: clamp(1.5rem, 4vw, 2rem) !important;
}

.about-section h3, .guide-section h3 {
  font-size: clamp(1.1rem, 3vw, 1.4rem) !important;
}

/* Hero sections */
.about-hero h1, .guide-hero h1, .faq-hero h1, .roadmap-hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem) !important;
}

.about-hero p, .guide-hero p, .faq-hero p, .roadmap-hero p {
  font-size: clamp(1rem, 3vw, 1.3rem) !important;
}

/* Sticky page title indicator - only visible when scrolling */
.sticky-page-title {
  position: fixed;
  top: 70px; /* moved up for mobile/compact view */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 27, 51, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 480px) {
  .sticky-page-title { top: 60px; }
}

/* Decorative hourglass is visible everywhere (no desktop-only hiding) */

/* Note: phase-card pseudo-elements remain unchanged so hourglass shows on mobile as well */

.sticky-page-title.visible {
  opacity: 1;
}

.roadmap-tagline {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem) !important;
}

/* Rainbow lanes responsive */
.rainbow-lane h4 {
  font-size: clamp(1rem, 2.5vw, 1.2rem) !important;
}

.rainbow-lane p, .rainbow-lane li {
  font-size: clamp(0.85rem, 2vw, 1rem) !important;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* ============================================
   STATS CARDS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* ============================================
   STATS CARDS - COMPACT MODERN DESIGN
   ============================================ */

.stats-grid-compact {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 2rem 2rem 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.stat-card-mini {
  background: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 140px;
  border: 2px solid transparent;
}

.stat-card-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border-color: rgba(17, 204, 119, 0.3);
}

.stat-card-mini.highlight-purple {
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.05), rgba(199, 125, 255, 0.05));
  border-color: rgba(157, 78, 221, 0.2);
}

.stat-card-mini.highlight-purple:hover {
  border-color: rgba(157, 78, 221, 0.5);
  box-shadow: 0 4px 16px rgba(157, 78, 221, 0.2);
}

.stat-card-mini.highlight-red {
  background: linear-gradient(135deg, rgba(255, 51, 85, 0.05), rgba(255, 107, 136, 0.05));
  border-color: rgba(255, 51, 85, 0.2);
}

.stat-card-mini.highlight-red:hover {
  border-color: rgba(255, 51, 85, 0.5);
  box-shadow: 0 4px 16px rgba(255, 51, 85, 0.2);
}

.stat-icon {
  font-size: 1.75rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-value-mini {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.stat-label-mini {
  font-size: 0.7rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Last Update specific styling */
#lastUpdate {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

#lastUpdate .date {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
}

#lastUpdate .time {
  display: block;
  font-size: 0.65rem;
  color: var(--gray);
  font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 768px) {
  /* Show hamburger menu */
  .hamburger-menu {
    display: flex;
  }
  
  .mobile-nav-overlay {
    display: block;
  }
  
  /* Hide desktop navigation */
  .nav-tabs {
    display: none;
  }
  
  .nav-and-filters {
    flex-direction: column;
    padding: 0.5rem 1rem;
    gap: 0.75rem;
  }
  
  .header-filters {
    gap: 0.4rem;
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    order: 2;
  }
  
  .filters-popup-button {
    font-size: 0.75rem;
    padding: 0.45rem 0.8rem;
  }
  
  .reset-filters-btn {
    font-size: 0.7rem;
    padding: 0.35rem 0.7rem;
  }
  
  .view-mode-compact {
    flex-shrink: 0;
  }
  
  .view-toggle-label-compact {
    font-size: 0.7rem;
  }
  
  .toggle-switch-compact {
    gap: 0.2rem;
  }
  
  .toggle-track-compact {
    width: 32px;
    height: 18px;
  }
  
  .toggle-slider-compact {
    width: 14px;
    height: 14px;
  }
  
  .toggle-slider-compact.active {
    left: 16px;
  }
  
  .toggle-icon {
    font-size: 0.8rem;
  }
  
  .how-to-use-btn {
    font-size: 0.75rem;
    padding: 0.45rem 0.8rem;
  }
  
  .stats-grid-compact {
    gap: 0.35rem;
    margin: 0.5rem 0.5rem;
    padding: 0;
  }
  
  .stat-card-mini {
    min-width: 70px;
    padding: 0.35rem 0.5rem;
  }
  
  .stat-icon {
    font-size: 0.9rem;
  }
  
  .stat-value-mini {
    font-size: 0.85rem;
  }
  
  .stat-label-mini {
    font-size: 0.55rem;
  }
}

/* ============================================
   OLD STATS CARDS (KEEP FOR COMPATIBILITY)
   ============================================ */

.stat-card {
  background: var(--white);
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--navy);
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
}

/* ============================================
   VIEW MODE TOGGLE SWITCH
   ============================================ */

.view-mode-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 2rem;
  flex-wrap: wrap;
}

.view-toggle-label {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
}

.toggle-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.toggle-track {
  position: relative;
  width: 60px;
  height: 32px;
  background: linear-gradient(135deg, #FF8C42, #FFB347);
  border-radius: 20px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 25px;
  height: 25px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.toggle-slider.active {
  transform: translateX(28px);
}

.toggle-option {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray);
  transition: color 0.3s ease;
}

.toggle-option.active {
  color: var(--electric-blue);
  font-weight: 700;
}

.view-mode-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--gray);
  font-style: italic;
  flex-basis: 100%;
}

/* ============================================
   SMARTREPORT AI TEASER
   ============================================ */

.ai-teaser-section {
  margin: 1rem 2rem 1rem auto;
  max-width: 600px;
  position: relative;
  overflow: hidden;
}

.ai-teaser-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.ai-icon {
  font-size: 1.2rem;
  line-height: 1;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.ai-teaser-content {
  flex: 1;
  text-align: left;
}

.ai-teaser-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.ai-teaser-subtitle {
  font-size: 0.65rem;
  color: var(--gray);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.ai-badge {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.ai-teaser-hint {
  display: none;
}

/* ============================================
   FILTERS
   ============================================ */

/* ============================================
   COMPACT FILTERS - 2025 GLASSMORPHISM DESIGN
   ============================================ */

/* HEADER FILTERS - Ultra Compact */
.filters-section-header {
  background: rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 1rem;
  margin: 0;
}

.filters-inline-header {
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  max-width: 1400px;
  margin: 0 auto;
}

.filter-compact-header {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
}

.filter-compact-header label {
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.filter-compact-header select {
  padding: 0.25rem 0.4rem;
  padding-right: 1.5rem;
  font-size: 0.7rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.3rem center;
  background-size: 8px;
  min-width: 80px;
}

.filter-compact-header select:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: white;
}

.filter-compact-header select:focus {
  outline: none;
  border-color: #0A84FF;
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.2);
}

.reset-filters-header {
  padding: 0.25rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--white);
  background: rgba(255, 77, 109, 0.2);
  border: 1px solid rgba(255, 77, 109, 0.4);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.reset-filters-header:hover {
  background: rgba(255, 77, 109, 0.3);
  transform: translateY(-1px);
}

/* FILTERS POPUP MODAL */
.filters-popup-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #0A84FF 0%, #0066CC 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

.filters-popup-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
}

.filter-count-badge {
  background: rgba(255, 255, 255, 0.3);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
}

.filters-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filters-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.filters-modal-content {
  position: relative;
  background: linear-gradient(135deg, #1a2332 0%, #0f1621 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
}

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

.filters-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filters-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--white);
}

.filters-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.filters-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.filters-modal-body {
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.filter-group select,
.custom-date-inputs input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-group select:focus,
.custom-date-inputs input:focus {
  outline: none;
  border-color: #0A84FF;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.custom-date-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.custom-date-inputs label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.custom-date-inputs input {
  flex: 1;
}

.custom-date-inputs span {
  color: rgba(255, 255, 255, 0.6);
}

.filters-modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0A84FF 0%, #0066CC 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.filters-section-compact {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.filters-section-compact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(17, 204, 119, 0.3) 50%, 
    transparent 100%);
}

.filters-inline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: flex-end;
}

.filter-compact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 110px;
  flex: 1;
}

.filter-compact label {
  font-size: 0.6rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.25rem;
}

.filter-compact select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  padding-right: 2rem;
  font-size: 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 10px;
}

.filter-compact select option {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  padding: 0.5rem;
  color: #1e293b;
  background: white;
}

.filter-compact select:hover {
  border-color: rgba(17, 204, 119, 0.3);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(17, 204, 119, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

.filter-compact select:focus {
  outline: none;
  border-color: rgba(33, 150, 243, 0.5);
  box-shadow: 
    0 4px 20px rgba(33, 150, 243, 0.15),
    0 0 0 3px rgba(33, 150, 243, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

.reset-filters-compact {
  padding: 0.4rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--white);
  background: rgba(255, 77, 109, 0.15);
  border: 1px solid rgba(255, 77, 109, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0;
  white-space: nowrap;
}

.reset-filters-compact::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.2) 50%, 
    transparent 100%);
  transition: left 0.5s ease;
}

.reset-filters-compact:hover::before {
  left: 100%;
}

.reset-filters-compact:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 24px rgba(255, 51, 85, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.reset-filters-compact:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(255, 51, 85, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .filters-section-compact {
    padding: 0.5rem;
    margin: 0.4rem 0.5rem;
    border-radius: 8px;
  }
  
  .filters-inline {
    gap: 0.3rem;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .filter-compact {
    min-width: calc(50% - 0.15rem);
    flex: 0 0 calc(50% - 0.15rem);
  }
  
  .filter-compact label {
    font-size: 0.55rem;
    margin-bottom: 0.2rem;
  }
  
  .filter-compact select {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    padding-right: 1.8rem;
  }
  
  .reset-filters-compact {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    margin-top: 0.25rem;
  }
  
  /* Compact custom date inputs */
  .custom-date-inputs {
    gap: 0.3rem;
  }
  
  .custom-date-inputs label {
    font-size: 0.6rem;
  }
  
  .custom-date-inputs input {
    padding: 0.3rem 0.4rem;
    font-size: 0.65rem;
  }
  
  /* Compact view mode section */
  .view-mode-section {
    margin: 0.5rem;
    gap: 0.5rem;
  }
  
  .view-toggle-label {
    font-size: 0.75rem;
  }
  
  .toggle-track {
    width: 45px;
    height: 24px;
  }
  
  .toggle-slider {
    width: 20px;
    height: 20px;
    top: 2px;
    left: 2px;
  }
  
  .toggle-option {
    font-size: 0.7rem;
  }
  
  /* Smaller AI teaser button */
  .ai-teaser-section {
    padding: 0.4rem 0.6rem;
    margin: 0.5rem;
    max-width: 100%;
  }
  
  .ai-teaser-button {
    padding: 0.3rem 0.5rem;
    gap: 0.3rem;
  }
  
  .ai-icon {
    font-size: 0.9rem;
  }
  
  .ai-teaser-title {
    font-size: 0.7rem;
  }
  
  .ai-teaser-subtitle {
    font-size: 0.55rem;
  }
  
  .ai-badge {
    padding: 0.2rem 0.35rem;
    font-size: 0.5rem;
  }
}

/* ============================================
   OLD FILTERS (KEEP FOR COMPATIBILITY)
   ============================================ */

.filters-section {
  background: var(--white);
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.filter-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #DFE3E8;
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: var(--white);
  transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--electric-blue);
}

.reset-filters {
  padding: 0.75rem 1.5rem;
  background: var(--crash-red);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.reset-filters:hover {
  background: #E02244;
  transform: scale(1.05);
}

/* ============================================
   CUSTOM DATE RANGE INPUTS
   ============================================ */

.custom-date-inputs {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow);
}

.custom-date-inputs label {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.9rem;
}

.custom-date-inputs input[type="date"] {
  padding: 0.6rem;
  border: 2px solid var(--gray);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  color: var(--navy);
}

.custom-date-inputs input[type="date"]:focus {
  outline: none;
  border-color: var(--electric-blue);
}

.custom-date-inputs span {
  font-weight: 700;
  color: var(--gray);
}

/* ============================================
   SIGNAL COLOR BADGES
   ============================================ */

.signal-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.75rem;
  margin-right: 0.25rem;
  text-align: center;
  min-width: 24px;
}

/* Compact badge with enhanced ring */
.signal-badge-compact {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-right: 0.25rem;
  text-align: center;
  min-width: 24px;
  position: relative;
}

.signal-badge-compact.enhanced {
  box-shadow: 0 0 0 2px rgba(157, 78, 221, 0.4);
  animation: pulse-purple 2s ease-in-out infinite;
}

@keyframes pulse-purple {
  0%, 100% { box-shadow: 0 0 0 2px rgba(157, 78, 221, 0.4); }
  50% { box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.6); }
}

.enhanced-ring {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.7rem;
  line-height: 1;
}

/* Enhanced modifier pill */
.enhanced-pill {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(135deg, #9D4EDD, #C77DFF);
  color: var(--white);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.35rem;
  box-shadow: 0 2px 8px rgba(157, 78, 221, 0.3);
  white-space: nowrap;
}

.more-signals {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--gray);
  color: var(--white);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.25rem;
}

.drawdown-badge {
  display: inline-block;
  padding: 0.2rem 0.4rem;
  background: rgba(255, 51, 85, 0.15);
  color: var(--crash-red);
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.5rem;
  border: 1px solid rgba(255, 51, 85, 0.3);
}

.entry-pnl-mini {
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 4px;
  font-weight: 500;
}

.entry-pnl-mini .positive {
  color: var(--rally-green);
  font-weight: 600;
}

.entry-pnl-mini .negative {
  color: var(--crash-red);
  font-weight: 600;
}

.signal-PURPLE {
  background: linear-gradient(135deg, #9D4EDD, #C77DFF);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(157, 78, 221, 0.3);
}

.signal-RED {
  background: linear-gradient(135deg, #FF3355, #FF6B88);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(255, 51, 85, 0.3);
}

.signal-ORANGE {
  background: linear-gradient(135deg, #FF8C42, #FFB347);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(255, 140, 66, 0.3);
}

.signal-GREEN {
  background: linear-gradient(135deg, #11CC77, #4ADE80);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(17, 204, 119, 0.3);
}

.signal-YELLOW {
  background: linear-gradient(135deg, #FFDD55, #FFE999);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(255, 221, 85, 0.3);
}

/* ============================================
   PRICE & P&L COMBINED CELL
   ============================================ */

.price-pnl-cell {
  padding: 0.75rem 1rem !important;
}

.price-pnl-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.trigger-price {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

.pnl-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  min-width: 50px;
  text-align: center;
}

.pnl-badge.positive {
  background: linear-gradient(135deg, #11CC77, #4ADE80);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(17, 204, 119, 0.25);
}

.pnl-badge.negative {
  background: linear-gradient(135deg, #FF3355, #FF6B88);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(255, 51, 85, 0.25);
}

/* ============================================
   SIGNALS TABLE
   ============================================ */

.mobile-scroll-hint {
  display: none;
  background: var(--electric-blue);
  color: var(--white);
  padding: 0.5rem;
  text-align: center;
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  animation: pulse 2s ease-in-out infinite;
}

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

.signals-table-wrapper {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  position: relative;
  scroll-behavior: smooth;
}

/* Scrollbar styling for better visibility */
.signals-table-wrapper::-webkit-scrollbar {
  height: 12px;
}

.signals-table-wrapper::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 6px;
}
.signals-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--electric-blue);
  border-radius: 6px;
  border: 2px solid #e0e0e0;
}
.signals-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #0066cc;
}

.signals-table {
  width: 100%;
  border-collapse: collapse;
}

.signals-table thead {
  background: var(--navy);
  color: var(--white);
}

.signals-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.signals-table th:hover {
  background: rgba(10, 132, 255, 0.2);
}

.signals-table th.sortable::after {
  content: ' ⇅';
  opacity: 0.5;
}

.signals-table th.sort-asc::after {
  content: ' ▲';
  opacity: 1;
  color: var(--electric-blue);
}

.signals-table th.sort-desc::after {
  content: ' ▼';
  opacity: 1;
  color: var(--electric-blue);
}

.signals-table tbody tr {
  border-bottom: 1px solid #E5E7EB;
  transition: var(--transition);
  cursor: pointer;
}

.signals-table tbody tr:hover {
  background: rgba(10, 132, 255, 0.05);
}

/* Compressed mode parent row */
.ticker-parent-row {
  background: linear-gradient(to right, rgba(10, 132, 255, 0.03), transparent);
  font-weight: 600;
  border-left: 4px solid var(--electric-blue);
}

.ticker-parent-row:hover {
  background: rgba(10, 132, 255, 0.1);
}

.ticker-parent-row.expanded {
  background: rgba(10, 132, 255, 0.08);
  border-left-color: var(--recovery-green);
}

/* Compressed mode history rows */
.ticker-history-row {
  background: #F9FAFB;
  font-size: 0.9rem;
  display: none;
  border-left: 4px solid transparent;
  padding-left: 2rem;
}

/* Expanded history rows - distinct darker background with subtle border */
.expanded-history-row {
  background: linear-gradient(to right, rgba(71, 85, 105, 0.06), rgba(71, 85, 105, 0.03)) !important;
  border-left: 3px solid rgba(10, 132, 255, 0.3) !important;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.expanded-history-row:hover {
  background: linear-gradient(to right, rgba(71, 85, 105, 0.1), rgba(71, 85, 105, 0.05)) !important;
  border-left-color: rgba(10, 132, 255, 0.5) !important;
}

.expanded-history-row td {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.ticker-history-row.visible {
  display: table-row;
}

.ticker-history-row:hover {
  background: rgba(10, 132, 255, 0.05);
}

/* Show more row */
.show-more-row {
  background: transparent;
  border: none;
}

.show-more-signals-btn {
  background: rgba(10, 132, 255, 0.06);
  border: 1px solid rgba(10, 132, 255, 0.15);
  cursor: pointer;
  padding: 0.45rem 1.2rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--electric-blue);
  font-weight: 600;
  font-size: 0.72rem;
}

.show-more-signals-btn:hover {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(10, 132, 255, 0.15);
}

.show-more-signals-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(10, 132, 255, 0.1);
}

.show-more-signals-btn svg {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.show-more-signals-btn:hover svg {
  opacity: 1;
}

/* Expand/collapse indicator */
.expand-indicator {
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.expanded .expand-indicator {
  transform: rotate(90deg);
}

.signals-table td {
  padding: 1rem;
  font-size: 0.95rem;
}

.ticker-cell {
  font-weight: 700;
  color: var(--navy);
  font-size: 1.05rem;
  max-width: 200px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.company-name {
  display: block;
  font-size: 0.8rem;
  color: var(--gray);
  font-weight: 400;
  margin-top: 0.25rem;
  white-space: normal;
  word-wrap: break-word;
}

.positive {
  color: var(--recovery-green);
  font-weight: 600;
}

.negative {
  color: var(--crash-red);
  font-weight: 600;
}

/* ============================================
   EXPANDABLE ROW (Metadata Details)
   ============================================ */

.expandable-row {
  display: none;
  background: #F9FAFB;
}

.expandable-row.active {
  display: table-row;
}

.expandable-content {
  padding: 2rem;
  border-top: 3px solid var(--electric-blue);
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.metadata-section h4 {
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--electric-blue);
}

.metadata-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #E5E7EB;
}

.metadata-label {
  font-weight: 600;
  color: var(--gray);
}

.metadata-value {
  font-weight: 700;
  color: var(--navy);
}

.risk-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.risk-flag {
  padding: 0.3rem 0.7rem;
  background: var(--crash-red);
  color: var(--white);
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Split Warning Icon & Tooltip */
.split-warning-icon {
  display: inline-block;
  margin-left: 0.3rem;
  cursor: help;
  font-size: 1rem;
  position: relative;
  animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.split-warning-icon:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px rgba(255, 221, 85, 0.8));
}

/* Custom Tooltip */
.split-warning-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 120%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  color: var(--split-yellow);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: normal;
  max-width: 200px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10000;
  border: 1px solid var(--split-yellow);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.split-warning-icon:hover::after {
  opacity: 1;
}

/* Tooltip arrow */
.split-warning-icon::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--split-yellow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1001;
}

.split-warning-icon:hover::before {
  opacity: 1;
}

/* Split Risk Section - Compact */
.split-risk-section {
  background: linear-gradient(135deg, rgba(255, 221, 85, 0.08), rgba(255, 51, 85, 0.03));
  border: 1px solid var(--split-yellow);
  border-radius: 6px;
  padding: 0.6rem;
  font-size: 0.8rem;
}

.split-risk-section h4 {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.split-risk-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
}

/* Collapsible sections - Compact */
.split-collapsible {
  margin-top: 0.3rem;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.split-collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: rgba(255, 221, 85, 0.1);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.75rem;
  transition: background 0.2s ease;
  user-select: none;
}

.split-collapsible-header:hover {
  background: rgba(255, 221, 85, 0.2);
}

.expand-icon {
  transition: transform 0.3s ease;
  font-size: 0.65rem;
}

.split-collapsible.expanded .expand-icon {
  transform: rotate(180deg);
}

.split-collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 0.6rem;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.split-collapsible.expanded .split-collapsible-content {
  max-height: 500px;
  padding: 0.6rem;
}

.risk-badge-high {
  background: var(--crash-red);
  color: var(--white);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.risk-badge-medium {
  background: var(--split-yellow);
  color: #000;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.risk-badge-none {
  background: var(--recovery-green);
  color: var(--white);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ============================================
   EDUCATION PANEL
   ============================================ */

.education-panel {
  background: linear-gradient(135deg, var(--navy), #1A3A52);
  color: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-top: 2rem;
  box-shadow: var(--shadow-lg);
}

.education-panel h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--electric-blue);
}

.color-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.color-explanation {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  border-left: 4px solid;
}

.color-explanation.purple { border-left-color: var(--purple-combo); }
.color-explanation.red { border-left-color: var(--crash-red); }
.color-explanation.orange { border-left-color: var(--orange-extreme); }
.color-explanation.green { border-left-color: var(--recovery-green); }
.color-explanation.yellow { border-left-color: var(--split-yellow); }

.color-explanation h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.color-explanation p {
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.5;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--gray);
}

.loading::after {
  content: '⚡';
  font-size: 3rem;
  display: block;
  margin-top: 1rem;
  animation: pulse 1.5s infinite;
}

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

.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--gray);
  font-size: 1.2rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  /* Hide desktop-only text */
  .desktop-text {
    display: none;
  }
  
  header {
    padding: 0.5rem 0.75rem;
  }
  
  .header-content {
    flex-direction: row;
    padding: 0;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  
  /* Show small logo on left */
  .logo-section {
    display: flex;
    gap: 0.3rem;
    order: -2;
    flex-shrink: 0;
  }
  
  .logo {
    height: 32px;
  }
  
  .brand-text {
    display: none;
  }
  
  /* Search in middle */
  .search-box {
    order: -1;
    flex: 0 1 auto;
    max-width: 50%;
    min-width: 120px;
    margin: 0;
  }
  
  .search-box input {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  
  /* Show compact nav below header */
  header nav {
    width: 100%;
    gap: 0.25rem !important;
    margin: 0.4rem 0 0 0 !important;
    justify-content: space-between;
    order: 10;
  }
  
  header nav a {
    font-size: 0.6rem !important;
    padding: 0.25rem 0.35rem !important;
    flex: 1;
    text-align: center;
  }
  
  /* Move last update stat to header on mobile */
  .stats-grid-compact .stat-card-mini:last-child {
    display: none;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  /* Hide stats on mobile */
  .stats-grid-compact {
    display: none;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  /* Hide mobile scroll hint - no scroll needed */
  .mobile-scroll-hint {
    display: none;
  }
  
  /* Make table fit viewport without scrolling */
  .signals-table-wrapper {
    width: 100%;
    overflow-x: visible;
  }
  
  .signals-table {
    font-size: 0.7rem;
    width: 100%;
    table-layout: auto;
  }
  
  .signals-table th,
  .signals-table td {
    padding: 0.4rem 0.25rem;
    font-size: 0.7rem;
    overflow: visible;
  }
  
  /* Ticker cell wraps text */
  .ticker-cell {
    white-space: normal;
  }
  
  /* Remove specific column width constraints */
  .signals-table th:nth-child(2),
  .signals-table td:nth-child(2),
  .signals-table th:nth-child(3),
  .signals-table td:nth-child(3),
  .signals-table th:nth-child(4),
  .signals-table td:nth-child(4) {
    width: auto;
    padding: 0.4rem 0.2rem !important;
  }
  
  .company-name {
    font-size: 0.6rem !important;
    word-wrap: break-word;
    line-height: 1.2;
  }
  
  /* Compact metadata in ticker cell */
  .ticker-meta {
    font-size: 0.55rem !important;
    line-height: 1.2;
  }
  
  /* Make signal badges smaller on mobile */
  .signal-badge-compact {
    padding: 0.08rem 0.2rem;
    font-size: 0.55rem;
    min-width: 18px;
    margin-right: 0.1rem;
    border-radius: 8px;
  }
  
  .signal-badge {
    padding: 0.1rem 0.25rem;
    font-size: 0.5rem;
    min-width: 18px;
    border-radius: 8px;
  }
  
  .more-signals {
    padding: 0.1rem 0.25rem;
    font-size: 0.5rem;
    margin-left: 0.1rem;
    border-radius: 8px;
  }
  
  /* Smaller enhanced pill on mobile */
  .enhanced-pill {
    padding: 0.15rem 0.3rem;
    font-size: 0.55rem;
  }
  
  /* Adjust P&L display for mobile */
  .price-pnl-container {
    flex-direction: column;
    gap: 2px;
  }
  
  .trigger-price {
    font-size: 0.65rem !important;
  }
  
  .pnl-badge {
    font-size: 0.7rem !important;
  }
  
  /* Compact AI score */
  .signals-table td:nth-child(3) {
    font-size: 0.75rem;
  }
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
}

footer p {
  opacity: 0.7;
  font-size: 0.9rem;
}


/* ============================================
   COMPANY INFO BUTTON & MODAL
   ============================================ */

.info-button {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.1), rgba(10, 132, 255, 0.15));
  border: 1.5px solid rgba(10, 132, 255, 0.3);
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  color: var(--electric-blue);
}

.info-button:hover {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.2), rgba(10, 132, 255, 0.25));
  border-color: var(--electric-blue);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

.company-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.company-modal-content {
  background: linear-gradient(135deg, var(--navy), #1A3A52);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.company-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
  border-bottom: 2px solid rgba(10, 132, 255, 0.3);
}

.company-modal-header h2 {
  color: var(--white);
  font-size: 1.5rem;
  margin: 0;
  font-weight: 900;
}

.modal-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.company-modal-body {
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 100px);
  color: var(--white);
}

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

@media (max-width: 768px) {
  .company-modal-content {
    max-height: 90vh;
  }
  
  .company-modal-body {
    max-height: calc(90vh - 90px);
  }
  
  .metadata-grid {
    display: grid;
    gap: 0.5rem;
  }
}

/* ============================================
   COMPANY INFO BUTTON & MODAL
   ============================================ */

.info-button {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.1), rgba(10, 132, 255, 0.15));
  border: 1.5px solid rgba(10, 132, 255, 0.3);
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  color: var(--electric-blue);
}

.info-button:hover {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.2), rgba(10, 132, 255, 0.25));
  border-color: var(--electric-blue);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.3);
}

.company-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.company-modal-content {
  background: linear-gradient(135deg, var(--navy), #1A3A52);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.company-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
  border-bottom: 2px solid rgba(10, 132, 255, 0.3);
}

.company-modal-header h2 {
  color: var(--white);
  font-size: 1.5rem;
  margin: 0;
  font-weight: 900;
}

.modal-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.company-modal-body {
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 100px);
  color: var(--white);
}

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

@media (max-width: 768px) {
  .company-modal-content {
    max-height: 90vh;
  }
  
  .company-modal-body {
    max-height: calc(90vh - 90px);
  }
  
  .metadata-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Modal-specific metadata styling - OVERRIDE default light theme */
.company-modal-body .metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.company-modal-body .metadata-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid rgba(10, 132, 255, 0.2);
}

.company-modal-body .metadata-section h4 {
  color: var(--white);
  font-size: 1rem;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(10, 132, 255, 0.4);
  font-weight: 700;
}

.company-modal-body .metadata-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.company-modal-body .metadata-item:last-child {
  border-bottom: none;
}

.company-modal-body .metadata-label {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.company-modal-body .metadata-value {
  font-weight: 700;
  color: var(--white);
  text-align: right;
  font-size: 0.9rem;
}

.company-modal-body .metadata-value.positive {
  color: var(--crash-green);
}

.company-modal-body .metadata-value.negative {
  color: var(--crash-red);
}

.company-modal-body .risk-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.company-modal-body .risk-flag {
  padding: 0.4rem 0.8rem;
  background: var(--crash-red);
  color: var(--white);
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Split Warning Glow on Info Button */
.info-button.split-warning {
  border-color: var(--split-yellow) !important;
  background: linear-gradient(135deg, rgba(255, 221, 85, 0.15), rgba(255, 221, 85, 0.2)) !important;
  animation: pulse-split-glow 2s ease-in-out infinite !important;
  box-shadow: 0 0 12px rgba(255, 221, 85, 0.4) !important;
  border-radius: 50% !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  flex-shrink: 0 !important;
}

.info-button.split-warning:hover {
  background: linear-gradient(135deg, rgba(255, 221, 85, 0.25), rgba(255, 221, 85, 0.3)) !important;
  box-shadow: 0 0 20px rgba(255, 221, 85, 0.7) !important;
  transform: scale(1.1);
}

@keyframes pulse-split-glow {
  0%, 100% { 
    box-shadow: 0 0 12px rgba(255, 221, 85, 0.4);
  }
  50% { 
    box-shadow: 0 0 20px rgba(255, 221, 85, 0.7);
  }
}

/* Split Risk Section in Modal */
.company-modal-body .split-risk-section {
  background: linear-gradient(135deg, rgba(255, 221, 85, 0.1), rgba(255, 51, 85, 0.05));
  border: 1px solid rgba(255, 221, 85, 0.3);
  margin-bottom: 2rem;
}

.company-modal-body .split-risk-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.company-modal-body .risk-badge-high,
.company-modal-body .risk-badge-medium,
.company-modal-body .risk-badge-low {
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.company-modal-body .risk-badge-high {
  background: var(--crash-red);
  color: var(--white);
}

.company-modal-body .risk-badge-medium {
  background: var(--split-yellow);
  color: var(--navy);
}

.company-modal-body .risk-badge-low {
  background: var(--crash-green);
  color: var(--white);
}

.company-modal-body .split-collapsible {
  margin-top: 0.75rem;
}

.company-modal-body .split-collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.company-modal-body .split-collapsible-header:hover {
  background: rgba(255, 255, 255, 0.1);
}

.company-modal-body .split-collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.company-modal-body .split-collapsible.expanded .split-collapsible-content {
  max-height: 500px;
  padding: 0.75rem 0.5rem;
  margin-top: 0.5rem;
  overflow-y: auto;
}

.company-modal-body .split-collapsible .expand-icon {
  transition: transform 0.3s ease;
}

.company-modal-body .split-collapsible.expanded .expand-icon {
  transform: rotate(180deg);
}

/* Ensure last section in modal has proper bottom spacing */
.company-modal-body .metadata-section:last-child {
  margin-bottom: 0;
  padding-bottom: 1rem;
}

.company-modal-body .metadata-grid > .metadata-section:last-child {
  margin-bottom: 1.5rem;
}

/* ============================================
   ONBOARDING DRAWER
   ============================================ */

.onboarding-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1a2332 0%, #0f1621 100%);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
  max-height: 85vh;
  overflow-y: auto;
}

.onboarding-drawer.active {
  transform: translateY(0);
}

.onboarding-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
}

.onboarding-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  color: var(--gray);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.onboarding-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--navy);
}

.onboarding-content h2 {
  color: var(--split-yellow);
  font-size: 1.8rem;
  margin: 0 0 1.5rem 0;
  font-weight: 700;
}

.onboarding-content .guide-section-title {
  color: var(--electric-blue);
  font-size: 1.4rem;
  margin: 2rem 0 1rem 0;
  font-weight: 700;
  border-bottom: 2px solid var(--electric-blue);
  padding-bottom: 0.5rem;
}

.onboarding-content .guide-section-title:first-of-type {
  margin-top: 1rem;
}

.onboarding-content .step {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-left: 4px solid var(--electric-blue);
  padding: 1.2rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.onboarding-content .step strong {
  color: var(--white);
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.5rem;
}

.onboarding-content .step em {
  color: rgba(255, 255, 255, 0.7);
}

/* Color-coded signal tiles */
.onboarding-content .step-purple {
  background: linear-gradient(135deg, #6B21A8, #7C3AED);
  border-left-color: #A78BFA;
}

.onboarding-content .step-red {
  background: linear-gradient(135deg, #B91C1C, #DC2626);
  border-left-color: #F87171;
}

.onboarding-content .step-orange {
  background: linear-gradient(135deg, #C2410C, #EA580C);
  border-left-color: #FB923C;
}

.onboarding-content .step-green {
  background: linear-gradient(135deg, #047857, #059669);
  border-left-color: #34D399;
}

.onboarding-content .step-yellow {
  background: linear-gradient(135deg, #A16207, #CA8A04);
  border-left-color: #FCD34D;
}

/* Scroll-to-top button */
.scroll-top-btn {
  /* default/floating style (will be overridden when used inline) */
  position: fixed;
  right: 18px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 6px 18px rgba(11,27,51,0.25);
  cursor: pointer;
  z-index: 3000;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Inline (under-disclaimer) presentation */
.scroll-top-btn.inline {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--electric-blue), #0066cc);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 6px 18px rgba(10,132,255,0.18);
  transform: none;
  opacity: 1;
  margin: 1rem auto 0 auto;
}

.scroll-top-btn.inline svg {
  width: 18px;
  height: 18px;
}


.onboarding-content .primary-cta {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--electric-blue), #0066cc);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

.onboarding-content .primary-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(10, 132, 255, 0.4);
}

@media (max-width: 768px) {
  .onboarding-content {
    padding: 1.5rem 1rem;
  }
  
  .onboarding-content h2 {
    font-size: 1.5rem;
    margin-right: 40px;
  }
  
  .onboarding-content .step {
    padding: 1rem;
    font-size: 0.95rem;
  }
}

