/**
 * ============================================================================
 * FUNDBENCHMARK UNIFIED STYLESHEET
 * Extracted from PHP templates
 * ============================================================================
 * @version 3.1.0
 * @date 2026-01-18
 */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Montserrat:wght@400;500;600;700&display=swap');


/* ============================================================================
   SECTION 1: FUND FINDER STYLES (from page-fund-finder.php)
   ============================================================================ */
/* ========================================
   FUND FINDER STYLES v2025.01.03
======================================== */
:root {
  --ff-bg: #0a0a0b;
  --ff-card: #141416;
  --ff-card-hover: #1c1c1f;
  --ff-border: #2a2a2f;
  --ff-border-light: #3a3a42;
  --ff-text: #c4c4cc;
  --ff-text-muted: #8a8a94;
  --ff-text-dim: #5a5a64;
  --ff-white: #ffffff;
  --ff-gold: #c9a962;
  --ff-gold-light: #e4d4a4;
  --ff-green: #22c55e;
  --ff-green-bright: #4ade80;
  --ff-red: #f87171;
  --ff-blue: #60a5fa;
  --ff-purple: #a78bfa;
}

.ff-page {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--ff-bg);
  color: var(--ff-text);
  min-height: 100vh;
  padding-bottom: 100px;
}

.ff-page * { box-sizing: border-box; }

/* Reset SVG icons to prevent theme interference */
.ff-page svg {
  max-width: none !important;
  max-height: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.ff-page svg path,
.ff-page svg line,
.ff-page svg circle,
.ff-page svg polyline,
.ff-page svg rect {
  animation: none !important;
  stroke-dasharray: none !important;
  stroke-dashoffset: 0 !important;
  opacity: 1 !important;
}

/* Block ALL Salient theme injected icons */
.ff-page .svg-icon-holder,
.ff-page .nectar-icon,
.ff-page .im-icon-wrap,
.ff-page .icon-default-style,
.ff-page button > span.icon,
.ff-page button svg.icon,
.ff-page .nectar-button svg,
.ff-page .nectar_button svg,
.ff-page [class*="nectar"] svg,
.ff-page button:not(.discover-card):not(.ff-filter-btn) > svg:not(.ff-search-icon) {
  display: none !important;
}

/* Hide any SVG that Salient injects into our buttons */
.ff-page .filter-chip svg,
.ff-page .fund-btn svg,
.ff-page .btn-primary svg,
.ff-page .comparison-clear svg,
.ff-page .comparison-btn svg:not(:first-child),
.ff-page .ff-clear-btn svg,
.ff-page .ff-active-screen-clear svg {
  display: none !important;
}

/* But SHOW our intentional icons */
.ff-page .discover-icon svg,
.ff-page .ff-filter-btn svg,
.ff-page .ff-search-icon,
.ff-page .filter-group-toggle,
.ff-page .empty-state-icon svg {
  display: block !important;
}

.ff-page button {
  font-family: inherit;
}

.ff-container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.ff-header {
  padding: 48px 0 32px;
  background: radial-gradient(ellipse at 50% 0%, rgba(201, 169, 98, 0.06) 0%, transparent 50%);
}

.ff-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400;
  color: var(--ff-white);
  margin: 0 0 8px;
}

.ff-title span { color: var(--ff-gold); }

.ff-subtitle {
  font-size: 16px;
  color: var(--ff-text-muted);
  margin: 0;
}

/* Search Bar */
.ff-search-section {
  padding: 0 0 32px;
}

.ff-search-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.ff-search-box {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.ff-search-input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: var(--ff-card);
  border: 1px solid var(--ff-border);
  border-radius: 12px;
  font-size: 15px;
  color: var(--ff-white);
  outline: none;
  transition: border-color 0.2s;
}

.ff-search-input::placeholder { color: var(--ff-text-dim); }
.ff-search-input:focus { border-color: var(--ff-gold); }

.ff-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--ff-text-dim);
  stroke-width: 2;
  fill: none;
}

.ff-filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--ff-card);
  border: 1px solid var(--ff-border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ff-text);
  cursor: pointer;
  transition: all 0.2s;
}

.ff-filter-btn:hover { border-color: var(--ff-gold); color: var(--ff-white); }
.ff-filter-btn.active { background: var(--ff-gold); color: #000; border-color: var(--ff-gold); }
.ff-filter-btn.has-filters { border-color: var(--ff-gold); }
.ff-filter-btn.has-filters .ff-filter-count { background: var(--ff-gold); color: #000; }

.ff-filter-btn svg.ff-filter-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  display: block !important;
}

.ff-filter-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

.ff-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--ff-border);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.ff-total-badge {
  padding: 10px 16px;
  background: var(--ff-card);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ff-text-muted);
}

.ff-total-badge strong {
  color: var(--ff-gold);
  font-weight: 600;
}

/* Discover Section */
.ff-discover {
  padding: 0 0 32px;
}

.ff-discover-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--ff-white);
  margin: 0 0 16px;
}

.ff-discover-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) { .ff-discover-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .ff-discover-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ff-discover-grid { grid-template-columns: 1fr; } }

.discover-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 12px;
  background: var(--ff-card);
  border: 1px solid var(--ff-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.discover-card:hover {
  border-color: var(--ff-border-light);
  transform: translateY(-2px);
}

.discover-card.active {
  border-color: var(--ff-gold);
  background: linear-gradient(180deg, rgba(201, 169, 98, 0.1) 0%, var(--ff-card) 100%);
}

.discover-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 169, 98, 0.15);
  border-radius: 12px;
  margin-bottom: 12px;
}

.discover-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--ff-gold);
}

.discover-icon.icon-green { background: rgba(74, 222, 128, 0.15); }
.discover-icon.icon-green svg { stroke: var(--ff-green-bright); }

.discover-icon.icon-blue { background: rgba(96, 165, 250, 0.15); }
.discover-icon.icon-blue svg { stroke: var(--ff-blue); }

.discover-icon.icon-purple { background: rgba(167, 139, 250, 0.15); }
.discover-icon.icon-purple svg { stroke: var(--ff-purple); }

.discover-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ff-white);
  margin-bottom: 4px;
}

.discover-count {
  font-size: 22px;
  font-weight: 700;
  color: var(--ff-gold);
}

/* Active Screen Banner */
.ff-active-screen {
  display: none;
  padding: 12px 16px;
  background: rgba(201, 169, 98, 0.1);
  border-left: 3px solid var(--ff-gold);
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
}

.ff-active-screen-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ff-active-screen-label { font-size: 13px; color: var(--ff-text-muted); }
.ff-active-screen-name { font-size: 14px; font-weight: 600; color: var(--ff-gold); }
.ff-active-screen-clear {
  margin-left: auto;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--ff-border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ff-text-muted);
  cursor: pointer;
}

.ff-active-screen-clear:hover { border-color: var(--ff-gold); color: var(--ff-gold); }

/* Results Layout */
.ff-results {
  display: flex;
  gap: 24px;
}

/* Filter Sidebar - ALWAYS VISIBLE */
.ff-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: block; /* Always visible on desktop */
}

@media (max-width: 768px) {
  .ff-sidebar {
    display: none; /* Hidden on mobile by default */
  }
  .ff-sidebar.visible { 
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 1001;
    background: var(--ff-bg);
    padding: 16px;
    overflow-y: auto;
  }
}

.ff-sidebar-card {
  position: sticky;
  top: 20px;
  background: var(--ff-card);
  border: 1px solid var(--ff-border);
  border-radius: 14px;
  padding: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.ff-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ff-border);
}

.ff-sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ff-white);
  margin: 0;
}

.ff-clear-btn {
  font-size: 12px;
  color: var(--ff-gold);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}

.ff-clear-btn:hover { text-decoration: underline; }

/* Filter Groups */
.filter-group { margin-bottom: 20px; }
.filter-group.collapsed .filter-group-content { display: none; }

.filter-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
}

.filter-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ff-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group-toggle {
  width: 16px;
  height: 16px;
  stroke: var(--ff-text-muted);
  transition: transform 0.2s;
}

.filter-group.collapsed .filter-group-toggle { transform: rotate(-90deg); }

.filter-group-content {
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

/* Filter chip styling */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--ff-bg);
  border: 1px solid var(--ff-border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--ff-text);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.filter-chip::before,
.filter-chip::after,
.filter-chip > *:not(span):not(.filter-chip-count) {
  display: none !important;
}

.filter-chip:hover {
  border-color: var(--ff-gold);
  color: var(--ff-white);
}

.filter-chip.active {
  background: var(--ff-gold);
  border-color: var(--ff-gold);
  color: #000;
}

.filter-chip-count {
  font-size: 10px;
  opacity: 0.7;
}

.filter-empty {
  font-size: 12px;
  color: var(--ff-text-dim);
  font-style: italic;
  margin: 0;
}

/* Main Content */
.ff-main { flex: 1; min-width: 0; }

.ff-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.ff-results-count {
  font-size: 15px;
  color: var(--ff-text-muted);
}

.ff-results-count strong {
  color: var(--ff-gold);
  font-weight: 600;
}

.ff-sort-select {
  padding: 10px 32px 10px 14px;
  background: var(--ff-card);
  border: 1px solid var(--ff-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ff-text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a94' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* Fund Grid */
.ff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

/* Fund Card */
.fund-card {
  background: var(--ff-card);
  border: 1px solid var(--ff-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.fund-card:hover {
  border-color: var(--ff-border-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.fund-card-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--ff-border);
}

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

.fund-manager {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fund-manager-logo {
  width: 36px;
  height: 36px;
  background: var(--ff-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ff-gold);
  flex-shrink: 0;
}

.fund-manager-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fund-manager-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ff-text-light);
}

.fund-manager-people {
  font-size: 11px;
  color: var(--ff-text-dim);
}

.fund-badges { 
  display: flex; 
  flex-shrink: 0;
  max-width: 45%;
}

.fund-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.fund-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Asset class - gold */
.fund-badge-asset {
  background: rgba(201, 169, 98, 0.15);
  color: var(--ff-gold);
}

/* Region - blue */
.fund-badge-region {
  background: rgba(96, 165, 250, 0.15);
  color: var(--ff-blue);
}

/* Style/Strategy - green */
.fund-badge-style {
  background: rgba(74, 222, 128, 0.15);
  color: var(--ff-green-bright);
}

/* Other/fallback - gray */
.fund-badge-other {
  background: rgba(156, 163, 175, 0.15);
  color: var(--ff-silver);
}

/* Legacy support */
.fund-badge-sector {
  background: rgba(201, 169, 98, 0.15);
  color: var(--ff-gold);
}

.fund-badge-type {
  background: rgba(96, 165, 250, 0.15);
  color: var(--ff-blue);
}

.fund-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--ff-white);
  margin-bottom: 8px;
  line-height: 1.3;
  min-height: 40px;
}

.fund-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ff-text-dim);
}

.fund-meta-sep {
  color: var(--ff-text-dim);
  opacity: 0.5;
}

.fund-isin {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 10px;
  background: var(--ff-border);
  padding: 2px 6px;
  border-radius: 4px;
}

.fund-benchmark {
  background: var(--ff-bg);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--ff-text-muted);
}

.benchmark-label {
  color: var(--ff-text-dim);
}

.fund-card-body { padding: 14px; }

.fund-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.fund-stat {
  text-align: center;
  padding: 10px 4px;
  background: var(--ff-bg);
  border-radius: 8px;
  border: 1px solid var(--ff-border);
}

.fund-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--ff-white);
  line-height: 1.2;
}

.fund-stat-value.positive { color: var(--ff-green-bright) !important; }
.fund-stat-value.negative { color: var(--ff-red) !important; }
.fund-stat-value.gold { color: var(--ff-gold) !important; }

.fund-stat-label {
  font-size: 8px;
  font-weight: 500;
  color: var(--ff-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

/* ========================================
   SECTOR BAR IN CARDS
======================================== */
.fund-sector-bar {
  margin: 16px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ff-border);
}

.sector-bar-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--ff-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.sector-bar-container {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--ff-border);
  margin-bottom: 10px;
}

.sector-segment {
  height: 100%;
  min-width: 4px;
  transition: opacity 0.2s ease;
}

.sector-segment:hover {
  opacity: 0.85;
}

.sector-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 11px;
  color: var(--ff-text-muted);
}

.sector-legend-item {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* ========================================
   ALLOCATION BAR (FMP Sectors)
======================================== */
.fund-allocation-placeholder {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ff-border);
  min-height: 44px;
}

.allocation-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
}

.loading-text {
  font-size: 10px;
  color: var(--ff-text-dim);
  opacity: 0.6;
}

.allocation-empty {
  font-size: 10px;
  color: var(--ff-text-dim);
  text-align: center;
  padding: 8px 0;
  opacity: 0.5;
}

.fund-allocation-bar {
  /* Container for allocation display */
}

.allocation-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.allocation-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--ff-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.allocation-total {
  font-size: 12px;
  font-weight: 600;
  color: var(--ff-gold);
}

.allocation-bar-container {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--ff-border);
}

.fund-sectors { margin-bottom: 14px; }

.fund-sectors-label {
  font-size: 10px;
  color: var(--ff-text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.fund-sectors-bars {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--ff-border);
  margin-bottom: 6px;
}

.sector-bar { height: 100%; min-width: 3px; }

.fund-sectors-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 10px;
  color: var(--ff-text-muted);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
  flex-shrink: 0;
}

/* Card Actions */
.fund-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fund-btn {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.fund-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.fund-btn::before,
.fund-btn::after {
  display: none !important;
  content: none !important;
}

/* Compare button - DEFAULT STATE */
.fund-btn-compare {
  background: var(--ff-border) !important;
  color: var(--ff-text) !important;
  border: 2px solid var(--ff-border) !important;
}

.fund-btn-compare:hover { 
  background: var(--ff-border-light) !important; 
  color: var(--ff-white) !important; 
  border-color: var(--ff-gold) !important;
}

/* ========================================
   COMPARE BUTTON - ADDED STATE (GREEN OUTLINE)
======================================== */
.fund-btn-added {
  background: transparent !important;
  color: var(--ff-green) !important;
  border: 2px solid var(--ff-green) !important;
  font-weight: 600 !important;
}

.fund-btn-added:hover {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: var(--ff-green) !important;
}

/* Details button */
.fund-btn-details {
  background: transparent;
  border: 2px solid var(--ff-border);
  color: var(--ff-text-muted);
}

.fund-btn-details svg {
  stroke: currentColor;
}

.fund-btn-details:hover { 
  border-color: var(--ff-text-muted); 
  color: var(--ff-white); 
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--ff-card);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--ff-text-dim);
  stroke-width: 1.5;
  fill: none;
}

.empty-state-icon.loading svg {
  animation: ff-spin 1.5s linear infinite !important;
}

.empty-state-icon.loading svg path,
.empty-state-icon.loading svg circle {
  animation: none !important;
}

@keyframes ff-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.empty-state-title { font-size: 20px; color: var(--ff-white); margin: 0 0 8px; }
.empty-state-desc { font-size: 14px; color: var(--ff-text-muted); margin: 0 0 20px; }

.btn-primary {
  padding: 12px 24px;
  background: var(--ff-gold);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #000;
  cursor: pointer;
}

.btn-primary:hover { background: var(--ff-gold-light); }

/* Comparison Bar */
.comparison-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 20, 22, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--ff-border);
  padding: 12px 24px;
  transform: translateY(100%);
  transition: transform 0.3s;
  z-index: 1000;
}

.comparison-bar.visible { transform: translateY(0); box-shadow: 0 -4px 20px rgba(0,0,0,0.4); }

.comparison-bar-content {
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.comparison-funds {
  display: flex;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
}

.comparison-fund {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--ff-bg);
  border: 1px solid var(--ff-border);
  border-radius: 6px;
  white-space: nowrap;
}

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

.comparison-name {
  font-size: 12px;
  color: var(--ff-text);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comparison-remove {
  background: none;
  border: none;
  color: var(--ff-text-dim);
  cursor: pointer;
  padding: 2px;
  font-size: 14px;
}

.comparison-remove:hover { color: var(--ff-red); }

.comparison-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comparison-count { font-size: 13px; color: var(--ff-text-muted); }
.comparison-count span { color: var(--ff-gold); font-weight: 600; }

.comparison-clear {
  padding: 6px 12px;
  background: none;
  border: 1px solid var(--ff-border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ff-text-muted);
  cursor: pointer;
}

.comparison-clear:hover { border-color: var(--ff-red); color: var(--ff-red); }

.comparison-btn {
  padding: 10px 20px;
  background: var(--ff-gold);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #000;
  cursor: pointer;
}

.comparison-btn:hover { background: var(--ff-gold-light); }

/* Responsive */
@media (max-width: 768px) {
  .ff-results { flex-direction: column; }
  
  .fund-sectors-legend {
    display: none;
  }
}

/* NUCLEAR OPTION: Hide ALL Salient-injected button decorations */
.ff-page button {
  background-image: none !important;
}

.ff-page button > svg,
.ff-page button > i,
.ff-page button > .icon,
.ff-page button > [class*="icon"]:not(.discover-icon):not(.ff-filter-icon),
.ff-page button > span > svg,
.ff-page button > span > i {
  display: none !important;
}

/* Re-enable only our specific intentional icons */
.ff-page .discover-icon,
.ff-page .discover-icon svg,
.ff-page svg.ff-filter-icon,
.ff-page svg.ff-search-icon,
.ff-page .filter-group-toggle,
.ff-page .empty-state-icon,
.ff-page .empty-state-icon svg {
  display: flex !important;
}

.ff-page svg.ff-filter-icon,
.ff-page svg.ff-search-icon,
.ff-page .filter-group-toggle,
.ff-page .empty-state-icon svg,
.ff-page .discover-icon svg {
  display: block !important;
}

/* ============================================================================
   SECTION 2: FUND DETAIL STYLES (from page-fund-detail.php)
   ============================================================================ */
/* ========================================
   FD - FUND DETAIL STYLES
   Using fd- prefix per naming convention
======================================== */
:root {
  --fd-obsidian: #0a0a0b;
  --fd-charcoal: #141416;
  --fd-graphite: #1c1c1f;
  --fd-slate: #2a2a2f;
  --fd-pewter: #4a4a52;
  --fd-silver: #8a8a94;
  --fd-platinum: #c4c4cc;
  --fd-ivory: #f4f4f6;
  --fd-white: #ffffff;
  --fd-gold: #c9a962;
  --fd-gold-light: #e4d4a4;
  --fd-gold-dark: #a68b3d;
  --fd-success: #4ade80;
  --fd-error: #f87171;
  --fd-blue: #60a5fa;
  --fd-purple: #a78bfa;
  --fd-pink: #f472b6;
  --fd-orange: #fb923c;
  --fd-cyan: #22d3ee;
  --fd-lime: #a3e635;
  
  --fd-font-display: 'Cormorant Garamond', Georgia, serif;
  --fd-font-body: 'DM Sans', -apple-system, sans-serif;
  
  --fd-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --fd-ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  
  --fd-sidebar-width: 340px;
  --fd-header-height: 72px;
}

/* Reset for fund detail page */
.fd-page {
  font-family: var(--fd-font-body);
  background: var(--fd-charcoal);
  color: var(--fd-ivory);
  line-height: 1.5;
  min-height: 100vh;
}

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

/* ========================================
   GLOBAL NAVIGATION
======================================== */
.fd-global-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--fd-header-height);
  background: rgba(20, 20, 22, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--fd-slate);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
}

.fd-nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.fd-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.fd-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--fd-gold), var(--fd-gold-dark));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fd-logo-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--fd-obsidian);
  stroke-width: 2;
  fill: none;
}

.fd-logo-text {
  font-family: var(--fd-font-display);
  font-size: 22px;
  color: var(--fd-ivory);
}

.fd-logo-text span {
  color: var(--fd-gold);
}

.fd-nav-links {
  display: flex;
  gap: 8px;
}

.fd-nav-link {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fd-silver);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.fd-nav-link:hover {
  color: var(--fd-ivory);
  background: var(--fd-slate);
}

.fd-nav-link.active {
  color: var(--fd-gold);
  background: rgba(201, 169, 98, 0.1);
}

.fd-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fd-nav-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--fd-slate);
  border: 1px solid var(--fd-pewter);
  border-radius: 10px;
  width: 280px;
  transition: all 0.2s ease;
}

.fd-nav-search:focus-within {
  border-color: var(--fd-gold);
}

.fd-nav-search svg {
  width: 18px;
  height: 18px;
  stroke: var(--fd-silver);
  stroke-width: 2;
  fill: none;
}

.fd-nav-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--fd-ivory);
  font-family: var(--fd-font-body);
}

.fd-nav-search input::placeholder {
  color: var(--fd-pewter);
}

.fd-nav-search kbd {
  padding: 4px 8px;
  background: var(--fd-graphite);
  border-radius: 4px;
  font-size: 11px;
  color: var(--fd-silver);
  font-family: var(--fd-font-body);
}

.fd-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--fd-slate), var(--fd-pewter));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--fd-ivory);
  cursor: pointer;
}

/* ========================================
   MAIN LAYOUT
======================================== */
.fd-main-layout {
  display: grid;
  grid-template-columns: var(--fd-sidebar-width) 1fr var(--fd-sidebar-width);
  gap: 24px;
  padding: calc(var(--fd-header-height) + 32px) 40px 40px;
  max-width: 1800px;
  margin: 0 auto;
}

.fd-sidebar-left,
.fd-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: calc(var(--fd-header-height) + 32px);
  height: fit-content;
}

.fd-main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ========================================
   CARDS
======================================== */
.fd-card {
  background: var(--fd-graphite);
  border-radius: 20px;
  border: 1px solid var(--fd-slate);
}

/* Fund Header Card */
.fd-fund-header-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.fd-fund-header-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(180deg, rgba(201, 169, 98, 0.08), transparent);
  pointer-events: none;
}

.fd-fund-header-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  position: relative;
}

.fd-fund-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--fd-gold), var(--fd-gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--fd-obsidian);
  box-shadow: 0 8px 32px rgba(201, 169, 98, 0.25);
}

.fd-header-actions {
  display: flex;
  gap: 8px;
}

.fd-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--fd-slate);
  border: 1px solid var(--fd-pewter);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fd-action-btn:hover {
  background: var(--fd-pewter);
}

.fd-action-btn.active {
  background: var(--fd-gold);
  border-color: var(--fd-gold);
}

.fd-action-btn.active svg {
  stroke: var(--fd-obsidian);
}

.fd-action-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--fd-platinum);
  stroke-width: 2;
  fill: none;
}

.fd-fund-name {
  font-family: var(--fd-font-display);
  font-size: 24px;
  color: var(--fd-ivory);
  margin-bottom: 12px;
  font-weight: 400;
  line-height: 1.2;
}

.fd-fund-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fd-meta-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--fd-slate);
  color: var(--fd-platinum);
  cursor: pointer;
  transition: all 0.2s ease;
}

.fd-meta-tag:hover {
  background: var(--fd-pewter);
}

.fd-meta-tag.category {
  background: rgba(201, 169, 98, 0.15);
  color: var(--fd-gold);
  border: 1px solid rgba(201, 169, 98, 0.3);
}

/* Section Title */
.fd-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fd-silver);
}

/* Info Card */
.fd-info-card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--fd-slate);
}

.fd-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--fd-slate);
  transition: background 0.2s ease;
}

.fd-info-row:last-child {
  border-bottom: none;
}

.fd-info-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.fd-info-label {
  font-size: 13px;
  color: var(--fd-silver);
}

.fd-info-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--fd-ivory);
  display: flex;
  align-items: center;
  gap: 6px;
}

.fd-info-value.clickable {
  color: var(--fd-gold);
  cursor: pointer;
}

.fd-info-value.clickable:hover {
  text-decoration: underline;
}

.fd-info-value svg {
  width: 14px;
  height: 14px;
  stroke: var(--fd-gold);
  stroke-width: 2;
  fill: none;
}

.fd-info-value.highlight {
  color: var(--fd-gold);
  font-weight: 600;
}

/* ========================================
   PERFORMANCE CARD
======================================== */
.fd-performance-card {
  padding: 28px;
}

.fd-perf-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.fd-perf-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.fd-chart-toggle {
  display: flex;
  background: var(--fd-slate);
  border-radius: 10px;
  padding: 4px;
}

.fd-toggle-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fd-silver);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--fd-font-body);
  transition: all 0.2s ease;
}

.fd-toggle-btn.active {
  background: var(--fd-gold);
  color: var(--fd-obsidian);
}

.fd-time-periods {
  display: flex;
  gap: 6px;
}

.fd-period-btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fd-silver);
  background: transparent;
  border: 1px solid var(--fd-slate);
  cursor: pointer;
  font-family: var(--fd-font-body);
  transition: all 0.2s ease;
}

.fd-period-btn.active {
  background: var(--fd-gold);
  color: var(--fd-obsidian);
  border-color: var(--fd-gold);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(201, 169, 98, 0.4);
}

.fd-period-btn:hover:not(.active) {
  background: var(--fd-slate);
}

/* Performance Stats */
.fd-perf-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
  padding: 20px;
  background: var(--fd-slate);
  border-radius: 14px;
  position: relative;
}

.fd-perf-stats.comparing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--fd-gold), var(--fd-success));
}

.fd-perf-stat {
  text-align: center;
  padding: 0 16px;
  border-right: 1px solid var(--fd-pewter);
}

.fd-perf-stat:last-child {
  border-right: none;
}

.fd-perf-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--fd-success);
}

.fd-perf-value.negative {
  color: var(--fd-error);
}

.fd-perf-value.neutral {
  color: var(--fd-ivory);
}

.fd-perf-label {
  font-size: 12px;
  color: var(--fd-silver);
  margin-top: 6px;
}

.fd-perf-vs-peers {
  font-size: 11px;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.3s ease;
}

.fd-perf-vs-peers.visible {
  opacity: 1;
  transform: translateY(0);
}

.fd-perf-vs-peers.positive {
  background: rgba(74, 222, 128, 0.15);
  color: var(--fd-success);
}

.fd-perf-vs-peers.negative {
  background: rgba(248, 113, 113, 0.15);
  color: var(--fd-error);
}

.fd-comparing-badge {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--fd-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fd-comparing-badge.visible {
  opacity: 1;
}

.fd-comparing-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fd-gold);
  animation: fd-pulse 2s infinite;
}

@keyframes fd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Chart Container */
.fd-benchmark-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.fd-benchmark-label {
  font-size: 12px;
  color: var(--fd-silver);
}

.fd-add-competitor-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--fd-slate);
  border: 1px dashed var(--fd-pewter);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fd-add-competitor-btn:hover {
  border-color: var(--fd-gold);
  border-style: solid;
  background: rgba(201, 169, 98, 0.1);
}

.fd-add-competitor-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--fd-gold);
  stroke-width: 2;
  fill: none;
}

/* Line Chart */
.fd-line-chart {
  height: 320px;
  background: var(--fd-slate);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

.fd-chart-svg {
  width: 100%;
  height: 100%;
}

.fd-chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.fd-chart-line.fund {
  stroke: var(--fd-gold);
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: fd-drawLine 2s var(--fd-ease-out-expo) forwards;
}

.fd-chart-line.benchmark {
  stroke: var(--fd-pewter);
  stroke-dasharray: 4 4;
}

.fd-chart-line.watched-line,
.fd-chart-line.competitor-line {
  stroke-width: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fd-chart-line.watched-line.visible,
.fd-chart-line.competitor-line.visible {
  opacity: 1;
  animation: fd-drawLine 1s var(--fd-ease-out-expo) forwards;
}

.fd-chart-line.vanguard { stroke: #60a5fa; }
.fd-chart-line.blackrock { stroke: #a78bfa; }
.fd-chart-line.impax { stroke: #4ade80; }
.fd-chart-line.stewart { stroke: #f472b6; }
.fd-chart-line.jpmorgan { stroke: #fb923c; }
.fd-chart-line.matthews { stroke: #38bdf8; }
.fd-chart-line.invesco { stroke: #a3e635; }
.fd-chart-line.schroder { stroke: #e879f9; }
.fd-chart-line.fidelity { stroke: #2dd4bf; }

.fd-chart-area {
  fill: url(#fdGoldGradient);
  opacity: 0;
  animation: fd-fadeIn 1s var(--fd-ease-out-expo) 1s forwards;
}

@keyframes fd-drawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes fd-fadeIn {
  to { opacity: 0.3; }
}

.fd-watched-dot,
.fd-competitor-dot {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fd-watched-dot.visible,
.fd-competitor-dot.visible {
  opacity: 1;
}

/* Chart Tooltip */
.fd-chart-tooltip {
  position: absolute;
  background: var(--fd-obsidian);
  border: 1px solid var(--fd-slate);
  border-radius: 10px;
  padding: 12px 16px;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  transition: opacity 0.2s ease;
}

.fd-chart-tooltip.visible {
  opacity: 1;
}

.fd-tooltip-date {
  font-size: 11px;
  color: var(--fd-silver);
  margin-bottom: 6px;
}

.fd-tooltip-values {
  display: flex;
  gap: 16px;
}

.fd-tooltip-val {
  font-size: 14px;
  font-weight: 600;
}

.fd-tooltip-val.fund {
  color: var(--fd-gold);
}

.fd-tooltip-val.benchmark {
  color: var(--fd-silver);
}

.fd-tooltip-watched-values {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* Chart Legend */
.fd-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--fd-slate);
}

/* X-axis labels */
.fd-chart-x-axis {
  display: flex;
  justify-content: space-between;
  padding: 10px 0 0 0;
  font-size: 11px;
  color: var(--fd-silver);
}
.fd-chart-x-axis span {
  opacity: 0.7;
}
.fd-chart-x-axis .fd-forecast-date {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  padding: 2px 8px;
  border-radius: 10px;
  color: #c084fc;
  opacity: 1;
  font-weight: 500;
}

/* Y-axis labels */
.fd-chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px 12px 40px 0;
  font-size: 10px;
  color: var(--fd-silver);
  opacity: 0.7;
  text-align: right;
  min-width: 45px;
}

/* Chart wrapper with Y-axis */
.fd-line-chart-wrapper {
  display: flex;
  align-items: stretch;
  position: relative;
}

.fd-line-chart {
  flex: 1;
  position: relative;
}

/* Today line marker */
.fd-today-line {
  opacity: 0.3;
}

/* Improved Tooltip */
.fd-chart-tooltip {
  position: absolute;
  background: var(--fd-obsidian);
  border: 1px solid var(--fd-slate);
  border-radius: 10px;
  padding: 12px 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.fd-chart-tooltip.visible {
  opacity: 1;
}

.fd-tooltip-date {
  font-size: 11px;
  color: var(--fd-silver);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--fd-slate);
}

.fd-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}

.fd-tooltip-row.benchmark {
  opacity: 0.7;
}

.fd-tooltip-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fd-tooltip-name {
  flex: 1;
  color: var(--fd-silver);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.fd-tooltip-val {
  font-weight: 600;
  color: var(--fd-ivory);
  min-width: 50px;
  text-align: right;
}

.fd-tooltip-val.positive {
  color: #4ade80;
}

.fd-tooltip-val.negative {
  color: #f87171;
}

/* Competitor Tags */
.fd-competitor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--fd-slate);
}

.fd-competitor-tags:empty {
  display: none;
}

.fd-competitor-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--fd-charcoal);
  border: 1px solid var(--fd-slate);
  border-radius: 20px;
  font-size: 13px;
  color: var(--fd-ivory);
  cursor: default;
  transition: all 0.2s ease;
}

.fd-competitor-tag:hover {
  border-color: var(--fd-pewter);
}

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

.fd-competitor-tag-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-competitor-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--fd-silver);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  margin-left: 4px;
}

.fd-competitor-tag-remove:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

.fd-competitor-tag-remove svg {
  width: 12px;
  height: 12px;
}

.fd-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--fd-silver);
}

.fd-legend-line {
  width: 24px;
  height: 3px;
  border-radius: 2px;
}

.fd-legend-line.fund {
  background: var(--fd-gold);
}

.fd-legend-line.benchmark {
  background: repeating-linear-gradient(90deg, var(--fd-pewter) 0px, var(--fd-pewter) 4px, transparent 4px, transparent 8px);
}

/* Bar Chart */
.fd-bar-chart {
  display: none;
  padding: 40px;
  text-align: center;
  color: var(--fd-silver);
}

.fd-bar-chart.active {
  display: block;
}

/* Bar Chart Inner Styles */
.fd-bar-chart-inner {
  display: flex;
  height: 250px;
  padding: 20px 0;
}

.fd-bar-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 10px;
  font-size: 11px;
  color: var(--fd-silver);
  text-align: right;
  min-width: 40px;
}

.fd-bar-chart-bars {
  flex: 1;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  position: relative;
  border-left: 1px solid var(--fd-pewter);
}

.fd-bar-zero-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px dashed var(--fd-pewter);
}

.fd-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 80px;
}

.fd-bar-wrapper {
  flex: 1;
  width: 40px;
  position: relative;
}

.fd-bar {
  position: absolute;
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}

.fd-bar.positive {
  background: linear-gradient(180deg, #4ade80, #22c55e);
}

.fd-bar.negative {
  background: linear-gradient(0deg, #f87171, #ef4444);
  border-radius: 0 0 4px 4px;
}

.fd-bar-label {
  font-size: 11px;
  color: var(--fd-silver);
  margin-top: 8px;
  white-space: nowrap;
}

.fd-bar-value {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.fd-bar-value.positive { color: #4ade80; }
.fd-bar-value.negative { color: #f87171; }

/* Comparison markers on bar chart */
.fd-bar-comparison-marker {
  position: absolute;
  width: 100%;
  border-left: 3px solid #60a5fa;
  border-right: 3px solid #60a5fa;
  background: transparent;
  pointer-events: none;
  opacity: 0.8;
}

/* Comparison line styles */
.fd-chart-line.comparison {
  stroke-dasharray: 5, 3;
  opacity: 0.8;
}

/* Quartile Badges */
.fd-quartile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
}

.fd-quartile.q1 { background: #3b82f6; color: white; }
.fd-quartile.q2 { background: #3b82f6; color: white; }
.fd-quartile.q3 { background: #fbbf24; color: #1a1a1a; }
.fd-quartile.q4 { background: #f87171; color: white; }

.fd-rank {
  font-size: 11px;
  color: var(--fd-silver);
}

.fd-perf-ranking {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.fd-line-chart-wrapper.hidden {
  display: none;
}

/* ========================================
   ALLOCATION CARD
======================================== */
.fd-allocation-card {
  padding: 28px;
}

.fd-alloc-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.fd-allocation-tabs {
  display: flex;
  background: var(--fd-slate);
  border-radius: 10px;
  padding: 4px;
}

.fd-alloc-tab {
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fd-silver);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--fd-font-body);
  transition: all 0.2s ease;
}

.fd-alloc-tab.active {
  background: var(--fd-graphite);
  color: var(--fd-ivory);
}

.fd-alloc-panel {
  display: none;
}

.fd-alloc-panel.active {
  display: block;
}

/* FMP Loading State */
.fd-fmp-loading {
  padding: 40px;
  text-align: center;
  color: var(--fd-silver);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.fd-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--fd-slate);
  border-top-color: var(--fd-gold);
  border-radius: 50%;
  animation: fd-spin 0.8s linear infinite;
}

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

.fd-alloc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.fd-alloc-row {
  padding: 16px;
  background: var(--fd-slate);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fd-alloc-row:hover {
  background: var(--fd-pewter);
  transform: translateY(-2px);
}

.fd-alloc-row-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fd-alloc-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--fd-ivory);
}

.fd-alloc-values {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.fd-alloc-fund {
  color: var(--fd-gold);
  font-weight: 600;
}

.fd-alloc-bars-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fd-alloc-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fd-alloc-bar-label {
  width: 50px;
  font-size: 10px;
  color: var(--fd-silver);
}

.fd-alloc-bar-label.fund-label {
  color: var(--fd-gold);
}

.fd-alloc-bars {
  flex: 1;
  height: 8px;
  background: var(--fd-graphite);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.fd-alloc-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 4px;
  transition: width 1s var(--fd-ease-out-expo);
}

.fd-alloc-bar.fund {
  background: var(--fd-gold);
}

.fd-alloc-bar-value {
  font-size: 11px;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* Comparison bars in allocation */
.fd-alloc-comparison-bars {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--fd-pewter);
  display: none;
}

.fd-alloc-comparison-bars.visible {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fd-alloc-bar-row.comparison {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fd-alloc-bar-row.comparison .fd-alloc-bar-label {
  width: 80px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-alloc-comp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.fd-alloc-comp-row:last-child {
  margin-bottom: 0;
}

.fd-alloc-comp-label {
  width: 50px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-alloc-comp-bar-track {
  flex: 1;
  height: 6px;
  background: var(--fd-graphite);
  border-radius: 3px;
  overflow: hidden;
}

.fd-alloc-comp-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--fd-ease-out-expo);
}

.fd-alloc-comp-value {
  font-size: 10px;
  font-weight: 600;
  min-width: 35px;
  text-align: right;
}

.fd-alloc-comp-diff {
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 3px;
  min-width: 40px;
  text-align: center;
}

.fd-alloc-comp-diff.over {
  background: rgba(74, 222, 128, 0.15);
  color: var(--fd-success);
}

.fd-alloc-comp-diff.under {
  background: rgba(248, 113, 113, 0.15);
  color: var(--fd-error);
}

/* ========================================
   INSIGHTS CARD
======================================== */
.fd-insights-card {
  padding: 28px;
}

.fd-insights-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.fd-view-all-btn {
  font-size: 12px;
  color: var(--fd-gold);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.fd-view-all-btn:hover {
  text-decoration: underline;
}

.fd-view-all-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--fd-gold);
  stroke-width: 2;
  fill: none;
}

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

.fd-insight-item {
  background: var(--fd-slate);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fd-insight-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.fd-insight-image {
  height: 120px;
  background: linear-gradient(135deg, var(--fd-pewter), var(--fd-slate));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.fd-insight-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.6) 100%);
}

.fd-insight-image svg {
  width: 40px;
  height: 40px;
  stroke: var(--fd-silver);
  stroke-width: 1.5;
  fill: none;
  opacity: 0.5;
}

.fd-insight-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  background: rgba(201, 169, 98, 0.9);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--fd-obsidian);
}

.fd-insight-content {
  padding: 16px;
}

.fd-insight-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fd-ivory);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fd-insight-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--fd-silver);
}

.fd-insight-author {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fd-insight-author-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--fd-pewter);
}

/* ========================================
   NEWS TOGGLE & PINS
======================================== */
.fd-news-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fd-silver);
  background: transparent;
  border: 1px solid var(--fd-slate);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 6px;
}
.fd-news-toggle:hover {
  background: var(--fd-slate);
}
.fd-news-toggle.active {
  background: rgba(96, 165, 250, 0.15);
  border-color: var(--fd-blue);
  color: var(--fd-blue);
}
.fd-news-toggle svg {
  width: 14px;
  height: 14px;
}
.fd-news-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--fd-blue);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}

/* AI Forecast Toggle */
.fd-ai-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fd-silver);
  background: transparent;
  border: 1px solid var(--fd-slate);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 6px;
  position: relative;
  overflow: hidden;
}
.fd-ai-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(236, 72, 153, 0.1), rgba(249, 115, 22, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.fd-ai-toggle:hover::before {
  opacity: 1;
}
.fd-ai-toggle:hover {
  border-color: rgba(168, 85, 247, 0.5);
}
.fd-ai-toggle.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2), rgba(249, 115, 22, 0.2));
  border-color: transparent;
  border-image: linear-gradient(135deg, #a855f7, #ec4899, #f97316) 1;
}
.fd-ai-toggle.active .fd-ai-label {
  background: linear-gradient(135deg, #a855f7, #ec4899, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.fd-ai-toggle svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.fd-ai-label {
  position: relative;
  z-index: 1;
}

/* AI Forecast Line on Chart */
.fd-ai-forecast-line {
  stroke: url(#aiGradient);
  stroke-width: 2.5;
  fill: none;
  stroke-dasharray: 8 4;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.fd-ai-forecast-line.visible {
  opacity: 1;
  animation: aiPulse 2s ease-in-out infinite;
}
.fd-ai-forecast-area {
  fill: url(#aiGradientFill);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.fd-ai-forecast-area.visible {
  opacity: 0.15;
}
@keyframes aiPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* AI Forecast Badge on Chart */
.fd-ai-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.95), rgba(236, 72, 153, 0.95));
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4), 0 0 20px rgba(236, 72, 153, 0.2);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
}
.fd-ai-badge.visible {
  opacity: 1;
  transform: translateY(0);
}
.fd-ai-badge:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.5), 0 0 30px rgba(236, 72, 153, 0.3);
}
.fd-ai-badge:active {
  transform: scale(0.98);
}
.fd-ai-badge svg {
  width: 14px;
  height: 14px;
}
.fd-ai-badge::after {
  content: '›';
  margin-left: 4px;
  font-size: 14px;
  opacity: 0.8;
  transition: transform 0.2s ease;
}
.fd-ai-badge:hover::after {
  transform: translateX(2px);
}

/* News Pins Container */
.fd-pins-container {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px; /* Above x-axis */
  height: 60px;
  pointer-events: none;
}
.fd-pins-container .fd-news-pin {
  pointer-events: auto;
}

/* News Pins on Chart */
.fd-news-pin {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  cursor: pointer;
  z-index: 100;
  transition: all 0.2s ease;
}
.fd-news-pin:hover {
  z-index: 101;
}
.fd-news-pin-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fd-blue);
  border: 3px solid var(--fd-obsidian);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.7), 0 2px 8px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}
.fd-news-pin:hover .fd-news-pin-marker {
  transform: scale(1.3);
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.9), 0 4px 12px rgba(0,0,0,0.4);
}
.fd-news-pin-stem {
  position: absolute;
  bottom: 14px;
  left: 50%;
  width: 2px;
  height: 35px;
  background: linear-gradient(to top, rgba(96, 165, 250, 0.6), rgba(96, 165, 250, 0.1));
  transform: translateX(-50%);
  border-radius: 1px;
}
.fd-news-pin-count {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--fd-blue);
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
}
.fd-news-pin.sentiment-positive .fd-news-pin-marker {
  background: var(--fd-emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.7), 0 2px 8px rgba(0,0,0,0.3);
}
.fd-news-pin.sentiment-positive .fd-news-pin-stem {
  background: linear-gradient(to top, rgba(16, 185, 129, 0.6), rgba(16, 185, 129, 0.1));
}
.fd-news-pin.sentiment-positive .fd-news-pin-count {
  background: var(--fd-emerald);
}
.fd-news-pin.sentiment-negative .fd-news-pin-marker {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7), 0 2px 8px rgba(0,0,0,0.3);
}
.fd-news-pin.sentiment-negative .fd-news-pin-stem {
  background: linear-gradient(to top, rgba(239, 68, 68, 0.6), rgba(239, 68, 68, 0.1));
}
.fd-news-pin.sentiment-negative .fd-news-pin-count {
  background: #ef4444;
}

/* News Pin Tooltip - hover preview */
.fd-pin-tooltip {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: var(--fd-charcoal);
  border: 1px solid var(--fd-slate);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 200;
}
.fd-news-pin:hover .fd-pin-tooltip {
  opacity: 1;
  visibility: visible;
}
.fd-pin-tooltip-date {
  font-size: 10px;
  color: var(--fd-silver);
  margin-bottom: 8px;
}
.fd-pin-tooltip-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--fd-slate);
}
.fd-pin-tooltip-item:last-child {
  border-bottom: none;
}
.fd-pin-tooltip-title {
  font-size: 12px;
  color: var(--fd-ivory);
  line-height: 1.4;
  margin-bottom: 4px;
}
.fd-pin-tooltip-source {
  font-size: 10px;
  color: var(--fd-silver);
}

/* News Modal */
.fd-news-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.fd-news-modal.visible {
  opacity: 1;
  visibility: visible;
}
.fd-news-modal-content {
  background: var(--fd-charcoal);
  border: 1px solid var(--fd-slate);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.fd-news-modal.visible .fd-news-modal-content {
  transform: translateY(0);
}
.fd-news-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--fd-slate);
}
.fd-news-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fd-ivory);
}
.fd-news-modal-date {
  font-size: 12px;
  color: var(--fd-silver);
  margin-top: 4px;
}
.fd-news-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--fd-slate);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fd-silver);
  transition: all 0.2s ease;
}
.fd-news-modal-close:hover {
  background: var(--fd-pewter);
  color: var(--fd-ivory);
}
.fd-news-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.fd-news-modal-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fd-news-modal-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--fd-slate);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.fd-news-modal-item:hover {
  background: var(--fd-pewter);
  transform: translateX(4px);
}
.fd-news-modal-item-image {
  width: 100px;
  height: 70px;
  border-radius: 8px;
  background: var(--fd-pewter);
  flex-shrink: 0;
  overflow: hidden;
}
.fd-news-modal-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fd-news-modal-item-content {
  flex: 1;
  min-width: 0;
}
.fd-news-modal-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fd-ivory);
  line-height: 1.4;
  margin-bottom: 8px;
}
.fd-news-modal-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--fd-silver);
  flex-wrap: wrap;
}
.fd-news-modal-item-symbol {
  padding: 2px 6px;
  background: rgba(201, 169, 98, 0.2);
  color: var(--fd-gold);
  border-radius: 4px;
  font-weight: 600;
}
.fd-news-modal-item-sentiment {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.fd-news-modal-item-sentiment.positive {
  background: rgba(16, 185, 129, 0.2);
  color: var(--fd-emerald);
}
.fd-news-modal-item-sentiment.negative {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}
.fd-news-modal-item-sentiment.neutral {
  background: rgba(156, 163, 175, 0.2);
  color: var(--fd-silver);
}

/* ========================================
   AI FORECAST MODAL
======================================== */
.fd-ai-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.fd-ai-modal.visible {
  opacity: 1;
  visibility: visible;
}
.fd-ai-modal-content {
  background: linear-gradient(135deg, var(--fd-charcoal) 0%, #1a1a2e 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 20px;
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 40px rgba(168, 85, 247, 0.1);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}
.fd-ai-modal.visible .fd-ai-modal-content {
  transform: translateY(0) scale(1);
}
.fd-ai-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}
.fd-ai-modal-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.fd-ai-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
}
.fd-ai-modal-title {
  font-size: 18px;
  font-weight: 600;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.fd-ai-modal-subtitle {
  font-size: 12px;
  color: var(--fd-silver);
  margin-top: 2px;
}
.fd-ai-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fd-silver);
  transition: all 0.2s ease;
}
.fd-ai-modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}
.fd-ai-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Prediction Summary */
.fd-ai-prediction-summary {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(236, 72, 153, 0.05));
  border-radius: 16px;
  margin-bottom: 20px;
}
.fd-ai-prediction-value {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, #a855f7, #ec4899, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.fd-ai-prediction-label {
  font-size: 14px;
  color: var(--fd-silver);
  margin-top: 4px;
}
.fd-ai-confidence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 14px;
  background: rgba(0,0,0,0.3);
  border-radius: 20px;
  font-size: 12px;
  color: var(--fd-ivory);
}
.fd-ai-confidence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fd-silver);
}
.fd-ai-confidence-dot.high { background: var(--fd-emerald); }
.fd-ai-confidence-dot.medium { background: var(--fd-gold); }
.fd-ai-confidence-dot.low { background: #ef4444; }
.fd-ai-r2 {
  color: var(--fd-silver);
  font-size: 11px;
}

/* Sections */
.fd-ai-section {
  margin-bottom: 20px;
}
.fd-ai-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fd-ivory);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fd-ai-section-title svg {
  color: #a855f7;
}

/* Components */
.fd-ai-components {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fd-ai-component {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 12px;
}
.fd-ai-component-symbol {
  font-weight: 600;
  color: var(--fd-gold);
}
.fd-ai-component-weight {
  color: var(--fd-silver);
}
.fd-ai-component-type {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}
.fd-ai-component-type.holding {
  background: rgba(96, 165, 250, 0.2);
  color: var(--fd-blue);
}
.fd-ai-component-type.country {
  background: rgba(16, 185, 129, 0.2);
  color: var(--fd-emerald);
}

/* Methodology Steps */
.fd-ai-methodology {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fd-ai-step {
  display: flex;
  gap: 12px;
}
.fd-ai-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(236, 72, 153, 0.3));
  border: 1px solid rgba(168, 85, 247, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #a855f7;
  flex-shrink: 0;
}
.fd-ai-step-content {
  flex: 1;
}
.fd-ai-step-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fd-ivory);
  margin-bottom: 2px;
}
.fd-ai-step-desc {
  font-size: 12px;
  color: var(--fd-silver);
  line-height: 1.5;
}
.fd-ai-step-desc code {
  background: rgba(168, 85, 247, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 11px;
  color: #c084fc;
}

/* Stats */
.fd-ai-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.fd-ai-stat {
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
}
.fd-ai-stat-label {
  font-size: 10px;
  color: var(--fd-silver);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.fd-ai-stat-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--fd-ivory);
}
.fd-ai-stat-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.fd-ai-stat-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Disclaimer */
.fd-ai-disclaimer {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 10px;
  font-size: 11px;
  color: var(--fd-silver);
  line-height: 1.5;
}
.fd-ai-disclaimer svg {
  flex-shrink: 0;
  color: #f97316;
  margin-top: 2px;
}

/* ========================================
   NEWS SECTION CARD
======================================== */
.fd-news-card {
  padding: 24px;
}
.fd-news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.fd-news-tabs {
  display: flex;
  gap: 8px;
}
.fd-news-tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fd-silver);
  background: transparent;
  border: 1px solid var(--fd-slate);
  cursor: pointer;
  transition: all 0.2s ease;
}
.fd-news-tab:hover {
  background: var(--fd-slate);
}
.fd-news-tab.active {
  background: var(--fd-gold);
  color: var(--fd-obsidian);
  border-color: var(--fd-gold);
}
.fd-news-content {
  min-height: 200px;
}
.fd-news-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--fd-silver);
  font-size: 13px;
}
.fd-news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fd-news-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--fd-slate);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.fd-news-item:hover {
  background: var(--fd-pewter);
  transform: translateY(-2px);
}
.fd-news-item-image {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  background: var(--fd-pewter);
  flex-shrink: 0;
  overflow: hidden;
}
.fd-news-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fd-news-item-content {
  flex: 1;
  min-width: 0;
}
.fd-news-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fd-ivory);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fd-news-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--fd-silver);
}
.fd-news-item-symbol {
  padding: 2px 6px;
  background: rgba(201, 169, 98, 0.2);
  color: var(--fd-gold);
  border-radius: 4px;
  font-weight: 600;
}
.fd-news-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--fd-silver);
  font-size: 13px;
}
.fd-news-empty svg {
  width: 48px;
  height: 48px;
  stroke: var(--fd-silver);
  opacity: 0.5;
  margin-bottom: 12px;
}

/* ========================================
   RIGHT SIDEBAR CARDS
======================================== */
.fd-compare-card {
  padding: 24px;
}

.fd-compare-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.fd-watched-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--fd-gold);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fd-obsidian);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fd-watched-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fd-watched-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--fd-slate);
  border: 1px solid var(--fd-pewter);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--fd-font-body);
}

.fd-watched-chip:hover {
  background: var(--fd-pewter);
}

.fd-watched-chip.active {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.05);
}

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

.fd-chip-name {
  flex: 1;
  font-size: 13px;
  color: var(--fd-ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-chip-toggle {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--fd-pewter);
  position: relative;
}

.fd-watched-chip.active .fd-chip-toggle {
  background: currentColor;
  border-color: currentColor;
}

.fd-watched-chip.active .fd-chip-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 8px;
  border: solid var(--fd-obsidian);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.fd-add-fund-btn {
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--fd-gold), var(--fd-gold-dark));
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(201, 169, 98, 0.3);
  font-family: var(--fd-font-body);
  transition: all 0.2s ease;
}

.fd-add-fund-btn:hover {
  transform: translateY(-2px);
}

.fd-add-fund-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--fd-obsidian);
  stroke-width: 2;
  fill: none;
}

.fd-add-fund-btn span {
  font-size: 14px;
  font-weight: 600;
  color: var(--fd-obsidian);
}

/* Holdings Card */
.fd-holdings-card {
  overflow: hidden;
}

.fd-holdings-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--fd-slate);
  display: flex;
  justify-content: space-between;
}

.fd-holding-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--fd-slate);
  cursor: pointer;
  transition: background 0.2s ease;
}

.fd-holding-row:last-child {
  border-bottom: none;
}

.fd-holding-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.fd-holding-rank {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--fd-slate);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--fd-silver);
  flex-shrink: 0;
}

.fd-holding-info {
  flex: 1;
  min-width: 0;
}

.fd-holding-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fd-ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-holding-sector {
  font-size: 11px;
  color: var(--fd-silver);
  margin-top: 2px;
}

.fd-holding-weight {
  font-size: 14px;
  font-weight: 600;
  color: var(--fd-gold);
  flex-shrink: 0;
}

.fd-holding-arrow {
  flex-shrink: 0;
  opacity: 0.4;
  transition: all 0.2s ease;
}

.fd-holding-row:hover .fd-holding-arrow {
  opacity: 1;
  stroke: var(--fd-gold);
  transform: translateX(2px);
}

/* Allocation link styles */
.fd-alloc-link-icon {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0;
  transition: all 0.2s ease;
  color: var(--fd-silver);
}

.fd-alloc-clickable:hover .fd-alloc-link-icon {
  opacity: 1;
  color: var(--fd-gold);
}

.fd-alloc-clickable {
  position: relative;
}

.fd-alloc-clickable::after {
  content: 'View details →';
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  color: var(--fd-gold);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.fd-alloc-clickable:hover::after {
  opacity: 0.7;
}

/* CTA Card */
.fd-cta-card {
  padding: 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(201, 169, 98, 0.15), rgba(166, 139, 61, 0.1));
  border: 1px solid rgba(201, 169, 98, 0.3);
}

.fd-cta-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  background: var(--fd-gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fd-cta-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--fd-obsidian);
  stroke-width: 2;
  fill: none;
}

.fd-cta-title {
  font-family: var(--fd-font-display);
  font-size: 20px;
  color: var(--fd-ivory);
  margin-bottom: 8px;
  font-weight: 400;
}

.fd-cta-text {
  font-size: 13px;
  color: var(--fd-silver);
  margin-bottom: 16px;
  line-height: 1.5;
}

.fd-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--fd-gold);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fd-obsidian);
  cursor: pointer;
  font-family: var(--fd-font-body);
  transition: all 0.2s ease;
}

.fd-cta-btn:hover {
  transform: translateY(-2px);
}

.fd-cta-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--fd-obsidian);
  stroke-width: 2;
  fill: none;
}

/* ========================================
   TOAST NOTIFICATION
======================================== */
.fd-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--fd-graphite);
  border: 1px solid var(--fd-slate);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transition: all 0.4s var(--fd-ease-out-expo);
  z-index: 2000;
}

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

.fd-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(74, 222, 128, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fd-toast-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--fd-success);
  stroke-width: 2;
  fill: none;
}

.fd-toast-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fd-ivory);
}

.fd-toast-subtitle {
  font-size: 12px;
  color: var(--fd-silver);
  margin-top: 2px;
}

/* ========================================
   MODAL
======================================== */
.fd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.fd-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.fd-modal {
  width: 520px;
  max-height: 80vh;
  background: var(--fd-graphite);
  border: 1px solid var(--fd-slate);
  border-radius: 24px;
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s var(--fd-ease-out-expo);
}

.fd-modal-overlay.visible .fd-modal {
  transform: scale(1) translateY(0);
}

.fd-modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--fd-slate);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fd-modal-title {
  font-family: var(--fd-font-display);
  font-size: 22px;
  color: var(--fd-ivory);
  font-weight: 400;
}

.fd-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--fd-slate);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fd-modal-close:hover {
  background: var(--fd-pewter);
}

.fd-modal-close svg {
  width: 18px;
  height: 18px;
  stroke: var(--fd-platinum);
  stroke-width: 2;
  fill: none;
}

.fd-modal-body {
  padding: 20px 24px;
  max-height: 400px;
  overflow-y: auto;
}

.fd-modal-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--fd-slate);
  border: 1px solid var(--fd-pewter);
  border-radius: 12px;
  margin-bottom: 16px;
}

.fd-modal-search svg {
  width: 20px;
  height: 20px;
  stroke: var(--fd-silver);
  stroke-width: 2;
  fill: none;
}

.fd-modal-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--fd-ivory);
  font-family: var(--fd-font-body);
}

.fd-modal-category-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.fd-category-filter-btn {
  padding: 8px 14px;
  background: var(--fd-slate);
  border: 1px solid var(--fd-pewter);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fd-silver);
  cursor: pointer;
  font-family: var(--fd-font-body);
  transition: all 0.2s ease;
}

.fd-category-filter-btn.active {
  background: var(--fd-gold);
  border-color: var(--fd-gold);
  color: var(--fd-obsidian);
}

.fd-modal-fund-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fd-modal-fund-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--fd-slate);
  border: 1px solid var(--fd-pewter);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fd-modal-fund-item:hover {
  background: var(--fd-pewter);
}

.fd-modal-fund-item.selected {
  border-color: var(--fd-gold);
  background: rgba(201, 169, 98, 0.1);
}

.fd-modal-fund-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--fd-graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--fd-platinum);
  flex-shrink: 0;
}

.fd-modal-fund-info {
  flex: 1;
  min-width: 0;
}

.fd-modal-fund-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--fd-ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-modal-fund-meta {
  font-size: 12px;
  color: var(--fd-silver);
  margin-top: 2px;
}

.fd-modal-fund-perf {
  text-align: right;
  flex-shrink: 0;
}

.fd-modal-fund-return {
  font-size: 14px;
  font-weight: 600;
  color: var(--fd-success);
}

.fd-modal-fund-return.negative {
  color: var(--fd-error);
}

.fd-modal-fund-label {
  font-size: 11px;
  color: var(--fd-silver);
  margin-top: 2px;
}

.fd-modal-fund-period {
  font-size: 11px;
  color: var(--fd-pewter);
}

.fd-modal-fund-check {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--fd-pewter);
  transition: all 0.2s ease;
}

.fd-modal-fund-item.selected .fd-modal-fund-check {
  color: var(--fd-gold);
}

.fd-modal-fund-check svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.fd-modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--fd-slate);
  display: flex;
  gap: 12px;
}

.fd-modal-btn {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: var(--fd-font-body);
  transition: all 0.2s ease;
}

.fd-modal-btn.secondary {
  background: var(--fd-slate);
  color: var(--fd-platinum);
}

.fd-modal-btn.primary {
  background: linear-gradient(135deg, var(--fd-gold), var(--fd-gold-dark));
  color: var(--fd-obsidian);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.fd-selected-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--fd-obsidian);
  border-radius: 50%;
  font-size: 12px;
}

/* ========================================
   LOADING STATE
======================================== */
.fd-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 24px;
}

.fd-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--fd-slate);
  border-top-color: var(--fd-gold);
  border-radius: 50%;
  animation: fd-spin 1s linear infinite;
}

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

.fd-loading-text {
  font-size: 16px;
  color: var(--fd-silver);
}

/* ========================================
   ERROR STATE
======================================== */
.fd-error-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  text-align: center;
  padding: 40px;
}

.fd-error-icon {
  width: 64px;
  height: 64px;
  background: rgba(248, 113, 113, 0.15);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fd-error-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--fd-error);
  stroke-width: 2;
  fill: none;
}

.fd-error-title {
  font-family: var(--fd-font-display);
  font-size: 24px;
  color: var(--fd-ivory);
  font-weight: 400;
}

.fd-error-text {
  font-size: 14px;
  color: var(--fd-silver);
  max-width: 400px;
}

.fd-error-btn {
  margin-top: 8px;
  padding: 12px 24px;
  background: var(--fd-gold);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fd-obsidian);
  cursor: pointer;
  font-family: var(--fd-font-body);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1400px) {
  .fd-main-layout {
    grid-template-columns: 300px 1fr 300px;
  }
}

@media (max-width: 1200px) {
  .fd-main-layout {
    grid-template-columns: 1fr;
    padding: calc(var(--fd-header-height) + 24px) 24px 24px;
  }
  
  .fd-sidebar-left,
  .fd-sidebar-right {
    position: static;
  }
  
  .fd-insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .fd-perf-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .fd-perf-stat {
    border-right: none;
    border-bottom: 1px solid var(--fd-pewter);
    padding-bottom: 16px;
  }
  
  .fd-perf-stat:nth-child(2n) {
    border-right: none;
  }
  
  .fd-perf-stat:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

@media (max-width: 768px) {
  .fd-global-nav {
    padding: 0 20px;
  }
  
  .fd-nav-links {
    display: none;
  }
  
  .fd-nav-search {
    display: none;
  }
  
  .fd-main-layout {
    padding: calc(var(--fd-header-height) + 16px) 16px 16px;
    gap: 16px;
  }
  
  .fd-alloc-grid {
    grid-template-columns: 1fr;
  }
  
  .fd-insights-grid {
    grid-template-columns: 1fr;
  }
  
  .fd-time-periods {
    flex-wrap: wrap;
  }
}

/* ============================================================================
   SECTION 3: FUND COMPARISON STYLES (from page-fund-comparison.php)
   ============================================================================ */
/* ========================================
   FC - FUND COMPARISON STYLES
   Using fc- prefix per naming convention
======================================== */
:root {
  --fc-obsidian: #0a0a0b;
  --fc-charcoal: #141416;
  --fc-graphite: #1c1c1f;
  --fc-slate: #2a2a2f;
  --fc-pewter: #4a4a52;
  --fc-silver: #8a8a94;
  --fc-platinum: #c4c4cc;
  --fc-ivory: #f4f4f6;
  --fc-white: #ffffff;
  --fc-gold: #c9a962;
  --fc-gold-light: #e4d4a4;
  --fc-gold-dark: #a68b3d;
  --fc-success: #4ade80;
  --fc-error: #f87171;
  --fc-blue: #60a5fa;
  --fc-purple: #a78bfa;
  --fc-pink: #f472b6;
  --fc-orange: #fb923c;
  --fc-cyan: #22d3ee;
  --fc-lime: #a3e635;
  
  --fc-font-display: 'Cormorant Garamond', Georgia, serif;
  --fc-font-body: 'DM Sans', -apple-system, sans-serif;
  
  --fc-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --fc-ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset for comparison page */
.fc-page {
  font-family: var(--fc-font-body);
  background: var(--fc-obsidian);
  color: var(--fc-platinum);
  line-height: 1.5;
  min-height: 100vh;
}

.fc-page * {
  box-sizing: border-box;
}

/* ========================================
   HEADER
======================================== */
.fc-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--fc-slate);
}

.fc-header-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.fc-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fc-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--fc-graphite);
  border: 1px solid var(--fc-slate);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fc-back-btn:hover {
  background: var(--fc-slate);
  border-color: var(--fc-pewter);
}

.fc-back-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--fc-platinum);
  stroke-width: 2;
  fill: none;
}

.fc-page-title {
  font-family: var(--fc-font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--fc-white);
  margin: 0;
}

.fc-page-title .fc-highlight {
  color: var(--fc-gold);
}

.fc-fund-count-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(201, 169, 98, 0.1);
  border: 1px solid rgba(201, 169, 98, 0.2);
  border-radius: 100px;
}

.fc-fund-count-badge span {
  font-size: 14px;
  font-weight: 600;
  color: var(--fc-gold);
}

.fc-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--fc-font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--fc-ease-out-expo);
}

.fc-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.fc-btn-secondary {
  background: var(--fc-graphite);
  border: 1px solid var(--fc-slate);
  color: var(--fc-platinum);
}

.fc-btn-secondary:hover {
  background: var(--fc-slate);
  border-color: var(--fc-pewter);
}

.fc-btn-primary {
  background: linear-gradient(135deg, var(--fc-gold) 0%, var(--fc-gold-dark) 100%);
  color: var(--fc-obsidian);
  box-shadow: 0 4px 15px rgba(201, 169, 98, 0.3);
}

.fc-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 169, 98, 0.4);
}

/* ========================================
   MAIN CONTAINER
======================================== */
.fc-main-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 24px 120px;
}

/* ========================================
   FUND TABS (Selected Funds)
======================================== */
.fc-fund-tabs-section {
  margin-bottom: 32px;
}

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

.fc-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fc-silver);
}

.fc-add-fund-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px dashed var(--fc-pewter);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-silver);
  cursor: pointer;
  transition: all 0.2s ease;
}

.fc-add-fund-btn:hover {
  border-color: var(--fc-gold);
  color: var(--fc-gold);
  background: rgba(201, 169, 98, 0.05);
}

.fc-add-fund-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.fc-fund-tabs-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.fc-fund-tabs-container::-webkit-scrollbar {
  display: none;
}

.fc-fund-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--fc-graphite);
  border: 1px solid var(--fc-slate);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 280px;
}

.fc-fund-tab:hover {
  border-color: var(--fc-pewter);
}

.fc-fund-tab.active {
  background: rgba(201, 169, 98, 0.08);
  border-color: var(--fc-gold);
}

.fc-fund-tab-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fc-fund-tab-info {
  flex: 1;
  min-width: 0;
}

.fc-fund-tab-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fc-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.fc-fund-tab-meta {
  font-size: 12px;
  color: var(--fc-silver);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-fund-tab-remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fc-slate);
  border: none;
  border-radius: 6px;
  opacity: 0.6;
  transition: all 0.2s ease;
  flex-shrink: 0;
  cursor: pointer;
}

.fc-fund-tab-remove:hover {
  opacity: 1;
  background: var(--fc-error);
}

.fc-fund-tab-remove svg {
  width: 14px;
  height: 14px;
  stroke: var(--fc-platinum);
  stroke-width: 2;
  fill: none;
}

/* ========================================
   COMPARISON CARDS GRID
======================================== */
.fc-comparison-section {
  margin-bottom: 40px;
}

.fc-comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.fc-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

@media (min-width: 1200px) {
  .fc-comparison-grid.two-funds {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .fc-comparison-grid.three-funds {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .fc-comparison-grid.four-funds {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .fc-comparison-grid.five-funds {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ========================================
   FUND COMPARISON CARD
======================================== */
.fc-fund-card {
  background: var(--fc-graphite);
  border: 2px solid var(--fc-slate);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  animation: fc-slideUp 0.5s var(--fc-ease-out-expo) forwards;
  opacity: 0;
}

.fc-fund-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--fc-gold);
}

.fc-fund-card.fund-1::before { background: var(--fc-gold); }
.fc-fund-card.fund-2::before { background: var(--fc-pink); }
.fc-fund-card.fund-3::before { background: var(--fc-cyan); }
.fc-fund-card.fund-4::before { background: var(--fc-purple); }
.fc-fund-card.fund-5::before { background: var(--fc-orange); }

.fc-fund-card:nth-child(1) { animation-delay: 0.1s; }
.fc-fund-card:nth-child(2) { animation-delay: 0.15s; }
.fc-fund-card:nth-child(3) { animation-delay: 0.2s; }
.fc-fund-card:nth-child(4) { animation-delay: 0.25s; }
.fc-fund-card:nth-child(5) { animation-delay: 0.3s; }

.fc-fund-card:hover {
  border-color: var(--fc-pewter);
}

.fc-fund-card-header {
  padding: 20px;
  border-bottom: 1px solid var(--fc-slate);
}

.fc-fund-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.fc-fund-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--fc-obsidian);
}

.fc-fund-card.fund-1 .fc-fund-logo { background: linear-gradient(135deg, var(--fc-gold), var(--fc-gold-dark)); }
.fc-fund-card.fund-2 .fc-fund-logo { background: linear-gradient(135deg, var(--fc-pink), #db2777); }
.fc-fund-card.fund-3 .fc-fund-logo { background: linear-gradient(135deg, var(--fc-cyan), #0891b2); }
.fc-fund-card.fund-4 .fc-fund-logo { background: linear-gradient(135deg, var(--fc-purple), #7c3aed); }
.fc-fund-card.fund-5 .fc-fund-logo { background: linear-gradient(135deg, var(--fc-orange), #ea580c); }

.fc-fund-card-title-area {
  flex: 1;
  min-width: 0;
}

.fc-fund-card-brand {
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-silver);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.fc-fund-card-name {
  font-family: var(--fc-font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--fc-white);
  line-height: 1.3;
}

.fc-fund-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fc-fund-badge {
  padding: 4px 10px;
  background: var(--fc-slate);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--fc-platinum);
}

.fc-fund-badge.category {
  background: rgba(201, 169, 98, 0.15);
  color: var(--fc-gold);
}

/* ========================================
   FUND STATS GRID
======================================== */
.fc-fund-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--fc-slate);
}

.fc-fund-stat {
  background: var(--fc-graphite);
  padding: 16px;
  text-align: center;
}

.fc-fund-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--fc-white);
  margin-bottom: 4px;
}

.fc-fund-stat-value.positive {
  color: var(--fc-success);
}

.fc-fund-stat-value.negative {
  color: var(--fc-error);
}

.fc-fund-stat-value.gold {
  color: var(--fc-gold);
}

.fc-fund-stat-value.muted {
  color: var(--fc-silver);
}

.fc-fund-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--fc-silver);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========================================
   TOP SECTORS BAR
======================================== */
.fc-fund-sectors {
  padding: 16px 20px;
}

.fc-fund-sectors-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--fc-silver);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.fc-sectors-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--fc-slate);
}

.fc-sector-segment {
  height: 100%;
  transition: width 0.6s var(--fc-ease-out-expo);
}

.fc-sectors-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.fc-sector-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--fc-silver);
}

.fc-sector-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* Sector Colors */
.fc-sector-tech { background: var(--fc-blue); }
.fc-sector-financials { background: var(--fc-gold); }
.fc-sector-consumer { background: var(--fc-pink); }
.fc-sector-healthcare { background: var(--fc-success); }
.fc-sector-industrials { background: var(--fc-orange); }
.fc-sector-comm { background: var(--fc-cyan); }
.fc-sector-energy { background: var(--fc-error); }
.fc-sector-materials { background: var(--fc-purple); }
.fc-sector-utilities { background: var(--fc-lime); }
.fc-sector-other { background: var(--fc-pewter); }

/* ========================================
   PERFORMANCE CHART SECTION
======================================== */
.fc-chart-section {
  background: var(--fc-graphite);
  border: 1px solid var(--fc-slate);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 40px;
}

.fc-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.fc-chart-title {
  font-family: var(--fc-font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--fc-white);
  margin: 0;
}

.fc-chart-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fc-time-periods {
  display: flex;
  background: var(--fc-slate);
  border-radius: 8px;
  padding: 4px;
  gap: 2px;
}

.fc-period-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-silver);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fc-period-btn:hover {
  color: var(--fc-platinum);
}

.fc-period-btn.active {
  background: var(--fc-gold);
  color: var(--fc-obsidian);
}

.fc-chart-toggle {
  display: flex;
  background: var(--fc-slate);
  border-radius: 8px;
  padding: 4px;
}

.fc-toggle-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-silver);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fc-toggle-btn.active {
  background: var(--fc-graphite);
  color: var(--fc-ivory);
}

/* SVG Chart */
.fc-chart-wrapper {
  position: relative;
  height: 300px;
  margin-bottom: 20px;
}

.fc-chart-svg {
  width: 100%;
  height: 100%;
}

.fc-chart-grid-line {
  stroke: var(--fc-slate);
  stroke-width: 1;
}

.fc-chart-label {
  fill: var(--fc-pewter);
  font-size: 11px;
  font-family: var(--fc-font-body);
}

.fc-chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: fc-drawLine 1.5s var(--fc-ease-out-expo) forwards;
}

.fc-chart-line.fund-1 { stroke: var(--fc-gold); stroke-width: 3; animation-delay: 0s; }
.fc-chart-line.fund-2 { stroke: var(--fc-pink); animation-delay: 0.1s; }
.fc-chart-line.fund-3 { stroke: var(--fc-cyan); animation-delay: 0.2s; }
.fc-chart-line.fund-4 { stroke: var(--fc-purple); animation-delay: 0.3s; }
.fc-chart-line.fund-5 { stroke: var(--fc-orange); animation-delay: 0.4s; }
.fc-chart-line.benchmark { stroke: var(--fc-pewter); stroke-dasharray: 6 4; stroke-width: 2; opacity: 0.7; }

.fc-chart-area {
  opacity: 0;
  animation: fc-fadeIn 1s var(--fc-ease-out-expo) 0.5s forwards;
}

.fc-chart-area.fund-1 { fill: url(#fc-gradient1); }
.fc-chart-area.fund-2 { fill: url(#fc-gradient2); }
.fc-chart-area.fund-3 { fill: url(#fc-gradient3); }
.fc-chart-area.fund-4 { fill: url(#fc-gradient4); }
.fc-chart-area.fund-5 { fill: url(#fc-gradient5); }

.fc-chart-dot {
  opacity: 0;
  animation: fc-fadeIn 0.5s var(--fc-ease-out-expo) 1s forwards;
}

@keyframes fc-drawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes fc-fadeIn {
  to { opacity: 1; }
}

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

/* Chart Legend */
.fc-chart-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--fc-slate);
}

.fc-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.fc-legend-item:hover {
  opacity: 0.8;
}

.fc-legend-item.dimmed {
  opacity: 0.3;
}

.fc-legend-color {
  width: 16px;
  height: 4px;
  border-radius: 2px;
}

.fc-legend-color.fund-1 { background: var(--fc-gold); }
.fc-legend-color.fund-2 { background: var(--fc-pink); }
.fc-legend-color.fund-3 { background: var(--fc-cyan); }
.fc-legend-color.fund-4 { background: var(--fc-purple); }
.fc-legend-color.fund-5 { background: var(--fc-orange); }
.fc-legend-color.benchmark { 
  background: repeating-linear-gradient(90deg, var(--fc-pewter) 0px, var(--fc-pewter) 4px, transparent 4px, transparent 8px);
}

.fc-legend-name {
  font-size: 13px;
  color: var(--fc-platinum);
}

.fc-legend-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--fc-white);
}

/* ========================================
   ALLOCATION COMPARISON
======================================== */
.fc-allocation-section {
  background: var(--fc-graphite);
  border: 1px solid var(--fc-slate);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 40px;
}

.fc-allocation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.fc-allocation-title {
  font-family: var(--fc-font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--fc-white);
  margin: 0;
}

.fc-allocation-tabs {
  display: flex;
  background: var(--fc-slate);
  border-radius: 8px;
  padding: 4px;
}

.fc-alloc-tab {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-silver);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fc-alloc-tab.active {
  background: var(--fc-graphite);
  color: var(--fc-ivory);
}

.fc-allocation-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fc-allocation-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
}

@media (max-width: 768px) {
  .fc-allocation-row {
    grid-template-columns: 1fr;
  }
}

.fc-allocation-label {
  font-size: 14px;
  color: var(--fc-platinum);
}

.fc-allocation-bars {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fc-allocation-bar-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-allocation-bar {
  flex: 1;
  height: 24px;
  background: var(--fc-slate);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.fc-allocation-bar-fill {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-obsidian);
  transition: width 0.6s var(--fc-ease-out-expo);
}

.fc-allocation-bar-fill.fund-1 { background: var(--fc-gold); }
.fc-allocation-bar-fill.fund-2 { background: var(--fc-pink); }
.fc-allocation-bar-fill.fund-3 { background: var(--fc-cyan); }
.fc-allocation-bar-fill.fund-4 { background: var(--fc-purple); }
.fc-allocation-bar-fill.fund-5 { background: var(--fc-orange); }

.fc-allocation-bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--fc-platinum);
  min-width: 45px;
  text-align: right;
}

/* ========================================
   HOLDINGS COMPARISON
======================================== */
.fc-holdings-section {
  background: var(--fc-graphite);
  border: 1px solid var(--fc-slate);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 40px;
}

.fc-holdings-header {
  margin-bottom: 24px;
}

.fc-holdings-title {
  font-family: var(--fc-font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--fc-white);
  margin: 0;
}

.fc-holdings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.fc-holdings-column {
  background: var(--fc-charcoal);
  border: 1px solid var(--fc-slate);
  border-radius: 14px;
  overflow: hidden;
}

.fc-holdings-column-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--fc-slate);
  display: flex;
  align-items: center;
  gap: 10px;
}

.fc-holdings-column-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.fc-holdings-column-color.fund-1 { background: var(--fc-gold); }
.fc-holdings-column-color.fund-2 { background: var(--fc-pink); }
.fc-holdings-column-color.fund-3 { background: var(--fc-cyan); }
.fc-holdings-column-color.fund-4 { background: var(--fc-purple); }
.fc-holdings-column-color.fund-5 { background: var(--fc-orange); }

.fc-holdings-column-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fc-white);
  flex: 1;
}

.fc-holding-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fc-slate);
}

.fc-holding-item:last-child {
  border-bottom: none;
}

.fc-holding-item.shared {
  background: rgba(201, 169, 98, 0.05);
  border-left: 3px solid var(--fc-gold);
}

.fc-holding-rank {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fc-slate);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-silver);
  flex-shrink: 0;
}

.fc-holding-info {
  flex: 1;
  min-width: 0;
}

.fc-holding-name {
  font-size: 13px;
  color: var(--fc-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-holding-ticker {
  font-size: 11px;
  color: var(--fc-pewter);
}

.fc-holding-weight {
  font-size: 14px;
  font-weight: 600;
  color: var(--fc-gold);
}

/* ========================================
   METRICS TABLE
======================================== */
.fc-metrics-section {
  background: var(--fc-graphite);
  border: 1px solid var(--fc-slate);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 40px;
  overflow-x: auto;
}

.fc-metrics-header {
  margin-bottom: 24px;
}

.fc-metrics-title {
  font-family: var(--fc-font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--fc-white);
  margin: 0;
}

.fc-metrics-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.fc-metrics-table th,
.fc-metrics-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--fc-slate);
}

.fc-metrics-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-silver);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--fc-charcoal);
}

.fc-metrics-table th:first-child {
  border-radius: 8px 0 0 0;
}

.fc-metrics-table th:last-child {
  border-radius: 0 8px 0 0;
}

.fc-metrics-table td {
  font-size: 14px;
  color: var(--fc-platinum);
}

.fc-metrics-table td:first-child {
  font-weight: 600;
  color: var(--fc-white);
}

.fc-metrics-table tr:last-child td {
  border-bottom: none;
}

.fc-metrics-table .positive {
  color: var(--fc-success);
}

.fc-metrics-table .negative {
  color: var(--fc-error);
}

.fc-fund-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.fc-fund-indicator-dot.fund-1 { background: var(--fc-gold); }
.fc-fund-indicator-dot.fund-2 { background: var(--fc-pink); }
.fc-fund-indicator-dot.fund-3 { background: var(--fc-cyan); }
.fc-fund-indicator-dot.fund-4 { background: var(--fc-purple); }
.fc-fund-indicator-dot.fund-5 { background: var(--fc-orange); }

/* ========================================
   EMPTY STATE
======================================== */
.fc-empty-state {
  text-align: center;
  padding: 80px 24px;
}

.fc-empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--fc-graphite);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fc-empty-state-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--fc-pewter);
  stroke-width: 1.5;
  fill: none;
}

.fc-empty-state-title {
  font-family: var(--fc-font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--fc-white);
  margin-bottom: 12px;
}

.fc-empty-state-desc {
  font-size: 16px;
  color: var(--fc-silver);
  margin-bottom: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   LOADING STATE
======================================== */
.fc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.fc-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--fc-slate);
  border-top-color: var(--fc-gold);
  border-radius: 50%;
  animation: fc-spin 1s linear infinite;
  margin-bottom: 24px;
}

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

.fc-loading-text {
  font-size: 16px;
  color: var(--fc-silver);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
  .fc-header-content {
    flex-wrap: wrap;
  }
  
  .fc-fund-tab {
    min-width: 240px;
  }
  
  .fc-chart-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .fc-chart-controls {
    width: 100%;
    flex-wrap: wrap;
  }
  
  .fc-time-periods {
    flex: 1;
    justify-content: space-between;
  }
}

/* ============================================================================
   SECTION 4: GRID FIX - Force 3 columns
   ============================================================================ */
#fundsGrid,
.funds-grid,
.ff-funds-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
}

@media (max-width: 1400px) {
  #fundsGrid,
  .funds-grid,
  .ff-funds-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  #fundsGrid,
  .funds-grid,
  .ff-funds-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================================
   GRID OVERRIDE - Ensure 3 columns on desktop
   ============================================================================ */
.ff-grid,
#fundsGrid,
.funds-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
}

@media (max-width: 1200px) {
  .ff-grid,
  #fundsGrid,
  .funds-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .ff-grid,
  #fundsGrid,
  .funds-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================================
   CSS FIX: Sector Legend Container
   ============================================================================ */
.sector-legend {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px 12px !important;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ff-text-muted, #8a8a94);
}

.sector-legend-item {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sector-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.sector-legend-text {
  font-size: 11px;
  color: var(--ff-text-muted, #8a8a94);
}

/* Allocation Bar Container */
.fund-allocation-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ff-border, #2a2a2f);
}

.allocation-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.allocation-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ff-text-dim, #5a5a64);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.allocation-bar-container {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--ff-border, #2a2a2f);
}

.sector-segment {
  height: 100%;
  min-width: 3px;
}

/* ============================================================================
   CSS FIX: Filter Option Checkbox Styles
   ============================================================================ */
.filter-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.filter-option:hover {
  background: var(--ff-card-hover, #1c1c1f);
}

.filter-option.selected {
  background: rgba(201, 169, 98, 0.1);
}

.filter-checkbox {
  width: 18px;
  height: 18px;
  background: var(--ff-bg, #0a0a0b);
  border: 2px solid var(--ff-border-light, #3a3a42);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.filter-option.selected .filter-checkbox {
  background: var(--ff-gold, #c9a962);
  border-color: var(--ff-gold, #c9a962);
}

.filter-checkbox svg {
  width: 12px;
  height: 12px;
  stroke: transparent;
  stroke-width: 3;
  fill: none;
}

.filter-option.selected .filter-checkbox svg {
  stroke: var(--ff-bg, #0a0a0b);
}

.filter-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-label-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ff-text, #c4c4cc);
}

.filter-label-desc {
  font-size: 12px;
  color: var(--ff-text-dim, #5a5a64);
}

/* ============================================================================
   FILTER SIDEBAR FIXES
   ============================================================================ */

/* Filter group - collapsed by default */
.filter-group {
  border-bottom: 1px solid var(--ff-border, #2a2a2f);
  padding: 0;
  margin: 0;
}

.filter-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  cursor: pointer;
}

.filter-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ff-text, #c4c4cc) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group-toggle {
  width: 20px;
  height: 20px;
  stroke: var(--ff-text-muted, #8a8a94);
  fill: none;
  transition: transform 0.2s ease;
}

/* Collapsed state (default) */
.filter-group.collapsed .filter-group-toggle {
  transform: rotate(-90deg);
}

.filter-group.collapsed .filter-group-content {
  display: none;
}

/* Filter group content */
.filter-group-content {
  padding: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Filter option - checkbox style */
.filter-option {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
  text-align: left !important;
}

.filter-option:hover {
  background: var(--ff-card-hover, #1c1c1f) !important;
}

.filter-option.selected {
  background: rgba(201, 169, 98, 0.1) !important;
}

/* Checkbox */
.filter-checkbox {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  background: var(--ff-bg, #0a0a0b) !important;
  border: 2px solid var(--ff-border-light, #3a3a42) !important;
  border-radius: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
  margin-top: 2px !important;
}

.filter-option.selected .filter-checkbox {
  background: var(--ff-gold, #c9a962) !important;
  border-color: var(--ff-gold, #c9a962) !important;
}

.filter-checkbox svg {
  width: 12px !important;
  height: 12px !important;
  stroke: transparent !important;
  stroke-width: 3 !important;
  fill: none !important;
}

.filter-option.selected .filter-checkbox svg {
  stroke: var(--ff-bg, #0a0a0b) !important;
}

/* Filter label text - FIX BLACK TEXT */
.filter-option .filter-label,
.filter-option span:not(.filter-checkbox) {
  color: var(--ff-text, #c4c4cc) !important;
}

.filter-label {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  color: var(--ff-text, #c4c4cc) !important;
}

.filter-label-title,
.filter-option > span:nth-child(2) {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--ff-text, #c4c4cc) !important;
  line-height: 1.3 !important;
}

.filter-label-desc,
.filter-option > span:nth-child(3) {
  font-size: 12px !important;
  color: var(--ff-text-muted, #8a8a94) !important;
  line-height: 1.3 !important;
}

/* Empty state */
.filter-empty {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--ff-text-dim, #5a5a64);
}

/* Clear All button */
.ff-clear-btn {
  font-size: 13px;
  color: var(--ff-text-muted, #8a8a94);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.ff-clear-btn:hover {
  color: var(--ff-gold, #c9a962);
  background: rgba(201, 169, 98, 0.1);
}

/* Sidebar card padding */
.ff-sidebar-card {
  padding: 20px !important;
}

.ff-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ff-border, #2a2a2f);
}

.ff-sidebar-title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--ff-white, #ffffff) !important;
  margin: 0 !important;
}