/* ═══════════════════════════════════════════════════════════════
   Pikacuan Terminal — Premium Midnight Glassmorphism Design
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  /* Core palette - Midnight Theme */
  --bg-primary: #030407;
  /* Very deep obsidian */
  --bg-secondary: #0a0b10;
  --bg-card: rgba(15, 17, 26, 0.45);
  /* Glassy dark blue/grey */
  --bg-card-hover: rgba(22, 25, 38, 0.65);
  --bg-elevated: rgba(30, 34, 51, 0.85);

  /* Subtle borders */
  --border-color: rgba(255, 255, 255, 0.04);
  --border-accent: rgba(99, 102, 241, 0.3);
  --border-glow: rgba(255, 255, 255, 0.08);

  /* Text & Typography */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Accents - Neon Indigo & Purple */
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #d946ef 100%);

  /* Status Colors */
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --danger: #ef4444;
  --warning: #f59e0b;

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 32px;
  --gap-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.06);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-med: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);
}

/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* ── Ambient Glows ── */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(120px);
  opacity: 0.6;
}

.ambient-glow-1 {
  top: -10vh;
  left: -10vw;
  width: 50vw;
  height: 50vh;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
}

.ambient-glow-2 {
  bottom: -20vh;
  right: -10vw;
  width: 60vw;
  height: 60vh;
  background: radial-gradient(circle, rgba(217, 70, 239, 0.15) 0%, transparent 70%);
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════
   STICKY WRAPPER
   ══════════════════════════════════════════════════════ */
.sticky-top-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

/* ══════════════════════════════════════════════════════
   TICKER TAPE BAR
   ══════════════════════════════════════════════════════ */
#ticker-tape-bar {
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(3, 4, 7, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  min-height: 46px;
}

/* ══════════════════════════════════════════════════════
   HEADER (Premium Glassmorphism)
   ══════════════════════════════════════════════════════ */
#main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-lg);
  padding: 16px var(--gap-xl);
  background: linear-gradient(180deg, rgba(3, 4, 7, 0.9) 0%, rgba(3, 4, 7, 0.6) 100%);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--accent);
}

.main-logo {
  width: 32px;
  height: 32px;
  object-fit: cover;
  transform: scale(1.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.logo-accent {
  color: var(--text-primary);
  font-weight: 500;
}

/* Search Box (Spotlight Style) */
.header-center {
  flex: 1;
  max-width: 600px;
  display: flex;
  justify-content: center;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  height: 44px;
  transition: all var(--transition-med);
  box-shadow: var(--shadow-inset);
}

.search-box:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.search-box:focus-within {
  background: rgba(15, 17, 26, 0.8);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px var(--accent-glow), var(--shadow-inset);
  transform: scale(1.02);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.search-box:focus-within .search-icon {
  color: var(--accent-light);
}

#symbol-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  padding: 0 12px;
  letter-spacing: 0.03em;
}

#symbol-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0;
}

.search-kbd {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Global Search Dropdown & Autocomplete ── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  width: 100%;
  min-width: 480px;
  background: #0e111a;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 25px rgba(99, 102, 241, 0.2);
  max-height: 420px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  padding: 12px;
}

.search-dropdown.open {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: searchDropdownEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes searchDropdownEnter {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.search-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-width: none;
  flex-shrink: 0;
}

.search-filter-pills::-webkit-scrollbar {
  display: none;
}

.search-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.search-pill:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.4);
}

.search-pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent-light);
  box-shadow: 0 2px 10px var(--accent-glow);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 320px;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  border: 1px solid transparent;
}

.search-item:hover, .search-item.highlighted {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

.search-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-item-symbol {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.search-item-name {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.search-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-item-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-weight: 600;
  font-family: var(--font-mono);
}

.search-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

body.light-mode .search-dropdown {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

body.light-mode .search-item:hover, body.light-mode .search-item.highlighted {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  flex-shrink: 0;
}

.current-symbol-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success);
  white-space: nowrap;
  box-shadow: 0 0 15px var(--success-glow);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: dot-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes dot-pulse {

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

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-med);
  box-shadow: var(--shadow-inset);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: rotate(15deg);
}

.community-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-med);
  box-shadow: var(--shadow-inset);
  text-decoration: none;
}

.community-btn:hover {
  background: rgba(88, 101, 242, 0.15);
  /* Discord blurple */
  color: #5865F2;
  /* Discord color */
  border-color: rgba(88, 101, 242, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.2);
}

.watchlist-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-med);
  box-shadow: var(--shadow-inset);
  position: relative;
}

.watchlist-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--warning);
  transform: scale(1.1);
}

.watchlist-btn.active {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.watchlist-btn.active .icon-star-outline {
  display: none;
}

.watchlist-btn.active .icon-star-filled {
  display: block !important;
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

body.light-mode .icon-sun {
  display: block;
}

body.light-mode .icon-moon {
  display: none;
}

/* ══════════════════════════════════════════════════════
   USER MENU (Terminal Style)
   ══════════════════════════════════════════════════════ */
.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-med);
  box-shadow: var(--shadow-inset);
  color: var(--text-secondary);
}

.user-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  background: rgba(15, 17, 26, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(-10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.dropdown-header {
  padding: 12px;
  border-bottom: 1px dashed var(--border-color);
  margin-bottom: 8px;
}

.user-name {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.user-email {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  text-decoration: none;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.dropdown-item.danger {
  color: var(--danger);
  margin-top: 8px;
  border-top: 1px dashed var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ══════════════════════════════════════════════════════
   NAVIGATION TABS (Clean Floating Solid Buttons)
   ══════════════════════════════════════════════════════ */
#main-nav {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px 0;
  background: transparent;
  pointer-events: auto;
}

.nav-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 90vw;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #141724;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-med);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: #1e2334;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.nav-tab.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent-light);
  box-shadow: 0 4px 18px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

body.light-mode .nav-tab {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.light-mode .nav-tab:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

body.light-mode .nav-tab.active {
  background: var(--accent);
  border-color: var(--accent-light);
  color: #ffffff;
}

.nav-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.nav-tab.active svg {
  opacity: 1;
}

/* ══════════════════════════════════════════════════════
   TAB PAGES
   ══════════════════════════════════════════════════════ */
.tab-page {
  display: none;
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px var(--gap-xl);
  flex-direction: column;
  gap: var(--gap-xl);
  animation: page-fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tab-page.active {
  display: flex;
}

@keyframes page-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }

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

/* ══════════════════════════════════════════════════════
   WIDGET SECTION (Premium Glass Cards)
   ══════════════════════════════════════════════════════ */
.widget-section {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-md), var(--shadow-inset);
  animation: card-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.widget-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.widget-section:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.08), var(--shadow-inset);
  transform: translateY(-2px);
}

.widget-section:hover::before {
  opacity: 1;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

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

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

.section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  color: var(--accent-light);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.section-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin: 0;
}

/* Widget containers */
.widget-container {
  width: 100%;
  min-height: 80px;
  overflow: hidden;
}

/* Top row: Symbol Info + Company Profile side by side */
.top-row-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-xl);
}

.chart-widget-container {
  height: 600px;
}

.bottom-panels.dual-col {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xl);
  transition: all 0.5s var(--ease-out);
}

@media (min-width: 1024px) {
  .bottom-panels.dual-col {
    flex-direction: row;
  }

  .bottom-panels.dual-col>* {
    flex: 1 1 calc(50% - var(--gap-xl)/2);
    min-width: 0;
    /* Prevents flex items from overflowing */
  }
}

.panel-widget,
.stories-widget {
  height: 500px;
}

/* ── Smooth Widget Collapsing ── */
.widget-section,
.bottom-panels {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  opacity: 1;
  max-height: 2000px;
  /* Arbitrary large max-height for open state */
  transform: scaleY(1);
  transform-origin: top;
}

.widget-section.collapsed,
.bottom-panels.collapsed {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  transform: scaleY(0);
  pointer-events: none;
}

@media (min-width: 1024px) {
  .bottom-panels.dual-col>*.collapsed {
    flex: 0 0 0%;
    margin-right: calc(var(--gap-xl) * -1);
    /* Counteract gap when hiding one item */
  }
}

/* ── Widget Toggle Panel ── */
.widget-toggle-panel {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  flex-wrap: wrap;
  animation: card-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toggle-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  padding-right: 12px;
  border-right: 1px solid var(--border-color);
  margin-right: 4px;
}

.toggle-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-med);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.toggle-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-med);
  border-radius: inherit;
}

.toggle-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.toggle-chip.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent-light);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.15), var(--shadow-inset);
}

.toggle-chip.active:hover {
  background: rgba(99, 102, 241, 0.25);
}

.chip-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition-med);
  flex-shrink: 0;
}

.toggle-chip.active .chip-status {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* ── Section Collapse Animation ── */
.widget-section.collapsed,
.bottom-panels.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: none;
  pointer-events: none;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease,
    margin 0.4s ease,
    padding 0.4s ease;
}

.widget-section:not(.collapsed),
.bottom-panels:not(.collapsed) {
  max-height: 2000px;
  opacity: 1;
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease 0.1s;
}

/* ══════════════════════════════════════════════════════
   FUNDAMENTAL DATA VISUALIZATION
   ══════════════════════════════════════════════════════ */
.fundviz-container {
  padding: 28px;
}

/* Metric Cards Row */
.fundviz-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  position: relative;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-med);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.metric-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.metric-label svg {
  width: 14px;
  height: 14px;
  color: var(--accent-light);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.metric-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.metric-change.positive {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.metric-change.negative {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.metric-change.neutral {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

/* Revenue Bar Chart */
.fundviz-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.fundviz-chart-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-med);
}

.fundviz-chart-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.chart-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent-light);
}

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding-top: 10px;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.bar-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex: 1;
}

.bar {
  width: 70%;
  max-width: 48px;
  border-radius: 6px 6px 2px 2px;
  background: var(--accent-gradient);
  position: relative;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  animation: bar-grow 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  cursor: pointer;
}

.bar:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 16px var(--accent-glow);
}

.bar-value {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.bar:hover .bar-value {
  opacity: 1;
  color: var(--accent-light);
}

.bar-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

@keyframes bar-grow {
  from {
    height: 0 !important;
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Donut / Pie Chart */
.donut-chart-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.donut-svg {
  width: 160px;
  height: 160px;
  transform: rotate(-90deg);
}

.donut-segment {
  fill: none;
  stroke-width: 24;
  stroke-linecap: round;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  animation: donut-draw 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.donut-segment:hover {
  filter: brightness(1.3);
  stroke-width: 28;
}

@keyframes donut-draw {
  from {
    opacity: 0;
    stroke-width: 0;
  }

  to {
    opacity: 1;
  }
}

.donut-center-text {
  transform: rotate(90deg);
  transform-origin: center;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
  margin-left: auto;
  padding-left: 12px;
}

/* Health Score / Gauge */
.fundviz-health {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.health-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.health-title svg {
  color: var(--accent-light);
}

.gauge-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.gauge-svg {
  width: 200px;
  height: 120px;
}

.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 16;
  stroke-linecap: round;
}

.gauge-fill {
  fill: none;
  stroke-width: 16;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    stroke 0.6s ease;
}

.gauge-score {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 900;
  fill: var(--text-primary);
}

.gauge-label {
  font-size: 0.7rem;
  font-weight: 600;
  fill: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.health-indicators {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.health-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.health-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Placeholder state for viz */
.fundviz-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--text-muted);
  text-align: center;
}

.fundviz-placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 16px;
}

.fundviz-placeholder p {
  font-size: 0.9rem;
  max-width: 400px;
  line-height: 1.6;
}

.fundviz-placeholder .placeholder-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: 8px;
}

/* Live badge */
.fundviz-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 24px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: dot-pulse 2s ease infinite;
}

/* Loading state */
.fundviz-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 16px;
  color: var(--text-muted);
}

.fundviz-loading p {
  font-size: 0.85rem;
}

.fundviz-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Retry button */
.fundviz-retry-btn {
  margin-top: 16px;
  padding: 10px 24px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-pill);
  color: var(--accent-light);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-med);
}

.fundviz-retry-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}

/* Health factors grid */
.health-factors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.health-factor {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
}

.health-factor.good {
  border-color: rgba(16, 185, 129, 0.2);
}

.health-factor.warn {
  border-color: rgba(245, 158, 11, 0.2);
}

.hf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.health-factor.good .hf-dot {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.health-factor.warn .hf-dot {
  background: var(--warning);
  box-shadow: 0 0 6px var(--warning);
}

.hf-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.hf-value {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

/* ── SUB-TABS (Watchlist) ── */
.sub-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: fit-content;
  max-width: 100%;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sub-tabs::-webkit-scrollbar {
  display: none;
}

.sub-tab {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-med);
  white-space: nowrap;
}

.sub-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.sub-tab.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sub-page {
  display: none;
  animation: page-fade-up 0.4s var(--ease-out) both;
}

.sub-page.active {
  display: block;
}

/* ── Loading Skeleton ── */
.widget-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: inherit;
  background: linear-gradient(110deg,
      rgba(255, 255, 255, 0.01) 30%,
      rgba(255, 255, 255, 0.04) 50%,
      rgba(255, 255, 255, 0.01) 70%);
  background-size: 200% 100%;
  animation: premium-shimmer 2s infinite linear;
}

.widget-loading::after {
  content: 'INITIALIZING DATA...';
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.15em;
}

@keyframes premium-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ══════════════════════════════════════════════════════
   LOGO BUTTON
   ══════════════════════════════════════════════════════ */
.logo-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-md);
  transition: all var(--transition-med);
}

.logo-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.logo-btn:active {
  transform: scale(0.97);
}

/* ══════════════════════════════════════════════════════
   ABOUT MODAL
   ══════════════════════════════════════════════════════ */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.about-overlay.open {
  opacity: 1;
  visibility: visible;
}

.about-modal {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  margin: 20px;
  background: var(--bg-card);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-overlay.open .about-modal {
  transform: translateY(0) scale(1);
}

.about-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.about-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

/* Hero */
.about-hero {
  text-align: center;
  padding: 40px 36px 28px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.about-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
  margin-bottom: 16px;
}

.about-hero h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

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

.about-version {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-light);
}

/* Body */
.about-body {
  padding: 24px 36px;
}

.about-section {
  margin-bottom: 28px;
}

.about-section:last-child {
  margin-bottom: 0;
}

.about-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.about-section h3 svg {
  color: var(--accent-light);
  flex-shrink: 0;
}

.about-section>p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Features Grid */
.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.about-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.about-feature:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-sm);
  color: var(--accent-light);
}

.about-feature strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.about-feature span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Advantages */
.about-advantages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.advantage-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
}

.advantage-badge {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.advantage-item strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.advantage-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* About Footer */
.about-footer {
  text-align: center;
  padding: 16px 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.about-footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.about-footer a {
  color: var(--accent-light);
  font-weight: 600;
}

/* Light mode overrides */
body.light-mode .logo-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

body.light-mode .about-overlay {
  background: rgba(0, 0, 0, 0.4);
}

body.light-mode .about-modal {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
}

body.light-mode .about-close {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .about-hero {
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .about-feature,
body.light-mode .advantage-item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .about-feature:hover {
  background: rgba(0, 0, 0, 0.04);
}

body.light-mode .about-footer {
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .about-footer p {
  color: #475569;
}

/* Responsive */
@media (max-width: 600px) {
  .about-features {
    grid-template-columns: 1fr;
  }

  .about-body {
    padding: 20px 24px;
  }

  .about-hero {
    padding: 28px 24px 20px;
  }
}

/* ══════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════ */
#main-footer {
  border-top: 1px solid var(--border-color);
  padding: var(--gap-2xl) var(--gap-xl);
  margin-top: 40px;
  background: transparent;
}

.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  text-align: center;
}

#main-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

#main-footer a {
  color: var(--accent-light);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(40px) scale(0.9);
  background: rgba(15, 17, 26, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  padding: 14px 28px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow), var(--shadow-inset);
  z-index: 9999;
  opacity: 0;
  transition: all var(--transition-slow);
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */

.screener-widget {
  height: 750px;
}

.watchlist-widget {
  height: 650px;
}

.heatmap-widget {
  height: 650px;
}

.calendar-widget {
  height: 650px;
}

@media (max-width: 900px) {
  #ticker-tape-bar {
    min-height: auto;
  }

  #main-header {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 12px;
    margin-top: 0;
  }

  .header-center {
    order: 3;
    max-width: 100%;
    flex-basis: 100%;
    margin-top: 4px;
  }

  .bottom-panels.dual-col {
    flex-direction: column;
  }

  .top-row-panels {
    grid-template-columns: 1fr;
  }

  .fundviz-charts {
    grid-template-columns: 1fr;
  }

  .tab-page {
    padding: 24px 20px;
  }

  .chart-widget-container {
    height: 460px;
  }

  #main-nav {
    padding: 8px 16px;
    background: rgba(3, 4, 7, 0.95);
    backdrop-filter: blur(24px) saturate(1.5);
    border-bottom: 1px solid var(--border-color);
  }

  .nav-inner {
    width: 100%;
    justify-content: flex-start;
    border-radius: 8px;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
  }

  .toggle-panel-header {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
  }

  .widget-toggle-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .ambient-glow {
    display: none;
  }
}

@media (max-width: 768px) {

  .logo-text {
    display: none;
  }

  .header-right {
    gap: 8px;
  }

  .theme-toggle,
  .community-btn,
  .watchlist-btn {
    width: 38px;
    height: 38px;
  }

  .tab-page {
    padding: 24px 16px;
  }
}

@media (max-width: 600px) {

  .current-symbol-badge {
    font-size: 0.75rem;
    padding: 6px 10px;
    gap: 4px;
  }

  .header-right {
    gap: 6px;
  }

  .theme-toggle,
  .community-btn,
  .watchlist-btn {
    width: 36px;
    height: 36px;
  }

  .theme-toggle svg,
  .community-btn svg,
  .watchlist-btn svg {
    width: 16px;
    height: 16px;
  }

  .user-btn {
    padding: 4px;
    border-radius: 50%;
  }

  .user-btn svg {
    display: none;
  }

  .user-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .chart-widget-container {
    height: 380px;
  }

  .panel-widget {
    height: 420px;
  }

  .screener-widget {
    height: 500px;
  }

  .watchlist-widget {
    height: 450px;
  }

  .heatmap-widget {
    height: 400px;
  }

  .calendar-widget {
    height: 450px;
  }

  .fundviz-container {
    padding: 16px;
  }

  .fundviz-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .metric-value {
    font-size: 1.2rem;
  }

  .toggle-chip span:not(.chip-status) {
    display: none;
  }

  .toggle-chip {
    padding: 8px 12px;
  }

  .donut-chart-wrapper {
    flex-direction: column;
  }
}

/* ══════════════════════════════════════════════════════
   LIGHT MODE (Polished Elegant Light)
   ══════════════════════════════════════════════════════ */
body.light-mode {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --bg-elevated: #ffffff;

  --border-color: rgba(0, 0, 0, 0.06);
  --border-accent: rgba(99, 102, 241, 0.4);
  --border-glow: rgba(255, 255, 255, 0.5);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-glow: rgba(99, 102, 241, 0.15);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
  --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 1);
}

body.light-mode .ambient-glow-1 {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
}

body.light-mode .ambient-glow-2 {
  background: radial-gradient(circle, rgba(217, 70, 239, 0.08) 0%, transparent 70%);
}

body.light-mode #main-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

body.light-mode .search-box {
  background: rgba(0, 0, 0, 0.02);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

body.light-mode .search-box:focus-within {
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px var(--accent-glow);
}

body.light-mode .nav-inner {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), inset 0 1px 1px #fff;
}

body.light-mode .nav-tab:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}

body.light-mode #main-nav {
  background: rgba(248, 250, 252, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .nav-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

body.light-mode .sub-tabs {
  background: rgba(0, 0, 0, 0.04);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .sub-tab {
  color: var(--text-secondary);
}

body.light-mode .sub-tab:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}

body.light-mode .sub-tab.active {
  background: #ffffff;
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

body.light-mode #ticker-tape-bar {
  background: var(--bg-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.light-mode #main-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode #main-footer p {
  color: #475569;
}

body.light-mode #main-footer a {
  color: var(--accent);
}

/* Light mode — Toggle Panel */
body.light-mode .widget-toggle-panel {
  background: rgba(255, 255, 255, 0.8);
}

body.light-mode .toggle-chip {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
}

body.light-mode .toggle-chip:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

body.light-mode .toggle-chip.active {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent);
}

body.light-mode .toggle-panel-header {
  border-color: rgba(0, 0, 0, 0.08);
}

/* Light mode — Fundamental Viz */
body.light-mode .metric-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .metric-card:hover {
  background: rgba(0, 0, 0, 0.04);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.light-mode .fundviz-chart-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .fundviz-chart-card:hover {
  background: rgba(0, 0, 0, 0.03);
}

body.light-mode .fundviz-health {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .gauge-bg {
  stroke: rgba(0, 0, 0, 0.08);
}

/* ══════════════════════════════════════════════════════
   SCROLLBAR (Hidden for premium sleekness)
   ══════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.4);
}

/* ══════════════════════════════════════════════════════
   FOCUS & CLEANUP
   ══════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tradingview-widget-copyright {
  font-family: var(--font-mono);
  font-size: 0.65rem !important;
  text-align: center;
  padding: 6px 0 !important;
  opacity: 0.3;
  transition: opacity var(--transition-fast);
}

.widget-section:hover .tradingview-widget-copyright {
  opacity: 0.6;
}

/* ══════════════════════════════════════════════════════
   EMPTY WATCHLIST STATE
   ══════════════════════════════════════════════════════ */
.empty-watchlist {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  text-align: center;
  padding: var(--gap-2xl);
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  animation: card-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.empty-watchlist svg {
  color: var(--warning);
  opacity: 0.8;
  margin-bottom: var(--gap-lg);
  filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.3));
}

.empty-watchlist h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--gap-sm);
  font-weight: 600;
}

.empty-watchlist p {
  font-size: 0.95rem;
  max-width: 320px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════
   MARKET INTELLIGENCE CENTER
   ══════════════════════════════════════════════════════ */

/* Live indicator badge in section header */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--success);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: dot-pulse 2s ease infinite;
  display: inline-block;
}

.mic-refresh-badge {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Spinner */
@keyframes mic-spin { to { transform: rotate(360deg); } }
.mic-spin {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(255,255,255,0.07);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mic-spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* Full-width 3-panel MIC section */
.mic-section {
  padding: 0;
}

.mic-container {
  padding: 20px 24px 24px;
}

.mic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .mic-grid {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 640px) and (max-width: 1024px) {
  .mic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mic-panel:last-child { grid-column: span 2; }
}

.mic-panel {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 300px;
  transition: border-color var(--transition-med);
}
.mic-panel:hover {
  border-color: rgba(99,102,241,0.2);
}

.mic-panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.mic-panel-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-error {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px;
  text-align: center;
}

/* ── Panel 1: Fear & Greed ── */
.mic-fg-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.mic-gauge {
  width: 100%;
  max-width: 180px;
  overflow: visible;
}

.mic-fg-label {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
}

.mic-fg-spark-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.mic-sparkline {
  width: 100%;
  max-width: 160px;
  height: 36px;
  overflow: visible;
}

.mic-fg-scale {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 160px;
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ── Panel 2: Crypto ── */
.mic-crypto-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 320px;
  padding-right: 4px;
  flex: 1;
}
.mic-crypto-list::-webkit-scrollbar { width: 3px; }
.mic-crypto-list::-webkit-scrollbar-track { background: transparent; }
.mic-crypto-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.mic-coin {
  display: grid;
  grid-template-columns: 26px 1fr 60px auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}
.mic-coin:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.06);
}

.mic-coin-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.mic-coin-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mic-coin-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.mic-coin-full {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mic-coin-spark {
  height: 24px;
  width: 60px;
  overflow: visible;
}

.mic-coin-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.mic-price-val {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.mic-price-chg {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.mic-price-chg.pos { color: var(--success); }
.mic-price-chg.neg { color: var(--danger); }

/* ── Panel 3: Currency ── */
.mic-currency-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.mic-currency-row {
  display: grid;
  grid-template-columns: 22px 36px 1fr 80px;
  align-items: center;
  gap: 10px;
}

.mic-currency-flag {
  font-size: 1.1rem;
  line-height: 1;
}
.mic-currency-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.mic-currency-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.mic-currency-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 2px;
  transition: width 0.6s var(--ease-out);
}
.mic-currency-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.mic-currency-source {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255,255,255,0.05);
}

/* ── Compact MIC Panel (inside section-fundamental / dual panel) ── */
.mic-compact-container {
  height: auto !important;
  min-height: 160px;
}

.mic-compact-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.mic-compact {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
}

.mic-compact-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.mic-compact-score {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mic-compact-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mic-compact-sublabel {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mic-compact-divider {
  width: 1px;
  height: 60px;
  background: rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.mic-compact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mic-compact-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mic-compact-error {
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ══════════════════════════════════════════════════════
   FUNDAMENTAL VISUAL CHARTS
   ══════════════════════════════════════════════════════ */
.fundcharts-wrapper {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 660px;
  gap: 16px;
  padding: 16px 20px 24px;
}

.fundcharts-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.fundcharts-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
}

.fundcharts-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.fundcharts-tab-btn:hover {
  color: var(--text-primary);
}

.fundcharts-tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

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

.fundcharts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  height: auto;
}

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

.fundchart-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition-fast);
  min-height: 290px;
}

.fundchart-card:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.fundchart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.fundchart-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.fundchart-card-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.fundchart-canvas-container {
  width: 100%;
  height: 220px;
  position: relative;
}

.fundchart-tv-wrapper {
  width: 100%;
  height: 100%;
  min-height: 800px;
}

/* ══════════════════════════════════════════════════════
   HEADER ACTION BUTTONS & BADGES
   ══════════════════════════════════════════════════════ */
.header-action-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.alert-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--warning);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 6px var(--warning);
}

/* ══════════════════════════════════════════════════════
   PORTFOLIO TRACKER STYLING
   ══════════════════════════════════════════════════════ */
.portfolio-actions {
  display: flex;
  gap: 12px;
}

.terminal-btn-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #111827;
  font-weight: 800;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.terminal-btn-gold:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(217, 119, 6, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  background: linear-gradient(135deg, #fcd34d 0%, #b45309 100%);
}

.terminal-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.terminal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-sm-danger {
  background: rgba(239, 68, 68, 0.1);
  backdrop-filter: blur(4px);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sm-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.portfolio-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.portfolio-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.portfolio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f5a623, #6366f1);
}

.portfolio-card .card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 8px;
}

.portfolio-card .card-val {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.portfolio-card .card-sub {
  font-size: 0.78rem;
  margin-top: 4px;
}

.portfolio-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.portfolio-form-grid .full-width {
  grid-column: 1 / -1;
}

/* ══════════════════════════════════════════════════════
   CATEGORY BADGE & MODALS STYLING
   ══════════════════════════════════════════════════════ */
.category-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

/* ══════════════════════════════════════════════════════
   MODERN ALERT CONDITION UI
   ══════════════════════════════════════════════════════ */
.condition-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.condition-toggle-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.condition-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.condition-toggle-btn.active-above {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
}

.condition-toggle-btn.active-below {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
}

.cond-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.cond-up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.cond-down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.cond-text {
  display: flex;
  flex-direction: column;
}

.cond-text strong {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.cond-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  width: 100%;
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════
   ALERT TOASTS
   ══════════════════════════════════════════════════════ */
.alert-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.alert-toast {
  pointer-events: auto;
  background: rgba(15, 17, 26, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
}

@keyframes slideToast {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.alert-toast-icon {
  font-size: 1.3rem;
}

.alert-toast-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
}

.alert-toast-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════
   SNAPSHOT REPORT CARD STYLING
   ══════════════════════════════════════════════════════ */
.snapshot-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245, 166, 35, 0.3);
  background: linear-gradient(145deg, rgba(20, 23, 36, 0.9), rgba(12, 14, 22, 0.95));
}

.snap-metric-box {
  background: rgba(255,255,255,0.03);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.snap-metric-box strong {
  font-size: 1rem;
  font-family: var(--font-mono);
}

/* ══════════════════════════════════════════════════════
   LIGHT MODE — Modals, Snapshot, Toasts, Action Buttons
   (Forcing Dark Mode styling for a premium feel)
   ══════════════════════════════════════════════════════ */

/* Reset CSS Variables for these specific components back to Dark Mode */
body.light-mode .modal-content,
body.light-mode .snapshot-card,
body.light-mode .alert-toast,
body.light-mode .header-action-btn,
body.light-mode #price-alert-modal,
body.light-mode #export-snapshot-modal {
  --bg-primary: #030407;
  --bg-secondary: #0a0b10;
  --bg-card: rgba(15, 17, 26, 0.45);
  --bg-card-hover: rgba(22, 25, 38, 0.65);
  --bg-elevated: rgba(30, 34, 51, 0.85);

  --border-color: rgba(255, 255, 255, 0.04);
  --border-accent: rgba(99, 102, 241, 0.3);
  --border-glow: rgba(255, 255, 255, 0.08);

  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-glow: rgba(99, 102, 241, 0.25);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.06);
  
  color: var(--text-primary);
}

/* Modal backgrounds */
body.light-mode .modal-content {
  background: rgba(15, 17, 26, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
}

body.light-mode .modal-header h3 {
  color: #ffffff !important;
}

body.light-mode .modal-close-btn {
  color: var(--text-muted) !important;
}
body.light-mode .modal-close-btn:hover {
  color: #ffffff !important;
}

/* Inputs */
body.light-mode .modal-content .form-input,
body.light-mode .modal-content select.form-input {
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}
body.light-mode .modal-content select.form-input option {
  background: #0f111a !important;
  color: #ffffff !important;
}
body.light-mode .modal-content .form-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px var(--accent-glow) !important;
}
body.light-mode .modal-content label {
  color: #e2e8f0 !important;
}

/* Header buttons */
body.light-mode .header-action-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
  color: #94a3b8 !important;
}
body.light-mode .header-action-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
}

/* Snapshot */
body.light-mode .snapshot-card {
  background: linear-gradient(145deg, rgba(20, 23, 36, 0.9), rgba(12, 14, 22, 0.95)) !important;
  border-color: rgba(245, 166, 35, 0.3) !important;
  box-shadow: none !important;
}
body.light-mode .snap-metric-box {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}
body.light-mode .snap-metric-box .text-muted {
  color: #94a3b8 !important;
}
body.light-mode .snapshot-card h4,
body.light-mode .snapshot-card strong {
  color: #ffffff !important;
}
body.light-mode .snapshot-card div[style*="rgba(99,102,241"] {
  background: rgba(99, 102, 241, 0.08) !important;
  border-color: rgba(99, 102, 241, 0.15) !important;
}
body.light-mode .snapshot-card div[style*="rgba(16,185,129"] {
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.15) !important;
}
body.light-mode .snapshot-card div[style*="rgba(0,0,0"] {
  background: rgba(0, 0, 0, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  color: #e2e8f0 !important;
}

/* Toasts */
body.light-mode .alert-toast {
  background: rgba(15, 17, 26, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
}
body.light-mode .alert-toast-title { color: #ffffff !important; }
body.light-mode .alert-toast-desc { color: #94a3b8 !important; }

/* Modal Body elements */
body.light-mode .modal-body .text-muted { color: #94a3b8 !important; }
body.light-mode .modal-body h4 { color: #ffffff !important; }
body.light-mode .modal-body hr { border-color: rgba(255, 255, 255, 0.1) !important; }

body.light-mode .alert-list-container > div {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
}
body.light-mode .btn-sm-danger {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}
body.light-mode .btn-sm-danger:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}
body.light-mode .terminal-btn-gold {
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
}


/* ══════════════════════════════════════════════════════
   ENTERPRISE ABOUT MODAL LAYOUT
   ══════════════════════════════════════════════════════ */
.about-modal.enterprise-layout {
  display: grid !important;
  grid-template-columns: 300px 1fr;
  max-width: 1000px !important;
  width: 95vw;
  padding: 0;
  overflow: hidden;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
  text-align: left;
}

.about-modal.enterprise-layout .about-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent !important;
  border: none !important;
  color: var(--text-muted) !important;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
  width: auto !important;
  height: auto !important;
}

.about-modal.enterprise-layout .about-close:hover {
  color: #fff !important;
}

/* Left Panel */
.about-left-panel {
  background: var(--bg-secondary);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
}

.about-brand-section {
  text-align: left;
  margin-bottom: 40px;
}

.about-brand-section .about-logo {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.about-brand-section h2 {
  font-size: 1.35rem;
  color: #fff;
  margin: 0 0 6px 0;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.about-brand-section .about-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* System Metrics */
.system-metrics {
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-row {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.02);
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.04);
}

.metric-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.metric-val {
  font-size: 0.85rem;
  color: #e2e8f0;
  font-family: var(--font-mono);
}

.status-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.15);
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.about-contact-min {
  margin-top: 40px;
}

.about-contact-min a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.about-contact-min a:hover {
  color: var(--accent);
}

/* Right Panel */
.about-right-panel {
  padding: 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 85vh;
  text-align: left;
}

.about-right-panel .about-body {
  flex: 1;
}

.about-section {
  margin-bottom: 36px;
}

.about-section h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 10px;
}

.about-section p {
  color: #cbd5e1;
  line-height: 1.7;
  font-size: 0.95rem;
  margin: 0;
}

.about-section strong {
  color: #fff;
}

/* Capabilities Grid */
.about-capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.cap-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cap-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.cap-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cap-info {
  display: flex;
  flex-direction: column;
}

.cap-info strong {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: #fff;
}

.cap-info span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.about-footer-enterprise {
  margin-top: 20px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.05);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Light Mode Overrides for Enterprise Layout */
body.light-mode .about-modal.enterprise-layout {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 30px 80px rgba(0,0,0,0.15);
}

body.light-mode .about-left-panel {
  background: #f8fafc;
  border-right-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .about-brand-section h2,
body.light-mode .about-section strong,
body.light-mode .cap-info strong {
  color: #0f172a;
}

body.light-mode .metric-row {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .metric-val,
body.light-mode .about-section p {
  color: #334155;
}

body.light-mode .cap-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

body.light-mode .cap-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

body.light-mode .about-section h3 {
  border-bottom-color: rgba(0, 0, 0, 0.06);
  color: #64748b;
}

body.light-mode .about-footer-enterprise {
  border-top-color: rgba(0, 0, 0, 0.06);
}

@media (max-width: 768px) {
  .about-modal.enterprise-layout {
    grid-template-columns: 1fr;
  }
  .about-left-panel {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 30px 24px;
  }
  body.light-mode .about-left-panel {
    border-bottom-color: rgba(0, 0, 0, 0.06);
  }
  .about-brand-section {
    margin-bottom: 24px;
  }
  .about-contact-min {
    margin-top: 24px;
  }
  .about-right-panel {
    padding: 24px;
  }
}

@media print {
  @page {
    size: auto;
    margin: 0mm; /* Removes browser headers/footers containing URLs */
  }

  /* Hide absolutely everything in the body to prevent extra blank pages */
  body > * {
    display: none !important;
  }

  /* Only show the snapshot modal, taking it out of absolute positioning */
  body > #export-snapshot-modal {
    display: flex !important;
    position: static !important;
    width: 100vw;
    height: 100vh;
    padding: 2cm !important;
    background: #ffffff !important;
    box-sizing: border-box;
    flex-direction: column;
    justify-content: flex-start;
  }

  /* Remove all background colors to save ink and ensure a clean light theme */
  body {
    background: #ffffff !important;
  }

  .snapshot-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
    width: 100%;
    margin: 0 auto;
    max-width: 800px;
  }

  /* Force text colors to black */
  .snapshot-card *,
  .snap-metric-box *,
  .modal-body p {
    color: #0f172a !important;
    text-shadow: none !important;
  }

  .snap-metric-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
  }

  /* Context Row styling */
  .snapshot-card div[style*="rgba(99,102,241"] {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
  }
  
  .snapshot-card div[style*="rgba(16,185,129"] {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
  }
  
  .snapshot-card div[style*="rgba(0,0,0"] {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
  }

  /* Hide close button, print button, and header title to save space */
  .modal-close-btn, 
  #trigger-print-snapshot-btn,
  .modal-header {
    display: none !important;
  }

  /* Ensure colors print exactly as shown */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
