/* ═══════════════════════════════════════════════════════════
   NEWS PAGE — TMI
   ═══════════════════════════════════════════════════════════ */
:root {
    --bg: #e8eaed;
    --card: #ffffff;
    --muted: #6b7280;
    --border: #d1d5db;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --green: #10b981;
    --red: #ef4444;
    --max-width: 920px;
}

/* ─── Page wrapper — full-width 3-column grid ───── */
.news-page {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    grid-template-rows: auto;
    gap: 0 20px;
    padding: 24px 24px 60px;
    min-height: calc(100vh - 80px);
}

/* Override the parent .container max-width for full-width layout */
main.container:has(.news-page) {
    max-width: 100%;
    padding: 0;
}

/* ═══════════════════════════════════════════════════
   SIDEBARS
   ═══════════════════════════════════════════════════ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    overflow: hidden;
}

.news-main {
    min-width: 0;
}

.analytics-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}

.analytics-card-header svg {
    color: var(--accent);
    flex-shrink: 0;
}

.analytics-loading {
    font-size: .8rem;
    color: var(--muted);
}

/* ── Top Indicators Row (FGI + Calendar) ── */
.top-indicators-row {
    display: flex;
    gap: 16px;
    margin: 24px 24px 0;
    align-items: stretch;
}

/* ── Fear & Greed Index Card ── */
.fgi-card {
    width: 280px;
    min-width: 280px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color .4s, box-shadow .4s;
}

/* Zone glow effects */
.fgi-zone-extreme-fear {
    border-color: rgba(192, 57, 43, .35);
    box-shadow: 0 0 18px rgba(192, 57, 43, .10);
}

.fgi-zone-fear {
    border-color: rgba(230, 126, 34, .30);
    box-shadow: 0 0 18px rgba(230, 126, 34, .08);
}

.fgi-zone-neutral {
    border-color: rgba(241, 196, 15, .30);
    box-shadow: 0 0 18px rgba(241, 196, 15, .08);
}

.fgi-zone-greed {
    border-color: rgba(46, 204, 113, .30);
    box-shadow: 0 0 18px rgba(46, 204, 113, .08);
}

.fgi-zone-extreme-greed {
    border-color: rgba(39, 174, 96, .35);
    box-shadow: 0 0 18px rgba(39, 174, 96, .10);
}

.fgi-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .02em;
    border-bottom: 1px solid var(--border);
}

.fgi-header svg {
    color: var(--accent);
    flex-shrink: 0;
}

.fgi-delta {
    margin-left: auto;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: .02em;
    line-height: 1.3;
}

.fgi-delta-up {
    color: #27ae60;
    background: rgba(39, 174, 96, .1);
}

.fgi-delta-down {
    color: #e74c3c;
    background: rgba(231, 76, 60, .1);
}

.fgi-delta-flat {
    color: var(--muted);
    background: rgba(127, 127, 127, .08);
}

.fgi-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px 8px;
    gap: 4px;
}

.fgi-gauge-wrap {
    text-align: center;
    width: 100%;
    position: relative;
}

.fgi-gauge {
    width: 200px;
    height: 120px;
    display: block;
    margin: 0 auto;
}

/* Animated needle */
.fgi-needle-anim {
    transition: transform 1.2s cubic-bezier(.34, 1.56, .64, 1);
    transform: rotate(-90deg);
}

.fgi-center {
    margin-top: -6px;
}

.fgi-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    transition: color .4s;
    font-variant-numeric: tabular-nums;
}

.fgi-label {
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    transition: color .4s;
}

/* Signal interpretation */
.fgi-signal {
    font-size: .66rem;
    color: var(--muted);
    line-height: 1.45;
    padding: 5px 8px;
    border-left: 3px solid var(--border);
    border-radius: 0 4px 4px 0;
    background: rgba(59, 130, 246, .02);
    width: 100%;
    min-height: 18px;
    transition: border-left-color .4s;
}

.fgi-history {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}

.fgi-hist-row {
    display: grid;
    grid-template-columns: 58px 1fr 32px;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    border-radius: 4px;
}

.fgi-hist-row:hover {
    background: rgba(59, 130, 246, .04);
}

.fgi-hist-key {
    font-size: .64rem;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

.fgi-hist-bar-wrap {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.fgi-hist-bar {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width .8s cubic-bezier(.25, .46, .45, .94), background .4s;
}

.fgi-hist-val {
    font-size: .68rem;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.fgi-footer {
    font-size: .58rem;
    color: var(--muted);
    text-align: center;
    padding: 5px 12px;
    border-top: 1px solid var(--border);
    letter-spacing: .01em;
}

/* ── Economic Calendar — full-width landscape strip ── */
/* ── Economic Calendar ── */
.econ-strip {
    flex: 1;
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.econ-strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

.econ-strip-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .02em;
}

.econ-strip-title svg {
    color: var(--accent);
    flex-shrink: 0;
}

/* Week navigation */
.econ-week-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.econ-arrow-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    font-weight: 600;
}

.econ-arrow-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(59, 130, 246, .06);
}

.econ-week-label {
    font-size: .76rem;
    font-weight: 600;
    color: var(--text);
    min-width: 180px;
    text-align: center;
    white-space: nowrap;
}

.econ-today-btn {
    padding: 3px 10px;
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: all .15s;
}

.econ-today-btn:hover {
    background: var(--accent-hover);
}

.econ-countdown {
    font-size: .68rem;
    color: var(--muted);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.econ-strip-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.econ-refresh-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 2px;
    line-height: 1;
    transition: color .2s;
}

.econ-refresh-btn:hover {
    color: var(--accent);
}

.econ-impact-tabs {
    display: flex;
    gap: 4px;
}

.econ-tab {
    padding: 4px 10px;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all .15s;
}

.econ-tab:hover {
    border-color: var(--accent);
    color: var(--text);
}

.econ-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.econ-country-select {
    padding: 4px 6px;
    font-size: .68rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    outline: none;
}

.econ-country-select:focus {
    border-color: var(--accent);
}

/* Scroll wrapper */
.econ-scroll-wrap {
    position: relative;
}

.econ-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 30px;
    height: 52px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: all .15s;
    font-weight: 600;
}

.econ-scroll-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #fff;
}

.econ-scroll-left {
    left: 6px;
}

.econ-scroll-right {
    right: 6px;
}

/* Horizontal day columns */
.econ-calendar {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    min-height: 140px;
    scroll-behavior: smooth;
}

.econ-day-col {
    min-width: 240px;
    flex: 1 0 240px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--card);
    transition: background .15s;
}

.econ-day-col:last-child {
    border-right: none;
}

.econ-day-col.econ-day-today {
    background: rgba(59, 130, 246, .03);
}

.econ-day-col.econ-day-empty {
    opacity: .5;
}

.econ-day-header {
    padding: 8px 14px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--accent);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
}

.econ-day-today .econ-day-header {
    background: rgba(59, 130, 246, .08);
}

.econ-day-count {
    background: var(--accent);
    color: #fff;
    font-size: .56rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    margin-left: auto;
}

.econ-day-events {
    flex: 1;
    overflow-y: auto;
    max-height: 340px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.econ-no-events {
    padding: 30px 14px;
    text-align: center;
    color: var(--muted);
    font-size: .74rem;
    font-style: italic;
}

.econ-event {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    font-size: .76rem;
    cursor: default;
    transition: background .15s;
}

.econ-event[data-expandable] {
    cursor: pointer;
}

.econ-event:hover {
    background: rgba(0, 0, 0, .02);
}

.econ-event.econ-expanded {
    background: rgba(0, 0, 0, .03);
}

.econ-event.econ-upcoming {
    opacity: .6;
}

.econ-event.econ-released {
    opacity: 1;
}

.econ-event:last-child {
    border-bottom: none;
}

.econ-event-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.econ-event-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.econ-status-dot.econ-released {
    background: var(--accent);
}

.econ-status-dot.econ-upcoming {
    background: var(--muted);
}

.econ-time {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 500;
}

.econ-impact {
    font-size: .6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.econ-impact-low {
    background: rgba(100, 100, 100, .12);
    color: var(--muted);
}

.econ-impact-med {
    background: rgba(255, 170, 0, .12);
    color: #c98700;
}

.econ-impact-high {
    background: rgba(255, 59, 48, .1);
    color: #e53030;
}

.econ-event-title {
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 4px;
    font-size: .74rem;
}

.econ-unit {
    font-weight: 400;
    color: var(--muted);
    font-size: .68rem;
}

.econ-event-values {
    display: flex;
    gap: 10px;
    font-size: .7rem;
    color: var(--muted);
}

.econ-val {
    display: flex;
    gap: 3px;
    align-items: baseline;
    min-width: 0;
}

.econ-val b {
    font-size: .6rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.econ-val.econ-beat {
    color: #34c759;
    font-weight: 600;
}

.econ-val.econ-miss {
    color: #ff3b30;
    font-weight: 600;
}

.econ-val.econ-inline {
    color: var(--text);
    font-weight: 600;
}

.econ-event-detail {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    font-size: .68rem;
    color: var(--muted);
    line-height: 1.45;
}

.econ-detail-row {
    margin-bottom: 2px;
}

.econ-detail-row b {
    color: var(--text);
    font-weight: 600;
}

.econ-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
}

.econ-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .62rem;
    color: var(--muted);
}

.econ-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.econ-dot-released {
    background: var(--accent);
}

.econ-dot-upcoming {
    background: var(--muted);
}

.econ-beat-icon {
    color: #34c759;
    font-size: .65rem;
}

.econ-miss-icon {
    color: #ff3b30;
    font-size: .65rem;
}

.econ-empty {
    font-size: .8rem;
    color: var(--muted);
    text-align: center;
    padding: 20px 12px;
    width: 100%;
}

/* ── Trending tickers ── */
.trending-tabs {
    display: flex;
    gap: 4px;
    padding: 0 12px 8px;
}

.trending-tab {
    flex: 1;
    padding: 4px 0;
    font-size: .64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all .15s;
}

.trending-tab:hover {
    border-color: var(--accent);
    color: var(--text);
}

.trending-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.trending-count {
    margin-left: auto;
    font-size: .6rem;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.trending-tickers {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 28px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
}

.trending-item:hover {
    background: rgba(59, 130, 246, .05);
}

.trending-rank {
    font-size: .65rem;
    font-weight: 700;
    color: var(--muted);
    min-width: 18px;
    text-align: center;
}

.trending-rank-top {
    color: var(--accent);
    font-size: .72rem;
}

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

.trending-sym-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.trending-sym {
    font-weight: 700;
    font-size: .78rem;
    color: var(--text);
}

.trending-hot {
    font-size: .65rem;
    line-height: 1;
}

.trending-price {
    font-size: .64rem;
    font-weight: 600;
    margin-left: auto;
}

.trending-meta {
    display: flex;
    gap: 8px;
    margin-top: 1px;
}

.trending-mentions {
    font-size: .62rem;
    color: var(--muted);
}

.trending-sent {
    font-size: .62rem;
    font-weight: 600;
}

.trending-sent-bull {
    color: var(--green);
}

.trending-sent-bear {
    color: var(--red);
}

.trending-sent-neutral {
    color: var(--muted);
}

.trending-mini-bar {
    display: flex;
    height: 3px;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 3px;
}

.trending-mini-bull {
    background: var(--green);
    height: 100%;
    transition: width .4s;
}

.trending-mini-bear {
    background: var(--red);
    height: 100%;
    transition: width .4s;
}

.bull-text {
    color: var(--green);
}

.bear-text {
    color: var(--red);
}

/* ═══════════════════════════════════════════════════
   INSIDER TRADING WIDGET
   ═══════════════════════════════════════════════════ */

.insider-card {
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.insider-badge {
    margin-left: auto;
    font-size: .65rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    transition: all .3s ease;
}

.insider-badge-loaded {
    background: rgba(59, 130, 246, .15);
    color: #60a5fa;
}

.insider-filter-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    margin-bottom: 6px;
}

.insider-tab {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 6px;
    background: transparent;
    color: var(--text-dim);
    font-size: .72rem;
    cursor: pointer;
    transition: all .2s;
    font-weight: 500;
}

.insider-tab:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--text-secondary);
}

.insider-tab.active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    border-color: rgba(255, 255, 255, .15);
}

.insider-tab-buy.active {
    background: rgba(34, 197, 94, .15);
    color: var(--green);
    border-color: rgba(34, 197, 94, .25);
}

.insider-tab-sell.active {
    background: rgba(239, 68, 68, .12);
    color: var(--red);
    border-color: rgba(239, 68, 68, .2);
}

.insider-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .1) transparent;
}

.insider-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    border-left: 3px solid transparent;
    transition: all .2s ease;
    cursor: default;
}

.insider-item:hover {
    background: rgba(255, 255, 255, .06);
}

.insider-item.insider-buy {
    border-left-color: var(--green);
}

.insider-item.insider-sell {
    border-left-color: var(--red);
}

.insider-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.insider-ticker {
    font-weight: 700;
    font-size: .82rem;
    color: #fff;
    font-family: 'SF Mono', 'Fira Code', monospace;
    min-width: 50px;
}

.insider-txn {
    font-size: .7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.insider-txn.insider-buy {
    background: rgba(34, 197, 94, .15);
    color: var(--green);
}

.insider-txn.insider-sell {
    background: rgba(239, 68, 68, .12);
    color: var(--red);
}

.insider-value {
    margin-left: auto;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.insider-row-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .68rem;
    color: var(--text-dim);
}

.insider-owner {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insider-role {
    opacity: .6;
    font-style: italic;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insider-date {
    margin-left: auto;
    white-space: nowrap;
    font-family: 'SF Mono', 'Fira Code', monospace;
    opacity: .7;
}

/* ═══════════════════════════════════════════════════
   WATCHLIST BAR
   ═══════════════════════════════════════════════════ */
/* watchlist/alerts bars now use .sidebar-section */

.watchlist-header,
.alerts-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
}

.watchlist-title,
.alerts-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    font-weight: 600;
    color: #1f2937;
}

.watchlist-title svg,
.alerts-title svg {
    color: #f59e0b;
}

.watchlist-controls,
.alerts-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.watchlist-controls input,
.alerts-controls input {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .8rem;
    flex: 1;
    min-width: 0;
    outline: none;
    background: #f9fafb;
}

.watchlist-controls input:focus,
.alerts-controls input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .15);
}

.btn-wl-add,
.btn-alert-add {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: all .2s;
}

.btn-wl-add:hover,
.btn-alert-add:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-wl-filter {
    padding: 5px 12px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: transparent;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.btn-wl-filter:hover,
.btn-wl-filter.active {
    background: var(--accent);
    color: #fff;
}

.watchlist-symbols,
.alert-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 20px;
}

.wl-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(245, 158, 11, .08), rgba(245, 158, 11, .15));
    color: #92400e;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
}

.wl-remove {
    background: none;
    border: none;
    color: #92400e;
    cursor: pointer;
    font-size: .9rem;
    padding: 0 2px;
    opacity: .6;
}

.wl-remove:hover {
    opacity: 1;
}

.wl-empty,
.alert-empty {
    font-size: .78rem;
    color: var(--muted);
    font-style: italic;
}

.alert-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(239, 68, 68, .06), rgba(239, 68, 68, .12));
    color: #991b1b;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
}

.alert-remove {
    background: none;
    border: none;
    color: #991b1b;
    cursor: pointer;
    font-size: .9rem;
    padding: 0 2px;
    opacity: .6;
}

.alert-remove:hover {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════
   NEWS HEADER / CONTROLS
   ═══════════════════════════════════════════════════ */
.news-header {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 20px 14px;
    margin-bottom: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
}

.news-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.news-title-row h1 {
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1f2937;
    margin: 0;
}

.title-icon {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all .2s;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    color: var(--muted);
}

.btn-icon:hover {
    border-color: var(--accent);
}

.btn-icon:hover svg {
    color: var(--accent);
}

.btn-icon.active {
    border-color: var(--accent);
    background: rgba(59, 130, 246, .06);
}

.btn-icon.active svg {
    color: var(--accent);
}

.live-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    display: none;
}

.btn-icon.active .live-dot {
    display: block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .3;
    }
}

.bookmark-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    line-height: 1.3;
}

/* ── Search / Symbol inputs ── */
.news-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.search-box,
.symbol-filter {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    transition: border-color .2s;
}

.search-box:focus-within,
.symbol-filter:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .1);
}

.search-icon,
.filter-icon {
    width: 16px;
    height: 16px;
    color: var(--muted);
    flex-shrink: 0;
}

.search-box input,
.symbol-filter input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 8px;
    font-size: .88rem;
    outline: none;
}

.btn-clear {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0 4px;
}

.btn-apply {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
    transition: background .2s;
}

.btn-apply:hover {
    background: var(--accent-hover);
}

/* ── Quick symbol tags ── */
.quick-symbols {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.sym-tag {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all .2s;
}

.sym-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.sym-tag.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Sort / date row ── */
.news-sort-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sort-group,
.date-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-sort-row label {
    font-size: .78rem;
    color: var(--muted);
    font-weight: 500;
}

.news-sort-row select,
.news-sort-row input[type="date"] {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .78rem;
    background: #f9fafb;
    outline: none;
}

.btn-date-clear {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
    padding: 3px 8px;
    font-size: .85rem;
}

.results-info {
    margin-left: auto;
    font-size: .78rem;
    color: var(--muted);
    font-weight: 500;
}

/* ── Sentiment filter ── */
.sentiment-filter-group {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 3px;
}

.sent-filter-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--muted);
    transition: all .2s;
}

.sent-filter-btn:hover {
    color: #1f2937;
}

.sent-filter-btn.active {
    background: #fff;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.sent-filter-btn.bull-btn.active {
    background: #ecfdf5;
    color: #059669;
}

.sent-filter-btn.bear-btn.active {
    background: #fef2f2;
    color: #dc2626;
}

/* ═══════════════════════════════════════════════════
   NEW-ARTICLES TOAST
   ═══════════════════════════════════════════════════ */
.new-articles-toast {
    position: sticky;
    top: 220px;
    z-index: 100;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: .88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, .35);
    max-width: 320px;
    margin: 0 auto 12px;
    animation: slideDown .3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

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

.new-articles-toast button {
    background: rgba(255, 255, 255, .25);
    border: none;
    color: #fff;
    padding: 4px 14px;
    border-radius: 16px;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}

.new-articles-toast button:hover {
    background: rgba(255, 255, 255, .4);
}

/* ═══════════════════════════════════════════════════
   NEWS GRID
   ═══════════════════════════════════════════════════ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

/* ── Card ── */
.news-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    position: relative;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
}

.news-card.featured:first-child {
    grid-column: 1 / -1;
}

.news-card.alert-highlight {
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, .25);
}

.card-body {
    padding: 18px 20px 16px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.card-source {
    font-size: .72rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.card-time {
    font-size: .72rem;
    color: var(--muted);
}

.alert-badge {
    background: linear-gradient(135deg, rgba(251, 191, 36, .15), rgba(251, 191, 36, .25));
    color: #92400e;
    font-size: .68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.sentiment-badge {
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.sentiment-badge.bullish {
    background: rgba(16, 185, 129, .1);
    color: var(--green);
}

.sentiment-badge.bearish {
    background: rgba(239, 68, 68, .1);
    color: var(--red);
}

.card-headline {
    font-size: 1.02rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.4;
    margin: 0 0 6px;
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}

.card-headline:hover {
    color: var(--accent);
}

.card-summary {
    font-size: .84rem;
    color: var(--muted);
    line-height: 1.55;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-symbols {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.card-symbol {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    color: #374151;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.card-symbol:hover {
    background: var(--accent);
    color: #fff;
}

.card-quote {
    font-weight: 600;
    font-size: .65rem;
}

.quote-up {
    color: var(--green);
}

.quote-down {
    color: var(--red);
}

.card-symbol:hover .quote-up,
.card-symbol:hover .quote-down {
    color: #fff;
}

.card-actions {
    display: flex;
    gap: 6px;
}

.btn-bookmark,
.btn-expand {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.btn-bookmark svg,
.btn-expand svg {
    width: 16px;
    height: 16px;
    color: var(--muted);
}

.btn-bookmark:hover,
.btn-expand:hover {
    border-color: var(--accent);
}

.btn-bookmark:hover svg,
.btn-expand:hover svg {
    color: var(--accent);
}

.btn-bookmark.active {
    border-color: var(--accent);
    background: rgba(59, 130, 246, .06);
}

.btn-bookmark.active svg {
    color: var(--accent);
}

/* ── Skeleton ── */
.news-card.skeleton {
    pointer-events: none;
}

.skel-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    margin-bottom: 12px;
}

.skel-line.w80 {
    width: 80%;
    height: 16px;
}

.skel-line.w60 {
    width: 60%;
}

.skel-line.w40 {
    width: 40%;
}

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

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

/* ── Empty state ── */
.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.news-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: .4;
}

.news-empty p {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.news-empty span {
    font-size: .85rem;
}

/* ── Bookmark empty ── */
.bookmark-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
}

.bookmark-empty p {
    font-weight: 600;
    margin: 0 0 4px;
}

.bookmark-empty span {
    font-size: .85rem;
}

/* ── Load more ── */
.load-more-wrap {
    text-align: center;
    padding: 10px 0 30px;
}

.btn-load-more {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 32px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: all .2s;
}

.btn-load-more:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(59, 130, 246, .2);
}

.btn-load-more:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════
   ARTICLE MODAL
   ═══════════════════════════════════════════════════ */
.article-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(4px);
}

.article-modal-content {
    position: relative;
    background: var(--card);
    border-radius: 18px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
    animation: modalIn .25s ease;
}

@keyframes modalIn {
    from {
        transform: translateY(30px) scale(.97);
        opacity: 0;
    }

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

.article-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    z-index: 10;
    transition: all .2s;
}

.article-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.modal-source {
    font-size: .8rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
}

.modal-time {
    font-size: .8rem;
    color: var(--muted);
}

.modal-headline {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.35;
    color: #1f2937;
    margin: 0 0 12px;
}

.modal-symbols {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.modal-symbol {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 700;
    color: #374151;
}

.modal-content-text {
    font-size: .92rem;
    color: #374151;
    line-height: 1.7;
}

.modal-content-text p {
    margin: 0 0 12px;
}

.modal-content-text a {
    color: var(--accent);
    text-decoration: underline;
}

.modal-content-text img {
    max-width: 100%;
    border-radius: 8px;
    margin: 12px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.btn-read-original {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: .88rem;
    transition: background .2s;
}

.btn-read-original:hover {
    background: var(--accent-hover);
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: .88rem;
    color: #374151;
    transition: all .2s;
}

.btn-share:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

/* Collapse right sidebar */
@media (max-width: 1400px) {
    .news-page {
        grid-template-columns: 240px 1fr 280px;
    }
}

@media (max-width: 1200px) {
    .news-page {
        grid-template-columns: 240px 1fr;
    }

    .sidebar-right {
        grid-column: 1 / -1;
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .econ-day-col {
        min-width: 240px;
        flex: 1 0 240px;
    }
}

/* Collapse both sidebars — single column */
@media (max-width: 900px) {
    .news-page {
        grid-template-columns: 1fr;
        padding: 16px 14px 40px;
    }

    .sidebar-left,
    .sidebar-right {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .sidebar-left {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
    }

    .sidebar-right {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .top-indicators-row {
        flex-direction: column;
        margin: 12px 10px 0;
        gap: 10px;
    }

    .fgi-card {
        width: 100%;
        min-width: 0;
        flex-direction: row;
        max-height: 140px;
    }

    .fgi-header {
        writing-mode: vertical-lr;
        text-orientation: mixed;
        padding: 10px 6px;
        border-bottom: none;
        border-right: 1px solid var(--border);
        font-size: .7rem;
    }

    .fgi-body {
        flex-direction: row;
        padding: 8px 12px;
    }

    .fgi-gauge-wrap {
        width: auto;
        min-width: 120px;
    }

    .fgi-gauge {
        width: 110px;
        height: 66px;
    }

    .fgi-value {
        font-size: 1.4rem;
    }

    .fgi-label {
        font-size: .68rem;
    }

    .fgi-history {
        width: auto;
        flex: 1;
    }

    .fgi-footer {
        display: none;
    }

    .econ-strip {
        border-radius: 8px;
    }

    .econ-strip-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 12px;
        gap: 6px;
    }

    .econ-week-nav {
        width: 100%;
        justify-content: center;
    }

    .econ-week-label {
        min-width: 0;
        font-size: .7rem;
    }

    .econ-scroll-btn {
        display: none;
    }

    .econ-day-col {
        min-width: 200px;
        flex: 1 0 200px;
    }

    .econ-day-events {
        max-height: 260px;
    }

    .news-header {
        padding: 14px 14px 10px;
    }

    .news-controls {
        flex-direction: column;
        gap: 8px;
    }

    .news-sort-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-card.featured:first-child {
        grid-column: auto;
    }

    .sidebar-left {
        grid-template-columns: 1fr;
    }

    .sidebar-right {
        grid-template-columns: 1fr;
    }

    .article-modal-content {
        width: 96%;
        padding: 20px 16px;
        border-radius: 14px;
    }

    .modal-headline {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .news-page {
        padding: 12px 10px 30px;
    }

    .news-title-row h1 {
        font-size: 1.1rem;
    }

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

    .card-headline {
        font-size: .92rem;
    }

    .card-summary {
        font-size: .8rem;
    }

    .quick-symbols {
        gap: 4px;
    }

    .sym-tag {
        padding: 3px 8px;
        font-size: .72rem;
    }
}