* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    /* Palette matched directly to the reference site's compiled CSS
       (https://sab-pulse-mvp3-frontend-986820793629.us-central1.run.app/)
       - --page: 18 23 43, --surface: 27 33 64, --surface-2: 36 43 78,
       --brand-gold: 242 169 59, --gray-400/600/900 for text tiers.
       --maroon stays a darker goldenrod (readable with white text on solid
       buttons/tabs) while --gold carries the reference's actual bright
       accent gold for text/underline/border accents only. */
    --maroon: #b8860b;
    --maroon-dark: #8f6a09;
    --navy: #242b4e;
    --navy-2: #303860;
    --gold: #f2a93b;
    --gold-dark: #d69026;
    --gold-bg: #3d2e14;
    --gold-border: #5c4620;
    --bg: #12172b;
    --surface: #1b2140;
    --surface-2: #242b4e;
    --border: #303860;
    --text: #f4f2ed;
    --text-light: #c4c9db;
    --text-dim: #9299b5;
    --good: #3ed998;
    --good-bg: rgba(62,217,152,0.14);
    --bad: #ff6163;
    --bad-bg: rgba(255,97,99,0.14);
    --warn: #f2a93b;
    --warn-bg: rgba(242,169,59,0.14);
    --mono: 'IBM Plex Mono', monospace;
    --sans: 'IBM Plex Sans', 'Inter', sans-serif;
    --serif: 'Fraunces', 'Playfair Display', serif;
}
body { font-family: var(--sans); background: var(--bg); color: var(--text); }
.mono { font-family: var(--mono); }

/* ============================== ICONS (Feather) ============================== */
svg.feather { width: 14px; height: 14px; stroke-width: 2.2; vertical-align: -2px; flex-shrink: 0; }
.tabs a svg.feather, .btn svg.feather { margin-right: 4px; }
.tabs a svg.feather { width: 13px; height: 13px; }
.dd-chevron-icon svg.feather { width: 11px; height: 11px; stroke-width: 2.6; vertical-align: -1px; margin-right: 0; color: var(--text-dim); }
.dd-icon svg.feather { color: var(--text-light); }
h3 svg.feather, .ai-title svg.feather, .watch-title svg.feather { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; }

/* ============================== TOP BAR ============================== */
.top-bar { background: var(--surface); padding: 8px 32px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 11px; flex-wrap: wrap; gap: 8px; font-family: var(--mono); }
.crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumb-pill { background: var(--maroon); color: #fff; padding: 4px 10px; border-radius: 4px; font-weight: 700; letter-spacing: 0.4px; }
.crumb-sep { color: var(--text-dim); }
.crumb-strong { font-weight: 700; color: var(--text); letter-spacing: 0.3px; }
.crumb-muted { color: var(--text-light); }
.crumb-right { color: var(--text-light); display: flex; align-items: center; gap: 6px; }
.live-dot { color: var(--good); font-size: 9px; }

/* ============================== SEMANTIC DELTA CHIPS ============================== */
.chip-good { background: var(--good-bg); color: var(--good); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-flat { background: var(--bg); color: var(--text-light); }

/* ============================== HEADER ============================== */
.header { background: var(--surface); padding: 16px 32px 0; border-bottom: 1px solid var(--border); }
.header-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.3px; color: var(--text); }
.header-description { font-size: 12.5px; color: var(--text-light); margin-bottom: 12px; line-height: 1.5; max-width: 820px; }

.controls { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.period-type-toggle { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.ptt-btn { background: transparent; border: none; padding: 7px 14px; font-size: 12px; font-weight: 700; color: var(--text-light); cursor: pointer; border-radius: 6px; font-family: var(--sans); }
.ptt-btn.active { background: var(--maroon); color: #fff; }
.dropdown-btn { position: relative; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.dropdown-btn:hover { border-color: #c7ccd6; }
.dd-icon { font-size: 13px; }
.dd-dot { color: var(--maroon); }
.dd-chevron { color: var(--text-dim); font-size: 11px; margin-left: 2px; }
.dropdown-btn select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.view-select-btn {
    position: relative; display: flex; align-items: center; gap: 10px;
    background: var(--gold-bg); border: 1.5px solid var(--gold-border); border-radius: 10px;
    padding: 12px 18px; cursor: pointer; max-width: 100%; width: fit-content;
    transition: border-color 0.15s, background 0.15s;
}
.view-select-btn:hover { border-color: var(--maroon); background: rgba(242,169,59,0.1); }
.view-select-tag {
    font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.6px;
    color: var(--maroon); background: var(--surface); border: 1px solid var(--gold-border);
    border-radius: 5px; padding: 3px 7px; text-transform: uppercase; flex-shrink: 0;
}
.view-select-btn .dd-icon { color: var(--maroon); flex-shrink: 0; }
.view-select-btn #matrixViewDropdownLabel { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; }
.view-select-count { font-size: 11px; color: var(--text-dim); white-space: nowrap; padding-left: 4px; border-left: 1px solid var(--gold-border); margin-left: 2px; }
.view-select-chevron { color: var(--maroon); margin-left: 2px; }
.view-select-chevron svg.feather { width: 16px; height: 16px; stroke-width: 2.6; }
.view-select-btn select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; font-size: 16px; }
@media (max-width: 700px) {
    .view-select-btn { flex-wrap: wrap; }
    .view-select-count { border-left: none; padding-left: 0; margin-left: 0; width: 100%; }
}

.tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 0; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent; text-decoration: none; border-radius: 6px 6px 0 0; }
.tabs a:hover { background: var(--bg); color: var(--text); }
.tabs a.active { color: var(--gold-dark); border-bottom-color: var(--gold); background: var(--gold-bg); }
.tabs-spacer { flex: 1; }
.btn { padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 12px; white-space: nowrap; font-family: var(--sans); background: var(--surface); color: var(--text); margin-bottom: 5px; }
.btn:hover { background: var(--bg); }
.btn-ghost { color: var(--text); }
.btn-primary { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.btn-primary:hover { background: var(--maroon-dark); }
.btn-icon { padding: 8px 11px; }

.container { max-width: 1400px; margin: 0 auto; padding: 14px 32px 0; }
.container.wide { max-width: 100%; }
.tab-section { display: none; }
.tab-section.active { display: block; animation: fadeIn 0.25s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.loading-note { padding: 40px; text-align: center; color: var(--text-light); font-size: 13px; }

/* ============================== BANNER ============================== */
.banner { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 14px 20px; border-radius: 10px; margin-bottom: 14px; }
.banner-tag { display: inline-block; background: var(--gold); color: #221a00; padding: 4px 10px; border-radius: 4px; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 8px; }
.banner-tag-light { background: rgba(184,134,11,0.85); color: #221a00; }
.banner-title { font-size: 13.5px; line-height: 1.65; color: #dfe4ea; }
.banner-title b { color: #fff; }
.banner-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.banner-chip { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; padding: 5px 11px; font-family: var(--mono); font-size: 10.5px; color: #d6dce5; display: flex; align-items: center; gap: 6px; }
.banner-chip b { color: #fff; }

/* ============================== SECTION LABEL ============================== */
.section-label-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; color: var(--text); margin: 14px 0 8px; text-transform: uppercase; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-maroon { background: var(--gold); }
.section-label-right { margin-left: auto; font-weight: 500; color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.chip-inline { background: var(--bad-bg); color: var(--bad); padding: 2px 9px; border-radius: 10px; font-size: 10.5px; font-weight: 700; }

/* ============================== AUTOMATED ALERTS ============================== */
.alerts-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; margin-bottom: 14px; }
.alert-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--text-dim); border-radius: 10px; padding: 12px 14px; }
.alert-card.sev-high { border-left-color: var(--bad); }
.alert-card.sev-medium { border-left-color: var(--warn); }
.alert-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.alert-metric { font-size: 12px; font-weight: 700; color: var(--text); }
.alert-severity-chip { font-family: var(--mono); font-size: 9px; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.alert-severity-chip.sev-high { background: var(--bad-bg); color: var(--bad); }
.alert-severity-chip.sev-medium { background: var(--warn-bg); color: var(--warn); }
.alert-scope-chip { font-family: var(--mono); font-size: 9px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 8px; }
.alert-gauge { margin-bottom: 8px; }
.alert-gauge-svg { display: block; width: 100%; height: auto; }
.alert-gauge-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 8.5px; color: var(--text-dim); margin-top: 2px; }
.alert-text { font-size: 11.5px; color: var(--text-light); line-height: 1.5; }
.alert-z { font-family: var(--mono); font-weight: 700; color: var(--text); }
.alerts-empty { grid-column: 1 / -1; padding: 16px; text-align: center; color: var(--text-light); font-size: 12px; background: var(--good-bg); border-radius: 10px; }

/* ============================== OUTLOOK / MARKET OUTLOOK CARDS ============================== */
.outlook-grid { display: grid; grid-template-columns: 2fr 1.1fr; gap: 12px; margin-bottom: 12px; align-items: stretch; }
@media (max-width: 1024px) { .outlook-grid { grid-template-columns: 1fr; } }
.outlook-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-content: stretch; }
.outlook-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 13px 14px; display: flex; flex-direction: column; }
.outlook-icon-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.outlook-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px; color: var(--text-light); background: var(--bg); border: 1px solid var(--border); padding: 3px 8px; border-radius: 20px; text-transform: uppercase; }
.outlook-title { font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.outlook-text { font-size: 12px; color: var(--text-light); line-height: 1.5; flex: 1; margin-bottom: 10px; }
.outlook-metric { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--border); padding-top: 9px; font-size: 10.5px; color: var(--text-light); gap: 8px; }
.outlook-metric-box { font-family: var(--mono); font-weight: 700; color: var(--text); background: var(--bg); border: 1px solid var(--border); padding: 4px 9px; border-radius: 6px; font-size: 11px; white-space: nowrap; }

.focus-position-card { background: linear-gradient(155deg, var(--bg) 0%, var(--bg) 55%, var(--navy) 100%); border-top: 3px solid var(--gold); border-radius: 12px; color: #fff; padding: 16px; display: flex; flex-direction: column; box-shadow: 0 4px 18px rgba(0,0,0,0.35); }
.focus-position-tag-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.focus-position-tag { background: rgba(255,255,255,0.14); font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px; padding: 4px 9px; border-radius: 4px; text-transform: uppercase; }
.focus-position-link { font-size: 11px; color: var(--gold); text-decoration: none; cursor: pointer; }
.focus-position-headline { font-size: 14.5px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.focus-position-desc { font-size: 11.5px; line-height: 1.55; color: #d6dce5; margin-bottom: 12px; flex: 1; }
.focus-metric-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 12px; }
.focus-metric-chip { background: rgba(255,255,255,0.08); border-radius: 8px; padding: 8px 6px; text-align: center; }
.focus-metric-chip-label { font-family: var(--mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.3px; opacity: 0.75; margin-bottom: 4px; }
.focus-metric-chip-value { font-size: 15px; font-weight: 700; }

/* ============================== KPI STRIP ============================== */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 6px; }
.kpi-strip-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: 10px; padding: 12px 14px; }
.kpi-strip-card.trend-good { border-left-color: var(--good); }
.kpi-strip-card.trend-bad { border-left-color: var(--bad); }
.kpi-strip-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.3px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 7px; }
.kpi-strip-value-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.kpi-strip-value { font-size: 21px; font-weight: 700; color: var(--text); }
.kpi-strip-delta { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.kpi-strip-text { font-size: 11px; color: var(--text-light); line-height: 1.4; margin-bottom: 5px; }
.kpi-strip-details { font-size: 10.5px; font-weight: 700; color: var(--maroon); text-decoration: none; cursor: pointer; }

/* ============================== ACTION PLAN ============================== */
.action-plan { display: flex; flex-direction: column; gap: 7px; margin-bottom: 6px; }
.action-item { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--maroon); border-radius: 8px; padding: 10px 14px; display: flex; gap: 12px; align-items: flex-start; }
.action-priority { font-family: var(--mono); font-size: 10px; font-weight: 800; color: #fff; background: var(--maroon); border-radius: 5px; padding: 2px 7px; white-space: nowrap; margin-top: 1px; }
.action-priority.p2 { background: var(--warn); }
.action-priority.p3 { background: var(--text-dim); }
.action-body b { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; color: var(--text); }
.action-body span { font-size: 12px; color: var(--text-light); line-height: 1.5; }

.watch-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 6px; margin-bottom: 6px; align-items: stretch; }
@media (max-width: 1100px) { .watch-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .watch-grid { grid-template-columns: 1fr; } }
.watch-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 13px 14px; }
.watch-title { font-family: var(--mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.watch-item { font-size: 11.5px; line-height: 1.5; padding: 8px 11px; border-radius: 6px; margin-bottom: 6px; border-left: 3px solid var(--border); background: var(--bg); color: var(--text-light); }
.watch-item:last-child { margin-bottom: 0; }
.watch-high { border-left-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.watch-medium { border-left-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.watch-positive { border-left-color: var(--good); background: var(--good-bg); color: var(--good); }

/* ============================== AI BADGE ============================== */
.ai-badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; padding: 3px 9px; border-radius: 20px; background: var(--gold-bg); border: 1px solid var(--gold-border); color: var(--gold-dark); white-space: nowrap; }

/* ============================== TREND TAB ============================== */
.trend-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-title { font-size: 15px; font-weight: 700; margin: 5px 0 3px; color: var(--text); }
.panel-sub { font-size: 12px; color: var(--text-light); line-height: 1.5; max-width: 620px; }
.view-toggle-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view-toggle { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.view-toggle button { background: transparent; border: none; padding: 7px 12px; font-size: 11.5px; font-weight: 600; color: var(--text-light); cursor: pointer; border-radius: 6px; font-family: var(--sans); }
.view-toggle button.active { background: var(--navy); color: #fff; }

.kpi-select-row { display: flex; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; }
.kpi-select-row button { background: var(--surface); color: var(--text-light); border: 1px solid var(--border); padding: 6px 13px; border-radius: 18px; font-size: 11px; font-weight: 600; cursor: pointer; font-family: var(--sans); }
.kpi-select-row button:hover { border-color: #c7ccd6; color: var(--text); }
.kpi-select-row button.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.trend-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.trend-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; }
.trend-stat-label { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-dim); margin-bottom: 6px; }
.trend-stat-value { font-size: 18px; font-weight: 700; color: var(--text); }
.trend-stat-note { font-size: 10.5px; color: var(--text-light); margin-top: 3px; }

.chart-container { background: var(--bg); color: #fff; padding: 16px 18px; border-radius: 12px; margin-bottom: 14px; border: 1px solid var(--border); }
.chart-title-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; flex-wrap: wrap; gap: 10px; }
.chart-title { font-size: 13px; font-weight: 700; }
.chart-subtitle { font-size: 11px; color: #aab4c4; margin-top: 3px; }
.chart-current-chip { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; padding: 6px 12px; font-family: var(--mono); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.main-chart { position: relative; height: 260px; margin: 12px 0; }
.chart-footer { font-size: 10.5px; color: #8b97a8; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 9px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }

.chart-pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.chart-pair-grid .chart-container { margin-bottom: 0; }
.chart-pair-grid .main-chart { height: 220px; }
@media (max-width: 900px) { .chart-pair-grid { grid-template-columns: 1fr; } }

.movers-quad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1100px) { .movers-quad-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .movers-quad-grid { grid-template-columns: 1fr; } }
.peer-mover-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px; }
.peer-mover-card-head { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-dim); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.mover-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-top: 1px solid var(--border); font-size: 11.5px; }
.mover-row:first-of-type { border-top: none; }
.mover-row.is-focus { color: var(--gold); font-weight: 700; }
.mover-row-val.good { color: var(--good); }
.mover-row-val.bad { color: var(--bad); }
.mover-empty { font-size: 11px; color: var(--text-dim); padding: 4px 0; }

.market-pulse-detail { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); }
.peer-insights-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.peer-insights-list li { font-size: 12px; line-height: 1.5; color: var(--text-light); }

.matrix-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 14px; overflow-x: auto; }
table.data-matrix { width: 100%; border-collapse: collapse; font-size: 11.5px; font-family: var(--mono); min-width: 640px; }
table.data-matrix th { text-align: right; padding: 8px 12px; font-size: 9.5px; text-transform: uppercase; color: var(--text-dim); border-bottom: 2px solid var(--border); letter-spacing: 0.3px; }
table.data-matrix th:first-child { text-align: left; }
table.data-matrix td { text-align: right; padding: 7px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
table.data-matrix td:first-child { text-align: left; color: var(--text-light); }
table.data-matrix tr:last-child td { font-weight: 700; background: var(--gold-bg); }
/* Per-bank tables (not period-trend tables) use is-focus for the highlighted
   row instead - the last row has no special meaning there, so the generic
   rule above is neutralised and overridden. */
#marketPulseTable tr:last-child td { font-weight: 400; background: none; }
#marketPulseTable tr.is-focus td { font-weight: 700; background: var(--gold-bg); color: var(--text); }
#marketPulseTable tr.is-focus td:first-child { color: var(--maroon); }
#growthTable tr:last-child td { font-weight: 400; background: none; }
#growthTable tr.is-focus td { font-weight: 700; background: var(--gold-bg); color: var(--text); }
#growthTable tr.is-focus td:first-child { color: var(--maroon); }
#growthTable th { white-space: nowrap; }
#rawDataPager button { background: var(--surface); color: var(--text-light); border: 1px solid var(--border); padding: 6px 13px; border-radius: 18px; font-size: 11px; font-weight: 600; cursor: pointer; font-family: var(--sans); }
#rawDataPager button:disabled { opacity: 0.4; cursor: default; }

.forecast-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin: 0 0 14px; max-height: 360px; overflow-y: auto; overflow-x: auto; }
.forecast-table-wrap table.data-matrix { min-width: 0; }
.forecast-table-wrap thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
tr.forecast-projected-row td { background: rgba(242,169,59,0.10); color: var(--text); }
tr.forecast-projected-row:last-child td { background: rgba(242,169,59,0.20); }

.rates-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 6px; }
@media (max-width: 900px) { .rates-grid { grid-template-columns: 1fr; } }
.rates-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 13px 14px; }
.rates-card-title { font-family: var(--mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text); margin-bottom: 8px; }
.rate-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.rate-row:last-child { border-bottom: none; }
.rate-row-label { color: var(--text-light); }
.rate-row-value { display: flex; align-items: center; gap: 8px; }
.rate-row-num { font-family: var(--mono); font-weight: 700; color: var(--text); }
.rate-row-delta { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; }

.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
.insight-card { background: var(--surface); padding: 13px 14px; border-radius: 10px; border: 1px solid var(--border); }
.insight-label { font-family: var(--mono); font-size: 9.5px; font-weight: 700; color: var(--maroon); text-transform: uppercase; margin-bottom: 7px; letter-spacing: 0.3px; }
.insight-value { font-size: 18px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.insight-text { font-size: 11px; color: var(--text-light); line-height: 1.5; }

/* ============================== PEER MATRIX TAB ============================== */
.comparison-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
.comparison-card { background: var(--surface); padding: 13px 14px; border-radius: 10px; border: 1px solid var(--border); }
.comparison-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.comparison-label { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.3px; }
.comparison-delta-chip { font-family: var(--mono); font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.comparison-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comparison-row-label { flex: 0 0 50px; font-size: 10.5px; color: var(--text-light); font-weight: 600; }
.comparison-bar { flex: 1; height: 15px; background: var(--bg); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.comparison-fill { height: 100%; background: var(--gold); }
.comparison-fill.sector { background: var(--maroon); }
.comparison-row-value { font-family: var(--mono); font-weight: 700; font-size: 11.5px; min-width: 56px; text-align: right; color: var(--text); }
.comparison-meta { font-size: 10px; color: var(--text-dim); margin-top: 8px; display: flex; justify-content: space-between; }
.peers-link { color: var(--maroon); font-weight: 700; text-decoration: none; cursor: pointer; }

.balance-sheet-row { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.bs-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.bs-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--gold-bg); color: var(--maroon); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.bs-head-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.bs-head-sub { font-size: 10.5px; color: var(--text-dim); }
.bs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.bs-metric-label { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.3px; margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.bs-metric-value { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.bs-metric-note { font-size: 10px; color: var(--text-light); }
.tooltip-icon { color: var(--text-dim); cursor: help; font-size: 11px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; opacity: 0.65; transition: opacity 0.15s, color 0.15s; }
.tooltip-icon:hover { opacity: 1; color: var(--maroon); }

.matrix-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 10px; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 10px; }

.leaderboard-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; overflow-x: auto; }
table.leaderboard { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 600px; }
table.leaderboard th { text-align: left; padding: 8px 10px; font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; color: var(--text-dim); border-bottom: 2px solid var(--border); letter-spacing: 0.3px; }
table.leaderboard td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
table.leaderboard tr.is-focus { background: var(--gold-bg); font-weight: 700; }
table.leaderboard tr:hover { background: var(--bg); }
.rank-chip { display: inline-block; min-width: 22px; text-align: center; padding: 2px 6px; border-radius: 10px; font-family: var(--mono); font-size: 10px; font-weight: 700; color: white; }
.rank-good { background: var(--good); }
.rank-mid { background: var(--warn); }
.rank-bad { background: var(--bad); }

.panel-intro { background: var(--surface); padding: 13px 14px; border-radius: 10px; margin-bottom: 12px; border: 1px solid var(--border); }
.panel-intro h3 { font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.panel-intro p { font-size: 11.5px; color: var(--text-light); line-height: 1.5; }

.heatmap-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; overflow-x: auto; }
table.heatmap-table { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 11.5px; min-width: 780px; }
table.heatmap-table th { text-align: center; padding: 6px 9px; font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.2px; font-weight: 700; }
table.heatmap-table th:first-child { text-align: left; }
.heatmap-bank { text-align: left !important; font-weight: 700; padding: 8px 10px !important; white-space: nowrap; color: var(--text); }
.heatmap-cell { text-align: center; padding: 8px 6px; border-radius: 6px; font-family: var(--mono); font-weight: 700; color: #16210f; }
.heatmap-na { background: var(--bg); color: var(--text-dim); font-weight: 400; }
tr.is-focus .heatmap-bank { color: var(--maroon); }
.heatmap-legend { display: flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--text-light); margin-top: 12px; }
.heatmap-legend-scale { flex: 1; max-width: 220px; height: 9px; border-radius: 5px; background: linear-gradient(90deg, #e2775f 0%, #f0d27a 50%, #4fae7a 100%); }

/* ============================== SENSITIVITY TAB ============================== */
.panel-card { background: var(--surface); padding: 16px 18px; border-radius: 12px; border: 1px solid var(--border); }
.panel-card h2 { font-size: 14px; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.sensitivity-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.scenario-intro { font-size: 12px; color: var(--text-light); line-height: 1.5; max-width: 640px; }
.sensitivity-controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.control-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.control-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.control-item label { font-size: 12px; font-weight: 700; color: var(--text); }
.control-value-badge { font-family: var(--mono); font-size: 11.5px; font-weight: 700; background: var(--navy); color: #fff; padding: 3px 9px; border-radius: 6px; }
input[type="range"] { width: 100%; accent-color: var(--maroon); margin-bottom: 5px; }
.control-range-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-dim); }

.scenario-bottom-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; align-items: stretch; }
@media (max-width: 900px) { .scenario-bottom-grid { grid-template-columns: 1fr; } }
.scenario-bottom-grid .scenario-output-panel,
.scenario-bottom-grid .ai-insights { margin-bottom: 0; height: 100%; }
.scenario-output-panel { background: var(--navy); color: #fff; padding: 14px 16px; border-radius: 12px; margin-bottom: 12px; }
.scenario-output-tag { font-family: var(--mono); font-size: 9.5px; font-weight: 700; color: var(--maroon); letter-spacing: 0.5px; margin-bottom: 10px; }
.scenario-main-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.scenario-main-label { font-size: 11px; color: #aab4c4; margin-bottom: 4px; }
.scenario-main-value { font-size: 25px; font-weight: 700; }
.scenario-main-delta { font-size: 11.5px; margin-top: 3px; font-weight: 600; }
.scenario-side-col { display: flex; flex-direction: column; gap: 6px; justify-content: center; min-width: 220px; }
.scenario-side-row { display: flex; justify-content: space-between; gap: 16px; font-size: 11.5px; color: #cbd3dd; }
.scenario-side-row b { color: #fff; }
.scenario-side-row b.status-trailing { color: #f0b93d; }
.scenario-side-row b.status-leading { color: #6fe3a0; }
.scenario-note { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-radius: 8px; padding: 10px 13px; font-size: 11px; color: #dbe1ea; line-height: 1.5; }

.ai-insights { background: var(--gold-bg); padding: 14px 16px; border-radius: 10px; border-left: 3px solid var(--maroon); margin-bottom: 6px; }
.ai-title { font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--maroon); margin-bottom: 9px; display: flex; align-items: center; gap: 10px; text-transform: uppercase; flex-wrap: wrap; }
.ai-insight { font-size: 12px; line-height: 1.6; color: var(--text); margin-bottom: 7px; padding: 9px 12px; background: var(--surface); border-radius: 8px; border-left: 3px solid var(--maroon); }
.ai-insight:last-child { margin-bottom: 0; }
.ai-insight b { color: var(--text); }

/* ============================== NEWS WIRE TAB (NEWSPAPER) ============================== */
/* Deliberately a light paper page, not the app's dark theme - every color
   token below is locally overridden so every existing newspaper-* rule
   (already written in terms of these variables) just works unchanged. */
.newspaper {
    --bg: #f3ecda;
    --surface: #fffcf5;
    --surface-2: #f3ecda;
    --border: #ddd0ac;
    --text: #1c1a15;
    --text-light: #52493a;
    --text-dim: #7d7260;
    --maroon: #7c2140;
    --maroon-dark: #5e1830;
    --good: #1a7a4c;
    --good-bg: #e7f7ee;
    --bad: #b42318;
    --bad-bg: #fdecec;
    --warn: #b7791f;
    --warn-bg: #fef6e7;
    background: #f3ecda url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px 28px 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.newspaper-masthead-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dim); border-bottom: 1px solid var(--text); padding-bottom: 6px; margin-bottom: 10px; }
.newspaper-title { font-family: var(--serif); font-weight: 900; font-size: 42px; text-align: center; letter-spacing: 0.5px; color: var(--text); line-height: 1.1; }
.newspaper-tagline { text-align: center; font-family: var(--serif); font-style: italic; font-size: 12.5px; color: var(--text-light); margin: 8px auto 12px; max-width: 640px; }
.newspaper-rule { border-top: 1px solid var(--text); margin: 10px 0; }
.newspaper-rule-thick { border-top: 3px double var(--gold); margin: 4px 0 14px; }
.newspaper-toolbar { margin-bottom: 6px; }
.newspaper-toolbar-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.newspaper-toolbar-row .kpi-select-row { margin-bottom: 0; }

.newspaper-story { padding: 14px 0; }
.newspaper-lead { padding-top: 4px; padding-bottom: 20px; }
.newspaper-kicker { font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--maroon); margin-bottom: 6px; }
.newspaper-headline { font-family: var(--serif); font-weight: 800; line-height: 1.25; margin-bottom: 6px; }
.newspaper-lead .newspaper-headline { font-size: 30px; max-width: 820px; }
.newspaper-columns .newspaper-headline { font-size: 17px; }
.newspaper-headline a { color: var(--text); text-decoration: none; }
.newspaper-headline a:hover { text-decoration: underline; }
.newspaper-byline { font-family: var(--serif); font-style: italic; font-size: 11.5px; color: var(--text-dim); margin-bottom: 10px; }
.newspaper-story-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.newspaper-analysis-btn { background: var(--maroon); color: #fff; border: none; padding: 6px 14px; border-radius: 3px; font-size: 10.5px; font-weight: 700; cursor: pointer; font-family: var(--sans); }
.newspaper-analysis-btn:hover { background: var(--maroon-dark); }
.newspaper-columns { column-count: 3; column-gap: 28px; }
@media (max-width: 1024px) { .newspaper-columns { column-count: 2; } }
@media (max-width: 700px) { .newspaper-columns { column-count: 1; } .newspaper-title { font-size: 26px; } .newspaper-lead .newspaper-headline { font-size: 22px; } }
.newspaper-columns .newspaper-story { break-inside: avoid; -webkit-column-break-inside: avoid; }
.newspaper-story-divider { border-top: 1px dotted var(--border); margin: 0; break-inside: avoid; }

.news-summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
@media (max-width: 700px) { .news-summary-strip { grid-template-columns: 1fr 1fr; } }
.news-summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; text-align: center; }
.news-summary-value { font-size: 21px; font-weight: 700; color: var(--text); }
.news-summary-value.risk { color: var(--bad); }
.news-summary-value.opportunity { color: var(--good); }
.news-summary-value.reg { color: var(--warn); }
.news-summary-label { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-dim); margin-top: 4px; }

.news-risk-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }

.news-modal { background: var(--surface); border-radius: 12px; border-top: 4px solid var(--gold); width: 100%; max-width: 680px; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); max-height: 86vh; overflow-y: auto; }
.news-modal-headline { font-family: var(--serif); font-size: 21px; line-height: 1.3; margin: 8px 0 6px; color: var(--text); }
.news-modal-byline { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--text-dim); margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }

.news-verdict-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.news-theme-chip { background: var(--gold-bg); color: var(--gold-dark); border: 1px solid var(--gold-border); font-family: var(--mono); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; padding: 4px 11px; border-radius: 20px; }
.news-reg-chip { background: var(--bad-bg); color: var(--bad); font-family: var(--mono); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; padding: 4px 11px; border-radius: 20px; }

.news-analyst-take { margin-bottom: 14px; }
.news-analysis-loading { color: var(--text-dim); font-style: italic; }

.news-metrics-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.news-metric-pill { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; }
.news-metric-pill .label { display: block; font-family: var(--mono); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-dim); margin-bottom: 3px; }
.news-metric-pill .value { font-size: 12.5px; font-weight: 700; color: var(--text); }

.news-analysis-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 600px) { .news-analysis-grid { grid-template-columns: 1fr; } }
.news-analysis-block { background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--maroon); border-radius: 8px; padding: 11px 13px; }
.news-analysis-label { font-family: var(--mono); font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-dim); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.news-analysis-label .num { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--maroon); color: #fff; font-size: 8px; flex-shrink: 0; }
.news-analysis-text { font-size: 11.5px; color: var(--text-light); line-height: 1.55; }
.news-analysis-text b { color: var(--text); }
.news-loading, .news-empty { padding: 30px; text-align: center; color: var(--text-light); font-size: 12.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }

/* ============================== INDUSTRY DATA TAB ============================== */
.industry-toolbar { margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.industry-search { width: 100%; max-width: 480px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; font-family: var(--sans); color: var(--text); background: var(--surface); }
.industry-search:focus { outline: none; border-color: var(--maroon); }
.industry-detail-panel { margin-bottom: 14px; }
table.industry-table td:first-child { max-width: 420px; }
table.industry-table tbody tr { cursor: pointer; }

.industry-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-bottom: 12px; }
.industry-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s; }
.industry-card:hover { border-color: #c7ccd6; box-shadow: 0 3px 12px rgba(16,24,40,0.07); }
.industry-card { border-left: 3px solid transparent; }
.industry-card.trend-up { border-left-color: var(--good); }
.industry-card.trend-down { border-left-color: var(--bad); }
.industry-card.is-anomaly { border-left-color: var(--warn); }
.industry-card-cat { font-family: var(--mono); font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-dim); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 6px; }
.industry-card-anomaly-tag { color: var(--warn); font-weight: 700; }
.industry-card-name { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.35; margin-bottom: 8px; min-height: 32px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.industry-card-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.industry-card-value { font-size: 18px; font-weight: 700; color: var(--text); }
.industry-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--text-dim); margin-bottom: 8px; }
.industry-card-change { font-family: var(--mono); font-weight: 700; padding: 2px 7px; border-radius: 8px; font-size: 10px; }
.industry-compare-btn { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 10.5px; font-weight: 600; color: var(--text-light); cursor: pointer; font-family: var(--sans); }
.industry-compare-btn:hover { border-color: var(--maroon); color: var(--maroon); }
.industry-compare-btn.active { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.industry-compare-panel { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(16,24,40,0.05); }
.industry-compare-panel .chart-title { color: var(--text); }
.industry-compare-panel .chart-subtitle { color: var(--text-light); }
.industry-compare-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; }
.industry-compare-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text); border: 1px solid; border-radius: 20px; padding: 4px 12px; background: var(--bg); }
.industry-compare-chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.industry-compare-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.industry-compare-count { font-family: var(--mono); font-size: 11px; color: var(--text-light); }

/* ============================== FORECASTING TAB ============================== */
.forecast-layout { display: flex; gap: 18px; align-items: flex-start; margin-top: 12px; }
.forecast-sidebar { width: 300px; flex: 0 0 300px; }
.forecast-main { flex: 1 1 auto; min-width: 0; }
.forecast-picker-list { display: flex; flex-direction: column; gap: 6px; max-height: 640px; overflow-y: auto; margin-top: 10px; padding: 4px; }
.forecast-picker-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; cursor: pointer; font-size: 11.5px; color: var(--text); transition: border-color 0.15s; }
.forecast-picker-item:hover { border-color: var(--maroon); }
.forecast-picker-item.active { border-color: var(--maroon); background: var(--gold-bg); font-weight: 700; }
.forecast-picker-cat { display: block; font-family: var(--mono); font-size: 8.5px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 3px; }
.forecast-trend-chip { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 10px; }
.forecast-model-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 8px; }
.forecast-model-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: border-color 0.15s; }
.forecast-model-card:hover { border-color: var(--maroon); }
.forecast-model-card.is-best { border-color: var(--good); background: var(--good-bg); }
.forecast-model-card.is-active { box-shadow: 0 0 0 2px var(--maroon) inset; }
.forecast-model-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 6px; }
.forecast-model-label { font-size: 11.5px; font-weight: 700; color: var(--text); }
.forecast-model-best-tag { font-family: var(--mono); font-size: 8.5px; font-weight: 800; text-transform: uppercase; background: var(--good); color: #fff; padding: 2px 7px; border-radius: 10px; }
.forecast-model-stats { display: flex; gap: 12px; font-family: var(--mono); font-size: 10.5px; color: var(--text-light); margin-bottom: 6px; }
.forecast-model-stats b { color: var(--text); }
.forecast-model-desc { font-size: 10.5px; color: var(--text-dim); line-height: 1.4; }

/* ============================== FOOTER ============================== */
.footer { background: var(--surface); border-top: 1px solid var(--border); color: var(--text-light); padding: 14px 32px; text-align: center; font-size: 11px; margin-top: 24px; font-family: var(--mono); }
.footer-row { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ============================== TOAST ============================== */
.app-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 24px; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 300; }
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.app-toast-tick { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--good); color: #fff; font-size: 11px; flex-shrink: 0; }

/* ============================== EXPORT MODAL ============================== */
.export-modal-overlay { position: fixed; inset: 0; background: rgba(15,27,46,0.55); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.export-modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 460px; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); max-height: 86vh; overflow-y: auto; }
.export-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.export-modal-head h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.export-modal-close { background: none; border: none; font-size: 20px; color: var(--text-dim); cursor: pointer; line-height: 1; }
.export-modal-sub { font-size: 12px; color: var(--text-light); line-height: 1.5; margin-bottom: 14px; }
.export-section-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.export-section-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text); padding: 4px 0; cursor: pointer; }
.export-format-row { display: flex; gap: 18px; margin-bottom: 16px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.export-format-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.export-modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.export-progress { flex: 1; font-size: 11.5px; color: var(--text-light); font-family: var(--mono); }

/* ============================== MOBILE RESPONSIVE ============================== */
@media (max-width: 900px) {
    .header-title { font-size: 19px; }
    .header-description { display: none; }
    .exec-hero-title, .focus-position-headline { font-size: 14px; }
    .bs-grid { grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 10px; }
}

@media (max-width: 768px) {
    .top-bar { padding: 8px 16px; font-size: 10px; }
    .header { padding: 12px 16px 0; }
    .container { padding: 10px 16px 0; }
    .footer { padding: 14px 16px; }
    .footer-row { flex-direction: column; align-items: center; text-align: center; }

    .controls { flex-direction: column; align-items: stretch; }
    .period-type-toggle { width: 100%; }
    .dropdown-btn { width: 100%; justify-content: space-between; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: 4px; }
    .tabs a { white-space: nowrap; }
    .tabs-spacer { display: none; }
    .tabs .btn { flex-shrink: 0; }

    .focus-metric-chips { grid-template-columns: 1fr 1fr; }
    .scenario-side-col { min-width: 0; }
    .main-chart { height: 220px; }
    .chart-pair-grid .main-chart { height: 180px; }

    .export-modal { padding: 16px; }
    .export-format-row { flex-direction: column; gap: 10px; }

    .news-analysis-grid { grid-template-columns: 1fr; }
    .industry-card-grid { grid-template-columns: 1fr 1fr; }
    .forecast-layout { flex-direction: column; }
    .forecast-sidebar { width: 100%; flex-basis: auto; }
    .forecast-picker-list { max-height: 260px; }

    table.leaderboard, table.heatmap-table, table.data-matrix { min-width: 560px; }
}

@media (max-width: 480px) {
    .header-title { font-size: 17px; }
    .mode-btn, .ptt-btn { padding: 6px 10px; font-size: 11px; }
    .outlook-col { grid-template-columns: 1fr; }
    .kpi-strip { grid-template-columns: 1fr; }
    .news-summary-strip { grid-template-columns: 1fr 1fr; }
    .industry-card-grid { grid-template-columns: 1fr; }
    .focus-metric-chips { grid-template-columns: 1fr; }
    .comparison-grid, .insight-grid, .rates-grid { grid-template-columns: 1fr; }
    .alerts-strip { grid-template-columns: 1fr; }
    .scenario-main-value { font-size: 22px; }
    .kpi-value, .stat-pill-value { font-size: 18px; }
}

/* ============================== MARKET MOVERS (OVERVIEW) ============================== */
.market-movers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.mover-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.mover-list-scroll { max-height: 360px; overflow-y: auto; }
.mover-card-title { font-family: var(--mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dim); margin-bottom: 10px; }
.mover-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.mover-row:last-child { border-bottom: none; }
.mover-bank { font-weight: 600; color: var(--text); flex: 1; }
.mover-price { font-family: var(--mono); color: var(--text-light); white-space: nowrap; }
.mover-change { font-family: var(--mono); font-weight: 700; padding: 2px 8px; border-radius: 10px; font-size: 11px; white-space: nowrap; }
.mover-empty { color: var(--text-dim); font-size: 12px; padding: 8px 0; }
.week52-row { padding: 9px 0; border-bottom: 1px solid var(--border); }
.week52-row:last-child { border-bottom: none; }
.week52-row-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.week52-track { position: relative; height: 6px; background: var(--bg); border-radius: 4px; overflow: visible; margin-bottom: 4px; }
.week52-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--gold); border-radius: 4px; }
.week52-marker { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--maroon); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(16,24,40,0.3); transform: translate(-50%, -50%); }
.week52-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9.5px; color: var(--text-dim); }

@media (max-width: 900px) { .market-movers-grid { grid-template-columns: 1fr; } }

/* ============================== CHATBOT TAB ============================== */
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chat-suggestion-btn { background: var(--gold-bg); border: 1px solid var(--gold-border); color: var(--gold-dark); border-radius: 20px; padding: 6px 13px; font-size: 11.5px; font-weight: 600; cursor: pointer; font-family: var(--sans); }
.chat-suggestion-btn:hover { background: var(--gold-border); }
.chat-window { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; min-height: 360px; max-height: 560px; overflow-y: auto; margin-bottom: 12px; display: flex; flex-direction: column; gap: 12px; }
.chat-empty { color: var(--text-dim); font-size: 12.5px; text-align: center; margin: auto; padding: 30px 0; }
.chat-msg { display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-assistant { justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 8px; }
.chat-bubble { max-width: 720px; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.55; white-space: normal; }
.chat-msg-user .chat-bubble { background: var(--maroon); color: #fff; border-bottom-right-radius: 3px; }
.chat-msg-assistant .chat-bubble { background: var(--bg); color: var(--text); border-bottom-left-radius: 3px; }
.chat-bubble-error { background: var(--bad-bg); color: var(--bad); }
.chat-thinking { color: var(--text-dim); font-style: italic; }
.chat-bubble p { margin: 0 0 8px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble b { color: var(--gold); font-weight: 700; }
.chat-msg-user .chat-bubble b { color: #fff; }
.chat-heading { font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-dim); margin: 10px 0 4px; }
.chat-heading:first-child { margin-top: 0; }
.chat-list { margin: 0 0 8px 18px; padding: 0; }
.chat-list:last-child { margin-bottom: 0; }
.chat-list li { margin-bottom: 4px; line-height: 1.5; }
.chat-followups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.chat-block-title { font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-dim); margin-bottom: 6px; }
.chat-chart-wrap, .chat-table-wrap { width: 100%; max-width: 760px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.chat-table-wrap .matrix-wrap { margin-bottom: 0; }
table.chat-table th { cursor: pointer; user-select: none; }
table.chat-table th:hover { color: var(--maroon); }
.chat-input-row { display: flex; gap: 8px; }
.chat-input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: var(--sans); background: var(--surface); color: var(--text); }
.chat-input:focus { outline: none; border-color: var(--maroon); }

@media (max-width: 768px) {
    .chat-bubble, .chat-chart-wrap, .chat-table-wrap { max-width: 100%; }
    .chat-input-row { flex-wrap: wrap; }
    .chat-input { flex-basis: 100%; }
}
