/* =====================================================
   PAGE 1 - HOMEPAGE WITH DASHBOARD CATEGORIES
   ===================================================== */

/* Import fonts for modern look */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* =====================================================
   HOMEPAGE CARD & GRID LAYOUT
   ===================================================== */
#homepage {
  width: 100%;
  height: 100%;
}

#homepage .homepage-card {
  padding: 30px 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#homepage .homepage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  width: 100%;
  height: calc(100vh - 170px);
}


/* =====================================================
   HOMEPAGE SECTION CARDS
   ===================================================== */
#homepage .homepage-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(180deg, rgba(40, 40, 45, 0.9) 0%, rgba(30, 30, 35, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 0;
}

#homepage .homepage-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--section-color, #f7931a), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#homepage .homepage-section:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

#homepage .homepage-section:hover::before {
  opacity: 1;
}

/* Inactive section state (toggled off in settings) */
#homepage .homepage-section.section-inactive {
  opacity: 0.35;
  pointer-events: none;
}

#homepage .homepage-section.section-inactive .section-icon {
  filter: grayscale(1);
}

#homepage .homepage-section.section-inactive .section-arrow {
  display: none;
}

.inactive-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Section Icon */
#homepage .section-icon {
  width: 70px;
  height: 70px;
  min-width: 70px;
  min-height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  transition: all 0.3s ease;
  aspect-ratio: 1;
}

#homepage .section-icon i {
  font-size: 32px;
  color: var(--section-color, #f7931a);
  transition: transform 0.3s ease;
}

#homepage .homepage-section:hover .section-icon {
  transform: scale(1.1);
}

#homepage .homepage-section:hover .section-icon i {
  transform: scale(1.1);
}

/* Section Content */
#homepage .section-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#homepage .section-content h3 {
  font-family: 'Bebas Neue', Arial, sans-serif;
  font-size: 3rem;
  letter-spacing: 0.05em;
  color: #fff;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  text-shadow: none;
}

#homepage .section-content p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Section Arrow */
#homepage .section-arrow {
  height: 24px;
  margin-top: 20px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

#homepage .section-arrow i {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
}

#homepage .homepage-section:hover .section-arrow {
  opacity: 1;
  transform: translateY(0);
}

/* Coming soon sections need placeholder space for arrow alignment */
#homepage .homepage-section.coming-soon::after {
  content: '';
  height: 24px;
  margin-top: 20px;
}

/* =====================================================
   SECTION-SPECIFIC COLORS
   ===================================================== */
/* Bitcoin */
#homepage .bitcoin-section {
  --section-color: #f7931a;
}

#homepage .bitcoin-section:hover {
  background: linear-gradient(180deg, rgba(247, 147, 26, 0.15) 0%, rgba(30, 30, 35, 0.95) 100%);
}

/* Equities */
#homepage .equities-section {
  --section-color: #60a5fa;
}

#homepage .equities-section:hover {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.15) 0%, rgba(30, 30, 35, 0.95) 100%);
}

/* FX */
#homepage .fx-section {
  --section-color: #ef476f;
}

#homepage .fx-section:hover {
  background: linear-gradient(180deg, rgba(239, 71, 111, 0.15) 0%, rgba(30, 30, 35, 0.95) 100%);
}

/* Commodities */
#homepage .commodities-section {
  --section-color: #c0c0c0;
}

#homepage .commodities-section:hover {
  background: linear-gradient(180deg, rgba(192, 192, 192, 0.15) 0%, rgba(30, 30, 35, 0.95) 100%);
}

/* Crypto */
#homepage .crypto-section {
  --section-color: #a78bfa;
}

#homepage .crypto-section:hover {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.15) 0%, rgba(30, 30, 35, 0.95) 100%);
}

/* Weather */
#homepage .weather-section {
  --section-color: #38bdf8;
}

#homepage .weather-section:hover {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.15) 0%, rgba(30, 30, 35, 0.95) 100%);
}

/* Prescreens */
#homepage .screener-section {
  --section-color: #facc15;
}

#homepage .screener-section:hover {
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.15) 0%, rgba(30, 30, 35, 0.95) 100%);
}

/* Prediction Markets */
#homepage .predictions-section {
  --section-color: #3b82f6;
}

#homepage .predictions-section:hover {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.15) 0%, rgba(30, 30, 35, 0.95) 100%);
}

/* =====================================================
   COMING SOON BADGE & STATE
   ===================================================== */
#homepage .homepage-section.coming-soon {
  cursor: default;
  opacity: 0.7;
}

#homepage .homepage-section.coming-soon:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

#homepage .homepage-section.coming-soon:hover::before {
  opacity: 1;
}

#homepage .coming-soon-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.3) 100%);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: #60a5fa;
  letter-spacing: 0.1em;
}

/* =====================================================
   RESPONSIVE DESIGN FOR HOMEPAGE
   ===================================================== */
/* Large tablets and small laptops */
@media (max-width: 1400px) {
  #homepage .homepage-grid {
    gap: 14px;
  }
  
  #homepage .section-icon {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    margin-bottom: 18px;
  }
  
  #homepage .section-icon i {
    font-size: 40px;
  }
  
  #homepage .section-content h3 {
    font-size: 2.5rem;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  #homepage .homepage-card {
    padding: 20px;
  }
  
  #homepage .homepage-grid {
    gap: 12px;
  }
  
  #homepage .section-content h3 {
    font-size: 1.6rem;
  }
  
  #homepage .section-content p {
    font-size: 0.7rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  #homepage {
    height: 100%;
    overflow: hidden;
  }
  
  #homepage .homepage-card {
    padding: 15px;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  #homepage .homepage-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    height: 100%;
  }
  
  #homepage .homepage-section {
    padding: 12px 10px;
    border-radius: 12px;
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }
  
  #homepage .section-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    margin-bottom: 8px;
  }
  
  #homepage .section-icon i {
    font-size: 22px;
  }
  
  #homepage .section-content h3 {
    font-size: 1.4rem;
  }
  
  #homepage .section-content p {
    font-size: 0.65rem;
  }
  
  #homepage .section-arrow {
    display: none;
  }
  
  /* Hide the ::after placeholder on mobile too */
  #homepage .homepage-section.coming-soon::after {
    display: none;
  }
  
  #homepage .coming-soon-badge {
    top: 10px;
    right: 10px;
    font-size: 0.55rem;
    padding: 3px 8px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  #homepage .homepage-card {
    height: 100%;
    padding: 12px;
  }
  
  #homepage .homepage-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
  }
  
  #homepage .homepage-section {
    padding: 10px 8px;
  }
  
  #homepage .coming-soon-badge {
    top: 8px;
    right: 8px;
    font-size: 0.5rem;
    padding: 2px 6px;
  }
  
  #homepage .section-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    margin-bottom: 6px;
  }
  
  #homepage .section-icon i {
    font-size: 19px;
  }
  
  #homepage .section-content h3 {
    font-size: 1.5rem;
  }
  
  #homepage .section-content p {
    font-size: 0.65rem;
  }
}

/* Large monitors (1920px+) */
@media (min-width: 1920px) {
  #homepage .homepage-grid {
    gap: 20px;
  }
  
  #homepage .section-icon {
    width: 90px;
    height: 90px;
    margin-bottom: 30px;
  }
  
  #homepage .section-icon i {
    font-size: 42px;
  }
  
  #homepage .section-content h3 {
    font-size: 2.8rem;
  }
  
  #homepage .section-content p {
    font-size: 0.85rem;
  }
}

/* 2K monitors (2560x1440) */
@media (min-width: 2560px) {
  #homepage .homepage-grid {
    gap: 24px;
  }
  
  #homepage .section-icon {
    width: 150px;
    height: 150px;
    margin-bottom: 45px;
  }
  
  #homepage .section-icon i {
    font-size: 70px;
  }
  
  #homepage .section-content h3 {
    font-size: 4rem;
  }
  
  #homepage .section-content p {
    font-size: 1.3rem;
  }
  
  #homepage .coming-soon-badge {
    font-size: 1rem;
    padding: 10px 18px;
  }
}

/* 4K monitors (3840x2160) */
@media (min-width: 3840px) {
  #homepage .homepage-grid {
    gap: 30px;
  }
  
  #homepage .section-icon {
    width: 180px;
    height: 180px;
    margin-bottom: 50px;
  }
  
  #homepage .section-icon i {
    font-size: 85px;
  }
  
  #homepage .section-content h3 {
    font-size: 5rem;
  }
  
  #homepage .section-content p {
    font-size: 1.6rem;
  }
  
  #homepage .coming-soon-badge {
    font-size: 1.1rem;
    padding: 12px 20px;
  }
}


/* Page 1 Card Enhancements */
#page1 .card {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Removed ::before decorative line - using global border instead */


/* Modern number styling */
#page1 .card h2 {
  font-family: 'Bebas Neue', Arial, sans-serif;
  font-size: 5rem;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}

#page1 .card p {
  font-size: 25px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* BTC/USD Card - Hero styling */
#page1 #dashboard .card:first-child {
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.1) 0%, #202023 100%);
}

#page1 #dashboard .card:first-child h2 {
  background: linear-gradient(135deg, #f7931a 0%, #ff6b35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Price change badge - positioned top-right of last digit */
#page1 .price-change-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(0, 212, 170, 0.15);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #00d4aa;
  position: absolute;
  top: -30px;
  right: -80px;
  white-space: nowrap;
}

#page1 .price-change-badge.negative {
  background: rgba(255, 71, 87, 0.15);
  color: #ff4757;
}

#page1 .price-change-badge.neutral {
  background: rgba(150, 150, 150, 0.15);
  color: #999999;
}

/* Wrapper for h2 and badge */
#page1 .price-wrapper {
  position: relative;
  display: inline-block;
}

/* Sparkline for BTC/USD */
#page1 .sparkline-container {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  height: 40px;
  opacity: 0.5;
  pointer-events: none;
}

#page1 .sparkline-container svg {
  width: 100%;
  height: 100%;
}

#page1 .sparkline-path {
  fill: none;
  stroke: #f7931a;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#page1 .sparkline-fill {
  fill: url(#sparklineGradient);
  opacity: 0.3;
}

#page1 #dashboard .card:first-child .sparkline-container {
  opacity: 0.6;
}

/* Sats per Dollar - Dot grid visual */
#page1 .sats-visual {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0.35;
  pointer-events: none;
}

#page1 .sats-row {
  display: flex;
  gap: 4px;
}

#page1 .sat-dot {
  width: 10px;
  height: 10px;
  background: #f7931a;
  border-radius: 1px;
}

/* Sats per dollar color based on 24h change - subtle gradient */
#page1 #sats-per-dollar.positive {
  background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#page1 #sats-per-dollar.negative {
  background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#page1 #sats-per-dollar.neutral {
  background: linear-gradient(135deg, #888888 0%, #aaaaaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hash Rate - Mini bar chart */
#page1 .mini-chart {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  height: 35px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  opacity: 0.4;
  pointer-events: none;
}

#page1 .chart-bar {
  flex: 1;
  background: linear-gradient(180deg, #f7931a 0%, rgba(247, 147, 26, 0.2) 100%);
  border-radius: 2px 2px 0 0;
}

/* Circulating Supply - Progress bar - ABOVE THE NUMBER */
#page1 .supply-bar {
  position: absolute;
  top: 25px;
  left: 24px;
  right: 24px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  overflow: hidden;
  pointer-events: none;
}

#page1 .supply-progress {
  height: 100%;
  width: 95.08%;
  background: linear-gradient(135deg, #f7931a 0%, #ff6b35 100%);
  border-radius: 100px;
  position: relative;
}

#page1 .supply-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

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

/* Difficulty Adjustment Card - Modern progress ring */
#page1 .difficulty-card {
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#page1 .difficulty-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}


#page1 .difficulty-card .adjustments {
  margin-top: -15px;
  margin-bottom: 0px;
}

#page1 .difficulty-card h1 {
  font-size: 25px;
}

#page1 .difficulty-card .adjustment span {
  font-family: 'JetBrains Mono', monospace;
}

#page1 .difficulty-card .remaining-blocks {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

/* Modern Donut Chart for Difficulty */
#page1 .difficulty-card .progress-bar {
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 0 20px rgba(243, 156, 18, 0.2),
    inset 0 0 15px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease;
}

#page1 .difficulty-card .progress-bar::before {
  background: linear-gradient(145deg, #252528 0%, #1a1a1d 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

#page1 .difficulty-card .progress-bar span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}



/* Market Cap - accent color */
#page1 #dashboard .card:nth-child(8) h2 {
  color: #f7931a;
}

/* =====================================================
   FEAR & GREED MINI CARD - MODERN DESIGN
   ===================================================== */
#page1 .fear-greed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 20px;
}

#page1 .mini-gauge-container {
  width: 300px;
  height: 170px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Scale down gauge for smaller tablets */
@media (min-width: 768px) and (max-width: 1366px) {
  #page1 .mini-gauge-container {
    width: 220px;
    height: 125px;
  }
}

/* Scale up gauge container for larger monitors */
@media (min-width: 1920px) {
  #page1 .mini-gauge-container {
    width: 375px;
    height: 213px;
  }
}

@media (min-width: 2560px) {
  #page1 .mini-gauge-container {
    width: 450px;
    height: 255px;
  }
}

/* Ultrawide monitors (3440x1440) */
@media (min-width: 3000px) {
  #page1 .mini-gauge-container {
    width: 550px !important;
    height: 310px !important;
  }
  
  #page1 #dashboard .mini-card h2,
  #page1 .dual-card-wrapper .mini-card h2,
  #page1 .mini-card h2 {
    font-size: 5.5rem !important;
  }
  
  #page1 #dashboard .mini-card p,
  #page1 .dual-card-wrapper .mini-card p,
  #page1 .mini-card p {
    font-size: 38px !important;
  }
  
  #page1 #dashboard .mini-card .fee-unit,
  #page1 .dual-card-wrapper .mini-card .fee-unit,
  #page1 .mini-card .fee-unit {
    font-size: 25px !important;
  }
  
  /* Difficulty Adjustment Card scaling */
  #page1 .difficulty-card h1 {
    font-size: 42px !important;
  }
  
  #page1 .difficulty-card .adjustment span {
    font-size: 28px !important;
  }
  
  #page1 .difficulty-card .remaining-blocks {
    font-size: 22px !important;
  }
  
  #page1 .difficulty-card .progress-bar {
    width: 160px !important;
    height: 160px !important;
  }
  
  #page1 .difficulty-card .progress-bar::before {
    width: 130px !important;
    height: 130px !important;
  }
  
  #page1 .difficulty-card .progress-bar span {
    font-size: 36px !important;
  }
  
  /* Sats dots scaling */
  #page1 .sat-dot {
    width: 15px !important;
    height: 15px !important;
  }
}

#page1 #fearGreedMiniGauge {
  display: block;
}

#page1 .fear-greed-card p {
  margin-top: 5px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #ffae42;
}

/* =====================================================
   DUAL CARD WRAPPER - Two mini cards in one card space
   ===================================================== */
#page1 #dashboard .dual-card-wrapper,
#page1 .dual-card-wrapper.equal-height,
#page1 .dual-card-wrapper {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 10px;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  justify-content: stretch;
  align-items: stretch;
  width: 100% !important;
  margin: 0 !important;
}

#page1 .dual-card-wrapper::before {
  display: none !important;
}

#page1 .mini-card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 15px;
  background: linear-gradient(135deg, #202023 0%, #1a1a1c 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

/* Removed ::before decorative line - using border instead */


#page1 .mini-card h2 {
  font-family: 'Bebas Neue', Arial, sans-serif;
  font-size: 3.5rem;
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0 0 8px 0;
  color: #fff;
}

#page1 .mini-card p {
  font-size: 25px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #ffae42;
  margin: 0;
  padding: 0;
}

/* Smaller desktops - fit text on one line */
@media (min-width: 769px) and (max-width: 1440px) {
  #page1 .mini-card p {
    font-size: 18px;
  }
  
  #page1 .mini-card .fee-unit {
    font-size: 12px;
  }
}

#page1 .mini-card .fee-unit {
  font-size: 11px;
  opacity: 0.7;
}

/* Mobile: Stack mini cards vertically */
@media (max-width: 768px) {
  #page1 .dual-card-wrapper {
    flex-direction: column !important;
    gap: 8px;
    padding: 8px !important;
  }
  
  #page1 .mini-card {
    padding: 20px 15px;
  }
  
  #page1 .mini-card h2 {
    font-size: 3rem;
  }
  
  #page1 .mini-card p {
    font-size: 14px;
  }
}

/* Page 6 Mempool Visualizer - Add border to match other cards */
#page6 #svelte-app,
.tx-area {
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-sizing: border-box !important;
  border-radius: 10px !important;
}

#page6 {
  margin-bottom: -2px !important;
}

/* =====================================================
   SCREENER DASHBOARD HOME — Dynamic Data Panels
   ===================================================== */

#screener .screener-home-card {
  padding: 16px;
  height: 100%;
  display: flex;
  align-items: stretch;
}

.screener-dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  height: calc(100vh - 170px);
}

/* Individual data panel card */
.screener-dash-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 0;
}

.screener-dash-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Card header — icon + preset name */
.screener-dash-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(8px, 1vh, 14px) clamp(10px, 1.2vw, 16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.screener-dash-icon {
  width: clamp(28px, 3.5vh, 40px);
  height: clamp(28px, 3.5vh, 40px);
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.screener-dash-icon i {
  font-size: clamp(13px, 1.6vh, 18px);
  color: var(--card-color, #facc15);
}

.screener-dash-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(20px, 1.4vh, 16px);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screener-dash-arrow {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.2);
  font-size: clamp(10px, 1.2vh, 14px);
  transition: all 0.3s ease;
}

.screener-dash-card:hover .screener-dash-arrow {
  color: var(--card-color, #facc15);
  transform: translateX(2px);
}

/* Mini stats strip — 3 key metrics */
.screener-dash-stats {
  display: flex;
  gap: clamp(4px, 0.5vw, 8px);
  padding: clamp(6px, 0.8vh, 10px) clamp(8px, 1vw, 14px);
  flex-shrink: 0;
}

.screener-dash-stat {
  flex: 1;
  padding: clamp(4px, 0.6vh, 8px) clamp(4px, 0.5vw, 8px);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
  min-width: 0;
}

.screener-dash-stat-label {
  font-size: clamp(12px, 1.8vh, 10px);
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screener-dash-stat-sym {
  font-size: clamp(20px, 1.8vh, 13px);
  font-weight: 700;
  color: #ffae42;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screener-dash-stat-val {
  font-size: clamp(15px, 1.8vh, 13px);
  font-weight: 600;
}

.screener-dash-stat-val.up { color: #4ade80; }
.screener-dash-stat-val.down { color: #ff4444; }
.screener-dash-stat-val.neutral { color: rgba(255, 255, 255, 0.5); }

/* Ticker feed — top 5 rows */
.screener-dash-feed {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.screener-dash-row {
  display: flex;
  align-items: center;
  padding: clamp(3px, 0.5vh, 6px) clamp(8px, 1vw, 14px);
  gap: clamp(6px, 0.8vw, 12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  flex: 1;
  min-height: 0;
}

.screener-dash-row:last-child {
  border-bottom: none;
}

.screener-dash-rank {
  font-size: clamp(8px, 1vh, 11px);
  color: rgba(255, 255, 255, 0.2);
  width: clamp(14px, 1.8vw, 20px);
  text-align: center;
  flex-shrink: 0;
}

.screener-dash-sym {
  font-size: clamp(12px, 1.8vh, 14px);
  font-weight: 700;
  color: #ffae42;
  width: clamp(45px, 5vw, 65px);
  flex-shrink: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screener-dash-price {
  font-size: clamp(13px, 1.2vh, 14px);
  color: rgba(255, 255, 255, 0.7);
  flex: 1;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.screener-dash-chg {
  font-size: clamp(13px, 1.2vh, 14px);
  font-weight: 600;
  min-width: clamp(50px, 5.5vw, 72px);
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.screener-dash-chg.up { color: #4ade80; }
.screener-dash-chg.down { color: #ff4444; }
.screener-dash-chg.flat { color: rgba(255, 255, 255, 0.35); }

/* Skeleton loading state */
.screener-dash-skeleton .screener-dash-stats,
.screener-dash-skeleton .screener-dash-feed {
  opacity: 0.4;
}

.screener-dash-skeleton .screener-dash-stat,
.screener-dash-skeleton .screener-dash-row {
  position: relative;
  overflow: hidden;
}

.screener-dash-skel-bar {
  height: clamp(8px, 1vh, 12px);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  animation: screener-shimmer 1.5s ease-in-out infinite;
}

.screener-dash-skel-bar.w60 { width: 60%; }
.screener-dash-skel-bar.w40 { width: 40%; }
.screener-dash-skel-bar.w80 { width: 80%; }

@keyframes screener-shimmer {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* =====================================================
   S&P 500 HEATMAP — Full Page
   ===================================================== */

#heatmap {
  padding-left: 8px;
  padding-right: 8px;
}

#heatmap .card.heatmap-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 70px 20px 75px 20px !important;
  overflow: hidden;
}

#sp500-heatmap-wrap {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: none;
  border-radius: 10px;
}

#sp500-heatmap-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Bottom info bar — overlays inside heatmap at bottom center */
.sp500-info-bar {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #fff;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 6px;
  padding: 0 20px;
  z-index: 10;
}

.sp500-info-bar.active {
  display: flex;
}

.sp500-info-bar .info-symbol {
  font-weight: 700;
  color: #fff;
}

.sp500-info-bar .info-sector {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.6rem;
}

.sp500-info-bar .info-price {
  color: rgba(255, 255, 255, 0.85);
}

.sp500-info-bar .info-change-pos {
  color: #4ade80;
  font-weight: 700;
}

.sp500-info-bar .info-change-neg {
  color: #f87171;
  font-weight: 700;
}

.sp500-info-bar .info-mcap {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.6rem;
}

.sp500-info-bar .info-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.15);
}

/* S&P 500 heatmap cells */
.sp500-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: opacity 0.15s ease;
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
}

.sp500-cell:hover {
  opacity: 0.82;
  z-index: 10;
}

.sp500-cell-ticker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.sp500-cell-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  line-height: 1.15;
  text-align: center;
}

/* Sector labels */
.sp500-sector-name {
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  z-index: 3;
}

/* Loading & error states */
.heatmap-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  height: 100%;
  gap: 20px;
  z-index: 5;
}

.heatmap-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #6b7282;
  border-radius: 50%;
  animation: heatmap-spin 1s linear infinite;
}

#heatmap .heatmap-loading p {
  color: #888;
  font-size: 18px;
  margin: 0;
}

@keyframes heatmap-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.sp500-heatmap-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.35);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

/* =====================================================
   NEWS TERMINAL
   ===================================================== */

#news {
  padding-left: 8px;
  padding-right: 8px;
}

#news .card.news-page-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 65px 20px 70px 20px !important;
  overflow: hidden;
  position: relative;
  align-items: stretch;
  text-align: left;
  justify-content: flex-start;
}

#news .ta-section-title {
  font-size: clamp(12px, 1.5vh, 17px);
  margin-bottom: clamp(10px, 1.3vh, 16px);
  padding-bottom: clamp(10px, 1.3vh, 16px);
}

/* --- 3-Column Grid --- */
.news-intelligence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.news-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.news-col-left {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.news-col-center {
  overflow: hidden;
}

.news-col-right {
  overflow-y: auto;
  scrollbar-width: none;
}

.news-summary-card {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.news-summary-card #news-ai-summary {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.news-risk-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}
.news-risk-card #news-risk-indicators {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-rates-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* --- Strategic Risk Overview (WorldMonitor design) --- */
.srisk-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: space-evenly;
}

.srisk-gauges-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 8px;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 100%);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}

.srisk-gauge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
}

.srisk-gauge-item canvas {
  width: 100%;
  max-width: 180px;
  height: auto;
  aspect-ratio: 180 / 110;
}

.srisk-gauge-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.srisk-gauge-trend {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
}

/* Metrics row */
.srisk-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.srisk-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.2vh, 18px) 4px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.2s ease;
}

.srisk-metric:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

.srisk-metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
}

.srisk-metric-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(9px, 1.2vh, 14px);
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.3px;
  line-height: 1.2;
  margin-top: 2px;
}

.srisk-metric-bar {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.srisk-metric-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* --- Top Risks (WorldMonitor pattern) --- */
.srisk-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.srisk-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(9px, 1.1vh, 13px);
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.srisk-risk-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.srisk-risk-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(255, 136, 0, 0.06);
  border-radius: 4px;
  border-left: 2px solid #facc15;
}

.srisk-risk-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(9px, 1.1vh, 13px);
  font-weight: 700;
  color: #facc15;
  min-width: 14px;
}

.srisk-risk-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(10px, 1.2vh, 14px);
  color: rgba(255,255,255,0.7);
  line-height: 1.3;
}

/* --- Market Overview Cards --- */
.news-market-card {
  flex: 0 0 auto;
}

.news-market-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
}

.news-mkt-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: clamp(8px, 1vh, 14px) clamp(8px, 1vh, 14px);
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.2s ease;
}

.news-mkt-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

.news-mkt-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(9px, 1.1vh, 13px);
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-mkt-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(14px, 1.7vh, 20px);
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  line-height: 1;
}

.news-mkt-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(10px, 1.2vh, 14px);
  font-weight: 600;
  line-height: 1;
}

.news-mkt-change.up { color: #4ade80; }
.news-mkt-change.down { color: #ff4444; }
.news-mkt-change.flat { color: rgba(255,255,255,0.35); }

/* --- Macro Indicators (CPI, Unemployment, Fed Funds) --- */
.news-macro-card {
  flex: 0 0 auto;
}

.news-macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.news-macro-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 1.5vh, 22px) 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.2s ease;
}

.news-macro-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

.news-macro-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(20px, 2.5vh, 30px);
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.news-macro-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(10px, 1.2vh, 14px);
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 5px;
}

.news-macro-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(10px, 1.3vh, 15px);
  font-weight: 600;
  margin-top: 5px;
}

.news-macro-change.up { color: #4ade80; }
.news-macro-change.down { color: #ff4444; }
.news-macro-change.flat { color: rgba(255,255,255,0.35); }

.news-macro-spark {
  margin-top: 6px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.news-macro-spark .news-econ-sparkline {
  width: 100%;
  height: 24px;
}

/* --- Economic Indicators (Freight & PPI + Oil) --- */
.news-econ-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 0 0 auto;
}

.news-econ-half {
  min-width: 0;
}

.news-econ-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-econ-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(8px, 1vh, 14px) 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  border-left: 3px solid #f7931a;
  transition: all 0.2s ease;
}

.news-econ-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  border-left-color: #f7931a;
}

.news-econ-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.news-econ-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(10px, 1.2vh, 14px);
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.news-econ-sparkline {
  flex-shrink: 0;
}

.news-econ-numbers {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.news-econ-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(12px, 1.5vh, 18px);
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.news-econ-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(10px, 1.2vh, 14px);
  font-weight: 600;
}

.news-econ-change.up { color: #4ade80; }
.news-econ-change.down { color: #ff4444; }
.news-econ-change.flat { color: rgba(255,255,255,0.35); }

.news-econ-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(8px, 1vh, 11px);
  color: rgba(255,255,255,0.2);
}

/* --- AI Orb Animation --- */
.ai-orb {
  width: 28px;
  height: 28px;
  position: relative;
  flex-shrink: 0;
  margin-right: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter:
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.6))
    drop-shadow(0 0 8px rgba(145, 71, 255, 0.3))
    drop-shadow(0 0 4px rgba(145, 71, 255, 0.4));
}

.ai-orb-ball {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: #5a4080;
  filter: url(#ai-gooey);
  animation: ai-orb-circle 4.2s ease-in-out infinite;
}

.ai-orb-borders {
  position: relative;
  display: flex;
  width: 15px;
  height: 15px;
  margin: 5px;
  border-radius: 50%;
  border-top: 3px solid #3b82f6;
  border-left: 3px solid #3b82f6;
}

.ai-orb-rings {
  aspect-ratio: 1;
  border-radius: 50%;
  position: absolute;
  inset: 0;
  perspective: 5rem;
}

.ai-orb-rings::before,
.ai-orb-rings::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  background: linear-gradient(white, blue, magenta, violet, lightyellow) border-box;
  mask-composite: exclude;
}

.ai-orb-rings::before {
  animation: ai-orb-ring180 10s linear infinite;
}

.ai-orb-rings::after {
  animation: ai-orb-ring90 10s linear infinite;
}

.ai-orb-lines {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background-image: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.75) 15%,
    #3b82f6 50%
  );
  clip-path: polygon(
    50% 25%, 65% 30%, 75% 42%, 75% 58%,
    65% 70%, 50% 75%, 35% 70%, 26% 58%,
    25% 42%, 35% 30%
  );
  animation: ai-orb-ball-anim 15s both ease;
  pointer-events: none;
}

@keyframes ai-orb-circle {
  0%   { transform: scale(1.5); }
  15%  { transform: scale(1.53); }
  30%  { transform: scale(1.48); }
  45%  { transform: scale(1.44); }
  60%  { transform: scale(1.47); }
  85%  { transform: scale(1.53); }
  100% { transform: scale(1.5); }
}

@keyframes ai-orb-ring180 {
  0%   { transform: rotateY(180deg) rotateX(180deg) rotateZ(180deg); }
  50%  { transform: rotateY(360deg) rotateX(360deg) rotateZ(360deg) scale(1.1); }
  100% { transform: rotateY(540deg) rotateX(540deg) rotateZ(540deg); }
}

@keyframes ai-orb-ring90 {
  0%   { transform: rotateY(90deg) rotateX(90deg) rotateZ(90deg); }
  50%  { transform: rotateY(270deg) rotateX(270deg) rotateZ(270deg) scale(1.1); }
  100% { transform: rotateY(450deg) rotateX(450deg) rotateZ(450deg); }
}

@keyframes ai-orb-ball-anim {
  2%       { clip-path: polygon(50% 25%, 50% 0, 75% 42%, 75% 58%, 65% 70%, 50% 75%, 35% 70%, 26% 58%, 25% 42%, 50% 0); }
  4%       { clip-path: polygon(50% 25%, 70% 0, 75% 42%, 85% 66%, 65% 100%, 50% 75%, 35% 100%, 15% 65%, 25% 42%, 30% 0); }
  6%       { clip-path: polygon(50% 25%, 50% 15%, 75% 42%, 75% 58%, 65% 70%, 50% 75%, 35% 70%, 26% 58%, 25% 42%, 50% 15%); }
  7%, 59%  { clip-path: polygon(50% 25%, 100% 12%, 75% 42%, 85% 66%, 65% 70%, 50% 75%, 35% 70%, 15% 65%, 25% 42%, 0 12%); }
  9%, 57%  { clip-path: polygon(50% 25%, 50% 0, 75% 42%, 75% 58%, 65% 70%, 50% 75%, 35% 70%, 26% 58%, 25% 42%, 50% 0); }
  12%, 55%, 61% { clip-path: polygon(50% 25%, 65% 30%, 75% 42%, 75% 58%, 65% 70%, 50% 75%, 35% 70%, 26% 58%, 25% 42%, 35% 30%); }
}

/* --- AI Market Summary --- */
.news-ai-text {
  font-size: clamp(10px, 1.4vh, 15px);
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  font-style: italic;
  padding: 8px 0;
  /* Siri-style pastel gradient hidden underneath normal text */
  background: linear-gradient(
    90deg,
    #b8a9e8, #a0b4f0, #9ac5e8, #8ed0d4,
    #a0ccbb, #c4c0a8, #ccb4a8, #c0a8c4,
    #b8a9e8, #a0b4f0
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.8);
}

.news-ai-text.ai-shimmer {
  animation: ai-siri-sweep 8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ai-siri-sweep {
  0% {
    -webkit-text-fill-color: rgba(255, 255, 255, 0.8);
    background-position: 100% 50%;
  }
  20% {
    -webkit-text-fill-color: rgba(255, 255, 255, 0.35);
    background-position: 60% 50%;
  }
  40% {
    -webkit-text-fill-color: transparent;
    background-position: 20% 50%;
  }
  60% {
    -webkit-text-fill-color: transparent;
    background-position: -20% 50%;
  }
  80% {
    -webkit-text-fill-color: rgba(255, 255, 255, 0.35);
    background-position: -60% 50%;
  }
  100% {
    -webkit-text-fill-color: rgba(255, 255, 255, 0.8);
    background-position: -100% 50%;
  }
}

.news-ai-fallback {
  color: rgba(255, 255, 255, 0.4);
  font-style: normal;
  background: none !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.4) !important;
}

/* --- Sentiment Breakdown --- */
.news-rates-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  justify-content: space-evenly;
}

.news-rate-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.2s ease;
}

.news-rate-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

.news-rate-flag {
  font-size: clamp(16px, 2vh, 24px);
  flex-shrink: 0;
}

.news-rate-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(11px, 1.4vh, 16px);
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  flex: 1;
  min-width: 0;
}

.news-rate-prev {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(10px, 1.2vh, 14px);
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

.news-rate-arrow-sep {
  font-size: clamp(9px, 1.1vh, 13px);
  color: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.news-rate-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(14px, 1.7vh, 20px);
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  flex-shrink: 0;
}

.news-rate-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(10px, 1.2vh, 14px);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 65px;
  text-align: right;
}

.news-rate-change.up { color: #ff4444; }
.news-rate-change.down { color: #4ade80; }
.news-rate-change.flat { color: rgba(255,255,255,0.35); }

.news-feed-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.news-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.news-feed-header .ta-section-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* --- Category Filter Tabs --- */
.news-category-tabs {
  display: flex;
  gap: 4px;
}

.news-tab {
  padding: 4px 12px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-tab:hover {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.04);
}

.news-tab.active {
  color: #f7931a;
  background: rgba(247, 147, 26, 0.08);
  border-color: rgba(247, 147, 26, 0.2);
}

/* --- Headline Feed List --- */
.news-feed-list {
  flex: 1;
  overflow-y: auto;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.news-feed-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 4px;
  border-left: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: all 0.15s ease;
}

.news-feed-item:hover {
  background: rgba(255,255,255,0.05);
}

.news-feed-item.sentiment-bullish {
  border-left-color: #4ade80;
  background: rgba(74, 222, 128, 0.04);
}
.news-feed-item.sentiment-bearish {
  border-left-color: #ff4444;
  background: rgba(255, 68, 68, 0.04);
}
.news-feed-item.sentiment-neutral {
  border-left-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.02);
}

.news-feed-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.news-feed-title {
  font-size: clamp(12px, 1.4vh, 16px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-feed-time-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(8px, 1vh, 12px);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.news-feed-tags {
  display: flex;
  flex-direction: row;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}

.news-feed-source-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(8px, 1vh, 12px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.news-feed-sentiment-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.news-feed-sentiment-tag.bullish {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}

.news-feed-sentiment-tag.bearish {
  background: rgba(255, 68, 68, 0.1);
  color: #ff4444;
}

.news-feed-sentiment-tag.neutral {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.4);
}

.news-feed-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Homepage Tile Color --- */
#homepage .news-section {
  --section-color: #e74c3c;
}
#homepage .news-section:hover {
  background: linear-gradient(180deg, rgba(231, 76, 60, 0.15) 0%, rgba(30, 30, 35, 0.95) 100%);
}

/* --- Responsive: Small Desktop (1201px–1600px) --- */
@media (max-width: 1600px) and (min-width: 1201px) {
  /* Force equal columns — override auto min so gauges don't inflate middle */
  .news-intelligence-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }
  .news-col {
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  }

  /* Risk card: allow shrinking so macro card fits */
  .news-risk-card {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }

  /* Reduce column gap */
  .news-col-center,
  .news-col-right {
    gap: 10px;
  }

  /* Slightly less side padding to give columns more room */
  #news .card.news-page-card {
    padding: 65px 12px 70px 12px !important;
  }

  .srisk-gauge-label {
    font-size: 8px;
  }

  /* Scale down gauge canvases (!important overrides JS inline styles) */
  .srisk-gauge-item canvas {
    width: 120px !important;
    height: 73px !important;
  }
  .srisk-gauges-row {
    gap: 4px;
    padding: 8px 4px;
    justify-content: center;
  }
  .srisk-gauge-item {
    flex: 1;
  }
  .srisk-metrics {
    gap: 4px;
  }
  .srisk-metric {
    padding: 6px 4px;
  }

  /* Economic indicators: hide sparklines, compact layout */
  .news-econ-sparkline {
    display: none;
  }
  .news-econ-item {
    gap: 6px;
    padding: 6px 8px;
  }
  .news-econ-name {
    font-size: 10px;
  }
  .news-econ-value {
    font-size: 11px;
  }
  .news-econ-change {
    font-size: 9px;
  }

  /* Policy rates: compact layout */
  .news-rate-item {
    gap: 6px;
    padding: 8px 8px;
  }
  .news-rate-flag {
    font-size: 14px;
  }
  .news-rate-name {
    font-size: 10px;
  }
  .news-rate-prev {
    font-size: 9px;
  }
  .news-rate-arrow-sep {
    font-size: 8px;
  }
  .news-rate-value {
    font-size: 12px;
  }
  .news-rate-change {
    font-size: 9px;
    min-width: 50px;
  }

  /* Right column: scrollable if content overflows vertically */
  .news-col-right {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  }
}

/* --- Responsive: Tablet --- */
@media (max-width: 1200px) {
  .news-intelligence-grid {
    grid-template-columns: 1fr 1fr;
  }
  .news-col-left {
    grid-column: 1 / -1;
  }
}

/* --- Responsive: Large screens --- */
@media (min-width: 1920px) {
  .srisk-gauge-label {
    font-size: 12px;
  }
  .srisk-gauge-trend {
    font-size: 12px;
  }
  .news-rate-item {
    padding: 15px 12px;
  }
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
  #news .card.news-page-card {
    padding: 60px 10px 70px 10px !important;
  }
  .news-intelligence-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .news-category-tabs {
    flex-wrap: wrap;
  }
  .news-tab {
    font-size: 10px;
    padding: 3px 8px;
  }
  .news-feed-title {
    font-size: 13px;
  }
  .news-feed-desc {
    display: none;
  }
  .srisk-gauges-row {
    gap: 4px;
    padding: 8px 4px;
  }
  .srisk-gauge-item canvas {
    width: 120px;
    height: 73px;
  }
  .srisk-gauge-label {
    font-size: 8px;
  }
}

@media (max-width: 480px) {
  .news-category-counts {
    grid-template-columns: 1fr;
  }
  .srisk-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Screener detail wrapper fills the page */
#screener-detail {
  width: 100%;
  height: 100%;
}

/* Screener Dashboard Responsive: large tablets */
@media (max-width: 1400px) {
  .screener-dash-title {
    font-size: clamp(17px, 1.4vh, 16px);
  }
  .screener-dash-grid {
    gap: 10px;
  }
  .screener-dash-sym {
    font-size: clamp(10px, 1.2vh, 12px);
  }
  .screener-dash-price {
    font-size: clamp(10px, 1.2vh, 12px);
  }
  .screener-dash-chg {
    font-size: clamp(10px, 1.2vh, 12px);
  }
  .screener-dash-stat-sym {
    font-size: clamp(14px, 1.4vh, 11px);
  }
  .screener-dash-stat-val {
    font-size: clamp(11px, 1.4vh, 11px);
  }
  .screener-dash-stat-label {
    font-size: clamp(9px, 1.2vh, 9px);
  }
  .srisk-metric-value {
    font-size: 12px;
  }
  .srisk-metric-label {
    font-size: 10px;
  }
}

/* Screener Dashboard Responsive: tablets */
@media (max-width: 1024px) {
  #screener .screener-home-card {
    padding: 12px;
  }
  .screener-dash-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .screener-dash-stats {
    padding: 4px 8px;
    gap: 4px;
  }
  .screener-dash-row {
    padding: 2px 8px;
  }
}

/* Screener Dashboard Responsive: mobile */
@media (max-width: 768px) {
  #screener .screener-home-card {
    padding: 8px;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  .screener-dash-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    height: 100%;
  }
  .screener-dash-header {
    padding: 5px 8px;
    gap: 6px;
  }
  .screener-dash-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 6px;
  }
  .screener-dash-stats {
    padding: 3px 6px;
    gap: 3px;
  }
  .screener-dash-stat {
    padding: 3px 4px;
  }
  .screener-dash-stat-sym {
    display: none;
  }
  .screener-dash-row {
    padding: 1px 6px;
    gap: 4px;
  }
  .screener-dash-rank {
    display: none;
  }
  .screener-dash-price {
    display: none;
  }
  .sp500-cell-ticker { font-size: 0.5rem; }
  .sp500-cell-pct { font-size: 0.4rem; }
  .sp500-info-bar { font-size: 0.6rem; height: 28px; min-height: 28px; }
}

/* Screener Dashboard Responsive: small mobile */
@media (max-width: 480px) {
  #screener .screener-home-card {
    padding: 6px;
  }
  .screener-dash-grid {
    gap: 4px;
  }
  .screener-dash-header {
    padding: 4px 6px;
    gap: 4px;
  }
  .screener-dash-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }
  .screener-dash-stats {
    display: none;
  }
  .screener-dash-row {
    padding: 1px 4px;
  }
  .sp500-info-bar { font-size: 0.55rem; height: 26px; min-height: 26px; }
}
