:root {
  --docbg-dark: #090b10;
  --textcolor-dark: #d0d4df;
  --contrast-dark: #ffffff;
  --itembg-dark: #141924;
  --expandbg-dark: #1f2633;
  --previewbg-dark: #141924;
  --border-dark: #202737;
  --hover-dark: #1a2332;
  --docbg-light: #f5f5f9;
  --textcolor-light: #111827;
  --contrast-light: #000000;
  --itembg-light: #ffffff;
  --expandbg-light: #e5e7ef;
  --previewbg-light: #ffffff;
  --border-light: #d1d5e5;
  --hover-light: #f0f2f8;
  --accent: #00e6ff;
  --accent-text: #00e6ff;
  --warning-red: #ef4444;
  --warning-orange: #f97316;
  --warning-yellow: #eab308;
  --bias-left: #3b82f6;
  --bias-center: #10b981;
  --bias-right: #dc2626;
  --scrollbar-track-dark: #0d1017;
  --scrollbar-thumb-dark: #2a3444;
  --scrollbar-thumb-hover-dark: #3d4a5c;
  --scrollbar-track-light: #e5e7ef;
  --scrollbar-thumb-light: #b0b8c9;
  --scrollbar-thumb-hover-light: #8a94a8;
  --docbg: var(--docbg-dark);
  --textcolor: var(--textcolor-dark);
  --contrast: var(--contrast-dark);
  --itembg: var(--itembg-dark);
  --expandbg: var(--expandbg-dark);
  --previewbg: var(--previewbg-dark);
  --border: var(--border-dark);
  --hover-bg: var(--hover-dark);
  --scrollbar-track: var(--scrollbar-track-dark);
  --scrollbar-thumb: var(--scrollbar-thumb-dark);
  --scrollbar-thumb-hover: var(--scrollbar-thumb-hover-dark);
}
body[data-theme="light"] {
  --docbg: var(--docbg-light);
  --textcolor: var(--textcolor-light);
  --contrast: var(--contrast-light);
  --itembg: var(--itembg-light);
  --expandbg: var(--expandbg-light);
  --previewbg: var(--previewbg-light);
  --border: var(--border-light);
  --hover-bg: var(--hover-light);
  --scrollbar-track: var(--scrollbar-track-light);
  --scrollbar-thumb: var(--scrollbar-thumb-light);
  --scrollbar-thumb-hover: var(--scrollbar-thumb-hover-light);
  --accent-text: #000000;
}
/* Light mode: all badge text black, all cyan/accent text black */
body[data-theme="light"] .badge { color: #000 !important; }
body[data-theme="light"] .badge-topic, body[data-theme="light"] .badge-sources,
body[data-theme="light"] .badge-truth, body[data-theme="light"] .badge-trending,
body[data-theme="light"] .badge-bias, body[data-theme="light"] .badge-factuality,
body[data-theme="light"] .badge-country, body[data-theme="light"] .badge-funding,
body[data-theme="light"] .badge-ownership, body[data-theme="light"] .badge-bias-sev,
body[data-theme="light"] .badge-risk, body[data-theme="light"] .badge-reliability,
body[data-theme="light"] .badge-sentiment, body[data-theme="light"] .badge-sensationalism,
body[data-theme="light"] .badge-bot { color: #000 !important; }
body[data-theme="light"] .topbar .logo { color: #000; }
body[data-theme="light"] .breakdown-header { color: #000; }
body[data-theme="light"] .spread-title { color: #000; }
body[data-theme="light"] .stat-value { color: #000; }
body[data-theme="light"] .filter-group label { color: #000; }
body[data-theme="light"] .s-count { color: #000; }
body[data-theme="light"] .badge-popup-title { color: #000; }
body[data-theme="light"] .sources-popup-header h3 { color: #000; }
body[data-theme="light"] .legal-modal-header h2 { color: #000; }
body[data-theme="light"] .legal-modal-body h3 { color: #000; }
body[data-theme="light"] .tooltip-title { color: #000; }
body[data-theme="light"] .footer-link, body[data-theme="light"] .footer-link-btn { color: #000; }
body[data-theme="light"] .trending-label { color: #555; }

/* Light mode: Graph bars black instead of cyan */
body[data-theme="light"] .spread-bar-fill { background: #000; }
body[data-theme="light"] .spread-chart { background: rgba(0,0,0,0.05); }
body[data-theme="light"] .stat-item { background: rgba(0,0,0,0.05); }

/* Light mode: Hover effects - black/grey instead of cyan */
body[data-theme="light"] a:hover { color: #555; }
body[data-theme="light"] .source-name a:hover { color: #555; }
body[data-theme="light"] .title a:hover { color: #555; }
body[data-theme="light"] .item h1.title a:hover { color: #555 !important; }
body[data-theme="light"] .sub-row-title a:hover { color: #555; }
body[data-theme="light"] .source-popup-row .source-title a:hover { color: #555; }
body[data-theme="light"] .trending-topic:hover { border-color: #000; background: rgba(0,0,0,0.05); }
body[data-theme="light"] .trending-topic.active { border-color: #000; background: rgba(0,0,0,0.1); color: #000; }
body[data-theme="light"] .panel-toggle:hover { background: rgba(0,0,0,0.05); }
body[data-theme="light"] .search-btn:hover { border-color: #000; }
body[data-theme="light"] .filter-btn:hover { border-color: #000; }
body[data-theme="light"] .theme-toggle:hover { border-color: #000; }
body[data-theme="light"] .sub-row-expand:hover { border-color: #000; }
body[data-theme="light"] .expand:hover { border-color: #000; background: rgba(0,0,0,0.05); }
body[data-theme="light"] .sources-dropdown #sources-toggle:hover { border-color: #000; }
body[data-theme="light"] .nav-icon-btn:hover { border-color: #000; }
body[data-theme="light"] .menu-toggle:hover { border-color: #000; }
body[data-theme="light"] .back-to-top:hover { border-color: #000; background: rgba(0,0,0,0.08); }
body[data-theme="light"] .apply-btn { background: #333; color: #fff; border-color: #333; }
body[data-theme="light"] .apply-btn:hover { background: #222; border-color: #222; }
body[data-theme="light"] #clear-filters:hover { border-color: #000; }

/* Dark mode: Title hover - light grey instead of cyan */
.title a:hover { color: #c0c0c0 !important; }
.item h1.title a:hover { color: #c0c0c0 !important; }
.sub-row-title a:hover { color: #c0c0c0; }

/* Nav icon buttons (refresh, image toggle) */
.nav-icon-btn { background: transparent; border: 1px solid var(--border); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--textcolor); cursor: pointer; font-size: 14px; transition: border-color 0.2s, background 0.2s; padding: 0; }
.nav-icon-btn:hover { border-color: var(--accent); }
.nav-icon-btn.active { border-color: var(--accent); background: rgba(0, 230, 255, 0.15); color: var(--accent); }

/* Back to top button */
.back-to-top { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: var(--itembg); border: 1px solid var(--border); color: var(--textcolor); font-size: 18px; cursor: pointer; display: none; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 90; transition: background 0.2s, transform 0.2s, border-color 0.2s; }
.back-to-top:hover { border-color: var(--accent); background: rgba(0, 230, 255, 0.15); transform: translateY(-2px); }
.back-to-top.visible { display: flex; }

/* Images hidden mode */
body.images-hidden .enc_img { display: none !important; }
body.images-hidden .sub-img { display: none !important; }
body.images-hidden .sub-preview-img { display: none !important; }
body.images-hidden .source-popup-row .source-details img { display: none !important; }
body.images-hidden .source-preview img { display: none !important; }
body.images-hidden .imbalance-card-image { display: none !important; }
body.images-hidden .amplification-image { display: none !important; }
body.images-hidden .misinfo-image { display: none !important; }
body.images-hidden .influence-outlet-icon { display: none !important; }
body.images-hidden .tool-source-icon { display: none !important; }

/* Mobile: Disable all hover previews and tooltips to prevent tap conflicts */
@media (hover: none), (max-width: 768px) {
  .source-preview { display: none !important; }
  .sub-preview { display: none !important; }
  .sub-row:hover .source-preview { display: none !important; }
  .sub-row:hover .sub-preview { display: none !important; }
  .source-popup-row:hover .source-preview { display: none !important; }
  .custom-tooltip { display: none !important; }
  .custom-tooltip.visible { display: none !important; }
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
html { overflow-x: hidden; }
body { margin: 0; padding-top: 96px; padding-bottom: 0; background-color: var(--docbg); color: var(--textcolor); font-family: Inter, system-ui, Segoe UI, Roboto, Arial; font-size: 14px; overflow-x: hidden; width: 100%; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
a { color: var(--contrast); text-decoration: none; }
a:hover { text-decoration: underline; }

.loading-overlay { position: fixed; top: 96px; left: 0; right: 0; bottom: 0; background: var(--docbg); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 80; transition: opacity 0.3s ease; }
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner { width: 50px; height: 50px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.loading-text { margin-top: 16px; font-family: Orbitron, sans-serif; font-size: 14px; color: #9ca3af; letter-spacing: 0.1em; text-transform: uppercase; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar { font-family: Orbitron, sans-serif; position: fixed; top: 0; left: 0; right: 0; height: 56px; background: radial-gradient(circle at top left, #152138, #060710); display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid var(--border); z-index: 100; }
body[data-theme="light"] .topbar { background: linear-gradient(to right, #e5e7ef, #f5f7ff); }
.top-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar .logo { font-weight: 800; font-size: 20px; letter-spacing: 0.08em; color: var(--accent); }
.topbar .subtitle { font-family: Orbitron, sans-serif; font-weight: 700; font-size: 11px; opacity: 0.75; white-space: nowrap; }
.subtitle-link { text-decoration: none !important; color: inherit; }
.subtitle-link:hover { text-decoration: none !important; }
.top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 1; min-width: 0; }
#statusbar { font-size: 11px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.trending-bar { position: fixed; top: 56px; left: 0; right: 0; height: 40px; background: var(--itembg); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 12px; gap: 8px; z-index: 95; overflow: hidden; }
.trending-label { font-family: Orbitron, sans-serif; font-size: 10px; color: #9ca3af; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }
.trending-arrow { color: var(--accent); }
body[data-theme="light"] .trending-arrow { color: #555; }
.trending-topics { display: flex; gap: 8px; flex: 1; overflow: hidden; }
.trending-topic { background: var(--expandbg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px; font-size: 11px; font-family: Inter, sans-serif; color: var(--textcolor); cursor: pointer; white-space: nowrap; transition: border-color 0.2s, background 0.2s; flex-shrink: 0; }
.trending-topic:hover { border-color: var(--accent); background: rgba(0, 230, 255, 0.1); }
.trending-topic.active { border-color: var(--accent); background: rgba(0, 230, 255, 0.2); color: var(--accent); }

.search-container { position: relative; display: flex; align-items: center; }
.search-btn { background: transparent; border: 1px solid var(--border); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--textcolor); cursor: pointer; font-size: 14px; padding: 0; transition: border-color 0.2s; }
.search-btn:hover { border-color: var(--accent); }
.search-input-wrapper { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; background: var(--itembg); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; width: 0; opacity: 0; transition: width 0.3s ease, opacity 0.3s ease; }
.search-input-wrapper.open { width: 200px; opacity: 1; }
.search-input-wrapper input { background: transparent; border: none; outline: none; color: var(--textcolor); font-family: Inter, sans-serif; font-size: 12px; padding: 6px 12px; width: 100%; }
.search-input-wrapper input::placeholder { color: var(--textcolor); opacity: 0.5; }
.search-close { background: transparent; border: none; color: var(--textcolor); cursor: pointer; padding: 6px 10px; font-size: 14px; opacity: 0.7; }
.search-close:hover { opacity: 1; }
.filter-btn { background: transparent; border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px; color: var(--textcolor); cursor: pointer; font-family: Orbitron, sans-serif; font-size: 10px; display: flex; align-items: center; gap: 4px; transition: border-color 0.2s; height: 28px; }
.filter-btn:hover { border-color: var(--accent); }
.filter-btn.active { border-color: var(--accent); background: rgba(0, 230, 255, 0.1); }
.filter-panel { position: fixed; top: 96px; left: 0; right: 0; background: var(--itembg); border-bottom: 1px solid var(--border); padding: 16px; display: none; flex-wrap: wrap; gap: 12px; z-index: 90; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.filter-panel.open { display: flex; }
.filter-panel-close { position: absolute; top: 12px; right: 12px; background: transparent; border: 1px solid var(--border); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--textcolor); cursor: pointer; font-size: 14px; transition: border-color 0.2s, background 0.2s; }
.filter-panel-close:hover { border-color: var(--accent); background: rgba(0, 230, 255, 0.1); }
body[data-theme="light"] .filter-panel-close:hover { border-color: #000; background: rgba(0,0,0,0.05); }
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.filter-group label { font-size: 10px; text-transform: uppercase; color: var(--accent-text); font-family: Orbitron, sans-serif; }
.filter-group select { background: var(--expandbg); border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; color: var(--textcolor); font-size: 12px; cursor: pointer; }
.filter-actions { display: flex; gap: 8px; align-items: flex-end; }
.filter-actions button { padding: 6px 16px; border-radius: 4px; font-size: 11px; cursor: pointer; font-family: Orbitron, sans-serif; }
.apply-btn { background: var(--accent); border: none; color: #000; font-weight: 600; }
.apply-btn:hover { background: #00c4d9; }
#clear-filters { background: transparent; border: 1px solid var(--border); color: var(--textcolor); }
#clear-filters:hover { border-color: var(--accent); }
.active-filters { display: none; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 8px; }
.active-filter-tag { background: rgba(0, 230, 255, 0.15); border: 1px solid var(--accent); border-radius: 999px; padding: 3px 10px; font-size: 10px; display: flex; align-items: center; gap: 6px; }
.remove-filter { cursor: pointer; opacity: 0.7; }
.remove-filter:hover { opacity: 1; }

.sources-dropdown { position: relative; display: flex; align-items: center; }
#sources-toggle { background: transparent; border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px; color: var(--textcolor); cursor: pointer; font-family: Orbitron, sans-serif; font-size: 10px; white-space: nowrap; height: 28px; display: flex; align-items: center; }
#sources-toggle:hover { border-color: var(--accent); }
.sources-dropdown.open #sources-toggle { border-color: var(--accent); background: rgba(0, 230, 255, 0.1); }
.sources-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-height: 400px; overflow-y: auto; background: var(--itembg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: none; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.sources-dropdown.open .sources-panel { display: block; }
.sources-grid { display: flex; flex-direction: column; gap: 6px; }
.source-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: var(--expandbg); border-left: 3px solid transparent; }
.source-item.bias-left, .source-item.bias-lean-left { border-left-color: var(--bias-left); }
.source-item.bias-right, .source-item.bias-lean-right { border-left-color: var(--bias-right); }
.source-item.bias-center { border-left-color: var(--bias-center); }
.source-item.inactive { opacity: 0.5; }
.source-item-link { display: block; text-decoration: none; color: inherit; border-radius: 6px; transition: transform 0.1s, box-shadow 0.2s; }
.source-item-link:hover { text-decoration: none; transform: translateX(2px); }
.source-item-link:hover .source-item { background: var(--hover-bg); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.s-icon { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; background: rgba(255,255,255,0.9); padding: 2px; }
.s-icon-text { width: 20px; height: 20px; border-radius: 4px; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 8px; }
.s-info { flex: 1; min-width: 0; }
.s-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--textcolor); }
.s-meta { font-size: 9px; opacity: 0.7; }
.s-count { font-size: 10px; color: var(--accent-text); font-family: Orbitron, sans-serif; }

/* Main Menu Dropdown */
.main-menu { position: relative; display: flex; align-items: center; }
.menu-toggle { background: transparent; border: 1px solid var(--border); border-radius: 4px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--textcolor); cursor: pointer; font-size: 16px; transition: border-color 0.2s; padding: 0; }
.menu-toggle:hover { border-color: var(--accent); }
.main-menu.open .menu-toggle { border-color: var(--accent); background: rgba(0, 230, 255, 0.1); }
.menu-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 220px; max-height: 80vh; overflow-y: auto; background: var(--itembg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 0; display: none; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.main-menu.open .menu-panel { display: block; }
.menu-section { padding: 4px 0; }
.menu-section:not(:last-child) { border-bottom: 1px solid var(--border); }
.menu-section-title { font-family: Orbitron, sans-serif; font-size: 9px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; padding: 8px 16px 4px; opacity: 0.8; }
body[data-theme="light"] .menu-section-title { color: #333; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 12px; color: var(--textcolor); cursor: pointer; transition: background 0.15s; font-family: Inter, sans-serif; background: transparent; border: none; width: 100%; text-align: left; }
.menu-item:hover { background: var(--hover-bg); }
.menu-item.active { color: var(--accent); background: rgba(0, 230, 255, 0.1); }
.menu-item-icon { font-size: 14px; width: 20px; text-align: center; flex-shrink: 0; }
.menu-item-text { flex: 1; }
body[data-theme="light"] .menu-item:hover { background: rgba(0,0,0,0.05); }
body[data-theme="light"] .menu-item.active { background: rgba(0,0,0,0.08); color: #000; }

.theme-toggle { background: transparent; border: 1px solid var(--border); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--textcolor); cursor: pointer; font-size: 14px; transition: border-color 0.2s; }
.theme-toggle:hover { border-color: var(--accent); }

.grid { column-count: 3; column-gap: 10px; padding: 5px; margin: 0 auto; width: 100%; max-width: 100%; box-sizing: border-box; overflow-x: hidden; }
.item { padding: 14px; background: var(--itembg); border: 1px solid var(--border); border-radius: 16px; opacity: 0; animation: fadeInCard 0.3s ease forwards; position: relative; z-index: 1; break-inside: avoid; margin-bottom: 10px; display: inline-block; width: 100%; }
.item:has(.sub-row:hover) { z-index: 50; }
.item.filtered-out { display: none !important; }
.item.initially-hidden { display: none !important; }
@keyframes fadeInCard { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 1921px) { .grid { column-count: 5; } }
@media (min-width: 1441px) and (max-width: 1920px) { .grid { column-count: 4; } }
@media (min-width: 901px) and (max-width: 1440px) { .grid { column-count: 3; } }
@media (min-width: 601px) and (max-width: 900px) { .grid { column-count: 2; } }
@media (max-width: 600px) { .grid { column-count: 1; } }

/* Coverage Breakdown & More Analysis - Unified seamless panels */
.coverage-breakdown, .more-analysis { margin: 8px 0; }

/* Panel container with border around everything */
.coverage-breakdown { 
  background: var(--expandbg); 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  overflow: hidden;
}
.more-analysis { 
  background: var(--expandbg); 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  overflow: hidden;
}

/* Panel toggle buttons - no separate border since container has it */
.panel-toggle { 
  width: 100%; 
  background: transparent; 
  border: none; 
  padding: 8px 12px; 
  color: var(--textcolor); 
  font-family: Orbitron, sans-serif; 
  font-size: 10px; 
  cursor: pointer; 
  display: flex; 
  flex-wrap: wrap;
  align-items: center; 
  gap: 8px; 
  transition: background 0.2s; 
}
.panel-toggle:hover { background: rgba(0, 230, 255, 0.05); }

.toggle-icon { transition: transform 0.3s; flex-shrink: 0; }
.panel-toggle[aria-expanded="true"] .toggle-icon { transform: rotate(180deg); }
.toggle-text { flex-shrink: 0; }
.toggle-badges { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.toggle-badges .badge { font-size: 9px; padding: 3px 8px; pointer-events: auto; position: relative; z-index: 10; }
.toggle-bias-spread { width: 100%; margin-top: 4px; }

/* Sources badge clickable */
.sources-badge-clickable, .badge-sources.clickable { cursor: pointer !important; }
.sources-badge-clickable:hover, .badge-sources.clickable:hover { box-shadow: 0 0 10px rgba(34, 197, 94, 0.6); transform: scale(1.05); }

/* Panel content - no separate border */
.panel-content { 
  max-height: 0; 
  overflow: hidden; 
  transition: max-height 0.3s ease, padding 0.3s ease; 
  background: transparent;
  border-top: 1px solid transparent;
}

/* When expanded - just show content with border separator */
.coverage-breakdown:not(.collapsed) .panel-content,
.more-analysis:not(.collapsed) .panel-content { 
  max-height: 600px; 
  padding: 12px; 
  border-top: 1px solid var(--border);
}

.breakdown-section { margin-bottom: 12px; }
.breakdown-section:last-child { margin-bottom: 0; }
.breakdown-header { font-family: Orbitron, sans-serif; font-size: 10px; color: var(--accent-text); margin-bottom: 8px; text-transform: uppercase; }
.breakdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.breakdown-grid .spread-chart:last-child { grid-column: 1 / -1; }

.spread-chart { background: rgba(0,0,0,0.2); border-radius: 6px; padding: 8px; }
.spread-title { font-size: 9px; font-family: Orbitron, sans-serif; color: var(--accent-text); margin-bottom: 6px; }
.spread-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.spread-name { font-size: 10px; width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.spread-bar-container { flex: 1; max-width: 60px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.spread-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.spread-pct { font-size: 9px; width: 30px; text-align: right; opacity: 0.8; }
.content-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-item { display: flex; justify-content: space-between; padding: 6px 10px; background: rgba(0,0,0,0.2); border-radius: 4px; }
.stat-label { font-size: 10px; opacity: 0.8; }
.stat-value { font-size: 12px; font-family: Orbitron, sans-serif; color: var(--accent-text); }

/* Bias Spread Bar - Full width with labels inside */
.bias-spread-container { width: 100%; }
.bias-spread-bar { display: flex; height: 20px; border-radius: 4px; overflow: hidden; background: var(--border); width: 100%; }
.bias-spread-mini .bias-spread-bar { height: 18px; }
.bias-segment { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-family: Orbitron, sans-serif; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); white-space: nowrap; overflow: hidden; transition: width 0.3s; min-width: 0; }
.bias-left-seg { background: var(--bias-left); }
.bias-center-seg { background: var(--bias-center); }
.bias-right-seg { background: var(--bias-right); }
.bias-spread-labels { display: none; }

.warning-flags { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.warning-flag { padding: 4px 10px; border-radius: 4px; font-size: 10px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.flag-high { background: rgba(239, 68, 68, 0.2); border: 1px solid var(--warning-red); color: var(--warning-red); }
.flag-medium { background: rgba(249, 115, 22, 0.2); border: 1px solid var(--warning-orange); color: var(--warning-orange); }
.flag-low { background: rgba(234, 179, 8, 0.2); border: 1px solid var(--warning-yellow); color: var(--warning-yellow); }
.trending-indicator { background: linear-gradient(135deg, #f97316, #eab308); color: #000; padding: 2px 8px; border-radius: 4px; font-size: 9px; font-family: Orbitron, sans-serif; font-weight: 600; white-space: nowrap; margin-left: auto; }

.article-badges-visible { margin: 10px 0; }
.badge-row { display: flex; gap: 5px; margin: 5px 0; padding: 0 5px; }
.badge-row .badge { flex: 1; text-align: center; min-width: 0; }
.badge-row .badge:first-child { text-align: left; }
.badge-row .badge:last-child { text-align: right; }
.badge { font-size: 9px; font-family: Orbitron, sans-serif; padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); background: rgba(0,0,0,0.3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 0 4px rgba(255,255,255,0.08); cursor: pointer; transition: box-shadow 0.2s, transform 0.1s; }
.badge:hover { box-shadow: 0 0 8px rgba(0, 230, 255, 0.4); transform: scale(1.02); }
.badge.clickable { cursor: pointer; }
.badge-topic, .badge.topic { border-color: #00e6ff; color: #00e6ff; }
.badge-sources, .badge.cites { border-color: #22c55e; color: #22c55e; }
.badge-truth, .badge.truth { border-color: #8b5cf6; color: #8b5cf6; }
.badge-trending, .badge.trending { border-color: #fb923c; color: #fb923c; }
.badge-bias, .badge.bias-left, .badge.bias-lean-left { border-color: var(--bias-left); color: var(--bias-left); }
.badge.bias-right, .badge.bias-lean-right { border-color: var(--bias-right); color: var(--bias-right); }
.badge.bias-center { border-color: var(--bias-center); color: var(--bias-center); }
.badge-factuality { border-color: #9ca3af; color: #9ca3af; }
.badge-country { border-color: #38bdf8; color: #38bdf8; }
.badge-funding { border-color: #f472b6; color: #f472b6; }
.badge-ownership { border-color: #c084fc; color: #c084fc; }
.badge-bias-sev { border-color: #fb7185; color: #fb7185; }
.badge-risk { border-color: #ef4444; color: #ef4444; }
.badge-reliability { border-color: #2dd4bf; color: #2dd4bf; }
.badge-sentiment { border-color: #818cf8; color: #818cf8; }
.badge-sensationalism { border-color: #fbbf24; color: #fbbf24; }
.badge-bot { border-color: #e879f9; color: #e879f9; }
.row { display: flex; align-items: center; gap: 6px; }
.source-row { margin-bottom: 6px; }
.source-name { font-weight: 600; font-size: 12px; flex: 1; }
.source-name a { color: var(--textcolor); }
.source-name a:hover { color: var(--accent); }
.date { font-size: 11px; opacity: 0.7; white-space: nowrap; }
.item h1.title { font-size: 17px; line-height: 1.35; margin: 8px 0; font-weight: 700; }
.item h1.title a { color: var(--contrast); }
.item h1.title a:hover { color: var(--accent); }
.content { font-size: 13px; line-height: 1.5; margin: 8px 0; opacity: 0.9; word-wrap: break-word; overflow-wrap: break-word; overflow: hidden; }

.ficon-text { min-width: 24px; height: 24px; border-radius: 6px; background: rgba(0,0,0,0.45); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 10px; margin-right: 6px; text-transform: uppercase; color: #9aa2b6; flex-shrink: 0; }
.ficon-img { width: 20px; height: 20px; margin-right: 6px; border-radius: 4px; object-fit: contain; flex-shrink: 0; background: rgba(255, 255, 255, 0.9); padding: 2px; }
.ficon-img.sm { width: 16px; height: 16px; margin-right: 4px; padding: 1px; }
.ficon-text.sm { min-width: 16px; width: 16px; height: 16px; font-size: 8px; }

.sub-articles { margin-top: 6px; }
.sub-row { margin-top: 4px; position: relative; padding: 4px 0; border-radius: 4px; transition: background 0.15s; }
.sub-row:hover { background: var(--hover-bg); }
.sub-row-content { display: flex; align-items: center; font-size: 11px; }
.sub-row-expand { background: transparent; border: 1px solid var(--border); border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; color: var(--textcolor); cursor: pointer; font-size: 10px; margin-right: 6px; flex-shrink: 0; transition: border-color 0.2s; }
.sub-row-expand:hover { border-color: var(--accent); }
.sub-row-expand.expanded { background: rgba(0, 230, 255, 0.1); border-color: var(--accent); }
.sub-article-details { display: none; margin-top: 8px; padding: 10px; background: var(--expandbg); border-radius: 8px; border: 1px solid var(--border); }
.sub-article-details.open { display: block; }
.sub-article-details .sub-img { width: 100%; max-height: 150px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.sub-article-details .sub-summary { font-size: 12px; color: var(--textcolor); opacity: 0.85; margin-bottom: 8px; }

.sub-preview { position: absolute; width: 280px; background: var(--itembg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 60; display: none; left: 100%; top: 0; margin-left: 10px; pointer-events: none; }
.sub-preview.show-left { left: auto; right: 100%; margin-left: 0; margin-right: 10px; }
.sub-row:hover .sub-preview { display: block; }
.sub-row:hover { position: relative; z-index: 10; }
@media (max-width: 960px) { .sub-preview { display: none !important; } }
.sub-preview-img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.sub-preview-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.sub-preview-summary { font-size: 11px; color: var(--textcolor); opacity: 0.8; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.expand { display: block; width: 80px; margin: 8px auto 0 auto; padding: 4px 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--expandbg); color: var(--textcolor); font-size: 11px; cursor: pointer; }
.expand:hover { border-color: var(--accent); }
.hidden { display: none; }
.enc_img { width: 100%; margin: 8px 0; border-radius: 12px; overflow: hidden; }
.enc_img img { width: 100%; height: auto; display: block; border-radius: 12px; }
.no-results { text-align: center; padding: 60px 20px; color: var(--textcolor); opacity: 0.7; display: none; column-span: all; }
.no-results.visible { display: block; }
.no-results h2 { font-family: Orbitron, sans-serif; font-size: 18px; margin-bottom: 8px; }
.no-results p { font-size: 14px; }

.custom-tooltip { position: fixed; background: var(--itembg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 13px; font-family: Inter, sans-serif; color: var(--textcolor); max-width: 280px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 1000; pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.custom-tooltip.visible { opacity: 1; }
.custom-tooltip .tooltip-title { font-family: Orbitron, sans-serif; font-size: 11px; color: var(--accent-text); margin-bottom: 4px; text-transform: uppercase; }

.badge-popup-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 500; display: none; align-items: center; justify-content: center; }
.badge-popup-overlay.open { display: flex; }
.badge-popup { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; max-width: 400px; width: 90%; box-shadow: 0 16px 48px rgba(0,0,0,0.6); }
.badge-popup-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.badge-popup-title { font-family: Orbitron, sans-serif; font-size: 14px; color: var(--accent-text); }
.badge-popup-close { background: transparent; border: none; color: var(--textcolor); font-size: 20px; cursor: pointer; opacity: 0.7; }
.badge-popup-close:hover { opacity: 1; }
.badge-popup-score { font-size: 32px; font-family: Orbitron, sans-serif; text-align: center; margin: 16px 0; }
.badge-popup-description { font-size: 14px; line-height: 1.5; color: var(--textcolor); opacity: 0.9; }

/* Sources Popup - Enhanced with sub-article style items and hover previews */
.sources-popup-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 500; display: none; align-items: center; justify-content: center; }
.sources-popup-overlay.open { display: flex; }
.sources-popup { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; max-width: 600px; width: 90%; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 16px 48px rgba(0,0,0,0.6); }
.sources-popup-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-shrink: 0; }
.sources-popup-header h3 { font-family: Orbitron, sans-serif; font-size: 14px; color: var(--accent-text); margin: 0; }
.sources-popup-close { background: transparent; border: none; color: var(--textcolor); font-size: 20px; cursor: pointer; }
.sources-popup-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overflow-x: hidden; flex: 1; }

/* Source popup items styled like sub-articles */
.source-popup-row { position: relative; padding: 6px 4px; border-radius: 4px; transition: background 0.15s; }
.source-popup-row:hover { background: var(--hover-bg); }
.source-popup-row-content { display: flex; align-items: center; font-size: 11px; gap: 6px; }
.source-popup-row .sub-row-expand { background: transparent; border: 1px solid var(--border); border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; color: var(--textcolor); cursor: pointer; font-size: 10px; flex-shrink: 0; transition: border-color 0.2s; }
.source-popup-row .sub-row-expand:hover { border-color: var(--accent); }
.source-popup-row .sub-row-expand.expanded { background: rgba(0, 230, 255, 0.1); border-color: var(--accent); }
.source-popup-row .ficon-img { width: 20px; height: 20px; border-radius: 4px; background: rgba(255,255,255,0.9); padding: 2px; margin: 0; flex-shrink: 0; object-fit: contain; }
.source-popup-row .ficon-text { min-width: 20px; width: 20px; height: 20px; border-radius: 4px; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 8px; margin: 0; flex-shrink: 0; }
.source-popup-row .source-title { flex: 1; min-width: 0; }
.source-popup-row .source-title a { color: var(--textcolor); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-popup-row .source-title a:hover { color: var(--accent); text-decoration: none; }
.source-popup-row .source-date { font-size: 10px; opacity: 0.7; flex-shrink: 0; }

/* Source popup expanded details with image, summary and badges */
.source-popup-row .source-details { display: none; margin-top: 8px; padding: 10px; background: var(--expandbg); border-radius: 8px; border: 1px solid var(--border); }
.source-popup-row .source-details.open { display: block; }
.source-popup-row .source-details img { width: 100%; max-height: 150px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.source-popup-row .source-details .source-summary { font-size: 12px; opacity: 0.85; margin-bottom: 10px; line-height: 1.4; }
.source-popup-row .source-details .source-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.source-popup-row .source-details .source-badges .badge { font-size: 8px; padding: 2px 6px; }

/* Hover preview tooltip - positioned inside the popup container */
.source-popup-row .source-preview { 
  position: fixed; 
  width: 280px; 
  background: var(--itembg); 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  padding: 12px; 
  box-shadow: 0 8px 24px rgba(0,0,0,0.6); 
  z-index: 1000; 
  display: none; 
  pointer-events: none;
  /* Position to the right side of the popup, not left */
  transform: translateX(20px);
}
.source-popup-row .source-preview img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.source-popup-row .source-preview .sub-preview-title { font-size: 12px; font-weight: 600; color: var(--contrast); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.source-popup-row .source-preview .sub-preview-summary { font-size: 11px; opacity: 0.85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Preview shown via JavaScript positioning */

/* Footer - Not fixed, only visible at bottom of page */
.site-footer { background: var(--itembg); border-top: 1px solid var(--border); padding: 20px; text-align: center; margin-top: 40px; margin-bottom: 0; }
.footer-main { font-family: Orbitron, sans-serif; font-size: 10px; color: var(--textcolor); opacity: 0.8; margin-bottom: 6px; }
.footer-links { display: flex; justify-content: center; align-items: center; gap: 8px; }
.footer-link, .footer-link-btn { font-size: 11px; color: var(--accent-text); background: none; border: none; cursor: pointer; font-family: Inter, sans-serif; padding: 0; }
.footer-link:hover, .footer-link-btn:hover { text-decoration: underline; }
.footer-divider { color: var(--textcolor); opacity: 0.4; }
.ad-bottom { margin-bottom: 0; }

.legal-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 600; display: none; align-items: center; justify-content: center; padding: 20px; }
.legal-modal.open { display: flex; }
.legal-modal-content { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; max-width: 700px; width: 100%; max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; }
.legal-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.legal-modal-header h2 { font-family: Orbitron, sans-serif; font-size: 16px; color: var(--accent-text); margin: 0; }
.legal-modal-close { background: transparent; border: none; color: var(--textcolor); font-size: 20px; cursor: pointer; }
.legal-modal-body { padding: 20px; overflow-y: auto; font-size: 13px; line-height: 1.6; }
.legal-modal-body h3 { font-family: Orbitron, sans-serif; font-size: 12px; color: var(--accent-text); margin: 20px 0 10px 0; }
.legal-modal-body h3:first-of-type { margin-top: 10px; }
.legal-modal-body p { margin: 10px 0; }
.legal-modal-body ul { margin: 10px 0; padding-left: 20px; }
.legal-modal-body li { margin: 5px 0; }

@media (max-width: 768px) {
  html, body { overflow-x: hidden; width: 100%; }
  .topbar { padding: 0 8px; height: 50px; }
  .top-left .subtitle { display: none; }
  .top-left .beta-flag { display: none; }
  .top-right { gap: 6px; }
  .top-right #statusbar { display: none; }
  .filter-btn span { display: none; }
  .filter-btn { padding: 6px 10px; }
  .trending-bar { top: 50px; height: 36px; padding: 0 8px; }
  .trending-label { font-size: 9px; }
  .trending-topic { padding: 3px 10px; font-size: 10px; }
  body { padding-top: 86px; padding-bottom: 20px; }
  .loading-overlay { top: 86px; }
  .grid { column-count: 1; padding: 5px; }
  .item { width: 100%; max-width: 100%; }
  .filter-panel { position: fixed; top: 86px; left: 0; right: 0; bottom: 0; max-height: none; height: auto; overflow-y: auto; padding: 16px; padding-top: 50px; padding-bottom: 100px; z-index: 200; }
  .filter-panel-close { position: fixed; top: 92px; right: 16px; z-index: 210; }
  .filter-group { min-width: calc(50% - 8px); }
  .filter-actions { width: 100%; justify-content: center; padding-top: 8px; padding-bottom: 20px; }
  .search-input-wrapper.open { position: fixed; top: 50px; left: 0; right: 0; width: 100%; padding: 8px; background: var(--itembg); border-bottom: 1px solid var(--border); z-index: 100; }
  .search-input-wrapper.open #search-input { width: 100%; }
  .sources-panel { right: auto; left: 50%; transform: translateX(-50%); width: 300px; max-width: calc(100vw - 20px); }
  .badge { font-size: 8px; padding: 3px 5px; }
  .badge-row { gap: 3px; padding: 0 3px; }
  .bias-spread-bar { max-width: 100%; }
  .breakdown-grid { grid-template-columns: 1fr; }
  .site-footer { padding: 15px; margin-top: 30px; }
  .footer-main { font-size: 9px; }
  .footer-links { flex-wrap: wrap; gap: 6px; }
  /* Keep toggle badges visible on mobile, just smaller */
  .toggle-badges { gap: 4px; }
  .toggle-badges .badge { font-size: 8px; padding: 2px 6px; }
  .toggle-bias-spread .bias-segment { font-size: 8px; }
  /* Warning flags tappable on mobile */
  .warning-flag { cursor: pointer; }
}
@media (max-width: 480px) {
  .topbar { padding: 0 8px; height: 52px; }
  .logo img { width: 22px; height: 22px; }
  .top-right { gap: 6px; }
  .sources-dropdown #sources-toggle { font-size: 11px; padding: 6px 10px; }
  .filter-btn { padding: 6px 10px; font-size: 11px; }
  .search-btn { width: 36px; height: 36px; font-size: 14px; }
  .theme-toggle { width: 34px; height: 34px; font-size: 14px; }
  .nav-icon-btn { width: 34px; height: 34px; font-size: 14px; }
  .menu-toggle { width: 40px; height: 36px; font-size: 16px; }
  .trending-bar { top: 52px; height: 36px; }
  body { padding-top: 88px; }
  .loading-overlay { top: 88px; }
  .filter-panel { top: 88px; }
  .filter-panel-close { top: 94px; }
  .search-input-wrapper.open { top: 52px; }
  .filter-group { min-width: 100%; }
}

/* ===== NARRATIVE IMBALANCE VIEW ===== */
.imbalance-view { padding: 20px; max-width: 1400px; margin: 0 auto; }
.imbalance-header { text-align: center; margin-bottom: 30px; }
.imbalance-header h1 { font-family: Orbitron, sans-serif; font-size: 24px; color: var(--accent); margin-bottom: 10px; }
.imbalance-description { color: var(--textcolor); opacity: 0.8; max-width: 700px; margin: 0 auto 20px; line-height: 1.5; }
.imbalance-back { background: transparent; border: 1px solid var(--border); border-radius: 20px; padding: 8px 20px; color: var(--textcolor); cursor: pointer; font-family: Inter, sans-serif; transition: border-color 0.2s, background 0.2s; }
.imbalance-back:hover { border-color: var(--accent); background: rgba(0, 230, 255, 0.1); }
body[data-theme="light"] .imbalance-back:hover { border-color: #000; background: rgba(0,0,0,0.05); }

.imbalance-section { margin-bottom: 40px; }
.imbalance-section-header { padding: 15px 20px; border-radius: 12px; margin-bottom: 15px; }
.imbalance-section-header.left-coverage { background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05)); border-left: 4px solid var(--bias-left); }
.imbalance-section-header.right-coverage { background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05)); border-left: 4px solid var(--bias-right); }
.imbalance-section-header h2 { font-family: Orbitron, sans-serif; font-size: 16px; margin-bottom: 5px; }
.imbalance-section-header p { font-size: 12px; opacity: 0.7; margin: 0; }

.imbalance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 15px; }
.imbalance-card { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 15px; }
.imbalance-card-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.imbalance-card-title a { color: var(--contrast); text-decoration: none; }
.imbalance-card-title a:hover { text-decoration: underline; }
.imbalance-card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 11px; opacity: 0.7; }
.imbalance-bar { height: 24px; border-radius: 4px; overflow: hidden; display: flex; margin-bottom: 10px; }
.imbalance-bar-left { background: var(--bias-left); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 600; }
.imbalance-bar-center { background: var(--bias-center); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 600; }
.imbalance-bar-right { background: var(--bias-right); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 600; }
.imbalance-sources { font-size: 11px; color: var(--textcolor); opacity: 0.8; }
.imbalance-ratio { font-family: Orbitron, sans-serif; font-size: 12px; color: var(--accent); margin-top: 8px; }

.imbalance-summary { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 25px; margin-top: 30px; }
.imbalance-summary-top { margin-top: 0; margin-bottom: 30px; }
.imbalance-summary h3 { font-family: Orbitron, sans-serif; font-size: 16px; color: var(--accent); margin-bottom: 10px; }
.imbalance-summary h4 { font-size: 14px; margin: 20px 0 10px; }
.imbalance-summary p { line-height: 1.6; opacity: 0.9; margin-bottom: 15px; }
.imbalance-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 20px 0; }
.imbalance-stat { background: var(--expandbg); border-radius: 8px; padding: 15px; text-align: center; }
.imbalance-stat-value { font-family: Orbitron, sans-serif; font-size: 24px; color: var(--accent); }
.imbalance-stat-label { font-size: 11px; opacity: 0.7; margin-top: 5px; }

/* Imbalance two-column layout for desktop */
.imbalance-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.imbalance-column { display: flex; flex-direction: column; }
.imbalance-stories { display: flex; flex-direction: column; gap: 15px; }
.imbalance-card { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 15px; }
.imbalance-card-image { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; background: var(--expandbg); }
.imbalance-card-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.imbalance-card-title a { color: var(--contrast); text-decoration: none; }
.imbalance-card-title a:hover { color: #c0c0c0; }
body[data-theme="light"] .imbalance-card-title a:hover { color: #555; }
.imbalance-card-badges { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.imbalance-bar { height: 24px; border-radius: 4px; overflow: hidden; display: flex; margin-bottom: 10px; }
.imbalance-bar-left { background: var(--bias-left); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 600; }
.imbalance-bar-center { background: var(--bias-center); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 600; }
.imbalance-bar-right { background: var(--bias-right); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 600; }
.imbalance-ratio { font-family: Orbitron, sans-serif; font-size: 11px; color: var(--accent); }

@media (max-width: 768px) {
  .imbalance-columns { grid-template-columns: 1fr; }
  .imbalance-header h1 { font-size: 18px; }
  .imbalance-stats { grid-template-columns: repeat(2, 1fr); }
}

.imbalance-empty { text-align: center; padding: 30px; opacity: 0.6; font-style: italic; }

/* Light mode: Imbalance view - black text */
body[data-theme="light"] .imbalance-header h1 { color: #000; }
body[data-theme="light"] .imbalance-summary h3 { color: #000; }
body[data-theme="light"] .imbalance-stat-value { color: #000; }
body[data-theme="light"] .imbalance-ratio { color: #333; }

/* Search reset indicator for mobile */
.search-reset-indicator { background: var(--accent); color: #000; border: none; border-radius: 999px; padding: 4px 12px; font-size: 11px; font-family: Inter, sans-serif; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }
.search-reset-indicator span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.search-reset-indicator:hover { background: #00c8dd; }
body[data-theme="light"] .search-reset-indicator { background: #333; color: #fff; }
body[data-theme="light"] .search-reset-indicator:hover { background: #000; }

/* ===== TOOL VIEWS (Compare Sources, Feed Builder) ===== */
.tool-view { padding: 20px; max-width: 1400px; margin: 0 auto; }
.tool-header { text-align: center; margin-bottom: 30px; }
.tool-header h1 { font-family: Orbitron, sans-serif; font-size: 24px; color: var(--accent); margin-bottom: 10px; }
.tool-description { color: var(--textcolor); opacity: 0.8; max-width: 700px; margin: 0 auto 20px; line-height: 1.5; }
.tool-back-btn { background: transparent; border: 1px solid var(--border); border-radius: 20px; padding: 8px 20px; color: var(--textcolor); cursor: pointer; font-family: Inter, sans-serif; transition: border-color 0.2s, background 0.2s; }
.tool-back-btn:hover { border-color: var(--accent); background: rgba(0, 230, 255, 0.1); }
body[data-theme="light"] .tool-back-btn:hover { border-color: #000; background: rgba(0,0,0,0.05); }
body[data-theme="light"] .tool-header h1 { color: #000; }

/* Compare Sources View */
.sources-compare-container { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.sources-compare-column { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 15px; }
.sources-column-header { padding: 12px; border-radius: 8px; margin-bottom: 15px; text-align: center; }
.sources-column-header h2 { font-family: Orbitron, sans-serif; font-size: 14px; margin: 0; }
.sources-column-header.left-header { background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.05)); border-left: 3px solid var(--bias-left); }
.sources-column-header.center-header { background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05)); border-left: 3px solid var(--bias-center); }
.sources-column-header.right-header { background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05)); border-left: 3px solid var(--bias-right); }
.sources-list { display: flex; flex-direction: column; gap: 10px; max-height: 600px; overflow-y: auto; }
.source-compare-card { background: var(--expandbg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; transition: border-color 0.2s; }
.source-compare-card:hover { border-color: var(--accent); }
.source-compare-card.highlighted { border-color: var(--accent); background: rgba(0, 230, 255, 0.1); animation: highlightPulse 1s ease-out; }
@keyframes highlightPulse { 0% { box-shadow: 0 0 20px rgba(0, 230, 255, 0.6); } 100% { box-shadow: none; } }
body[data-theme="light"] .source-compare-card:hover { border-color: #000; }
.source-compare-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; cursor: pointer; }
.source-compare-icon { width: 24px; height: 24px; border-radius: 4px; }
.source-compare-name { font-weight: 600; font-size: 13px; flex: 1; }
.source-compare-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.source-compare-badges .badge { font-size: 9px; padding: 2px 6px; cursor: pointer; }
.source-compare-details { padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--border); font-size: 11px; opacity: 0.8; }
.source-compare-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.source-flag { font-size: 9px; padding: 2px 6px; border-radius: 4px; }
.source-flag.flag-high { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.source-flag.flag-medium { background: rgba(251, 146, 60, 0.2); color: #fb923c; }

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

/* Feed Builder View - Dashboard Layout */
.feed-builder-dashboard { display: grid; grid-template-columns: 1fr 280px; gap: 25px; max-width: 1100px; }
.feed-builder-main { display: flex; flex-direction: column; gap: 20px; }
.feed-builder-sidebar { display: flex; flex-direction: column; }
.feed-builder-row { display: flex; flex-direction: column; gap: 20px; }
.feed-builder-row.feed-builder-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.feed-builder-name-section { margin-bottom: 0; }
.feed-builder-section { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.feed-builder-section h3 { font-family: Orbitron, sans-serif; font-size: 13px; color: var(--accent); margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
body[data-theme="light"] .feed-builder-section h3 { color: #000; }
.feed-builder-hint { font-size: 11px; opacity: 0.7; margin-bottom: 12px; }
.feed-builder-input { width: 100%; padding: 12px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 8px; color: var(--textcolor); font-family: Inter, sans-serif; font-size: 14px; box-sizing: border-box; margin-bottom: 10px; }
.feed-builder-input:focus { outline: none; border-color: var(--accent); }
body[data-theme="light"] .feed-builder-input:focus { border-color: #000; }
.feed-builder-select { padding: 10px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 8px; color: var(--textcolor); font-family: Inter, sans-serif; min-width: 120px; width: 100%; }
.feed-builder-options { display: flex; flex-wrap: wrap; gap: 8px; }
.feed-option { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: border-color 0.2s; font-size: 11px; }
.feed-option:hover { border-color: var(--accent); }
body[data-theme="light"] .feed-option:hover { border-color: #000; }
.feed-option input { accent-color: var(--accent); width: 14px; height: 14px; }
.feed-builder-actions { text-align: center; padding: 15px; background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; }
.feed-save-btn { background: var(--accent); color: #000; border: none; border-radius: 8px; padding: 12px 40px; font-family: Orbitron, sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.feed-save-btn:hover { background: #00c8dd; }
body[data-theme="light"] .feed-save-btn { background: #333; color: #fff; }
body[data-theme="light"] .feed-save-btn:hover { background: #000; }
.saved-feeds-list { display: flex; flex-direction: column; gap: 10px; }
.saved-feed-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 8px; }
.saved-feed-name { font-weight: 600; font-size: 12px; }
.saved-feed-actions { display: flex; gap: 6px; }
.saved-feed-btn { background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font-size: 10px; color: var(--textcolor); cursor: pointer; transition: border-color 0.2s; }
.saved-feed-btn:hover { border-color: var(--accent); }
.saved-feed-btn.delete { color: #ef4444; }
.saved-feed-btn.delete:hover { border-color: #ef4444; }

/* Feed Builder Sources Grid */
.feed-sources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; max-height: 300px; overflow-y: auto; padding: 5px; }
.feed-source-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.feed-source-item img { width: 18px; height: 18px; border-radius: 3px; }
.feed-source-item .source-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-source-item .add-source-btn { background: var(--accent); color: #000; border: none; border-radius: 4px; width: 22px; height: 22px; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feed-source-item .add-source-btn:hover { background: #00c8dd; }
body[data-theme="light"] .feed-source-item .add-source-btn { background: #333; color: #fff; }
body[data-theme="light"] .feed-source-item .add-source-btn:hover { background: #000; }
.feed-source-item.selected { border-color: var(--accent); background: rgba(0, 230, 255, 0.1); }
.feed-source-item.selected .add-source-btn { background: #ef4444; color: #fff; }
body[data-theme="light"] .feed-source-item.selected .add-source-btn { background: #ef4444; color: #fff; }
.feed-selected-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; min-height: 30px; }
.feed-selected-source { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--accent); color: #000; border-radius: 999px; font-size: 11px; font-weight: 600; }
.feed-selected-source .remove-source { cursor: pointer; opacity: 0.7; }
.feed-selected-source .remove-source:hover { opacity: 1; }

@media (max-width: 900px) {
  .feed-builder-dashboard { grid-template-columns: 1fr; }
  .feed-builder-row { grid-template-columns: 1fr; }
  .feed-builder-sidebar { order: -1; }
}

/* Ad Container Styles */
.ad-container { margin: 20px auto; padding: 10px; max-width: 1200px; }
.ad-bottom { margin-top: 30px; margin-bottom: 0; }
.ad-card { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 15px; break-inside: avoid; margin-bottom: 15px; min-height: 250px; display: flex; align-items: center; justify-content: center; }

/* Imbalance Card Image */
.imbalance-card-image { width: 100%; height: 180px; object-fit: cover; border-radius: 8px; margin-bottom: 12px; background: var(--expandbg); }
.imbalance-card-desc { font-size: 12px; color: var(--textcolor); opacity: 0.8; margin-top: 10px; line-height: 1.4; display: none; }
.imbalance-card-desc.visible { display: block; }
.imbalance-card-preview { font-size: 12px; color: var(--textcolor); opacity: 0.8; margin-bottom: 10px; line-height: 1.5; }
.imbalance-no-image { display: flex; align-items: center; justify-content: center; color: var(--textcolor); opacity: 0.4; font-size: 12px; }

/* Tool Sources List - shared across imbalance, amplification, misinfo */
.tool-sources-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.tool-source-item { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; }
.tool-source-icon { width: 16px; height: 16px; border-radius: 3px; background: rgba(255,255,255,0.9); padding: 1px; object-fit: contain; flex-shrink: 0; }
.tool-source-name { color: var(--textcolor); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.tool-source-more { font-size: 10px; color: var(--accent-text); padding: 4px 8px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 6px; }

/* Legacy Tool Favicons (keep for backwards compatibility) */
.imbalance-favicons, .tool-favicons { display: flex; align-items: center; gap: 4px; margin: 8px 0; flex-wrap: wrap; }
.imbalance-favicon, .tool-favicon { width: 20px; height: 20px; border-radius: 4px; background: rgba(255,255,255,0.9); padding: 2px; object-fit: contain; }
.imbalance-favicon-more, .tool-favicon-more { font-size: 10px; color: var(--textcolor); opacity: 0.7; padding: 2px 6px; background: var(--expandbg); border-radius: 4px; }
.imbalance-more-btn { background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-size: 10px; color: var(--textcolor); cursor: pointer; margin-top: 8px; transition: border-color 0.2s; }
.imbalance-more-btn:hover { border-color: var(--accent); }
body[data-theme="light"] .imbalance-more-btn:hover { border-color: #000; }

/* Source Compare Card with Badges */
.source-compare-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
/* ===== NEW TOOL VIEWS ===== */

/* Tool search bar */
.tool-search-bar { max-width: 500px; margin: 0 auto 30px; display: flex; gap: 10px; }
.tool-search-input { flex: 1; padding: 12px 16px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 8px; color: var(--textcolor); font-size: 14px; font-family: Inter, sans-serif; }
.tool-search-input:focus { outline: none; border-color: var(--accent); }
body[data-theme="light"] .tool-search-input:focus { border-color: #000; }
.tool-search-btn { padding: 12px 20px; background: var(--accent); border: none; border-radius: 8px; color: #000; font-weight: 600; cursor: pointer; font-family: Inter, sans-serif; }
.tool-search-btn:hover { background: #00c8dd; }
body[data-theme="light"] .tool-search-btn { background: #333; color: #fff; }
body[data-theme="light"] .tool-search-btn:hover { background: #000; }

/* Coverage Heatmap */
.heatmap-container { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; overflow-x: auto; }
.heatmap-grid { display: grid; gap: 3px; min-width: 700px; }
.heatmap-header-cell { padding: 12px 8px; text-align: center; font-family: Orbitron, sans-serif; font-size: 11px; color: var(--accent); background: var(--expandbg); border-radius: 4px; }
body[data-theme="light"] .heatmap-header-cell { color: #000; }
.heatmap-label { padding: 12px 10px; font-size: 12px; font-weight: 600; background: var(--expandbg); border-radius: 4px; white-space: nowrap; }
.heatmap-cell { padding: 20px 10px; text-align: center; font-size: 14px; font-weight: 700; border-radius: 4px; transition: transform 0.2s; cursor: pointer; font-family: Orbitron, sans-serif; }
.heatmap-cell:hover { transform: scale(1.05); z-index: 5; }
.heatmap-cell.intensity-0 { background: rgba(100, 100, 100, 0.1); color: var(--textcolor); opacity: 0.4; }
.heatmap-cell.intensity-1 { background: rgba(0, 230, 255, 0.15); color: var(--accent); }
.heatmap-cell.intensity-2 { background: rgba(0, 230, 255, 0.3); color: var(--accent); }
.heatmap-cell.intensity-3 { background: rgba(0, 230, 255, 0.45); color: #fff; }
.heatmap-cell.intensity-4 { background: rgba(0, 230, 255, 0.65); color: #fff; }
.heatmap-cell.intensity-5 { background: var(--accent); color: #000; }
.heatmap-legend { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 25px; padding: 15px; background: var(--itembg); border: 1px solid var(--border); border-radius: 8px; }
.legend-label { font-size: 12px; opacity: 0.8; }
.legend-gradient { width: 200px; height: 16px; border-radius: 8px; background: linear-gradient(to right, rgba(100,100,100,0.2), var(--accent)); }

/* Mobile Heatmap */
.heatmap-mobile { display: flex; flex-direction: column; gap: 15px; }
.heatmap-mobile-card { background: var(--expandbg); border: 1px solid var(--border); border-radius: 10px; padding: 15px; }
.heatmap-mobile-topic { font-family: Orbitron, sans-serif; font-size: 13px; color: var(--accent-text); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.heatmap-mobile-bars { display: flex; flex-direction: column; gap: 8px; }
.heatmap-mobile-bar { display: grid; grid-template-columns: 70px 1fr 30px; gap: 10px; align-items: center; }
.heatmap-mobile-bar-label { font-size: 10px; color: var(--textcolor); opacity: 0.8; }
.heatmap-mobile-bar-track { height: 20px; background: var(--itembg); border-radius: 4px; overflow: hidden; }
.heatmap-mobile-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.heatmap-mobile-bar-fill.intensity-0 { background: rgba(100, 100, 100, 0.3); }
.heatmap-mobile-bar-fill.intensity-1 { background: rgba(0, 230, 255, 0.3); }
.heatmap-mobile-bar-fill.intensity-2 { background: rgba(0, 230, 255, 0.45); }
.heatmap-mobile-bar-fill.intensity-3 { background: rgba(0, 230, 255, 0.6); }
.heatmap-mobile-bar-fill.intensity-4 { background: rgba(0, 230, 255, 0.8); }
.heatmap-mobile-bar-fill.intensity-5 { background: var(--accent); }
.heatmap-mobile-bar-value { font-family: Orbitron, sans-serif; font-size: 11px; text-align: right; color: var(--accent-text); }

/* Amplification Detector */
.amplification-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 25px; }
.amplification-stat { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; }
.amplification-stat-value { font-family: Orbitron, sans-serif; font-size: 28px; color: var(--accent); margin-bottom: 5px; }
body[data-theme="light"] .amplification-stat-value { color: #000; }
.amplification-stat-label { font-size: 11px; opacity: 0.7; }
.amplification-content { display: flex; flex-direction: column; gap: 20px; }
.amplification-cluster { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.amplification-content-row { display: flex; gap: 18px; align-items: flex-start; }
.amplification-image { width: 140px; height: 100px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--expandbg); }
.amplification-no-image { display: flex; align-items: center; justify-content: center; color: var(--textcolor); opacity: 0.4; font-size: 11px; }
.amplification-details { flex: 1; min-width: 0; }
.amplification-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 15px; }
.amplification-title { font-size: 15px; font-weight: 600; flex: 1; line-height: 1.4; }
.amplification-title a { color: var(--contrast); text-decoration: none; }
.amplification-title a:hover { color: #c0c0c0; }
.amplification-preview { font-size: 12px; color: var(--textcolor); opacity: 0.8; margin-bottom: 10px; line-height: 1.5; }
.amplification-score { background: rgba(249, 115, 22, 0.15); color: #f97316; padding: 6px 12px; border-radius: 8px; font-family: Orbitron, sans-serif; font-size: 12px; white-space: nowrap; }
.amplification-score.high { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.amplification-meta { display: flex; gap: 8px; margin-bottom: 10px; font-size: 12px; flex-wrap: wrap; align-items: center; }
.amplification-sources { display: flex; flex-wrap: wrap; gap: 8px; }
.amplification-source { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; }
.amplification-source img { width: 18px; height: 18px; border-radius: 3px; }
.amplification-indicators { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.amplification-indicator { font-size: 10px; padding: 5px 12px; border-radius: 6px; font-weight: 600; }
.amplification-indicator.simultaneous { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.amplification-indicator.similar { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.amplification-indicator.shared { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
@media (max-width: 768px) { .amplification-stats { grid-template-columns: 1fr; } .amplification-content-row { flex-direction: column; } .amplification-image { width: 100%; height: 150px; } }

/* Influence Map - Improved */
.influence-map-container { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; min-height: 400px; }
.influence-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 15px; flex-wrap: wrap; }
.influence-search { flex: 1; min-width: 200px; max-width: 400px; padding: 10px 15px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 8px; color: var(--textcolor); font-size: 13px; }
.influence-search:focus { outline: none; border-color: var(--accent); }
.influence-legend { display: flex; gap: 15px; font-size: 11px; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }
.legend-dot.bias-left { background: var(--bias-left); }
.legend-dot.bias-center { background: var(--bias-center); }
.legend-dot.bias-right { background: var(--bias-right); }
.influence-grid { display: flex; flex-direction: column; gap: 12px; }
.influence-card { background: var(--expandbg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.influence-card-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; background: var(--itembg); border-bottom: 1px solid var(--border); }
.influence-card-header:hover { background: var(--hover-bg); }
.influence-card-title { display: flex; align-items: center; gap: 8px; font-family: Orbitron, sans-serif; font-size: 13px; color: var(--accent-text); }
.influence-toggle-icon { font-size: 10px; transition: transform 0.2s; }
.influence-card.collapsed .influence-toggle-icon { transform: rotate(-90deg); }
.influence-card-count { font-size: 11px; opacity: 0.7; padding: 3px 10px; background: var(--expandbg); border-radius: 12px; }
.influence-card-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 15px; }
.influence-card.collapsed .influence-card-body { display: none; }
.influence-outlet-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--itembg); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; transition: border-color 0.2s, transform 0.15s; }
.influence-outlet-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.influence-outlet-card.bias-left { border-left: 3px solid var(--bias-left); }
.influence-outlet-card.bias-center { border-left: 3px solid var(--bias-center); }
.influence-outlet-card.bias-right { border-left: 3px solid var(--bias-right); }
.influence-outlet-icon { width: 24px; height: 24px; border-radius: 4px; flex-shrink: 0; background: rgba(255,255,255,0.9); padding: 2px; object-fit: contain; }
.influence-outlet-details { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.influence-outlet-name { font-size: 12px; font-weight: 600; color: var(--contrast); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.influence-outlet-info { font-size: 10px; color: var(--textcolor); opacity: 0.7; }
@media (max-width: 768px) {
  .influence-controls { flex-direction: column; align-items: stretch; }
  .influence-search { max-width: none; }
  .influence-card-body { grid-template-columns: 1fr; }
}

/* Misinformation Radar */
.misinfo-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 25px; }
.misinfo-stat { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; }
.misinfo-stat-value { font-family: Orbitron, sans-serif; font-size: 28px; margin-bottom: 5px; }
.misinfo-stat-value.high-risk { color: #ef4444; }
.misinfo-stat-value.medium-risk { color: #f97316; }
.misinfo-stat-value.low-risk { color: #22c55e; }
.misinfo-stat-label { font-size: 11px; opacity: 0.7; }
.misinfo-content { display: flex; flex-direction: column; gap: 15px; }
.misinfo-item { background: var(--itembg); border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; gap: 18px; align-items: flex-start; }
.misinfo-image { width: 140px; height: 100px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--expandbg); }
.misinfo-no-image { display: flex; align-items: center; justify-content: center; color: var(--textcolor); opacity: 0.4; font-size: 11px; }
.misinfo-main { display: flex; gap: 15px; flex: 1; min-width: 0; }
.misinfo-risk-indicator { width: 70px; text-align: center; flex-shrink: 0; padding: 10px; background: var(--expandbg); border-radius: 8px; }
.misinfo-risk-score { font-family: Orbitron, sans-serif; font-size: 26px; }
.misinfo-risk-score.high { color: #ef4444; }
.misinfo-risk-score.medium { color: #f97316; }
.misinfo-risk-score.low { color: #22c55e; }
.misinfo-risk-label { font-size: 9px; text-transform: uppercase; opacity: 0.7; margin-top: 4px; }
.misinfo-details { flex: 1; }
.misinfo-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.misinfo-title a { color: var(--contrast); text-decoration: none; }
.misinfo-title a:hover { color: #c0c0c0; }
body[data-theme="light"] .misinfo-title a:hover { color: #555; }
.misinfo-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.misinfo-flag { font-size: 10px; padding: 4px 10px; border-radius: 6px; font-weight: 600; }
.misinfo-flag.rapid-spread { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.misinfo-flag.low-diversity { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.misinfo-flag.emotional { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.misinfo-flag.single-source { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.misinfo-flag.low-reliability { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.misinfo-flag.mixed-reliability { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.misinfo-flag.elevated-risk { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.misinfo-flag.state-funded { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.misinfo-flag.high-risk { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.misinfo-flag.medium-risk { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.misinfo-summary { font-size: 12px; opacity: 0.8; margin-bottom: 10px; line-height: 1.5; }
.misinfo-sources { font-size: 11px; opacity: 0.7; }
@media (max-width: 768px) { .misinfo-stats { grid-template-columns: repeat(2, 1fr); } .misinfo-item { flex-direction: column; } .misinfo-main { flex-direction: column; } .misinfo-risk-indicator { width: 100%; } .misinfo-image { width: 100%; height: 150px; } }

/* Feed Builder improvements */
.feed-builder-top-row { grid-template-columns: 1fr 2fr; }
.feed-score-filters { display: flex; gap: 15px; flex-wrap: wrap; }
.feed-score-item { flex: 1; min-width: 140px; }
.feed-score-item label { display: block; font-size: 11px; margin-bottom: 6px; opacity: 0.8; }
.feed-saved-toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--itembg); border: 2px solid var(--accent); border-radius: 12px; padding: 16px 28px; font-size: 14px; color: var(--textcolor); box-shadow: 0 8px 32px rgba(0,0,0,0.4); z-index: 1000; opacity: 0; transition: transform 0.3s, opacity 0.3s; }
.feed-saved-toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Trending topic close button */
.trending-topic .trending-close { display: none; font-size: 12px; margin-left: 4px; opacity: 0.7; }
.trending-topic.active .trending-close { display: inline; }
.trending-topic.active .trending-close:hover { opacity: 1; }

/* Source More Analysis button */
.source-more-btn { width: 100%; margin-top: 10px; padding: 8px; background: var(--expandbg); border: 1px solid var(--border); border-radius: 6px; color: var(--textcolor); font-size: 11px; cursor: pointer; transition: border-color 0.2s; }
.source-more-btn:hover { border-color: var(--accent); }
body[data-theme="light"] .source-more-btn:hover { border-color: #000; }
.source-expanded-details { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.source-expanded-details.open { display: block; }
.source-detail-section { margin-bottom: 12px; }
.source-detail-section h4 { font-size: 11px; font-family: Orbitron, sans-serif; color: var(--accent); margin-bottom: 6px; }
body[data-theme="light"] .source-detail-section h4 { color: #333; }
.source-detail-section p { font-size: 12px; opacity: 0.8; margin: 0; line-height: 1.5; }
/* Beta Flag */
.beta-flag { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; font-family: Orbitron, sans-serif; font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 4px; border: none; cursor: pointer; margin-left: 8px; text-transform: uppercase; letter-spacing: 0.5px; transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3); }
.beta-flag:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(249, 115, 22, 0.5); }
body[data-theme="light"] .beta-flag { box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4); }

/* Menu Intro Section */
.menu-section-highlight { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 4px; }
.menu-item-new { background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(234, 88, 12, 0.1)) !important; border: 1px solid rgba(249, 115, 22, 0.3) !important; border-radius: 6px !important; }
.menu-item-new:hover { background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(234, 88, 12, 0.2)) !important; border-color: rgba(249, 115, 22, 0.5) !important; }
.menu-item-new .menu-item-icon { color: #f97316 !important; }
.menu-new-badge { background: #f97316; color: #fff; font-size: 8px; font-weight: 700; padding: 2px 5px; border-radius: 3px; margin-left: auto; text-transform: uppercase; letter-spacing: 0.3px; }

/* Intro Modal Specific Styles */
.intro-modal .intro-modal-content { max-width: 800px; max-height: 85vh; }
.intro-modal-body { line-height: 1.7; }
.intro-modal-body p { margin-bottom: 16px; }
.intro-modal-body h3 { font-family: Orbitron, sans-serif; color: var(--accent); font-size: 16px; margin: 28px 0 12px 0; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
body[data-theme="light"] .intro-modal-body h3 { color: #333; }
.intro-tagline { font-size: 15px; color: var(--accent); text-align: center; padding: 12px 0; margin-bottom: 20px !important; border-bottom: 1px solid var(--border); }
body[data-theme="light"] .intro-tagline { color: #666; }
.intro-cta { text-align: center; padding: 24px; margin: 24px 0; background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(0, 230, 255, 0.05)); border-radius: 12px; border: 1px solid var(--border); }
.intro-cta p { margin-bottom: 8px !important; font-size: 16px; }
.intro-footer { font-size: 12px; opacity: 0.7; text-align: center; margin-top: 24px !important; padding-top: 16px; border-top: 1px solid var(--border); }