:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #10b981;
  --accent: #f59e0b;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.85);
  --bg-secondary: #f1f5f9;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 20px;
  --radius-sm: 10px;
  --nav-height: 70px;
  --success: #10b981;
}

[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-nav: rgba(15, 23, 42, 0.9);
  --bg-secondary: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Visually hidden but still readable by screen readers and search engines */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Keep a clear, consistent focus indicator for keyboard navigation
   (Nielsen: visibility of system status / accessible feedback). */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Lightweight toast notifications for instant, unobtrusive action feedback */
.toast-container { position: fixed; top: calc(var(--nav-height) + 1rem); right: 1.5rem; z-index: 3000; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.toast { pointer-events: auto; background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 10px; padding: 0.75rem 1rem; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; max-width: 320px; animation: toastIn 0.2s ease-out; }
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: #ef4444; }
.toast.toast-hide { animation: toastOut 0.2s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }
body { font-family: 'Inter', sans-serif; background: var(--bg-body); color: var(--text-main); line-height: 1.5; transition: background-color 0.3s; overflow-x: hidden; }

/* Layout */
.nav-container { max-width: 1440px; margin: 0 auto; padding: 0 2rem; width: 100%; }

/* Navbar */
.navbar { background: var(--bg-nav); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); height: var(--nav-height); position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; }
.navbar .nav-container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -0.04em; display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; cursor: default; }
.nav-center { flex: 1; display: flex; justify-content: center; gap: 1rem; }
.nav-right { display: flex; align-items: center; gap: 0.5rem; }

/* Mobile hamburger */
.mobile-menu-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-main); cursor: pointer; align-items: center; justify-content: center; font-size: 1.2rem; }

.selector-trigger { background: var(--bg-card); border: 1px solid var(--border); padding: 0.6rem 1.2rem; border-radius: 12px; font-weight: 600; color: var(--text-main); cursor: pointer; display: flex; align-items: center; gap: 0.6rem; transition: all 0.2s; font-size: 13px; }
.selector-trigger:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }

.search-bar { position: relative; }
.search-bar input { background: var(--bg-body); border: 1px solid var(--border); padding: 0.6rem 1rem; border-radius: 12px; color: var(--text-main); width: 200px; transition: all 0.3s; font-size: 13px; }
.search-bar input:focus { outline: none; border-color: var(--primary); width: 280px; background: var(--bg-card); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }

/* Buttons */
.btn-icon-text { padding: 0.6rem 1rem; border-radius: 12px; font-weight: 700; border: none; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: all 0.2s; font-size: 13px; white-space: nowrap; }
.btn-refresh { background: var(--primary); color: white; }
.btn-refresh:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
.btn-refresh i.fa-spin { animation: spin 1s linear infinite; }
.btn-refresh:disabled, .btn-refresh.is-syncing { opacity: 0.75; cursor: progress; transform: none; box-shadow: none; }
.btn-theme { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-main); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.btn-theme:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(99, 102, 241, 0.05); }

/* Filter Bar */
.filter-bar { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 1rem 0; position: sticky; top: var(--nav-height); z-index: 900; }
.filter-bar .nav-container { display: flex; flex-direction: column; gap: 1rem; }
.quick-time-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-quick-time { padding: 6px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-body); color: var(--text-muted); font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-quick-time:hover, .btn-quick-time.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2); }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.filter-item { display: flex; align-items: center; gap: 0.5rem; }
.filter-label { font-weight: 800; color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.filter-select { background: var(--bg-body); border: 1px solid var(--border); padding: 0.5rem 0.7rem; border-radius: 10px; color: var(--text-main); font-size: 13px; font-weight: 500; outline: none; transition: all 0.2s; max-width: 160px; }
.filter-select:focus { border-color: var(--primary); background: var(--bg-card); }
.btn-apply { background: var(--secondary); color: white; }
.btn-apply:hover { background: #0da371; transform: translateY(-1px); }
.btn-podcast { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2); }
.btn-podcast:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(124, 58, 237, 0.3); }
.btn-podcast.playing i { animation: pulse-audio 1.5s infinite; }
.btn-podcast.loading { opacity: 0.7; pointer-events: none; }
.podcast-controls { display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.6rem; background: var(--bg-secondary); border-radius: 10px; animation: fadeInDown 0.2s ease; }
.podcast-speed-picker { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.7rem; background: var(--bg-secondary); border-radius: 10px; animation: fadeInDown 0.2s ease; }
.podcast-speed-picker .speed-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.btn-speed { padding: 0.3rem 0.55rem; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text-muted); font-size: 0.7rem; font-weight: 700; cursor: pointer; transition: all 0.15s; min-width: 32px; text-align: center; }
.btn-speed:hover { background: var(--bg-card); color: var(--primary); border-color: var(--border); }
.btn-speed.active { background: var(--primary); color: white; border-color: var(--primary); }
.btn-stop { color: #ef4444; }
.btn-stop:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
@keyframes pulse-audio { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }
.filter-actions { display: flex; align-items: center; gap: 0.75rem; }
.btn-strategy { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
.btn-strategy:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4); }
.btn-reset { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-reset:hover { border-color: #ef4444; color: #ef4444; background: rgba(239, 68, 68, 0.05); }

/* Report Dropdown */
.report-dropdown { position: relative; }
.report-dropdown-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 1100; min-width: 220px; padding: 6px; overflow: hidden; }
.report-dropdown-menu.show { display: block; animation: fadeInDown 0.2s ease; }
.report-period-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: none; background: transparent; color: var(--text-main); font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 8px; transition: all 0.15s; text-align: left; }
.report-period-btn:hover { background: var(--bg-secondary); color: var(--primary); }
.report-period-btn i { width: 18px; color: var(--text-muted); }
.report-period-btn:hover i { color: var(--primary); }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* Sort Controls */
.sort-controls { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.sort-controls .filter-label { margin-right: 0.25rem; }
.btn-sort { padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-body); color: var(--text-muted); font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-sort:hover, .btn-sort.active { background: var(--primary); color: white; border-color: var(--primary); }

/* News Grid */
.main-content { padding: 2rem 0; }
.news-list { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.results-summary {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.news-card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; transition: all 0.3s ease; display: flex; flex-direction: column; cursor: pointer; position: relative; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.news-card.strategic { border-left: 4px solid var(--accent); }
.news-card-image-container { width: 100%; height: 140px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 1.5rem; border-bottom: 1px solid var(--border); }
[data-theme="dark"] .news-card-image-container { background: var(--bg-secondary); }
.news-card-logo { max-width: 100%; max-height: 100%; object-fit: contain; }
.news-card-content { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.news-card-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.5rem; line-height: 1.4; color: var(--text-main); }
.news-card-description { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.25rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: auto; }
.badge { padding: 0.3rem 0.6rem; border-radius: 6px; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; }
.badge-company { background: #f1f5f9; color: #475569; }
.badge-source { background: #e0f2fe; color: #0369a1; }
.badge-category { background: #f0fdf4; color: #15803d; }
.badge-strategic { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; }
.badge-relevance { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.news-card-date { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-left: auto; }

/* Pagination */
.pagination-container { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1.5rem 0; margin-top: 1rem; }
.pagination-info { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 600px; }
.pagination-info span { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.page-size-selector { display: flex; align-items: center; gap: 0.5rem; }
.page-size-selector .filter-label { font-size: 0.8rem; color: var(--text-muted); }
.btn-page-size { padding: 0.35rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-main); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-page-size:hover { border-color: var(--primary); color: var(--primary); }
.btn-page-size.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination-nav { display: flex; align-items: center; gap: 0.4rem; }
.btn-page-nav { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-main); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-page-nav:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.btn-page-nav:disabled { opacity: 0.4; cursor: not-allowed; }
.page-numbers { display: flex; align-items: center; gap: 0.3rem; }
.btn-page-num { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-main); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-page-num:hover { border-color: var(--primary); color: var(--primary); }
.btn-page-num.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
.page-ellipsis { padding: 0 0.3rem; color: var(--text-muted); font-weight: 600; }

/* Source Link Button (Article Modal) */
.btn-source-link { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.4rem; background: var(--primary); color: white; text-decoration: none; border-radius: 12px; font-weight: 700; font-size: 13px; transition: all 0.2s; }
.btn-source-link:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }

/* AI Chat */
.ai-chat-toggle { position: fixed; bottom: 2rem; right: 2rem; width: 56px; height: 56px; border-radius: 18px; background: var(--primary); color: white; border: none; font-size: 24px; cursor: pointer; box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4); z-index: 1000; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.ai-chat-toggle:hover { transform: scale(1.1) translateY(-3px); box-shadow: 0 15px 40px rgba(99, 102, 241, 0.5); }
.ai-chat-window { position: fixed; bottom: 7rem; right: 2rem; width: 380px; height: 550px; max-height: calc(100vh - 10rem); background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); z-index: 1001; display: flex; flex-direction: column; overflow: hidden; animation: chatSlide 0.3s ease; }
@keyframes chatSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.ai-chat-header { padding: 1rem 1.25rem; background: var(--primary); color: white; font-weight: 800; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.ai-chat-messages { flex: 1; padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem; }
.ai-message { max-width: 85%; padding: 0.85rem 1rem; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.ai-message.bot { background: var(--bg-body); align-self: flex-start; border-bottom-left-radius: 4px; color: var(--text-main); }
.ai-message.user { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-chat-input-area { padding: 0.75rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; }
.ai-chat-input-area input { flex: 1; padding: 0.7rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-body); color: var(--text-main); outline: none; font-size: 13px; }

/* Modals */
.modal { display: none; position: fixed; z-index: 2000; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow-y: auto; }
.modal-content { background: var(--bg-card); max-width: 860px; margin: 2vh auto; border-radius: 24px; padding: 2.5rem 3rem; position: relative; max-height: 96vh; overflow-y: auto; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.2); scroll-behavior: smooth; }
.modal-header { margin-bottom: 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-weight: 800; letter-spacing: -0.02em; font-size: 1.3rem; }
.close { font-size: 1.8rem; cursor: pointer; color: var(--text-muted); transition: color 0.2s; line-height: 1; }
.close:hover { color: #ef4444; }

/* Company Selector Grid */
/* Category Tabs */
.category-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.btn-category { background: var(--bg-body); border: 1px solid var(--border); padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.btn-category:hover { background: var(--bg-card); border-color: var(--primary); color: var(--primary); }
.btn-category.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; max-height: 400px; overflow-y: auto; }
.company-item { background: var(--bg-body); border: 2px solid transparent; padding: 1rem; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; cursor: pointer; transition: all 0.2s; }
.company-item:hover { transform: translateY(-2px); background: var(--bg-card); border-color: var(--border); }
.company-item.selected { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); }
.company-item img { width: 40px; height: 40px; object-fit: contain; }
.company-item span { font-weight: 700; font-size: 0.8rem; text-align: center; }

/* Sync Status Bar */
.sync-status-bar { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 0.5rem 0; display: none; animation: slideDown 0.3s ease-out; }
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sync-content { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; font-weight: 600; color: var(--primary); }
.sync-progress-mini { flex: 1; height: 5px; background: var(--bg-body); border-radius: 3px; overflow: hidden; max-width: 250px; }
.sync-progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #8b5cf6); transition: width 0.5s ease; border-radius: 3px; }

/* Report Styles - Professional Layout */
.report-body { line-height: 1.75; font-size: 0.92rem; color: var(--text-main); padding: 0.5rem 0; }
.report-body h1, .report-h1 { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin: 0 0 0.75rem; letter-spacing: -0.02em; }
.report-body h2, .report-h2 { font-size: 1.15rem; font-weight: 700; color: var(--text-main); margin: 1.5rem 0 0.75rem; padding: 0.6rem 0.9rem; background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%); border-left: 4px solid var(--primary); border-radius: 0 10px 10px 0; }
[data-theme="dark"] .report-body h2 { background: linear-gradient(135deg, #1e293b 0%, #1e1b4b 100%); }
.report-body h3, .report-h3 { font-size: 0.98rem; font-weight: 700; color: var(--primary); margin: 1rem 0 0.4rem; padding-bottom: 0.2rem; }
.report-body p { margin: 0.4rem 0 0.6rem; }
.report-body blockquote, .report-quote { border-left: 3px solid var(--primary); background: var(--bg-secondary); padding: 0.7rem 1rem; margin: 0.6rem 0; border-radius: 0 10px 10px 0; font-style: italic; font-size: 0.85rem; line-height: 1.6; }
.report-body hr, .report-divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.report-body ul, .report-body ol { margin: 0.4rem 0 0.6rem 1.2rem; padding: 0; }
.report-body li { margin-bottom: 0.35rem; padding-left: 0.3rem; font-size: 0.88rem; line-height: 1.6; }
.report-body strong { color: var(--text-main); font-weight: 700; }
.report-body img, .report-img { width: 100%; border-radius: 10px; margin: 0.8rem 0; box-shadow: var(--shadow); max-height: 200px; object-fit: cover; }
.report-body a, .report-link { color: var(--primary); text-decoration: none; font-weight: 600; }
.report-body a:hover, .report-link:hover { text-decoration: underline; }
/* Report Cards - Borderless Design */
.report-card { background: var(--bg-secondary); border-radius: 14px; padding: 1rem 1.25rem; margin: 0.75rem 0; }
.report-kv { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.55rem 0; }
.report-kv + .report-kv { border-top: 1px solid rgba(99, 102, 241, 0.08); }
.report-kv-key { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; min-width: 110px; flex-shrink: 0; }
.report-kv-val { font-size: 0.88rem; font-weight: 600; color: var(--text-main); line-height: 1.5; }
.report-kv-val strong { color: var(--primary); }
.report-kv-val em { color: var(--text-muted); font-style: normal; font-size: 0.82rem; }

/* Callout Card (1-column tables) */
.report-callout { background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 100%); border-radius: 12px; padding: 1rem 1.25rem; margin: 0.75rem 0; }
[data-theme="dark"] .report-callout { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%); }
.report-callout-title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); margin-bottom: 0.4rem; }
.report-callout-body { font-size: 0.85rem; color: var(--text-main); line-height: 1.6; font-style: italic; }

/* Data Grid (multi-column tables) */
.report-data-grid { margin: 0.75rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.report-data-row { background: var(--bg-secondary); border-radius: 12px; padding: 0.85rem 1.1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem 1.25rem; transition: transform 0.15s, box-shadow 0.15s; }
.report-data-row:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08); }
.report-data-row:nth-child(odd) { background: var(--bg-body); }
.report-data-cell { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.report-data-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); opacity: 0.8; }
.report-data-value { font-size: 0.82rem; font-weight: 500; color: var(--text-main); line-height: 1.45; word-wrap: break-word; overflow-wrap: break-word; }
.report-data-value strong { color: var(--primary); font-weight: 700; }
.report-data-value em { color: var(--text-muted); font-style: normal; font-size: 0.78rem; }
.report-loading { text-align: center; padding: 3rem 2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 250px; }

/* Report Modal Layout */
.report-modal { max-width: 900px; padding: 2rem 2.5rem; }
.report-modal .modal-header { position: sticky; top: -2rem; background: var(--bg-card); padding: 0.75rem 0 1rem; margin: -0.5rem 0 0.5rem; z-index: 10; }
.report-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.report-header-actions .btn-icon-text { padding: 0.5rem 0.7rem; border-radius: 8px; font-size: 0.85rem; }
.report-content { padding: 0.75rem 0 0; max-width: 100%; }

/* Action Items in Report */
.action-item { background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 100%); border: 1px solid #ddd6fe; border-radius: 10px; padding: 0.75rem 1rem; margin: 0.5rem 0; display: flex; align-items: flex-start; gap: 0.6rem; }
.action-item .action-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.action-item .action-text { font-size: 0.85rem; font-weight: 600; color: #4c1d95; }
.action-item .action-urgency { font-size: 0.7rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; margin-left: auto; flex-shrink: 0; }
.action-urgency.urgent { background: #fef2f2; color: #dc2626; }
.action-urgency.soon { background: #fff7ed; color: #ea580c; }
.action-urgency.plan { background: #f0fdf4; color: #16a34a; }

/* Yearly Summary */
.time-divider { color: var(--text-muted); font-size: 0.8rem; display: flex; align-items: center; }
.btn-yearly { background: var(--bg-secondary) !important; border: 1px solid var(--primary) !important; color: var(--primary) !important; font-weight: 600; }
.btn-yearly:hover { background: var(--primary) !important; color: white !important; }
.yearly-summary { padding: 0.75rem 0; }
.yearly-header { text-align: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--border); }
.yearly-header h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.4rem; }
.yearly-header p { color: var(--text-muted); font-size: 0.85rem; }
.yearly-company-card { background: var(--bg-secondary); border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem; border: 1px solid var(--border); transition: box-shadow 0.2s; }
.yearly-company-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.yearly-company-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.yearly-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: white; padding: 3px; }
.yearly-company-header h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.yearly-highlights { list-style: none; padding: 0; margin: 0; }
.yearly-highlights li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; line-height: 1.5; }
.yearly-highlights li:last-child { border-bottom: none; }
.yearly-highlights li::before { content: '→ '; color: var(--primary); font-weight: 600; }
.relevance-high { background: #dcfce7 !important; color: #166534 !important; font-weight: 600; }
.relevance-medium { background: #fef9c3 !important; color: #854d0e !important; font-weight: 600; }
.relevance-low { background: #f1f5f9 !important; color: #64748b !important; }

/* States */
.loading, .empty-state { text-align: center; padding: 4rem 2rem; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-left-color: var(--primary); border-radius: 50%; margin: 0 auto 1rem; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Email Subscription */
.btn-subscribe { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.btn-subscribe:hover { background: linear-gradient(135deg, #059669, #047857); transform: translateY(-1px); }
.subscribe-form { padding: 0.5rem 0; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 0.5rem; color: var(--text-main); }
.form-input { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 10px; font-size: 0.9rem; background: var(--bg-body); color: var(--text-main); outline: none; transition: border-color 0.2s; box-sizing: border-box; }
.form-input:focus { border-color: var(--primary); }
.frequency-options { display: flex; gap: 0.5rem; }
.btn-freq { flex: 1; padding: 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-body); font-weight: 600; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; }
.btn-freq:hover { border-color: var(--primary); color: var(--primary); }
.btn-freq.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sub-company-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; max-height: 200px; overflow-y: auto; padding: 0.5rem 0; }
.sub-company-chip { display: flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: 20px; font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: all 0.2s; background: var(--bg-body); }
.sub-company-chip img { width: 16px; height: 16px; object-fit: contain; }
.sub-company-chip:hover { border-color: var(--primary); }
.sub-company-chip.selected { background: rgba(99,102,241,0.1); border-color: var(--primary); color: var(--primary); }
.btn-subscribe-submit { width: 100%; padding: 0.8rem; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border: none; border-radius: 10px; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.btn-subscribe-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.btn-subscribe-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.sub-status { margin-top: 1rem; padding: 0.75rem; border-radius: 8px; font-size: 0.8rem; font-weight: 600; text-align: center; }
.sub-status.success { background: #ecfdf5; color: #059669; }
.sub-status.error { background: #fef2f2; color: #dc2626; }

/* Nav Tabs */
.nav-tabs { display: flex; gap: 0.25rem; background: var(--bg-body); border-radius: 10px; padding: 3px; margin-right: 0.75rem; }
.nav-tab { display: flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.9rem; border: none; border-radius: 8px; background: transparent; font-size: 0.8rem; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: all 0.2s; }
.nav-tab:hover { color: var(--text-main); background: var(--bg-card); }
.nav-tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.3); }

/* IPO Tracker Section */
.ipo-section { padding: 2rem 0; }
.ipo-header { margin-bottom: 1.5rem; }
.ipo-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--text-main); margin: 0; }
.ipo-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.3rem; }
.ipo-filters { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; align-items: center; }
.ipo-time-filters, .ipo-status-filters { display: flex; gap: 0.4rem; }
.btn-ipo-time, .btn-ipo-status { padding: 0.4rem 0.8rem; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-body); font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-ipo-time:hover, .btn-ipo-status:hover { border-color: var(--primary); color: var(--primary); }
.btn-ipo-time.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-ipo-status.active { background: #10b981; color: #fff; border-color: #10b981; }

/* IPO Stats */
.ipo-stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.ipo-stat-card { background: var(--bg-card); border-radius: 12px; padding: 1.25rem; text-align: center; border: 1px solid var(--border); }
.ipo-stat-card .stat-number { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.ipo-stat-card .stat-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ipo-stat-card.filed .stat-number { color: #f59e0b; }
.ipo-stat-card.preparing .stat-number { color: #3b82f6; }
.ipo-stat-card.rumored .stat-number { color: #8b5cf6; }

/* IPO Cards */
.ipo-list { display: grid; gap: 1rem; }
.ipo-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; transition: all 0.2s; }
.ipo-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); border-color: var(--primary); }
.ipo-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.ipo-company-info h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-main); }
.ipo-ticker { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); background: var(--bg-body); padding: 0.15rem 0.5rem; border-radius: 4px; margin-top: 0.2rem; display: inline-block; }
.ipo-status-badge { padding: 0.3rem 0.7rem; border-radius: 20px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.status-filed { background: #fef3c7; color: #d97706; }
.status-preparing { background: #dbeafe; color: #2563eb; }
.status-rumored { background: #ede9fe; color: #7c3aed; }
.ipo-description { font-size: 0.83rem; color: var(--text-muted); line-height: 1.5; margin: 0 0 0.75rem; }
.ipo-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ipo-meta-item { display: flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.ipo-meta-item i { color: var(--primary); font-size: 0.7rem; }
.ipo-countdown { color: #f59e0b; }

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

/* Large tablets and small desktops */
@media (max-width: 1200px) {
  .nav-center { gap: 0.5rem; }
  .search-bar input { width: 160px; }
  .search-bar input:focus { width: 200px; }
  .nav-right .btn-icon-text span { display: none; }
  .nav-right .btn-icon-text { padding: 0.6rem; width: 40px; height: 40px; justify-content: center; }
}

/* Tablets */
@media (max-width: 1024px) {
  .navbar .nav-container { padding: 0 1rem; }
  .filter-row { flex-direction: column; align-items: stretch; gap: 1rem; }
  .filter-actions { justify-content: space-between; }
  .news-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
  .sort-controls { margin-left: 0; margin-top: 0.5rem; }
  /* Tablet report cards */
  .report-data-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .report-modal { max-width: 95vw; padding: 1.5rem 2rem; }
  .podcast-controls { flex-wrap: wrap; }
  /* Tablet nav tabs */
  .nav-tabs { margin-right: 0.5rem; }
  .nav-tab span { display: none; }
  .nav-tab { padding: 0.4rem 0.7rem; }
  /* Tablet IPO */
  .ipo-stat-cards { grid-template-columns: repeat(2, 1fr); }
  .ipo-meta { gap: 0.5rem; }
  /* Tablet subscription */
  .sub-company-grid { max-height: 150px; }
  .frequency-options { flex-wrap: wrap; }
}

/* Mobile */
@media (max-width: 768px) {
  :root { --nav-height: 60px; }
  .nav-container { padding: 0 1rem; }
  
  /* Mobile nav */
  .nav-center { order: 3; width: 100%; justify-content: center; margin-top: 0.5rem; }
  .nav-tabs { width: 100%; justify-content: center; }
  .nav-tab { flex: 1; justify-content: center; padding: 0.5rem; min-height: 40px; }
  .nav-tab span { font-size: 0.75rem; }
  .selector-trigger { width: 100%; justify-content: center; margin-top: 0.5rem; min-height: 44px; }
  .navbar .nav-container { flex-wrap: wrap; justify-content: space-between; }
  .mobile-menu-toggle { display: flex; min-width: 44px; min-height: 44px; }
  .nav-right { display: none; }
  .nav-right.mobile-open { display: flex; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 1rem; flex-wrap: wrap; gap: 0.5rem; box-shadow: var(--shadow-lg); z-index: 999; }
  .nav-right.mobile-open .btn-icon-text { flex: 1; min-width: calc(50% - 0.5rem); justify-content: center; min-height: 44px; }
  .nav-right.mobile-open .btn-icon-text span { display: inline; }
  .nav-right.mobile-open .search-bar { width: 100%; order: -1; }
  .nav-right.mobile-open .search-bar input { width: 100%; min-height: 44px; font-size: 16px; }
  .nav-right.mobile-open .search-bar input:focus { width: 100%; }
  
  /* Mobile filter bar */
  .filter-bar { padding: 0.75rem 0; }
  .quick-time-filters { gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .quick-time-filters::-webkit-scrollbar { display: none; }
  .btn-quick-time { padding: 8px 14px; font-size: 12px; flex-shrink: 0; min-height: 36px; }
  .filter-row { gap: 0.75rem; }
  .filter-group { gap: 0.5rem; width: 100%; }
  .filter-item { flex: 1; min-width: 0; }
  .filter-select { width: 100%; max-width: none; font-size: 14px; min-height: 44px; padding: 0.6rem; }
  .filter-actions { width: 100%; }
  .filter-actions .btn-icon-text { flex: 1; justify-content: center; font-size: 13px; padding: 0.6rem 0.75rem; min-height: 44px; }
  .sort-controls { width: 100%; justify-content: flex-start; }
  .btn-sort { min-height: 36px; padding: 6px 14px; font-size: 12px; }
  
  /* Report dropdown mobile */
  .report-dropdown { flex: 1; }
  .report-dropdown-menu { left: 0; right: 0; min-width: unset; }
  .report-period-btn { padding: 12px 14px; min-height: 44px; }
  
  /* Mobile podcast controls */
  .podcast-controls { gap: 0.3rem; padding: 0.35rem 0.5rem; border-radius: 8px; }
  .btn-speed { min-height: 36px; min-width: 36px; font-size: 0.68rem; }
  
  /* Mobile news grid */
  .main-content { padding: 1rem 0; }
  .news-list { grid-template-columns: 1fr; gap: 1rem; }
  .news-card-image-container { height: 100px; padding: 1rem; }
  .news-card-content { padding: 1rem; }
  .news-card-title { font-size: 0.95rem; }
  .news-card-description { font-size: 0.8rem; margin-bottom: 1rem; }
  .news-card { min-height: 44px; }
  
  /* Mobile chat */
  .ai-chat-window { width: calc(100% - 2rem); right: 1rem; bottom: 5rem; height: calc(100vh - 8rem); max-height: none; border-radius: 16px; }
  .ai-chat-toggle { bottom: 1.5rem; right: 1.5rem; width: 54px; height: 54px; border-radius: 14px; font-size: 22px; }
  .ai-chat-input-area input { min-height: 44px; font-size: 16px; }
  .ai-chat-input-area button { min-width: 44px; min-height: 44px; }
  
  /* Mobile modals */
  .modal-content { width: calc(100% - 1.5rem); margin: 2vh 0.75rem; padding: 1.25rem; border-radius: 18px; max-height: 96vh; }
  .report-modal { padding: 1.25rem 1rem; }
  .modal-header h2 { font-size: 1.1rem; }
  
  /* Mobile report cards */
  .report-card { padding: 0.75rem 1rem; margin: 0.5rem 0; }
  .report-kv { flex-direction: column; gap: 0.2rem; padding: 0.5rem 0; }
  .report-kv-key { min-width: unset; font-size: 0.7rem; }
  .report-kv-val { font-size: 0.84rem; }
  .report-data-row { grid-template-columns: 1fr 1fr; padding: 0.75rem; gap: 0.5rem 0.75rem; }
  .report-data-label { font-size: 0.6rem; }
  .report-data-value { font-size: 0.78rem; }
  .report-callout { padding: 0.75rem 1rem; }
  .report-callout-body { font-size: 0.8rem; }
  .company-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .company-item { padding: 0.75rem 0.5rem; min-height: 44px; }
  .company-item img { width: 32px; height: 32px; }
  .company-item span { font-size: 0.7rem; }
  
  /* Mobile IPO */
  .ipo-section { padding: 1rem 0; }
  .ipo-header h2 { font-size: 1.1rem; }
  .ipo-stat-cards { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .ipo-stat-card { padding: 0.75rem; }
  .ipo-stat-card .stat-number { font-size: 1.4rem; }
  .ipo-stat-card .stat-label { font-size: 0.65rem; }
  .ipo-filters { flex-direction: column; gap: 0.5rem; }
  .ipo-time-filters, .ipo-status-filters { flex-wrap: wrap; }
  .btn-ipo-time, .btn-ipo-status { padding: 0.35rem 0.65rem; font-size: 0.7rem; min-height: 36px; display: flex; align-items: center; }
  .ipo-card { padding: 1rem; }
  .ipo-card-header { flex-direction: column; gap: 0.5rem; }
  .ipo-meta { gap: 0.5rem; }
  .ipo-meta-item { font-size: 0.7rem; }
  .ipo-description { font-size: 0.78rem; }
  /* Mobile subscription */
  .subscribe-form .form-group { margin-bottom: 1rem; }
  .frequency-options { flex-wrap: wrap; }
  .btn-freq { min-width: calc(50% - 0.25rem); min-height: 44px; }
  .sub-company-grid { max-height: 160px; }
  .sub-company-chip { font-size: 0.68rem; padding: 0.3rem 0.5rem; min-height: 32px; }
  /* Mobile pagination */
  .pagination-container { padding: 0.75rem 0; }
  .pagination-info { flex-direction: column; gap: 0.5rem; align-items: center; }
  .page-numbers { gap: 0.2rem; }
  .btn-page-num { min-width: 32px; min-height: 32px; font-size: 0.75rem; }
  .btn-page-nav { min-width: 36px; min-height: 36px; }
  /* Safe area for notched phones */
  body { padding-bottom: env(safe-area-inset-bottom); }
  .navbar { padding-top: env(safe-area-inset-top); }
}

/* Small phones */
@media (max-width: 480px) {
  .news-list { gap: 0.75rem; }
  .news-card-image-container { height: 80px; }
  .badge { font-size: 0.6rem; padding: 0.2rem 0.4rem; }
  .company-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-time-filters { gap: 4px; }
  .btn-quick-time { padding: 4px 8px; font-size: 10px; border-radius: 8px; }
  /* Small phone report cards */
  .report-data-row { grid-template-columns: 1fr; }
  .report-kv-val { font-size: 0.8rem; }
  .report-body h2, .report-h2 { font-size: 1rem; padding: 0.5rem 0.75rem; }
  .report-body h3, .report-h3 { font-size: 0.88rem; }
  .modal-content { padding: 1rem 0.75rem; margin: 1vh 0.5rem; }
  /* Small phone podcast controls */
  .podcast-controls { gap: 0.25rem; padding: 0.3rem 0.4rem; }
  .btn-speed { padding: 0.25rem 0.4rem; font-size: 0.65rem; min-width: 28px; }
  /* Small phone IPO */
  .ipo-stat-cards { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .ipo-stat-card { padding: 0.6rem; border-radius: 8px; }
  .ipo-stat-card .stat-number { font-size: 1.2rem; }
  .ipo-card { padding: 0.75rem; border-radius: 10px; }
  .ipo-company-info h3 { font-size: 0.9rem; }
  .ipo-meta-item { font-size: 0.65rem; }
  /* Small phone nav tabs */
  .nav-tab { font-size: 0.7rem; padding: 0.4rem 0.5rem; }
}

