/* StockTi.com - Bloomberg Dark Theme */

.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; }

@font-face { font-family: 'Farray'; src: url('/fonts/FARRAY.otf') format('opentype'); font-display: swap; }

:root {
    --bg-body: #0a0e17;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-surface: #0f1520;
    --bg-input: #1a2332;
    --border: #1e293b;
    --border-light: #2a3a50;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59,130,246,0.1);
    --positive: #10b981;
    --positive-bg: rgba(16,185,129,0.1);
    --negative: #ef4444;
    --negative-bg: rgba(239,68,68,0.1);
    --warning: #f59e0b;
    --cyan: #06b6d4;
    --nav-height: 56px;
    --ticker-height: 36px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --nav-bg: rgba(10, 14, 23, 0.85);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.5);
    --overlay-gradient: rgba(10,14,23,0.95);
}

/* Light theme */
[data-theme="light"] {
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --bg-surface: #f5f6f8;
    --bg-input: #f0f2f5;
    --border: #d1d5db;
    --border-light: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37,99,235,0.08);
    --positive: #059669;
    --positive-bg: rgba(5,150,105,0.08);
    --negative: #dc2626;
    --negative-bg: rgba(220,38,38,0.08);
    --warning: #d97706;
    --cyan: #0891b2;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
    --overlay-gradient: rgba(255,255,255,0.95);
}
[data-theme="light"] .ticker-bar { background: #ffffff; border-bottom-color: #d1d5db; }
[data-theme="light"] .ticker-item { color: var(--text-secondary); }
[data-theme="light"] .ticker-item .ticker-symbol { color: var(--text-primary); }
[data-theme="light"] .article-card { box-shadow: var(--shadow-sm); }
[data-theme="light"] .sidebar-card { box-shadow: var(--shadow-sm); }
[data-theme="light"] img { filter: none; }

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

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

.container { max-width: 1320px; margin: 0 auto; padding: 0 20px; }

/* ── Ticker Bar ── */
.ticker-bar {
    background: #060a10;
    border-bottom: 1px solid var(--border);
    height: var(--ticker-height);
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.ticker-content {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0;
    animation: tickerScroll 60s linear infinite;
    white-space: nowrap;
}

.ticker-content:hover { animation-play-state: paused; }

a.ticker-item { text-decoration: none; color: inherit; }
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    height: 100%;
}

.ticker-item .ticker-symbol { color: var(--text-secondary); font-weight: 600; }
.ticker-item .ticker-price { font-family: var(--font-mono); color: var(--text-primary); font-size: 12px; }
.ticker-item .ticker-change { font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.ticker-item .ticker-change.positive { color: var(--positive); }
.ticker-item .ticker-change.negative { color: var(--negative); }

.ticker-loading { color: var(--text-muted); font-size: 12px; padding: 0 20px; }

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

/* ── Navigation ── */
.main-nav {
    background: var(--nav-bg, rgba(10, 14, 23, 0.85));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    position: sticky;
    top: var(--ticker-height);
    z-index: 1000;
}

.nav-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 32px;
}

.nav-logo { display: flex; align-items: center; font-family: 'Farray', sans-serif; font-size: 24px; font-weight: 400; letter-spacing: 0.5px; }
.logo-stock { color: var(--text-primary); }
.logo-ti { color: var(--accent); }

.nav-links { display: flex; gap: 4px; }
.nav-link {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); background: var(--accent-light); }

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

.nav-search {
    position: relative;
    width: 260px;
}
.nav-search input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 16px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 360px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}
.search-dropdown.active { display: block; }

.search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid var(--border);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-card-hover); }
.search-result-symbol { font-weight: 700; font-size: 14px; }
.search-result-name { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.search-result-price { font-family: var(--font-mono); font-size: 13px; }

.market-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}
.market-status.open .status-dot { background: var(--positive); animation: pulse 2s infinite; }
.market-status.open .status-text { color: var(--positive); }
.market-status.closed .status-dot { background: var(--negative); }
.market-status.closed .status-text { color: var(--text-muted); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.2s;
}

/* ── Main Content ── */
.main-content { min-height: 60vh; padding: 24px 0; }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.card-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.card-body { padding: 20px; }

/* ── Section Headers ── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.section-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.section-link { font-size: 13px; font-weight: 500; }

/* ── Grid Layouts ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── Homepage Hero ── */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.breaking-banner {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05));
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.breaking-label {
    background: var(--negative);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    animation: pulse 1.5s infinite;
}
.breaking-text { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.breaking-text a { color: var(--text-primary); }
.breaking-text a:hover { color: var(--accent); }

/* ── Article Cards ── */
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.article-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.article-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.article-card-body { padding: 16px 20px; }
.article-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}
.article-card-category {
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.article-card-time { color: var(--text-muted); }

.article-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card-title a { color: var(--text-primary); }
.article-card-title a:hover { color: var(--accent); }

.article-card-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-tickers {
    display: flex;
    gap: 4px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.ticker-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    color: var(--accent);
}

/* Featured article large */
.article-featured {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
}
.article-featured-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.article-featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, var(--overlay-gradient));
}
.article-featured-content {
    position: relative;
    padding: 32px;
    width: 100%;
}
.article-featured-content .article-card-category { font-size: 13px; }
.article-featured-content .article-card-title { font-size: 24px; -webkit-line-clamp: 3; margin-bottom: 8px; }
.article-featured-content .article-card-excerpt { -webkit-line-clamp: 2; }

/* Article list item (compact) */
.article-list-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.article-list-item:last-child { border-bottom: none; }
.article-list-thumb {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}
.article-list-body { flex: 1; min-width: 0; }
.article-list-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-list-title a { color: var(--text-primary); }
.article-list-title a:hover { color: var(--accent); }
.article-list-time { font-size: 11px; color: var(--text-muted); }

/* ── Sector Heatmap ── */
.heatmap-container { margin-bottom: 32px; }

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

a.heatmap-cell { text-decoration: none; display: block; color: inherit; }
.heatmap-cell {
    padding: 16px 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: opacity 0.15s;
    position: relative;
}
.heatmap-cell:hover { opacity: 0.85; }
.heatmap-cell-name { font-size: 12px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.heatmap-cell-value { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: #fff; }
.heatmap-cell-etf { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* Heatmap spans */
.heatmap-grid .heatmap-cell:nth-child(1) { grid-column: span 2; }
.heatmap-grid .heatmap-cell:nth-child(2) { grid-column: span 2; }

/* ── Trending Stocks ── */
.trending-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}
.trending-tab {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.trending-tab:hover { border-color: var(--border-light); color: var(--text-secondary); }
.trending-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.trending-list { list-style: none; }
.trending-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.trending-item:last-child { border-bottom: none; }
.trending-rank {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}
.trending-info { flex: 1; min-width: 0; }
.trending-symbol { font-weight: 700; font-size: 14px; }
.trending-name { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trending-spark { width: 60px; height: 24px; flex-shrink: 0; }
.trending-data { text-align: right; }
.trending-price { font-family: var(--font-mono); font-size: 14px; font-weight: 600; }
.trending-change { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }

/* ── Market Indices Grid ── */
.indices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 32px; }

a.index-card { text-decoration: none; color: inherit; }
.index-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color 0.15s;
}
.index-card:hover { border-color: var(--border-light); }
.index-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.index-price { font-family: var(--font-mono); font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.index-change { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }

/* ── Colors ── */
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.bg-positive { background: var(--positive-bg); }
.bg-negative { background: var(--negative-bg); }

/* ── Stock Page ── */
.stock-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.stock-title-section { flex: 1; }
.stock-symbol-large { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 4px; font-family: var(--font-mono); }
.stock-name-large { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.stock-exchange { font-size: 13px; color: var(--text-muted); }

.stock-price-section { text-align: right; }
.stock-price-large { font-family: var(--font-mono); font-size: 36px; font-weight: 700; }
.stock-change-large { font-family: var(--font-mono); font-size: 18px; font-weight: 600; }

.stock-chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}
.chart-period-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}
.chart-period-tab {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.15s;
}
.chart-period-tab:hover { border-color: var(--border-light); color: var(--text-secondary); }
.chart-period-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.stock-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}
.card .stock-stats-grid {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
}
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-value { font-family: var(--font-mono); font-size: 14px; font-weight: 600; }

/* ── Calendar ── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.calendar-day {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-height: 140px;
    max-height: 480px;
    padding: 14px;
    overflow-y: auto;
}
.calendar-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.calendar-day-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.calendar-day-header .event-count {
    font-weight: 400;
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}
.calendar-day.today .calendar-day-header { color: var(--accent); }
.calendar-event {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 3px;
    background: var(--bg-surface);
    transition: background 0.15s;
}
.calendar-event:hover { background: var(--bg-card-hover); }
.calendar-event-symbol { font-family: var(--font-mono); font-weight: 700; color: var(--text-primary); text-decoration: none; }
.calendar-event-symbol:hover { color: var(--accent); }
.calendar-event-name { color: var(--text-muted); font-size: 11px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-time { color: var(--text-muted); font-size: 10px; font-family: var(--font-mono); flex-shrink: 0; }
.calendar-event-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.calendar-event.beat .calendar-event-indicator { background: var(--positive); }
.calendar-event.miss .calendar-event-indicator { background: var(--negative); }
.calendar-event.mega-cap { background: rgba(37,99,235,0.1); }
.calendar-event.mega-cap .calendar-event-symbol { color: var(--accent); font-size: 13px; }
.calendar-event.large-cap .calendar-event-symbol { color: var(--text-primary); font-size: 13px; }
.calendar-event-eps {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-left: auto;
}
.calendar-event-eps .actual { font-weight: 600; }
.calendar-event-eps .actual.beat { color: var(--positive); }
.calendar-event-eps .actual.miss { color: var(--negative); }
.calendar-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.calendar-legend span { display: flex; align-items: center; gap: 5px; }
.calendar-legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ── Watchlist ── */
.watchlist-table {
    width: 100%;
    border-collapse: collapse;
}
.watchlist-table th,
.watchlist-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.watchlist-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-surface);
}
.watchlist-table td { font-size: 14px; }
.watchlist-table .mono { font-family: var(--font-mono); }
.watchlist-table tr:hover { background: var(--bg-card-hover); }

.watchlist-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: var(--negative); color: #fff; }
.btn-success { background: var(--positive); color: #fff; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-textarea { resize: vertical; min-height: 120px; }

/* ── Article Page ── */

/* Breadcrumb */
.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-top: 8px;
}
.article-breadcrumb a { color: var(--text-muted); }
.article-breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--border-light); font-size: 11px; }

/* Two-column layout */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}
.article-main { min-width: 0; }

/* Header */
.article-page-header { margin-bottom: 28px; }
.article-page-category {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.article-page-category a { color: var(--accent); }
.article-page-title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
}
.article-page-excerpt {
    font-size: 18px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 400;
}
.article-page-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.meta-sep { color: var(--border-light); }

/* Breaking flag */
.article-breaking-flag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05));
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius);
    padding: 8px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--negative);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.breaking-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--negative);
    animation: pulse 1.5s infinite;
}

/* Hero image */
.article-page-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

/* Ticker chips bar */
.article-tickers-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.article-tickers-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.article-tickers-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.article-ticker-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    transition: border-color 0.15s, background 0.15s;
}
.article-ticker-chip:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}
.chip-symbol {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 12px;
}
.chip-price {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 12px;
}
.chip-change {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
}
.chip-change.positive { color: var(--positive); }
.chip-change.negative { color: var(--negative); }

/* Article body content */
.article-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
}
.article-content h2 { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 32px 0 16px; }
.article-content h3 { font-size: 20px; font-weight: 600; color: var(--text-primary); margin: 24px 0 12px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin-bottom: 16px; padding-left: 24px; }
.article-content li { margin-bottom: 8px; }
.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 24px 0;
    background: var(--accent-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}
.article-content a { color: var(--accent); }
.article-content strong { color: var(--text-primary); }

/* Article footer bar (tags + share) */
.article-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-top: 32px;
    border-top: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}
.article-tags-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.article-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: border-color 0.15s, color 0.15s;
}
.article-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Share buttons */
.article-share {
    display: flex;
    align-items: center;
    gap: 8px;
}
.share-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-size: 12px;
    font-family: var(--font-sans);
}
.share-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ── Article Sidebar ── */
.article-sidebar {
    position: sticky;
    top: calc(var(--ticker-height) + var(--nav-height) + 24px);
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}
.sidebar-card-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

/* Sidebar stock items */
.sidebar-stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.sidebar-stock-item:last-child { border-bottom: none; }
.sidebar-stock-item:hover { background: var(--bg-card-hover); }
.sidebar-stock-left { min-width: 0; }
.sidebar-stock-symbol {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
.sidebar-stock-name {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}
.sidebar-stock-right { text-align: right; flex-shrink: 0; }
.sidebar-stock-price {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.sidebar-stock-change {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
}
.sidebar-stock-change.positive { color: var(--positive); }
.sidebar-stock-change.negative { color: var(--negative); }

/* Sidebar news items */
.sidebar-news-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.sidebar-news-item:last-child { border-bottom: none; }
.sidebar-news-item:hover { background: var(--bg-card-hover); }
.sidebar-news-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sidebar-news-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* Sidebar newsletter/CTA */
.sidebar-newsletter {
    padding: 20px 16px;
}
.sidebar-newsletter .sidebar-card-header {
    padding: 0 0 12px;
    border-bottom: none;
}
.sidebar-newsletter-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 14px;
}

/* ── Related Articles Section ── */
.article-related-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.related-grid .article-card-title { font-size: 14px; }

/* ── Search Page ── */
.search-page-input {
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    color: var(--text-primary);
    font-size: 18px;
    font-family: var(--font-sans);
    outline: none;
    margin-bottom: 24px;
    transition: border-color 0.15s;
}
.search-page-input:focus { border-color: var(--accent); }

/* ── Search Page Discovery ── */
.search-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.search-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 20px; text-decoration: none; font-size: 13px;
    transition: border-color 0.15s;
}
.search-chip:hover { border-color: var(--accent); }
.search-chip-symbol { color: var(--text-primary); font-weight: 600; }
.search-chip-change { font-family: var(--font-mono); font-size: 12px; }
.search-chip-outline { background: transparent; }
.search-chip-outline .search-chip-symbol { font-weight: 500; color: var(--text-secondary); }
.search-chip-outline:hover .search-chip-symbol { color: var(--accent); }

.search-lists-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.search-list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); text-decoration: none;
    transition: border-color 0.15s;
}
.search-list-item:hover { border-color: var(--accent); }
.search-list-icon { font-size: 18px; flex-shrink: 0; }
.search-list-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }

@media (max-width: 768px) {
    .search-lists-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 32px;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.15s;
}
.pagination a:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.pagination .active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Error Page ── */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-code {
    font-family: var(--font-mono);
    font-size: 120px;
    font-weight: 800;
    color: var(--border);
    line-height: 1;
    margin-bottom: 16px;
}
.error-page h1 { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.error-page p { font-size: 16px; color: var(--text-secondary); margin-bottom: 32px; }
.error-actions { display: flex; gap: 12px; justify-content: center; }

/* ── Footer ── */
/* ── Scroll to top ── */
.scroll-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 56px 0 0;
    margin-top: 56px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 40px;
}
.footer-logo { font-family: 'Farray', sans-serif; font-size: 28px; font-weight: 400; letter-spacing: 0.5px; display: inline-block; margin-bottom: 14px; }
.footer-tagline { font-size: 13px; color: var(--text-muted); line-height: 1.7; max-width: 280px; }
.footer-col h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}
.footer-col a {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 11px;
    transition: color 0.15s;
}
.footer-col a:hover { color: var(--accent); }
.footer-disclaimer {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.8;
    padding: 20px 24px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    margin-top: 16px;
}
.footer-disclaimer a { color: #9ca3af; text-decoration: underline; }
.footer-disclaimer a:hover { color: var(--accent); }
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}
.footer-copyright { white-space: nowrap; }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: var(--text-muted); transition: color 0.15s; }
.footer-bottom-links a:hover { color: var(--accent); }

/* ── News Page ── */
.news-header { margin-bottom: 24px; }
.category-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.category-tab {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.category-tab:hover { border-color: var(--border-light); color: var(--text-secondary); }
.category-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

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

/* ── Markets Page ── */
.market-section { margin-bottom: 40px; }

/* ── Static Pages ── */
.static-page { max-width: 820px; margin: 0 auto; }
.static-page h1 { font-size: 36px; font-weight: 800; margin-bottom: 24px; }
.static-page h2 { font-size: 24px; font-weight: 700; margin: 32px 0 16px; }
.static-page p { font-size: 16px; line-height: 1.8; color: var(--text-secondary); margin-bottom: 16px; }
.static-page ul { list-style: disc; padding-left: 24px; margin-bottom: 16px; }
.static-page li { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }

/* ── Sidebar ── */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}
.sidebar .card { margin-bottom: 20px; }

/* ── Sparkline Canvas ── */
canvas.sparkline { display: block; }

/* ── Watchlist empty ── */
.watchlist-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.watchlist-empty h2 { font-size: 24px; color: var(--text-primary); margin-bottom: 12px; }
.watchlist-empty p { font-size: 14px; margin-bottom: 24px; }

/* ── Add to watchlist btn ── */
.watchlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    transition: all 0.15s;
}
.watchlist-btn:hover { border-color: var(--accent); color: var(--accent); }
.watchlist-btn.active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

/* ── Admin edit link ── */
.admin-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--warning);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: rgba(245,158,11,0.1);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; }
    .content-with-sidebar { grid-template-columns: 1fr; }
    .article-layout { grid-template-columns: 1fr; gap: 32px; }
    .article-sidebar { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
    .footer-brand { grid-column: 1 / -1; }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .heatmap-grid { grid-template-columns: repeat(3, 1fr); }
    .heatmap-grid .heatmap-cell:nth-child(1),
    .heatmap-grid .heatmap-cell:nth-child(2) { grid-column: span 1; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .calendar-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border); flex-direction: column; padding: 12px; }
    .nav-links.active { display: flex; }
    .nav-toggle { display: flex; }
    .nav-search { width: 180px; }
    .market-status { display: none; }
    .news-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .heatmap-grid { grid-template-columns: repeat(2, 1fr); }
    .article-page-title { font-size: 26px; }
    .article-page-excerpt { font-size: 16px; }
    .article-footer-bar { flex-direction: column; align-items: flex-start; }
    .stock-header { flex-direction: column; gap: 16px; }
    .stock-price-section { text-align: left; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
    .indices-grid { grid-template-columns: repeat(2, 1fr); }
    .calendar-grid { grid-template-columns: 1fr; }
    .stock-stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .heatmap-grid { grid-template-columns: 1fr; }
    .indices-grid { grid-template-columns: 1fr; }
    .trending-tabs { flex-wrap: wrap; }
}

/* ── Empty States ── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state p { margin-bottom: 12px; }

/* ── Tags ── */
.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}
.tag-earnings { background: rgba(59,130,246,0.1); color: var(--accent); }
.tag-dividend { background: rgba(16,185,129,0.1); color: var(--positive); }
.tag-ipo { background: rgba(245,158,11,0.1); color: var(--warning); }
.tag-split { background: rgba(139,92,246,0.1); color: #8b5cf6; }

/* ── Contact Form ── */
.contact-form { max-width: 600px; }
.form-success {
    background: var(--positive-bg);
    border: 1px solid var(--positive);
    border-radius: var(--radius);
    padding: 16px 20px;
    color: var(--positive);
    margin-bottom: 20px;
}

/* ── Loading ── */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Stock Page Grid (2-col layout) ── */
.stock-page-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}
.stock-main { min-width: 0; }
.stock-sidebar {
    position: sticky;
    top: calc(var(--ticker-height) + var(--nav-height) + 24px);
    align-self: start;
}

/* ── Range Bars ── */
.range-bars-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.range-bar-item { }
.range-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.range-bar-values {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}
.range-bar-track {
    position: relative;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: visible;
}
.range-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.range-bar-fill.fill-positive { background: var(--positive); }
.range-bar-fill.fill-negative { background: var(--negative); }
.range-bar-marker {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--text-primary);
    border: 2px solid var(--bg-body);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px var(--accent);
    z-index: 1;
}

/* ── Performance Row ── */
.perf-row {
    display: flex;
    gap: 0;
    overflow-x: auto;
}
.perf-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border-right: 1px solid var(--border);
    min-width: 72px;
}
.perf-cell:last-child { border-right: none; }
.perf-period {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.perf-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
}

/* ── Volume Analysis ── */
.vol-compare { display: flex; flex-direction: column; gap: 14px; }
.vol-bar-group { }
.vol-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.vol-bar-val { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }
.vol-bar-track {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.vol-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.vol-bar-fill.vol-high { background: var(--positive); }
.vol-bar-fill.vol-low { background: var(--accent); }
.vol-bar-fill.vol-avg { background: var(--text-muted); opacity: 0.4; }
.vol-ratio {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    padding-top: 4px;
}

/* ── Technical Indicators ── */
.technicals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.tech-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    background: var(--bg-surface);
    border-radius: var(--radius);
}
.tech-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tech-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.tech-signal {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    width: fit-content;
}
.signal-bullish { background: var(--positive-bg); color: var(--positive); }
.signal-bearish { background: var(--negative-bg); color: var(--negative); }
.signal-neutral { background: rgba(245,158,11,0.1); color: var(--warning); }

/* ── Analyst Ratings ── */
.analyst-consensus {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.consensus-badge {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.consensus-count {
    font-size: 13px;
    color: var(--text-muted);
}
.analyst-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}
.analyst-bar-segment { transition: width 0.5s ease; }
.bar-buy { background: var(--positive); }
.bar-hold { background: var(--warning); }
.bar-sell { background: var(--negative); }
.analyst-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ── Price Target ── */
.price-target-section {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.price-target-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.pt-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}
.pt-upside {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
}
.pt-track {
    position: relative;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-bottom: 10px;
}
.pt-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--positive));
    border-radius: 3px;
    opacity: 0.5;
}
.pt-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}
.pt-marker::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-body);
    margin: 0 auto;
}
.pt-current::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.pt-target::before { background: var(--positive); box-shadow: 0 0 0 2px var(--positive); }
.pt-marker span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
    white-space: nowrap;
}
.pt-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.pt-avg { font-weight: 600; color: var(--text-secondary); }

/* ── Financials Table ── */
.financials-table {
    width: 100%;
    border-collapse: collapse;
}
.financials-table th {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}
.financials-table th:first-child { text-align: left; }
.financials-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}
.financials-table tr:last-child td { border-bottom: none; }
.fin-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
.fin-val {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

/* ── Dividend Grid ── */
.dividend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
}
.dividend-grid .stat-item { background: var(--bg-card); }

/* ── Peers Table ── */
.peers-table {
    width: 100%;
    border-collapse: collapse;
}
.peers-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}
.peers-table td {
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.peers-table tr:last-child td { border-bottom: none; }
.peers-table tr:hover { background: var(--bg-card-hover); }
.peer-symbol {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent);
}
.peer-name {
    color: var(--text-secondary);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mono { font-family: var(--font-mono); }

/* ── Earnings Sidebar ── */
.earnings-date {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.earnings-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.earnings-countdown {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-light);
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.earnings-est {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-top: 6px;
}

/* ── Quick Stats Sidebar ── */
.quick-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.quick-stat-row:last-child { border-bottom: none; }
.quick-stat-row span:first-child { color: var(--text-muted); }
.quick-stat-row span:last-child { font-weight: 600; color: var(--text-primary); }

/* ── Stock Page Responsive ── */
@media (max-width: 1024px) {
    .stock-page-grid { grid-template-columns: 1fr; }
    .stock-sidebar { position: static; }
    .range-bars-row { grid-template-columns: 1fr; }
    .dividend-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .perf-row { flex-wrap: wrap; }
    .perf-cell { min-width: 60px; flex: 1 1 calc(25% - 1px); }
    .technicals-grid { grid-template-columns: 1fr 1fr; }
    .dividend-grid { grid-template-columns: 1fr; }
}

/* ── Misc ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* ── Theme Switcher ── */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}
.theme-switcher span { font-size: 12px; color: var(--text-muted); }
.theme-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}
.theme-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.2s;
}
[data-theme="light"] .theme-toggle { background: var(--accent); }
[data-theme="light"] .theme-toggle::after { transform: translateX(20px); background: #fff; }

/* ── Auto-linked Stock Mentions ── */
.article-content .stock-link {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}
.article-content .stock-link:hover {
    color: var(--accent-hover);
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}
.article-content .stock-link.ticker-mention {
    font-family: var(--font-mono);
    font-size: 0.92em;
    background: var(--accent-light);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
}
.article-content .stock-link.ticker-mention:hover {
    background: rgba(59,130,246,0.18);
}

/* ── Market Index Detail Page ── */
.index-card-link { text-decoration: none; color: inherit; display: block; cursor: pointer; }
.index-card-link:hover { border-color: var(--accent); }

.breadcrumb { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border-light); font-size: 11px; }

a.sidebar-heatmap-cell { text-decoration: none; color: inherit; }
.sidebar-heatmap-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}
.sidebar-heatmap-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.sidebar-heatmap-val { font-size: 12px; font-weight: 700; font-family: var(--font-mono); }
.sidebar-heatmap-cell:hover { opacity: 0.85; }
.sidebar-heatmap-cell.current-sector { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Sector page stock table */
.sector-stock-name { font-size: 13px; color: var(--text-secondary); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Stock Lists Index ── */
.list-category { margin-bottom: 40px; }
.list-category-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.stock-lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 16px;
}
.stock-list-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}
.stock-list-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}
.stock-list-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: var(--radius);
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}
.stock-list-info { flex: 1; min-width: 0; }
.stock-list-name { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.stock-list-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stock-list-arrow { font-size: 20px; color: var(--text-muted); flex-shrink: 0; transition: color 0.2s; }
.stock-list-card:hover .stock-list-arrow { color: var(--accent); }

/* ── List Detail Page ── */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}
.list-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.list-breadcrumb a { color: var(--text-muted); }
.list-breadcrumb a:hover { color: var(--accent); }
.list-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding-top: 28px;
}
.list-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.list-updated {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Stats Bar ── */
.list-stats-bar {
    display: flex;
    gap: 2px;
    margin-top: 20px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.list-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: none;
}
.list-stat:first-child { border-left: 1px solid var(--border); border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.list-stat:last-child { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.list-stat-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.list-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ── List Intro ── */
.list-intro {
    margin-top: 24px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}
.list-intro p { margin-bottom: 12px; }
.list-intro p:last-child { margin-bottom: 0; }

/* ── FAQ Section ── */
.list-faq { margin-top: 32px; }
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    overflow: hidden;
}
.faq-question {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after { content: '+'; font-size: 20px; color: var(--text-muted); flex-shrink: 0; margin-left: 16px; }
details[open] .faq-question::after { content: '−'; }
.faq-answer {
    padding: 0 20px 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .list-stats-bar { flex-wrap: wrap; }
    .list-stat { flex: 1 1 45%; border-left: 1px solid var(--border); border-radius: 0; }
    .list-stat:first-child { border-radius: var(--radius-lg) 0 0 0; }
    .list-stat:nth-child(2) { border-radius: 0 var(--radius-lg) 0 0; }
    .list-stat:last-child { border-radius: 0 0 var(--radius-lg) 0; }
}

/* ── List Table ── */
.list-table-wrap { overflow-x: auto; }
.list-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}
.list-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.list-table th:hover { color: var(--text-primary); }
.sort-arrow { display: inline-block; width: 14px; margin-left: 4px; font-size: 10px; vertical-align: middle; color: var(--text-muted); }
.sort-asc .sort-arrow::after { content: '\25B2'; color: var(--accent); }
.sort-desc .sort-arrow::after { content: '\25BC'; color: var(--accent); }
.sort-asc, .sort-desc { color: var(--text-primary); }
.list-table td {
    padding: 11px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.list-table tbody tr:hover { background: var(--bg-card-hover); }
.list-table tbody tr:last-child td { border-bottom: none; }
.list-rank {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.list-symbol {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    color: var(--accent);
}
.list-symbol:hover { text-decoration: underline; }
.list-name {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.consensus-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}
.consensus-buy { background: var(--positive-bg); color: var(--positive); }
.consensus-sell { background: var(--negative-bg); color: var(--negative); }
.consensus-hold { background: rgba(245,158,11,0.1); color: var(--warning); }

@media (max-width: 768px) {
    .stock-lists-grid { grid-template-columns: 1fr; }
    .list-header { flex-direction: column; }
    .list-meta { padding-top: 0; }
    .list-table td, .list-table th { padding: 10px 12px; }
}
