/*
 * analyst.css — The Analyst Panel Styles (Phase 2)
 * Designed by: Johnny Black | KAAI v1.0
 * Matches the CEO Panel dark theme (var() tokens from main.css)
 */

/* ── Panel layout ──────────────────────────────────────────────────────────── */
/*
 * FIX: display:flex MUST NOT be set here — ID specificity (100) beats
 * .panel-container { display:none } (specificity 10), keeping the panel
 * permanently visible even when another tab is active.
 * Apply flex layout only via .panel-container.active#panel-analyst below.
 */
#panel-analyst {
    height: 100%;
    overflow: hidden;
}

/* Flex column layout applied only when the Analyst tab is active */
.panel-container.active#panel-analyst {
    display: flex;
    flex-direction: column;
}

.analyst-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #2a2a2a);
    background: var(--bg-secondary, #161616);
    flex-shrink: 0;
}

.analyst-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
}

/* ── Stats bar ─────────────────────────────────────────────────────────────── */
.analyst-stats-bar {
    display: flex;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-tertiary, #111);
    border-bottom: 1px solid var(--border-color, #2a2a2a);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.analyst-stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    cursor: default;
    transition: border-color 0.2s;
}

.analyst-stat-chip:hover {
    border-color: var(--accent, #7c6fcd);
}

.analyst-stat-chip .chip-count {
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
    min-width: 20px;
    text-align: right;
}

.analyst-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
}
.analyst-status-dot.ok      { background: #4ade80; }
.analyst-status-dot.down    { background: #f87171; }
.analyst-status-dot.fetching{ background: #fbbf24; animation: analyst-pulse 1s infinite; }

@keyframes analyst-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ── Category filter tabs ──────────────────────────────────────────────────── */
.analyst-filters {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-secondary, #161616);
    border-bottom: 1px solid var(--border-color, #2a2a2a);
    overflow-x: auto;
    flex-shrink: 0;
}

.analyst-filter-btn {
    padding: 5px 14px;
    border-radius: 16px;
    border: 1px solid var(--border-color, #2a2a2a);
    background: transparent;
    color: var(--text-secondary, #aaa);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.analyst-filter-btn:hover {
    border-color: var(--accent, #7c6fcd);
    color: var(--text-primary, #e0e0e0);
}

.analyst-filter-btn.active {
    background: var(--accent, #7c6fcd);
    border-color: var(--accent, #7c6fcd);
    color: #fff;
    font-weight: 600;
}

/* ── News feed ─────────────────────────────────────────────────────────────── */
.analyst-feed {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analyst-empty {
    text-align: center;
    color: var(--text-muted, #555);
    padding: 48px 0;
    font-size: 14px;
}

.analyst-empty span {
    display: block;
    font-size: 36px;
    margin-bottom: 12px;
}

.analyst-loading {
    text-align: center;
    color: var(--text-secondary, #aaa);
    padding: 32px;
    font-size: 13px;
}

/* ── Article card ──────────────────────────────────────────────────────────── */
.analyst-card {
    background: var(--bg-secondary, #161616);
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 8px;
    padding: 12px 14px;
    transition: border-color 0.15s, background 0.15s;
    cursor: default;
}

.analyst-card:hover {
    border-color: var(--accent, #7c6fcd);
    background: var(--bg-hover, #1c1c1c);
}

.analyst-card-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.analyst-category-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Category colours */
.badge-tech        { background: #1e3a5f; color: #60a5fa; }
.badge-ai          { background: #2d1b4e; color: #a78bfa; }
.badge-finance     { background: #1a3a1a; color: #4ade80; }
.badge-crypto      { background: #3a2a10; color: #fbbf24; }
.badge-politics    { background: #3a1a1a; color: #f87171; }
.badge-cyber       { background: #1a2a3a; color: #22d3ee; }
.badge-general     { background: #2a2a2a; color: #aaa; }
.badge-middle_east { background: #2a1a0a; color: #fb923c; }
.badge-europe      { background: #0a1a3a; color: #93c5fd; }
.badge-asia        { background: #0a2a1a; color: #6ee7b7; }
/* Phase 5 — new category badges */
.badge-transportation { background: #0a2a2a; color: #2dd4bf; }  /* teal — shipping/freight */
.badge-aviation       { background: #0a1a2a; color: #38bdf8; }  /* sky blue — flights */
.badge-weather        { background: #1a1a30; color: #818cf8; }  /* indigo — weather/climate */

.analyst-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    line-height: 1.4;
    flex: 1;
}

.analyst-card-title a {
    color: inherit;
    text-decoration: none;
}
.analyst-card-title a:hover {
    color: var(--accent, #7c6fcd);
    text-decoration: underline;
}

.analyst-card-summary {
    font-size: 12px;
    color: var(--text-secondary, #999);
    line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.analyst-card-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted, #666);
}

.analyst-card-source { font-weight: 600; color: var(--text-secondary, #aaa); }
.analyst-card-dot { color: #444; }

/* ── Actions bar ───────────────────────────────────────────────────────────── */
.analyst-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.analyst-last-run {
    font-size: 11px;
    color: var(--text-muted, #666);
    margin-right: 8px;
}

/* ── Load more ─────────────────────────────────────────────────────────────── */
.analyst-load-more {
    text-align: center;
    padding: 12px;
}

/* ── Read link (inline-style replacement — resolves --accent-color in CSS) ── */
.analyst-read-link {
    color: var(--accent, #7c6fcd);
    font-size: 11px;
    text-decoration: none;
}
.analyst-read-link:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Phase 2 — Market Ticker Bar                                                 */
/* ═══════════════════════════════════════════════════════════════════════════ */

.analyst-ticker-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    background: #0d0d0d;
    border-bottom: 1px solid var(--border-color, #2a2a2a);
    overflow-x: auto;
    flex-shrink: 0;
    min-height: 34px;
    scrollbar-width: none;
}
.analyst-ticker-bar::-webkit-scrollbar { display: none; }

.analyst-ticker-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: var(--bg-secondary, #161616);
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 6px;
    white-space: nowrap;
    font-size: 11px;
    flex-shrink: 0;
    cursor: default;
    transition: border-color 0.15s;
}
.analyst-ticker-item:hover {
    border-color: var(--accent, #7c6fcd);
}

.ticker-src  { font-size: 10px; opacity: 0.6; }
.ticker-sym  { font-weight: 700; color: var(--text-primary, #e0e0e0); min-width: 36px; }
.ticker-price{ color: var(--text-secondary, #ccc); }
.ticker-chg  { font-weight: 600; font-size: 10px; }
.ticker-up   { color: #4ade80; }
.ticker-down { color: #f87171; }

.analyst-ticker-loading {
    font-size: 11px;
    color: var(--text-muted, #555);
    padding: 0 4px;
}

.analyst-ticker-updated {
    font-size: 10px;
    color: var(--text-muted, #444);
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Phase 2 — Phase badge & Reddit cards                                        */
/* ═══════════════════════════════════════════════════════════════════════════ */

.analyst-phase-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, #7c6fcd 0%, #a78bfa 100%);
    color: #fff;
    border-radius: 8px;
    padding: 1px 7px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.04em;
}

/* Reddit source badge inside article cards */
.analyst-source-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-reddit {
    background: #2a1010;
    color: #ff6314;
    border: 1px solid #4a2010;
}

/* Reddit card — subtle left-border accent */
.analyst-card-reddit {
    border-left: 3px solid #ff6314;
}
.analyst-card-reddit:hover {
    border-color: #ff6314;
    border-left-color: #ff6314;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Phase 3 — Credibility dots + Keyword chips                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Credibility tier dot — appears at start of card header */
.analyst-cred-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
    margin-right: 2px;
    background: #555;
    cursor: help;
}
.cred-tier1    { background: #4ade80; box-shadow: 0 0 4px #4ade8066; } /* green   — major outlet */
.cred-tier2    { background: #60a5fa; }                                  /* blue    — established  */
.cred-tier3    { background: #fbbf24; }                                  /* yellow  — smaller pub  */
.cred-community{ background: #ff6314; }                                  /* orange  — Reddit       */
.cred-unknown,
.cred-migrated { background: #555;   }                                   /* grey    — unknown      */

/* Keyword chip row */
.analyst-kw-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0 6px 0;
}

.analyst-kw-chip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 8px;
    background: #1e1e2a;
    border: 1px solid #333;
    color: #8b8fa8;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: default;
    transition: border-color 0.15s;
}
.analyst-kw-chip:hover {
    border-color: var(--accent, #7c6fcd);
    color: var(--accent, #7c6fcd);
}

/* Reddit score in card footer */
.analyst-reddit-score {
    font-size: 11px;
    color: #ff6314;
    font-weight: 600;
    margin-left: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Phase 3 — View-mode tabs (News | Market | Sources | Reports)                */
/* ═══════════════════════════════════════════════════════════════════════════ */

.analyst-view-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: var(--bg-tertiary, #111);
    border-bottom: 1px solid var(--border-color, #2a2a2a);
    flex-shrink: 0;
}

.analyst-view-tab {
    padding: 5px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #2a2a2a);
    background: transparent;
    color: var(--text-secondary, #aaa);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    letter-spacing: 0.02em;
}
.analyst-view-tab:hover {
    border-color: var(--accent, #7c6fcd);
    color: var(--text-primary, #e0e0e0);
    background: #1e1e2a;
}
.analyst-view-tab.active {
    background: var(--accent, #7c6fcd);
    border-color: var(--accent, #7c6fcd);
    color: #fff;
}

/* Main content wrapper (replaces #analyst-feed as the scroll container) */
.analyst-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Feed inside content */
.analyst-content .analyst-feed {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Phase 3 — Market table view                                                 */
/* ═══════════════════════════════════════════════════════════════════════════ */

.analyst-market-view {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ── Section header row ──────────────────────────────────────────────────── */
.mkt-section-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mkt-section-hint {
    font-size: 10px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted, #555);
    margin-left: auto;
}

/* ── World Indices card grid ─────────────────────────────────────────────── */
.mkt-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.mkt-index-card {
    background: var(--bg-secondary, #161616);
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 8px;
    padding: 10px 12px 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mkt-index-card:hover { border-color: var(--accent, #7c6fcd); background: #1a1a28; }
.mkt-index-card.idx-up   { border-left: 2px solid rgba(74,222,128,0.5); }
.mkt-index-card.idx-down { border-left: 2px solid rgba(248,113,113,0.5); }

.idx-flag-row { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.idx-sym  { font-size: 10px; font-weight: 700; color: var(--text-muted, #666); letter-spacing: 0.04em; }
.idx-name { font-size: 11px; font-weight: 600; color: var(--text-secondary, #aaa); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idx-price { font-size: 15px; font-weight: 700; color: var(--text-primary, #e2e8f0); margin: 3px 0 1px; }
.idx-chg {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}
.idx-up   .idx-chg, .idx-chg.idx-up   { color: #4ade80; }
.idx-down .idx-chg, .idx-chg.idx-down { color: #f87171; }

/* ── Commodity strip ─────────────────────────────────────────────────────── */
.mkt-commodity-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.mkt-commodity-pill {
    background: var(--bg-secondary, #161616);
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    transition: border-color 0.15s;
}
.mkt-commodity-pill:hover { border-color: var(--accent, #7c6fcd); }
.com-icon  { font-size: 18px; flex-shrink: 0; }
.com-body  { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.com-name  { font-size: 11px; font-weight: 600; color: var(--text-secondary, #aaa); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.com-price { font-size: 13px; font-weight: 700; color: var(--text-primary, #e2e8f0); }
.com-pct   { font-size: 12px; font-weight: 700; white-space: nowrap; }

/* ── Sparklines inline ───────────────────────────────────────────────────── */
.mkt-sparkline { display: inline-flex; align-items: center; }
.mkt-index-card .mkt-sparkline { margin-top: 4px; }

/* ── Market table with chart col ─────────────────────────────────────────── */
.analyst-market-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: var(--text-primary, #e0e0e0);
}
.analyst-market-table th {
    padding: 6px 10px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #666);
    border-bottom: 1px solid var(--border-color, #2a2a2a);
    white-space: nowrap;
}
.analyst-market-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #1a1a1a;
    white-space: nowrap;
}
.analyst-market-table th.num,
.analyst-market-table td.num { text-align: right; }
.analyst-market-table th.chart-col,
.analyst-market-table td.chart-col { text-align: center; width: 96px; }

.mkt-table-charts tr.mkt-row { cursor: pointer; }
.mkt-table-charts tr.mkt-row:hover td { background: #1a1a28; }

.mkt-up      { color: #4ade80; font-weight: 600; }
.mkt-down    { color: #f87171; font-weight: 600; }
.mkt-neutral { color: var(--text-muted, #666); }
.mkt-src     { font-size: 10px; color: var(--text-muted, #666); padding: 2px 6px;
               background: #1e1e1e; border-radius: 4px; }
.mkt-date    { font-size: 10px; color: var(--text-muted, #555); }

/* ── Full chart modal ────────────────────────────────────────────────────── */
.analyst-chart-modal-box {
    background: var(--bg-primary, #0d1117);
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 12px;
    width: min(720px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}
.analyst-chart-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-color, #2a2a2a);
    flex-shrink: 0;
}
.analyst-chart-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 4px;
}
.analyst-chart-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.chart-meta-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
}
.chart-meta-updated { font-size: 11px; color: var(--text-muted, #555); margin-left: auto; }

.analyst-chart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 20px;
}

.chart-period-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}
.chart-period-btn {
    padding: 4px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #2a2a2a);
    background: transparent;
    color: var(--text-muted, #666);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.chart-period-btn:hover { border-color: var(--accent, #7c6fcd); color: var(--accent, #7c6fcd); }
.chart-period-btn.active {
    background: rgba(124,111,205,0.15);
    border-color: var(--accent, #7c6fcd);
    color: var(--accent, #7c6fcd);
}
.chart-points-note {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted, #555);
}
.chart-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #666);
    font-size: 14px;
}
.chart-nodata {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #555);
    font-size: 13px;
    line-height: 1.7;
}
.chart-nodata span { font-size: 32px; display: block; margin-bottom: 10px; }
.chart-nodata small { color: var(--text-muted, #444); }

.analyst-chart-svg {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Phase 3 — Sources quality view                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */

.analyst-sources-view {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.analyst-sources-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.sources-avg {
    font-size: 11px;
    color: var(--text-secondary, #aaa);
    font-weight: 600;
}
.sources-count {
    font-size: 11px;
    color: var(--text-muted, #666);
    margin-left: auto;
}

.analyst-sources-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: var(--text-primary, #e0e0e0);
}
.analyst-sources-table th {
    padding: 5px 10px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #666);
    border-bottom: 1px solid var(--border-color, #2a2a2a);
    white-space: nowrap;
}
.analyst-sources-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #1a1a1a;
    white-space: nowrap;
    vertical-align: middle;
}
.analyst-sources-table tr:hover td { background: #1a1a22; }
.analyst-sources-table th.num,
.analyst-sources-table td.num { text-align: right; }

/* Grade progress bar */
.grade-bar-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}
.grade-bar {
    height: 6px;
    border-radius: 3px;
    flex: 1;
    max-width: 80px;
    transition: width 0.3s ease;
}
.grade-num {
    font-size: 11px;
    font-weight: 700;
    min-width: 26px;
    text-align: right;
}

/* Grade label chip */
.grade-label-chip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 8px;
    background: #1e1e2a;
    border: 1px solid #333;
    color: #8b8fa8;
    font-size: 10px;
    font-weight: 600;
    text-transform: capitalize;
}

/* Source action badges */
.src-action {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
}
.src-action.ok     { background: #0d2014; color: #4ade80; border: 1px solid #1a3a22; }
.src-action.warn   { background: #2a1a00; color: #fbbf24; border: 1px solid #3a2800; }
.src-action.remove { background: #2a0808; color: #f87171; border: 1px solid #3a1010; }
.src-action.new    { background: #0d1a2a; color: #60a5fa; border: 1px solid #1a2e3a; }

/* Row highlight for remove-flagged sources */
.src-row-remove td {
    opacity: 0.55;
    text-decoration: line-through;
    text-decoration-color: rgba(248,113,113,0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Phase 3 — Analysis reports view                                             */
/* ═══════════════════════════════════════════════════════════════════════════ */

.analyst-reports-view {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.analyst-report-card {
    background: var(--bg-secondary, #161616);
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 8px;
    padding: 14px 16px;
    transition: border-color 0.15s;
}
.analyst-report-card:hover { border-color: var(--accent, #7c6fcd); }

.report-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.report-period {
    font-size: 11px;
    color: var(--text-muted, #666);
}
.report-date {
    font-size: 11px;
    color: var(--text-muted, #555);
}
.report-io-risk {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.report-io-risk[data-risk="low"]    { background: #0d2014; color: #4ade80; border-color: #1a3a22; }
.report-io-risk[data-risk="medium"] { background: #2a1a00; color: #fbbf24; border-color: #3a2800; }
.report-io-risk[data-risk="high"]   { background: #2a0808; color: #f87171; border-color: #3a1010; }
.report-art-count {
    font-size: 11px;
    color: var(--text-muted, #666);
}
.report-generated {
    margin-left: auto;
}

/* Report summary body */
.report-summary {
    font-size: 13px;
    color: var(--text-secondary, #bbb);
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Keyword row inside report */
.report-kw-row {
    margin-bottom: 10px;
}

/* Top stories list */
.report-stories {
    margin-bottom: 10px;
}
.report-stories-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #666);
    margin-bottom: 5px;
}
.report-story {
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    padding: 3px 0;
    border-bottom: 1px dotted #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.report-story a {
    color: inherit;
    text-decoration: none;
}
.report-story a:hover {
    color: var(--accent, #7c6fcd);
    text-decoration: underline;
}
.story-src {
    font-size: 10px;
    color: var(--text-muted, #555);
}

/* Market context row */
.report-mkt-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.report-mkt-item {
    font-size: 11px;
    color: var(--text-secondary, #aaa);
    font-weight: 600;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 2px 8px;
}

/* Flagged sources warning */
.report-flagged {
    font-size: 11px;
    color: #fbbf24;
    background: #1a1200;
    border: 1px solid #2a1e00;
    border-radius: 6px;
    padding: 4px 10px;
    margin-top: 6px;
}

/* ── Markdown-rendered report summaries ─────────────────────────────────── */
/* Used for deep intelligence briefs (KEY DEVELOPMENTS / CAUSAL CHAINS etc.) */

.report-summary-md {
    font-size: 13px;
    color: var(--text-secondary, #bbb);
    line-height: 1.65;
    margin-bottom: 10px;
}

/* Section headers produced by _mdToHtml: **KEY DEVELOPMENTS** */
.report-section-header {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent, #7c6fcd);
    margin: 12px 0 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(124, 111, 205, 0.18);
}
.report-summary-md .report-section-header:first-child { margin-top: 0; }

/* Bullet lists */
.report-bullet-list {
    margin: 4px 0 6px 0;
    padding-left: 18px;
    list-style: disc;
}
.report-bullet-list li {
    font-size: 12.5px;
    color: var(--text-secondary, #c4c4c4);
    line-height: 1.6;
    margin-bottom: 3px;
}
.report-bullet-list li strong { color: #e2e8f0; }

/* Paragraph text inside structured brief */
.report-para {
    font-size: 13px;
    color: var(--text-secondary, #bbb);
    line-height: 1.65;
    margin: 2px 0 4px;
}
.report-para strong { color: #e2e8f0; }

/* Blank-line spacer between sections */
.report-para-break { height: 4px; }

/* Story category chip in cross-domain stories */
.story-cat {
    font-size: 10px;
    color: var(--accent, #7c6fcd);
    background: rgba(124, 111, 205, 0.08);
    border-radius: 3px;
    padding: 1px 4px;
    margin-right: 4px;
}

/* ── Global Synthesis report card (special highlighting) ──────────────────── */
.analyst-report-synthesis {
    border-color: rgba(99, 179, 237, 0.35) !important;
    background: linear-gradient(135deg,
        var(--bg-secondary, #161616) 0%,
        rgba(24, 36, 60, 0.9) 100%
    );
    box-shadow: 0 0 0 1px rgba(99, 179, 237, 0.12);
}
.analyst-report-synthesis:hover {
    border-color: rgba(99, 179, 237, 0.65) !important;
}
.analyst-report-synthesis .report-section-header {
    color: #63b3ed;
    border-bottom-color: rgba(99, 179, 237, 0.18);
}
.analyst-report-synthesis .report-bullet-list li strong,
.analyst-report-synthesis .report-para strong {
    color: #bee3f8;
}

/* Badge for global_synthesis */
.badge-global_synthesis {
    background: rgba(99, 179, 237, 0.12);
    border: 1px solid rgba(99, 179, 237, 0.28);
    color: #63b3ed;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Language badge (non-English articles)                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */
.analyst-lang-badge {
    display: inline-flex;
    align-items: center;
    background: #1a1a3a;
    border: 1px solid #2a2a5a;
    border-radius: 4px;
    color: #93c5fd;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    flex-shrink: 0;
}

/* ─── Read button (in-panel, not external link) ──────────────────────────── */
.analyst-read-btn {
    background: transparent;
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 4px;
    color: var(--accent, #7c6fcd);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    transition: all 0.15s;
    white-space: nowrap;
}
.analyst-read-btn:hover {
    background: var(--accent, #7c6fcd);
    border-color: var(--accent, #7c6fcd);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Read Modal — full article reader overlay                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */
.analyst-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.analyst-modal-overlay.open {
    display: flex;
}

.analyst-modal-box {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    width: 100%;
    max-width: 760px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    overflow: hidden;
}

/* Modal header row */
.analyst-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #1e1e1e;
    flex-shrink: 0;
}

.analyst-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.analyst-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.analyst-modal-source {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}
.analyst-modal-cat {
    font-size: 10px;
    background: #1e1e2e;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    color: #a78bfa;
    padding: 1px 6px;
    font-weight: 700;
    text-transform: uppercase;
}
.analyst-modal-date {
    font-size: 11px;
    color: var(--text-muted, #555);
}
.analyst-modal-lang-chip {
    font-size: 10px;
    background: #1a1a3a;
    border: 1px solid #2a2a5a;
    border-radius: 4px;
    color: #93c5fd;
    font-weight: 700;
    padding: 1px 6px;
}
.analyst-modal-cache-chip {
    font-size: 10px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    color: #666;
    padding: 1px 6px;
}
.analyst-modal-cache-chip.fresh {
    background: #0d1a10;
    border-color: #1a3a22;
    color: #4ade80;
}
.analyst-modal-loading-chip {
    font-size: 11px;
    color: var(--text-muted, #666);
}

/* External link button in modal header */
.analyst-modal-ext-link {
    font-size: 11px;
    color: var(--accent, #7c6fcd);
    text-decoration: none;
    padding: 3px 8px;
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 4px;
    transition: all 0.15s;
    white-space: nowrap;
}
.analyst-modal-ext-link:hover {
    background: var(--accent, #7c6fcd);
    color: #fff;
}

/* Close button */
.analyst-modal-close {
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    color: var(--text-secondary, #888);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 4px 8px;
    transition: all 0.15s;
}
.analyst-modal-close:hover {
    background: #2a0808;
    border-color: #f87171;
    color: #f87171;
}

/* Article title in modal */
.analyst-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
    line-height: 1.4;
    margin: 0;
    padding: 10px 16px 8px;
    border-bottom: 1px solid #1a1a1a;
    flex-shrink: 0;
}

/* Scrollable body */
.analyst-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 24px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
.analyst-modal-body::-webkit-scrollbar       { width: 6px; }
.analyst-modal-body::-webkit-scrollbar-track { background: transparent; }
.analyst-modal-body::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* Article paragraphs */
.analyst-modal-para {
    font-size: 13px;
    color: var(--text-secondary, #c0c0c0);
    line-height: 1.75;
    margin: 0 0 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Spinner inside modal body */
.analyst-modal-spinner {
    text-align: center;
    padding: 40px 0;
    font-size: 13px;
    color: var(--text-muted, #555);
}

/* Error state inside modal body */
.analyst-modal-error {
    text-align: center;
    padding: 30px;
    font-size: 13px;
    color: #f87171;
    background: #1a0808;
    border-radius: 6px;
    border: 1px solid #3a1010;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Analyst Config — CEO Panel Configuration tab section
   ───────────────────────────────────────────────────────────────────────────── */

.ac-subsection {
    margin-bottom: 18px;
    border: 1px solid var(--border, #1e2a3a);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface, #0d1117);
}

.ac-subsection-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted, #7a8a9a);
    background: var(--surface2, #111927);
    padding: 7px 14px;
    border-bottom: 1px solid var(--border, #1e2a3a);
}

.ac-subsection .settings-list {
    padding: 2px 0;
}

.ac-subsection-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #7a8a9a);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 8px 16px 2px;
}

/* Feed / subreddit / ticker / coin category header */
.ac-feed-category { margin-bottom: 10px; }

.ac-feed-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

.ac-feed-count {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
}

/* Chip grid */
.ac-feed-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 16px 10px;
}

.ac-feed-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity 0.15s, border-color 0.15s, background 0.15s;
    user-select: none;
    white-space: nowrap;
}

.ac-feed-chip.active {
    background: rgba(74, 222, 128, 0.07);
    border-color: rgba(74, 222, 128, 0.22);
    color: #4ade80;
}

.ac-feed-chip.inactive {
    background: rgba(100, 116, 139, 0.07);
    border-color: rgba(100, 116, 139, 0.18);
    color: var(--text-muted, #6b7280);
}

.ac-feed-chip:hover { opacity: 0.72; }

.ac-feed-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
}

.ac-feed-name { white-space: nowrap; }

.ac-empty {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    padding: 8px 16px;
}

/* Save row */
.ac-save-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 0 2px;
    border-top: 1px solid var(--border, #1e2a3a);
    margin-top: 6px;
}

.ac-save-status {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    margin-right: auto;
    transition: color 0.2s;
}

.ac-save-ok  { color: #4ade80; }
.ac-save-err { color: #f87171; }

/* ── Phase 5: Realtime Signals Banner ─────────────────────────────────────── */
.analyst-realtime-banner {
    margin: 0 0 10px;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #2a2a2a);
    background: rgba(30, 40, 60, 0.6);
    font-size: 12px;
    flex-shrink: 0;
}
.analyst-realtime-banner.agg-bull  { border-color: rgba(74,222,128,.35); background: rgba(74,222,128,.06); }
.analyst-realtime-banner.agg-bear  { border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.06); }
.analyst-realtime-banner.agg-watch { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.06); }
.analyst-realtime-banner.agg-neutral{ border-color: var(--border-color, #2a2a2a); }

.rt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}
.rt-label {
    font-weight: 600;
    color: var(--text-primary, #e5e7eb);
    font-size: 12px;
}
.rt-agg {
    color: var(--text-secondary, #9ca3af);
    font-size: 11px;
}
.rt-ts {
    color: var(--text-muted, #6b7280);
    font-size: 11px;
    margin-left: auto;
}
.rt-refresh-btn {
    font-size: 11px;
    padding: 2px 7px;
    line-height: 1.5;
    cursor: pointer;
}
.rt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.rt-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border-color, #333);
    background: var(--bg-tertiary, #111);
    color: var(--text-secondary, #aaa);
}
.rt-chip.rt-weather  { border-color: rgba(96,165,250,.3); }
.rt-chip.rt-flights  { border-color: rgba(167,139,250,.3); }
.rt-chip.rt-shipping { border-color: rgba(52,211,153,.3); }
.rt-signal-dot { font-size: 10px; }
.rt-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.rt-alert {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color, #333);
    background: var(--bg-tertiary, #111);
    color: var(--text-secondary, #aaa);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}
.rt-alert.rt-sev-watch    { border-color: rgba(251,191,36,.4); color: #fbbf24; }
.rt-alert.rt-sev-warning  { border-color: rgba(251,146,60,.4); color: #fb923c; }
.rt-alert.rt-sev-critical { border-color: rgba(248,113,113,.4); color: #f87171; }
/* ══════════════════════════════════════════════════════════════════════════
   OpenSky Network Config Section  (config-opensky-section)
   ══════════════════════════════════════════════════════════════════════════ */
.osk-status-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.osk-info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
}
.osk-info-row.osk-warn { color: #fb923c; }
.osk-info-label {
    min-width: 150px;
    color: var(--text-muted, #9ca3af);
    flex-shrink: 0;
}
.osk-info-value { color: var(--text-primary, #f1f5f9); }
.osk-ok-text    { color: #4ade80; }
.osk-mono       { font-family: monospace; font-size: 12px; }
.osk-masked     { letter-spacing: .05em; color: #94a3b8; }
/* Status pills */
.osk-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}
.osk-pill-ok  { background: rgba(74,222,128,.15); color: #4ade80; border: 1px solid rgba(74,222,128,.35); }
.osk-pill-err { background: rgba(248,113,113,.15); color: #f87171; border: 1px solid rgba(248,113,113,.35); }

/* ── Social Network Monitor (Phase 6) ──────────────────────────────────────── */
.analyst-social-view { padding: 0 2px; }

/* Summary bar */
.soc-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.soc-summary-chip {
    background: var(--surface2, #1f2937);
    border: 1px solid var(--border, #374151);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    color: var(--text-secondary, #9ca3af);
}
.soc-summary-chip strong { color: var(--text, #f9fafb); }
.soc-planned-chip strong { color: #6b7280; }

/* Section header */
.soc-section-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted, #6b7280);
    margin: 10px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border, #1f2937);
}

/* Swatch grid */
.soc-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.soc-swatch {
    background: var(--surface2, #1f2937);
    border: 1px solid var(--border, #374151);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.2s;
}
.soc-swatch-active  { border-left: 3px solid #22c55e; }
.soc-swatch-partial { border-left: 3px solid #fbbf24; }
.soc-swatch-planned { border-left: 3px solid #4b5563; opacity: 0.75; }
.soc-swatch-error   { border-left: 3px solid #ef4444; }

.soc-swatch:hover { border-color: var(--border-hover, #4b5563); }

.soc-swatch-top {
    display: flex;
    align-items: center;
    gap: 7px;
}
.soc-icon { font-size: 1.1rem; }
.soc-name { font-weight: 600; font-size: 0.85rem; flex: 1; }

.soc-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.soc-status-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.soc-active  { color: #22c55e; }
.soc-partial { color: #fbbf24; }
.soc-planned { color: #6b7280; }
.soc-error   { color: #ef4444; }

.soc-note {
    font-size: 0.72rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.35;
}
.soc-count {
    font-size: 0.75rem;
    color: #4ade80;
    font-weight: 600;
}


/* ── Research Tab ─────────────────────────────────────────────────────────── */

.res-thesis-card {
    background: var(--card-bg, rgba(255,255,255,.04));
    border: 1px solid var(--border-color, rgba(255,255,255,.08));
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .2s;
}
.res-thesis-card:hover { border-color: var(--border-hover, #4b5563); }

.res-thesis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Direction badge */
.res-dir-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.res-dir-buy  { background: rgba(34,197,94,.18);  color: #4ade80; border: 1px solid #22c55e44; }
.res-dir-sell { background: rgba(239,68,68,.18);  color: #f87171; border: 1px solid #ef444444; }
.res-dir-hold { background: rgba(250,204,21,.14); color: #fbbf24; border: 1px solid #fbbf2440; }

.res-subj-chip {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    background: rgba(255,255,255,.06);
    padding: 3px 8px;
    border-radius: 6px;
}

.res-conf-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.res-conf-bar-wrap {
    width: 80px;
    height: 5px;
    background: rgba(255,255,255,.08);
    border-radius: 3px;
    overflow: hidden;
}
.res-conf-bar {
    height: 100%;
    border-radius: 3px;
    transition: width .3s;
}
.res-conf-pct {
    font-size: 11px;
    font-weight: 700;
    min-width: 28px;
}
.res-ts {
    font-size: 10px;
    color: var(--text-muted, #555);
    white-space: nowrap;
}

.res-thesis-stmt {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-primary, #e2e8f0);
}

/* Trade setup row */
.res-setup {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
}
.res-setup-item {
    background: rgba(255,255,255,.05);
    padding: 3px 8px;
    border-radius: 5px;
    color: var(--text-secondary, #94a3b8);
}
.res-sl { color: #f87171; }
.res-tp { color: #4ade80; }

.res-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted, #6b7280);
    margin-top: 4px;
}
.res-section-risk { color: #f87171aa; }

.res-list {
    margin: 4px 0 0 14px;
    padding: 0;
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.6;
}
.res-list-risk li { color: #f8717199; }

.res-watch {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}
.res-watch-chip {
    font-size: 11px;
    background: rgba(96,165,250,.12);
    color: #60a5fa;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid #60a5fa33;
}

/* Research thesis body — pre-formatted Ollama / rule-based text */
.res-thesis-body {
    font-size: 12px;
    line-height: 1.65;
    color: var(--text-secondary, #94a3b8);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    padding: 10px 12px;
    background: rgba(255,255,255,.03);
    border-radius: 6px;
    border-left: 2px solid rgba(255,255,255,.08);
    font-family: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * INTELLIGENCE VIEW — redesigned research panel (replaces news-feed default)
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── Research launcher bar ────────────────────────────────────────────────── */
.intel-launcher {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--bg-secondary, #161616);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
}
.intel-launcher-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #818cf8;
    white-space: nowrap;
}

/* ── Asset intelligence board (compact grid) ──────────────────────────────── */
.intel-board {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.intel-board-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    background: rgba(255,255,255,.03);
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
    min-width: 80px;
}
.intel-board-card:hover  { background: rgba(255,255,255,.06); transform: translateY(-1px); }
.intel-board-card.selected { box-shadow: 0 0 0 1px currentColor; }
.intel-board-dir   { font-size: 10px; font-weight: 800; letter-spacing: .5px; }
.intel-board-asset { font-size: 14px; font-weight: 700; color: var(--text-primary, #e2e8f0); }
.intel-board-conf  { font-size: 11px; font-weight: 700; }
.intel-board-horizon { font-size: 10px; }

/* ── Deep-dive panel ──────────────────────────────────────────────────────── */
.intel-deepdive {
    background: var(--bg-secondary, #161616);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    overflow: hidden;
}
.intel-dd-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.02);
    flex-wrap: wrap;
}
.intel-dd-dir-badge {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .8px;
    padding: 5px 14px;
    border-radius: 6px;
    white-space: nowrap;
}
.intel-dd-asset {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary, #e2e8f0);
}
.intel-dd-meta {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #555);
    margin-top: 2px;
}
.intel-conf-gauge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
}
.intel-conf-gauge svg { display: block; }

/* ── Trade row (entry / SL / TP / size) ───────────────────────────────────── */
.intel-trade-row {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.intel-trade-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border-right: 1px solid rgba(255,255,255,.04);
}
.intel-trade-cell:last-child { border-right: none; }
.intel-trade-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted, #555);
    margin-bottom: 2px;
}
.intel-trade-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
    font-variant-numeric: tabular-nums;
}

/* ── Thesis sections ──────────────────────────────────────────────────────── */
.intel-sections {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.thesis-section {
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,.02);
}
.thesis-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 6px;
}
.thesis-section-body {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary, #94a3b8);
}
.thesis-section-body p  { margin: 0 0 4px; }
.thesis-section-body ul { margin: 4px 0 4px 16px; padding: 0; }
.thesis-section-body li { margin-bottom: 3px; list-style: disc; }
.thesis-section-body strong { color: var(--text-primary, #e2e8f0); }
.thesis-kv {
    font-size: 12px;
    padding: 2px 0;
    color: var(--text-secondary, #94a3b8);
}
.thesis-kv-key {
    color: var(--text-muted, #777);
    margin-right: 4px;
}
.thesis-raw {
    font-size: 12px;
    line-height: 1.65;
    color: var(--text-secondary, #94a3b8);
    padding: 10px 0;
}
