:root {
    /* Obelus exact brand tokens */
    --brand: #d97757;
    --brand-press: #c2603f;
    --brand-deep: #8a4a34;
    --sand: #c9a27e;
    --faint: #5f656c;
    --muted: #8d9298;
    --surface: #131619;
    --surface-2: #181c20;
    --ground: #0d0f11;
    --hairline: #23262b;
    --text: #e8e6e1;
    --breach: #e2564d;
    --clear: #4a9e6d;
    --s1: #d97757;
    --s2: #c9a27e;
    --s3: #5f656c;
    --s4: #8a4a34;

    /* Semantic Aliases */
    --bg: var(--ground);
    --accent: var(--brand); /* Terracotta: brand, actions, links, current period. Carries no state */

    /* Legacy compatibility aliases mapped strictly to palette */
    --bg-base: var(--ground);
    --bg-surface: var(--surface);
    --bg-card: var(--surface);
    --bg-card-hover: var(--surface-2);
    --border-subtle: var(--hairline);
    --border-strong: #2f343b;
    --text-main: var(--text);
    --text-muted: var(--muted);
    --text-dim: var(--faint);
    --accent-blue: var(--accent);
    --accent-emerald: var(--clear);
    --accent-amber: #c88937;
    --accent-rose: var(--breach);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    background-color: var(--ground);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    letter-spacing: -0.01em;
}

/* =========================================================
   APP SHELL (1180px Desktop Grid + Persistent Sidebar)
   ========================================================= */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--ground);
    width: 100%;
}

.app-sidebar {
    width: 190px;
    min-width: 190px;
    background: var(--ground);
    border-right: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
    z-index: 40;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 0;
}

.obelus-brand-lockup {
    height: 28px;
    width: auto;
    display: block;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav-link {
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 400;
    padding: 8px 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.12s ease;
    font-family: inherit;
    border-radius: 0;
}

.sidebar-nav-link:hover {
    color: var(--text);
    background: transparent;
}

.sidebar-nav-link.active {
    color: var(--text);
    font-weight: 600;
    background: transparent;
    border-left: 2px solid var(--brand);
}

.sidebar-bottom {
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-portfolio-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-total-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.sidebar-twr-val {
    font-size: 11px;
    color: var(--muted);
}

.sidebar-domain-footnote a {
    font-size: 11px;
    color: var(--faint);
    text-decoration: none;
    transition: color 0.15s ease;
    letter-spacing: -0.01em;
}

.sidebar-domain-footnote a:hover {
    color: var(--brand);
}

.app-main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Breadcrumbs Header */
header.app-header {
    height: 52px;
    border-bottom: 1px solid var(--hairline);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.top-loading-progress-bar {
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #e2564d);
    transition: width 0.25s ease, opacity 0.2s ease;
    opacity: 0;
    z-index: 40;
    pointer-events: none;
}

.top-loading-progress-bar.active {
    opacity: 1;
    animation: progressBarIndeterminate 1.2s infinite ease-in-out;
}

@keyframes progressBarIndeterminate {
    0% {
        left: 0%;
        width: 15%;
    }
    50% {
        left: 35%;
        width: 55%;
    }
    100% {
        left: 100%;
        width: 20%;
    }
}

.breadcrumb-trail {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
}

.crumb-link {
    color: var(--muted);
    cursor: pointer;
    transition: color 0.12s;
}

.crumb-link:hover {
    color: var(--text);
}

.crumb-sep {
    color: var(--faint);
}

.crumb-current {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--text);
}

.crumb-name {
    color: var(--muted);
}

.crumb-delta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--breach);
}

.crumb-pos {
    color: var(--faint);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-tab-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: #94a3b8;
    padding: 7px 14px;
    border-radius: 9999px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.nav-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.nav-tab-btn.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.5);
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.nav-divider {
    color: var(--text-dim);
    font-size: 14px;
}

.header-ticker-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title-ticker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
}

.header-title-summary {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.top-search-bar {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    padding: 6px 14px;
    width: 220px;
    transition: all 0.15s ease;
}

.top-search-bar:focus-within {
    border-color: #383e46;
    background: var(--surface-2);
    width: 250px;
}

.top-search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    width: 100%;
}

.top-search-bar input::placeholder {
    color: #64748b;
}

/* =========================================================
   PORTFOLIO HOME SCREEN (1180px Desktop Grid Alignment)
   ========================================================= */
.portfolio-screen {
    flex: 1;
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
    padding: 32px 36px 80px 36px;
    box-sizing: border-box;
}

.portfolio-hero {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 24px 28px;
    margin-bottom: 24px;
}

.portfolio-hero-headline {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.portfolio-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.portfolio-val-cluster {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.portfolio-provenance-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 3px 9px;
    border-radius: 9999px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.portfolio-provenance-badge.seeded {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: var(--accent-amber);
}

.portfolio-provenance-badge.live {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: var(--accent-emerald);
}

.portfolio-return-badge {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 4px 10px;
    border-radius: 9999px;
}

.portfolio-risk-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.risk-metric-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.risk-label {
    font-size: 10.5px;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.risk-val {
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1300px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 580px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

.triage-analytics-link-bar {
    margin-top: 28px;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px dashed rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.btn-triage-analytics-link {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-triage-analytics-link:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateX(2px);
}

/* Autocomplete Search Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 320px;
    background: #0f172a;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    max-height: 380px;
    overflow-y: auto;
}

.search-result-item {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.12s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover, .search-result-item.selected {
    background: rgba(56, 189, 248, 0.12);
}

.search-item-ticker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
}

.search-item-name {
    font-size: 11px;
    color: var(--text-muted);
}

.search-item-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
}

/* Watchlist Card Styling */
.watchlist-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.watchlist-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.watchlist-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.watchlist-signal-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.watchlist-signal-badge.buy {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.watchlist-signal-badge.watch {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.watchlist-signal-badge.hold {
    background: rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.4);
}

/* Portfolio Explicit Triage Call Card */
.portfolio-triage-call-card {
    margin-top: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
    border: 1px solid rgba(244, 63, 94, 0.35);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.triage-call-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.triage-call-badge {
    background: var(--accent-rose);
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.triage-call-headline {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.triage-call-subtext {
    font-size: 12px;
    line-height: 1.55;
    color: #cbd5e1;
}

.portfolio-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 195px;
    gap: 12px;
    position: relative;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.portfolio-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    background: rgba(24, 34, 53, 0.8);
}

.portfolio-card.status-border-BREACH {
    border-top: 4px solid var(--accent-rose);
}

.portfolio-card.status-border-WATCH {
    border-top: 4px solid var(--accent-amber);
}

.portfolio-card.status-border-PASS {
    border-top: 4px solid var(--accent-emerald);
}

.portfolio-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portfolio-card-ticker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
}

.portfolio-card-weight {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent-blue);
    font-weight: 700;
}

.portfolio-card-statline {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    justify-content: space-between;
}

.portfolio-worst-box {
    background: rgba(10, 12, 18, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portfolio-worst-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.portfolio-worst-title {
    font-size: 12px;
    font-weight: 700;
    color: #f1f5f9;
}

.portfolio-worst-sub {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
}



/* 1. Verdict Band */
.verdict-band {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.verdict-line-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.verdict-id-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
}

.verdict-ticker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
}

.verdict-period {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
}

.verdict-badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.verdict-meta-cluster {
    display: flex;
    align-items: center;
    gap: 12px;
}

.verdict-recency {
    font-size: 11px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.back-portfolio-btn {
    background: #192030;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.back-portfolio-btn:hover {
    color: #ffffff;
    border-color: var(--accent-blue);
    background: #232d44;
}

.verdict-line-2 {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.45;
}

/* Status Badges */
.badge-status {
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    letter-spacing: 0.4px;
    padding: 2px 7px;
    border-radius: 4px;
    text-align: center;
    flex-shrink: 0;
}

.badge-PASS {
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-WATCH {
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.45);
}

.badge-BREACH {
    color: var(--accent-rose);
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.48);
}

.badge-UNMONITORED {
    color: var(--text-dim);
    background: rgba(100, 116, 139, 0.12);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* 2. Seven Criteria Full Width Grid */
.criteria-strip-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-title-compact {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
}

.section-meta-right {
    font-size: 11px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    text-transform: none;
    font-weight: 500;
}

.criteria-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.criteria-active-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}

.passes-collapsed-bar {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #e2e8f0;
}

.passes-collapsed-lead {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--accent-emerald);
}

.passes-collapsed-names {
    color: var(--text-muted);
    font-weight: 400;
}

.passes-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    transition: color 0.15s;
}

.passes-toggle-btn:hover {
    color: var(--text-main);
}

.passes-expanded-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 4px;
}

.passes-expanded-grid.collapsed {
    display: none;
}

.criterion-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.criterion-card.status-BREACH {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.04);
}

.criterion-card.status-WATCH {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.03);
}

.criterion-card.status-PASS {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.02);
}

.crit-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.crit-card-status-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.status-BREACH .crit-card-status-label { color: var(--accent-rose); }
.status-WATCH .crit-card-status-label { color: var(--accent-amber); }
.status-PASS .crit-card-status-label { color: var(--accent-emerald); }

.crit-card-rule {
    font-size: 10px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.crit-card-name {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crit-card-metric {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    color: #e2e8f0;
    font-weight: 600;
}

.crit-card-trigger {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
}

/* 3. Decision Brief Panel (High signal, sleek consumer styling) */
.decision-brief-panel {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.85) 100%);
    border: 1px solid rgba(244, 63, 94, 0.35);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.decision-brief-panel.panel-positive {
    border-color: rgba(16, 185, 129, 0.45);
}

.decision-brief-panel.panel-flat {
    border-color: rgba(56, 189, 248, 0.35);
}

.decision-brief-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brief-headline-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.brief-ticker {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.2px;
}

.brief-move-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
}

.brief-move-badge.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

.brief-event {
    font-size: 12.5px;
    color: var(--text-dim);
    font-weight: 500;
}

.brief-chips-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

.brief-chip {
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 9999px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.brief-chip.chip-BREACH {
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.18);
    border: 1px solid rgba(244, 63, 94, 0.5);
}

.brief-chip.chip-WATCH {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.brief-chip.chip-PASS {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.brief-meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.brief-dot {
    color: rgba(255, 255, 255, 0.25);
}

.brief-valuation-tag {
    font-size: 11.5px;
    padding: 3px 8px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 6px;
    font-weight: 600;
}

/* Two core rows */
.decision-brief-core {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brief-text-row {
    font-size: 13.5px;
    line-height: 1.55;
    color: #e2e8f0;
}

.brief-text-row.secondary {
    color: #cbd5e1;
}

.brief-sentiment-label {
    font-weight: 700;
    font-size: 12px;
    color: #94a3b8;
    margin-right: 4px;
}

.brief-inference-tag {
    display: inline-block;
    margin-left: 6px;
    font-style: italic;
    font-size: 11.5px;
    color: #94a3b8;
}

/* Side-by-side falsifier boxes */
.brief-falsifiers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .brief-falsifiers-grid {
        grid-template-columns: 1fr;
    }
}

.brief-falsifier-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brief-falsifier-box.add-box {
    border-left: 4px solid #10b981;
}

.brief-falsifier-box.sell-box {
    border-left: 4px solid #f43f5e;
}

.falsifier-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.falsifier-label.add-label {
    color: #10b981;
}

.falsifier-label.sell-label {
    color: #ef4444;
}

.falsifier-text {
    font-size: 12px;
    line-height: 1.45;
    color: #cbd5e1;
}

.decision-brief-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.call-selector-cluster {
    display: flex;
    gap: 6px;
}

.call-btn {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.call-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateY(-1px);
}

.call-btn.active-Add {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.call-btn.active-Hold {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.call-btn.active-Trim {
    background: rgba(249, 115, 22, 0.2);
    border-color: #f97316;
    color: #f97316;
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.25);
}

.call-btn.active-Sell {
    background: rgba(244, 63, 94, 0.2);
    border-color: #f43f5e;
    color: #f43f5e;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.25);
}

.call-rationale-display {
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.45;
}

.call-rationale-display strong {
    color: #ffffff;
}

.link-toggle-btn {
    background: transparent;
    border: none;
    color: var(--accent-blue);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.link-toggle-btn:hover {
    color: #93c5fd;
}

/* 4. Collapsed Section Rows (Demoted below the fold) */
.collapsed-rows-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demoted-row-panel {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.7);
    transition: all 0.2s ease;
}

.demoted-row-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.demoted-header {
    cursor: pointer;
    user-select: none;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demoted-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.findings-count-badge {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 2px 8px;
    border-radius: 9999px;
}

.demoted-toggle-text {
    font-size: 11.5px;
    color: var(--accent-blue);
    font-weight: 600;
}

.panel {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diff-panel {
    border-color: rgba(59, 130, 246, 0.2);
}

.ghost-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--accent-blue);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ghost-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
}

.diff-body.collapsed, .bear-grid.collapsed {
    display: none;
}

.diff-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Trimmed card chrome: 1 meta line, 1 sentence, inline citation */
.diff-card-trimmed {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.diff-meta-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.diff-badge-tag {
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
}

.diff-citation-inline {
    color: var(--accent-blue);
    font-weight: 600;
}

.diff-merged-inline {
    color: var(--text-dim);
}

.diff-content-line {
    font-size: 12.5px;
    color: #f1f5f9;
    line-height: 1.45;
}

.diff-subbullet-trimmed {
    font-size: 11.5px;
    color: #cbd5e1;
    line-height: 1.4;
    padding-left: 12px;
    border-left: 2px solid var(--border-strong);
    margin-top: 3px;
}

/* 4. Bear Cases (Headlines First, Expandable) */
.bear-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bear-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bear-card-compact {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-rose);
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bear-header-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.bear-title {
    font-size: 13px;
    font-weight: 700;
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bear-expand-toggle {
    font-size: 11px;
    color: var(--text-dim);
    cursor: pointer;
}

.bear-drawer-content {
    font-size: 12px;
    color: #e2e8f0;
    line-height: 1.5;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.bear-drawer-content.collapsed {
    display: none;
}

.bear-evidence {
    font-size: 10.5px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 4px;
}

/* 5. Financial Trajectory & Table Drawer */
.collapsible-panel .chevron-indicator {
    display: inline-block;
    font-size: 10px;
    color: var(--accent-blue);
    transition: transform 0.2s ease;
}

.financials-drawer-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

.financials-drawer-body.collapsed {
    display: none;
}

.chart-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 12px 14px;
}

.chart-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-container {
    height: 220px;
    position: relative;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

th {
    background: #111420;
    color: var(--text-dim);
    padding: 8px 12px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

th:first-child, td:first-child { text-align: left; }

td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
}

.cell-cite {
    font-size: 9px;
    color: var(--accent-blue);
    text-decoration: none;
    opacity: 0.7;
    margin-left: 4px;
}

.cell-cite:hover { opacity: 1; text-decoration: underline; }

/* Stacked TTM Ledger Row */
.ttm-ledger-row {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.08) 0%, rgba(30, 41, 59, 0.6) 100%);
    border-bottom: 2px solid rgba(56, 189, 248, 0.35) !important;
}

.ttm-ledger-row td {
    padding: 10px 12px;
    color: #e2e8f0;
}

.ttm-badge-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.3px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .bear-grid {
        grid-template-columns: 1fr;
    }
    .criteria-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* 3-Tab Chart Strip */
.chart-tab-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-tabs-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chart-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-tab-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.04);
}

.chart-tab-btn.active {
    background: rgba(30, 41, 59, 0.95);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.chart-tab-dot {
    color: #ef4444;
    font-size: 14px;
    line-height: 0;
    vertical-align: middle;
}

.chart-tab-shortcut-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(148, 163, 184, 0.5);
    letter-spacing: 0.5px;
}

/* ==========================================================================
   INSTITUTIONAL PORTFOLIO TRACKER & RISK ANALYTICS STYLES
   ========================================================================== */

.tracker-hero {
    background: #0f1523;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tracker-hero-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 16px;
}

.tracker-twr-badge-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.tracker-cagr-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent-emerald);
    font-weight: 600;
}

/* KPI Card Grid */
.tracker-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.tracker-kpi-card {
    background: rgba(10, 13, 20, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.15s ease;
}

.tracker-kpi-card:hover {
    border-color: var(--border-strong);
}

.tracker-kpi-card.highlight-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(14, 17, 26, 0.8) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.tracker-kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.kpi-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.kpi-tag.success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.kpi-tag.neutral {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

.kpi-main-val {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.kpi-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.kpi-number.alert {
    color: #f87171;
}

.kpi-vs-text {
    font-size: 12px;
    color: var(--text-dim);
}

.kpi-callout-text {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

.kpi-callout-text strong {
    color: #34d399;
}

.kpi-subnote {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.3;
}

.kpi-dual-metric {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-muted);
}

.kpi-dual-metric strong {
    font-size: 17px;
    color: var(--text-main);
    margin-left: 2px;
}

/* Quality Overlay Strip */
.quality-overlay-strip {
    background: rgba(10, 13, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quality-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-overlay-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
}

.quality-overlay-subtitle {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-dim);
}

.quality-bar-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.legend-dot.breach { background: var(--accent-rose); }
.legend-dot.watch { background: var(--accent-amber); }
.legend-dot.intact { background: var(--accent-emerald); }
.legend-dot.unmonitored { background: #64748b; }

.quality-bar-container {
    height: 10px;
    background: #0f172a;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
}

.quality-bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.quality-bar-segment.breach { background: #ef4444; }
.quality-bar-segment.watch { background: #f59e0b; }
.quality-bar-segment.intact { background: #10b981; }
.quality-bar-segment.unmonitored { background: #64748b; }

.quality-capital-summary {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    gap: 16px;
    font-family: 'JetBrains Mono', monospace;
}

/* Charts Section */
.tracker-charts-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.tracker-chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px 20px;
}

.canvas-wrapper-tracker {
    position: relative;
    height: 320px;
    width: 100%;
}

.canvas-wrapper-drawdown {
    position: relative;
    height: 140px;
    width: 100%;
}

/* Contribution Table */
.tracker-table-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 30px;
}

.tracker-table-wrapper {
    overflow-x: auto;
    margin-top: 12px;
}

.tracker-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.tracker-table th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(14, 17, 26, 0.5);
}

.tracker-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}

.tracker-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.holding-id-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.holding-ticker-txt {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    color: #f8fafc;
}

.holding-name-sub {
    font-size: 11px;
    color: var(--text-dim);
}

.num-cell {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.badge-status-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
}

.badge-status-cell.BREACH {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-status-cell.WATCH {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status-cell.INTACT, .badge-status-cell.PASS {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status-cell.UNMONITORED {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.btn-table-action {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-table-action:hover {
    background: #334155;
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1024px) {
    .tracker-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .tracker-kpi-grid {
        grid-template-columns: 1fr;
    }
    .tracker-hero-main {
        flex-direction: column;
        gap: 12px;
    }
    .tracker-twr-badge-col {
        align-items: flex-start;
    }
}

/* Triage Surveillance Strip Styles */
.triage-surveillance-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    margin-top: 16px;
    margin-bottom: 8px;
}

.surveillance-card {
    background: #0d1017;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.surveillance-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.surveillance-title {
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.02em;
}

.surveillance-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.25);
}

.surveillance-tag.amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.surveillance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.surveillance-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.surveillance-item:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.surv-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    min-width: 48px;
    text-align: center;
}

.surv-badge.rose {
    background: rgba(244, 63, 94, 0.18);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.35);
}

.surv-badge.amber {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.surv-badge.emerald {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.surv-badge.blue {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.surv-badge.neutral {
    background: rgba(100, 116, 139, 0.18);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.35);
}

.surv-desc {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.surv-metric {
    font-size: 11px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.surv-sub {
    font-size: 10px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   SIMPLY WALL ST INSPIRED CONSUMER HERO & QUALITY SCORECARD
   ========================================================================== */

.consumer-hero-card {
    background: linear-gradient(180deg, #101626 0%, #0c101d 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    position: relative;
}

.consumer-hero-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.consumer-company-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.consumer-ticker-badge {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

.consumer-company-name {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.consumer-company-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.consumer-period-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
}

.consumer-meta-dot {
    color: rgba(255, 255, 255, 0.2);
}

.consumer-recency-text {
    font-size: 11px;
    color: var(--text-dim);
}

.consumer-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.consumer-action-btn {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.consumer-action-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-1px);
}

.consumer-back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.consumer-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Friendly Plain-English Takeaway Banner */
.consumer-takeaway-banner {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.takeaway-icon-bubble {
    font-size: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.takeaway-text-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.takeaway-lead-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #38bdf8;
}

.takeaway-sentence {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.45;
}

/* 5-Pillar Visual Health Scorecard (Simply Wall St Style) */
.sws-pillars-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.sws-pillar-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.18s ease;
    position: relative;
}

.sws-pillar-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(24, 34, 53, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.sws-pillar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sws-pillar-title {
    font-size: 13px;
    font-weight: 800;
    color: #f8fafc;
    display: block;
    letter-spacing: -0.01em;
}

.sws-pillar-tag {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    display: block;
    margin-top: 1px;
}

.info-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.info-help-btn:hover {
    background: #38bdf8;
    color: #0f172a;
    transform: scale(1.15);
}

.sws-pillar-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.sws-pillar-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 19px;
    font-weight: 800;
    color: #ffffff;
}

.sws-pillar-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}

.sws-meter-bar-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.sws-meter-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent-emerald);
    transition: width 0.3s ease;
}

.sws-pillar-sub {
    font-size: 10.5px;
    color: var(--text-dim);
    line-height: 1.35;
}

/* Pillar Card Status Variations */
.sws-pillar-card.pillar-pass {
    border-top: 3px solid var(--accent-emerald);
}
.sws-pillar-card.pillar-pass .sws-pillar-badge {
    background: rgba(16, 185, 129, 0.18);
    color: var(--accent-emerald);
}
.sws-pillar-card.pillar-pass .sws-meter-bar-fill {
    background: var(--accent-emerald);
}

.sws-pillar-card.pillar-watch {
    border-top: 3px solid var(--accent-amber);
}
.sws-pillar-card.pillar-watch .sws-pillar-badge {
    background: rgba(245, 158, 11, 0.18);
    color: var(--accent-amber);
}
.sws-pillar-card.pillar-watch .sws-meter-bar-fill {
    background: var(--accent-amber);
}

.sws-pillar-card.pillar-breach {
    border-top: 3px solid var(--accent-rose);
}
.sws-pillar-card.pillar-breach .sws-pillar-badge {
    background: rgba(244, 63, 94, 0.18);
    color: var(--accent-rose);
}
.sws-pillar-card.pillar-breach .sws-meter-bar-fill {
    background: var(--accent-rose);
}

.sws-pillar-card.pillar-neutral {
    border-top: 3px solid #38bdf8;
}
.sws-pillar-card.pillar-neutral .sws-pillar-badge {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
}
.sws-pillar-card.pillar-neutral .sws-meter-bar-fill {
    background: #38bdf8;
}

/* Consumer Details Accordion */
.consumer-details-accordion {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.consumer-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.12s ease;
}

.consumer-accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.consumer-pill-count {
    font-size: 10px;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--text-dim);
}

.consumer-toggle-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #38bdf8;
    font-weight: 600;
}


/* Educational Popover Modal */
.education-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 29, 0.75);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.education-modal-content {
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    animation: modalSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.education-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.education-icon {
    font-size: 18px;
}

.education-close-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 15px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.12s;
}

.education-close-btn:hover {
    color: #ffffff;
}

.education-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edu-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.edu-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #38bdf8;
}

.edu-text {
    font-size: 13px;
    line-height: 1.55;
    color: #e2e8f0;
    margin: 0;
}

.edu-context-box {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 12px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #cbd5e1;
}

/* ==========================================================================
   RESTRUCTURED PRESENTATION (Phases 0-6): Verdict-first, clean list, continuous evidence
   ========================================================================== */

/* Main Containers & Layout */
.portfolio-screen {
    padding: 24px 28px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.portfolio-hero-headline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.portfolio-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.portfolio-subtext {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
}

.portfolio-provenance-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portfolio-provenance-badge.seeded {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.portfolio-val-cluster {
    text-align: right;
}

.portfolio-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    display: block;
}

.portfolio-return-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-emerald);
}

.watchlist-quick-add-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
}

.watchlist-quick-add-cluster input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    color: #ffffff;
    width: 240px;
    outline: none;
    transition: border-color 0.15s;
}

.watchlist-quick-add-cluster input:focus {
    border-color: var(--accent-blue);
}

/* Portfolio & Ideas List Table (5 rows, fits one screen, hairlines only) */
.portfolio-list-wrapper {
    margin-top: 24px;
    background: transparent;
    border-top: 1px solid var(--border-subtle);
}

.portfolio-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.portfolio-list-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-subtle);
}

.portfolio-list-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    vertical-align: middle;
}

.portfolio-list-row, .portfolio-row-item {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.portfolio-list-row:hover, .portfolio-row-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.port-holding-cell {
    display: flex;
    flex-direction: column;
}

.port-ticker {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
}

.port-name {
    font-size: 12px;
    color: var(--text-dim);
}

.port-weight, .port-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.port-status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.port-status-badge.status-breach {
    color: var(--accent-rose);
}

.port-status-badge.status-watch {
    color: var(--accent-amber);
}

.port-status-badge.status-pass {
    color: var(--accent-emerald);
}

.port-metric-driving {
    font-size: 12px;
    color: var(--text-muted);
}

.port-metric-driving strong {
    color: #ffffff;
}

.port-arrow {
    text-align: right;
    color: var(--text-dim);
    font-size: 14px;
}

/* ==========================================================================
   UNIFIED PAGE SKELETON: All pages share the same desktop grid + quiet rail
   ========================================================================== */
.page-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 36px 80px 36px;
    box-sizing: border-box;
}

.page-desktop-grid {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 48px;
    align-items: start;
}

.page-main-col {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
}

/* Page Header Block */
.page-header-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-headline {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
    letter-spacing: -0.045em;
    margin: 0;
}

.page-subline {
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
}

/* Header dynamic items */
.header-page-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
}

.header-actions-slot {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ideas-quick-add {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ideas-quick-add input {
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text);
    font-family: inherit;
    outline: none;
    width: 140px;
}

.ideas-quick-add input:focus {
    border-color: #383e46;
}

.global-as-of-date {
    font-size: 11.5px;
    color: var(--faint);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.metric-benchmark-note {
    font-size: 11.5px;
    color: var(--faint);
    font-style: italic;
    margin-top: -16px;
    margin-bottom: 4px;
    line-height: 1.4;
}

/* 1. Verdict & Action Row (Verdict sitting beside actions) */
.ticker-verdict-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.ticker-verdict-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.verdict-headline {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
    letter-spacing: -0.045em;
}

.verdict-sub-sentence {
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
    max-width: 620px;
    letter-spacing: -0.01em;
}

.ticker-actions-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.call-selector-cluster {
    display: flex;
    align-items: center;
    gap: 6px;
}

.call-btn {
    background: transparent;
    border: 1px solid var(--hairline);
    color: var(--muted);
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s ease;
}

.call-btn:hover {
    color: var(--text);
    border-color: #383e46;
}

/* Terracotta active accent - terracotta is accent ONLY (actions, links, chart line) */
.call-btn.active-Trim,
.call-btn.active-Add,
.call-btn.active-Hold,
.call-btn.active-Sell {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
    font-weight: 700;
}

.action-ghost-btn {
    background: transparent;
    border: 1px solid var(--hairline);
    color: var(--muted);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s ease;
}

.action-ghost-btn:hover {
    color: var(--text);
    border-color: #383e46;
}

/* 2. Key Metrics Trio */
.key-metrics-trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 20px 0;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
}

.metric-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-col:not(:last-child) {
    border-right: 1px solid var(--hairline);
    padding-right: 16px;
}

.metric-col-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

.metric-col-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
}

.metric-col-val.num-fail {
    font-size: 21px;
    color: var(--breach);
    font-weight: 800;
}

.metric-col-val.num-watch {
    font-size: 21px;
    color: #c88937;
    font-weight: 800;
}

.metric-col-val.num-pass {
    color: var(--clear);
}

.num-fail {
    color: var(--breach);
    font-weight: 800;
}

.num-watch {
    color: #c88937;
    font-weight: 800;
}

.num-pass {
    color: var(--clear);
    font-weight: 800;
}

.verdict-headline .num-fail,
.verdict-headline .num-watch,
.verdict-headline .num-pass,
.page-headline .num-fail,
.page-headline .num-watch,
.page-headline .num-pass {
    font-size: inherit;
    font-family: 'JetBrains Mono', monospace;
}

.metric-col-sub {
    font-size: 11.5px;
    color: var(--faint);
    font-family: 'JetBrains Mono', monospace;
}

.passing-metrics-line {
    display: none;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    padding-top: 4px;
}

/* 3. What Changed */
.what-changed-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-label-dim {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--faint);
    text-transform: uppercase;
}

.what-changed-body {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
}

.what-changed-sub {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--muted);
}

/* 4. Continuous Evidence */
.evidence-continuous-section {
    display: flex;
    flex-direction: column;
    gap: 28px;
    border-top: 1px solid var(--hairline);
    padding-top: 24px;
}

.evidence-chart-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.evidence-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.evidence-chart-title {
    font-size: 11.5px;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
}

.evidence-chart-tabs {
    display: flex;
    gap: 4px;
}

.evidence-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s;
}

.evidence-tab-btn:hover {
    color: var(--text);
}

.evidence-tab-btn.active {
    background: var(--surface-2);
    border-color: var(--hairline);
    color: var(--accent);
}

.evidence-chart-canvas-wrap {
    height: 170px;
    width: 100%;
}

/* 5. Full 9-Column 7-Year History Ledger */
.desktop-ledger-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.desktop-ledger-wrapper {
    overflow-x: auto;
    width: 100%;
}

.desktop-ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.desktop-ledger-table th {
    padding: 8px 10px;
    color: var(--muted);
    font-weight: 500;
    text-align: right;
    border-bottom: 1px solid var(--hairline);
    white-space: nowrap;
}

.desktop-ledger-table th:first-child {
    text-align: left;
    padding-left: 0;
    color: var(--faint);
    width: 180px;
}

.desktop-ledger-table th.col-ttm {
    color: var(--accent);
    font-weight: 700;
}

.desktop-ledger-table td {
    padding: 10px 10px;
    text-align: right;
    color: var(--text);
    border-bottom: 1px solid var(--hairline);
    white-space: nowrap;
}

.desktop-ledger-table td:first-child {
    text-align: left;
    padding-left: 0;
    color: var(--muted);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12.5px;
}

.desktop-ledger-table td.col-ttm {
    font-weight: 700;
    color: var(--text);
}

.desktop-ledger-table td.col-ttm.ttm-breach {
    color: var(--breach);
}

.desktop-ledger-table tr.row-breached td {
    background: rgba(226, 86, 77, 0.03);
}

.desktop-ledger-table tr.row-breached td:first-child {
    color: var(--text);
    font-weight: 600;
}

.ledger-footnote {
    font-size: 11px;
    color: var(--faint);
    line-height: 1.5;
    margin-top: 4px;
}

/* ==========================================================================
   CLEAN TABLES (Portfolio, Ideas, Risk)
   Rule: Left for descriptive column, right for numerals, always.
   ========================================================================== */
.table-wrapper-clean {
    width: 100%;
    overflow-x: hidden; /* Avoid unsightly horizontal scrollbar */
}

.clean-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 13px;
}

.clean-table th {
    padding: 8px 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    border-bottom: 1px solid var(--hairline);
    white-space: nowrap;
}

.clean-table th.th-left, .clean-table td.td-left {
    text-align: left;
}

.clean-table th.th-right, .clean-table td.td-right {
    text-align: right;
}

.clean-table th:first-child, .clean-table td:first-child {
    padding-left: 0;
}

.clean-table th:last-child, .clean-table td:last-child {
    padding-right: 0;
}

.clean-table td {
    padding: 10px 8px;
    color: var(--text);
    border-bottom: 1px solid var(--hairline);
    white-space: nowrap;
}

.clean-table td.td-truncate {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clean-table tr.portfolio-row-item {
    cursor: pointer;
    transition: background 0.1s ease;
}

.clean-table tr.portfolio-row-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Recent Changes Feed */
.changed-today-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
}

.changed-feed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.changed-feed-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.changed-feed-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--faint);
    flex-shrink: 0;
}

.changed-feed-bold {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
}

.changed-feed-bold:hover {
    color: var(--accent);
}

.changed-feed-link {
    color: var(--muted);
    font-size: 11.5px;
    text-decoration: none;
    margin-left: 4px;
}

.changed-feed-link:hover {
    color: var(--text);
    text-decoration: underline;
}

.clean-table td strong {
    color: var(--text);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.clean-table td.num-cell {
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
}

.status-inline {
    font-size: 12px;
    font-weight: 600;
}

.status-inline.breach {
    color: var(--breach);
}

.status-inline.watch {
    color: #c88937;
}

.status-inline.pass {
    color: var(--clear);
}

.row-action-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 12.5px;
    transition: opacity 0.12s;
}

.row-action-link:hover {
    opacity: 0.8;
}

/* Feed & Notes */
.changed-today-section,
.not-screened-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
}

.changed-feed-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.changed-feed-item {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.changed-feed-bold {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--text);
}

.not-screened-note {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

/* Risk Charts in Unified Shell */
.risk-charts-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chart-block-clean {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-label-clean {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--faint);
    text-transform: uppercase;
}

.chart-canvas-wrap-risk {
    height: 170px;
    width: 100%;
}

.chart-canvas-wrap-dd {
    height: 110px;
    width: 100%;
}

.chart-legend-clean {
    font-size: 11px;
    color: var(--faint);
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.chart-legend-clean .legend-line.portfolio {
    color: var(--accent);
}

.chart-legend-clean .legend-line.sp500 {
    color: #94a3b8; /* Cool slate */
}

.chart-legend-clean .legend-line.nasdaq {
    color: #38bdf8; /* Distinct sky/cyan */
}

/* Ledger cell directional indicators */
.ledger-deteriorate {
    color: var(--breach) !important;
}


.quality-bar-compact {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--surface-2);
}

.quality-bar-seg-breach {
    background: var(--breach);
}

.quality-bar-seg-intact {
    background: var(--clear);
}

/* Unified Merged Findings Themes */
.findings-themes-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.themes-list {
    display: flex;
    flex-direction: column;
}

.theme-row {
    border-bottom: 1px solid var(--hairline);
}

.theme-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
    user-select: none;
    transition: color 0.12s;
}

.theme-row-header:hover .theme-name {
    color: var(--text);
}

.theme-name {
    font-size: 13px;
    color: var(--text);
}

.theme-count {
    font-size: 12px;
    color: var(--faint);
    font-family: 'JetBrains Mono', monospace;
}

.theme-items-drawer {
    padding: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.theme-item {
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
    padding-left: 12px;
    border-left: 2px solid var(--hairline);
}

.theme-item-text {
    color: var(--text);
}

.theme-item-cite {
    font-size: 11px;
    color: var(--faint);
    margin-top: 3px;
}

/* ==========================================================================
   QUIET RIGHT RAIL (Unified across Portfolio, Ideas, Risk, Ticker)
   ========================================================================== */
.page-right-rail,
.ticker-right-rail {
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding-top: 4px;
}

.rail-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rail-title {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--faint);
    text-transform: uppercase;
}

/* Red lines checklist with actual values */
.rail-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rail-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    line-height: 1.3;
}

.rail-item.clear {
    color: var(--muted);
}

.rail-item.breach {
    color: var(--breach);
}

.rail-item.watch {
    color: #c88937;
}

.rail-item-name {
    color: inherit;
}

.rail-item-num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: inherit;
}

/* Rail key-value list */
.rail-kv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rail-kv-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
}

.rail-k {
    color: var(--muted);
}

.rail-v {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    font-weight: 500;
}

.rail-v.breach {
    color: var(--breach);
    font-weight: 600;
}

.rail-v.clear {
    color: var(--clear);
}

.rail-narrative-box p {
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted);
    margin-bottom: 8px;
}

.rail-action-link {
    color: var(--accent);
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.12s;
}

.rail-action-link:hover {
    opacity: 0.8;
}

/* Source rail block */
.rail-source-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rail-source-line {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}

.rail-source-sub {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.4;
}

.rail-source-link {
    margin-top: 6px;
}

.rail-source-link a {
    color: var(--accent);
    text-decoration: none;
    font-size: 12px;
    transition: opacity 0.12s;
}

.rail-source-link a:hover {
    opacity: 0.8;
}

/* ==========================================================================
   BREAKPOINTS: At 1024 unstack rail; at 640 collapse ledger to chart + link
   ========================================================================== */
@media (max-width: 1024px) {
    .page-desktop-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* Rail unstacks and becomes a horizontal row */
    .page-right-rail,
    .ticker-right-rail {
        display: grid;
        grid-template-columns: 1.4fr 1fr 1fr;
        gap: 24px;
        order: 2;
        border-top: 1px solid var(--hairline);
        border-bottom: 1px solid var(--hairline);
        padding: 20px 0;
    }

    .page-main-col {
        order: 1;
    }

    .evidence-continuous-section {
        order: 3;
    }
}

@media (max-width: 640px) {
    .app-sidebar {
        display: none;
    }

    header.app-header {
        padding: 0 16px;
    }

    .page-shell {
        padding: 16px 16px 64px 16px;
    }

    .ticker-verdict-header {
        flex-direction: column;
        gap: 16px;
    }

    .ticker-actions-row {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .call-selector-cluster {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .call-btn {
        width: 100%;
        text-align: center;
        padding: 9px 0;
    }

    .action-ghost-btn {
        width: 100%;
        text-align: center;
    }

    .key-metrics-trio {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .metric-col:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid var(--hairline);
        padding-bottom: 12px;
    }

    .passing-metrics-line {
        display: block;
    }

    .page-right-rail,
    .ticker-right-rail {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* At 640 the ledger drops to chart plus link */
    .desktop-ledger-block {
        display: none;
    }
}


