/* Investor V1: a restrained layer over the existing public terminal. */
:root {
    --investor-space-1: 6px;
    --investor-space-2: 12px;
    --investor-space-3: 18px;
    --investor-space-4: 24px;
    --investor-radius: 14px;
    --investor-positive: #15803d;
}

.screen-fresher .nav-market-pulse { display: none; }
.screen-fresher .fresher-hero-studio { margin: 12px auto 18px; }
.screen-fresher .fresher-hero-heading { max-width: 780px; margin-inline: auto; }
.screen-fresher .fresher-hero-lead { font-size: clamp(2.1rem, 4.3vw, 3.6rem) !important; line-height: 1.13; }
.screen-fresher .fresher-hero-subline { max-width: 650px; margin-inline: auto; line-height: 1.5; }
.screen-fresher .fresher-quickscreen-wrap { margin-top: 20px !important; }
.screen-fresher .fresher-qs-btn { border-radius: 999px; padding: 10px 16px; font-weight: 650; }
.screen-fresher .fresher-qs-btn.active { box-shadow: 0 0 0 3px rgba(22,163,74,.14); }
.investor-quick-help { margin: 8px auto 0; text-align: center; color: var(--text-muted); font-size: .78rem; line-height: 1.5; }

#investorDataNote {
    margin: 12px 0 14px;
    padding: 11px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-secondary);
    background: var(--bg-surface-elevated);
    font-size: .78rem;
    line-height: 1.45;
}
#investorDataNote::before { content: "ⓘ"; color: var(--investor-positive); font-weight: 700; margin-right: 8px; }
#investorDataNote.investor-data-error { border-color: #d97706; background: #fff7ed; color: #7c2d12; }
#investorDataNote.investor-data-error::before { content: "⚠"; color: #b45309; }
#investorDataNote.investor-data-error a { color: inherit; font-weight: 700; text-decoration: underline; }
.investor-data-coverage { display: none; margin: -6px 0 14px; color: var(--text-secondary); font-size: .78rem; }
.screen-fresher .investor-data-coverage { display: block; }
.investor-data-coverage summary { width: fit-content; cursor: pointer; color: var(--investor-positive); font-weight: 700; padding: 5px 0; }
.investor-data-coverage-body { max-width: 760px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-surface); padding: 10px 16px; line-height: 1.5; }
.investor-data-coverage-body p { margin: 5px 0 10px; }
.investor-data-coverage-body ul { margin: 4px 0; padding-left: 20px; }
.investor-data-coverage-body li { margin: 4px 0; }
.investor-metric-help { margin: -4px 0 14px; color: var(--text-secondary); font-size: .78rem; }
.investor-metric-help summary { cursor: pointer; display: inline-block; padding: 5px 0; color: var(--investor-positive); font-weight: 700; }
.investor-metric-help-body { max-width: 760px; margin-top: 6px; border-left: 2px solid var(--investor-positive); padding: 2px 16px; line-height: 1.5; }
.investor-metric-help-body p { margin: 7px 0; }
.screen-fresher .screener-filter-bar { border-radius: var(--investor-radius); }
.screen-fresher #tab-screener .filter-row-bottom { display: grid !important; grid-template-columns: minmax(0,230px) minmax(0,1fr) auto auto; gap: 10px !important; align-items: center; }
.screen-fresher #tab-screener .filter-row-bottom > div:first-child { min-width: 0; }
.screen-fresher #screenerSectorSelect { max-width: 165px; }
.screen-fresher .screener-status-text strong { color: var(--text-primary); }
.screen-fresher #screenAdvanced summary { padding: 9px 6px; }

/* Five source-backed comparison fields remain in the beginner table. */
.screen-fresher #screenerTable :is(th,td):nth-child(3),
.screen-fresher #screenerTable :is(th,td):nth-child(4),
.screen-fresher #screenerTable :is(th,td):nth-child(5),
.screen-fresher #screenerTable :is(th,td):nth-child(7),
.screen-fresher #screenerTable :is(th,td):nth-child(8),
.screen-fresher #screenerTable :is(th,td):nth-child(9),
.screen-fresher #screenerTable :is(th,td):nth-child(10) { display: none !important; }
.screen-fresher #screenerTable :is(th,td):nth-child(11),
.screen-fresher #screenerTable :is(th,td):nth-child(12) { display: table-cell !important; }
.screen-fresher #screenerTable th { color: var(--text-secondary); font-size: .72rem; letter-spacing: .045em; }
.screen-fresher #screenerTable td { padding-block: 15px; font-variant-numeric: tabular-nums; }
.screen-fresher #screenerTable td:nth-child(2) strong { display: block; font-family: var(--font-sans); font-size: .92rem; }
.screen-fresher #screenerTable td:nth-child(2) small { color: var(--text-muted); font-size: .73rem; }
.screen-fresher #screenerTable td:nth-child(6) { font-weight: 700; }
.screen-fresher #screenerTable td:nth-child(11),
.screen-fresher #screenerTable td:nth-child(12) { color: var(--text-primary); }
.screen-fresher #screenerTable .stock-row { cursor: pointer; }
.screen-fresher #screenerTable .stock-row:focus-visible { outline-offset: -3px; }

.investor-stock-cards { display: none; }

@media (max-width: 768px) {
    .screen-fresher .top-nav {
        display: grid;
        grid-template-columns: minmax(0,1fr) auto;
        gap: 10px;
        align-items: center;
        margin-bottom: 4px;
        padding-bottom: 12px;
    }
    .screen-fresher .brand-unit { grid-column: 1; grid-row: 1; min-width: 0; }
    .screen-fresher .brand-name { font-size: .89rem; white-space: nowrap; }
    .screen-fresher .brand-emblem { width: 32px; height: 32px; }
    .screen-fresher .nav-right-controls { display: contents !important; }
    .screen-fresher #authContainer { grid-column: 2; grid-row: 1; }
    .screen-fresher #modeSwitcher { grid-column: 2; grid-row: 2; justify-self: end; }
    .screen-fresher .header-nav-links { grid-column: 1; grid-row: 2; margin: 0 !important; gap: 18px !important; }
    .screen-fresher .mode-btn { padding: 5px 9px; }
    .screen-fresher .fresher-hero-studio { margin: 4px auto 10px; }
    .screen-fresher .fresher-hero-heading { margin: 9px auto 12px !important; }
    .screen-fresher .fresher-hero-lead { font-size: clamp(1.9rem, 7.4vw, 2.7rem) !important; }
    .screen-fresher .fresher-hero-subline { font-size: .94rem !important; }
    .screen-fresher .fresher-quickscreen-wrap { justify-content: flex-start !important; gap: 7px !important; margin: 14px auto 2px !important; }
    .screen-fresher .fresher-qs-btn { padding: 8px 12px; font-size: .76rem; }
    .investor-quick-help { display: none; }
    .screen-fresher .screener-filter-bar { padding: 12px !important; }
    .screen-fresher #tab-screener .filter-row-bottom {
        display: grid !important;
        grid-template-columns: minmax(0,1fr) auto;
        gap: 8px !important;
        align-items: center !important;
    }
    .screen-fresher #tab-screener .filter-row-bottom > div:first-child { grid-row: 1; grid-column: 1; min-width: 0; }
    .screen-fresher #tab-screener .filter-row-bottom > div:first-child > span:first-child { display: none; }
    .screen-fresher #screenerSectorSelect { max-width: 178px; width: 100%; }
    .screen-fresher #tab-screener .filter-row-bottom > select { grid-row: 1; grid-column: 2; max-width: 116px; }
    .screen-fresher #tab-screener .filter-row-bottom > div:nth-child(2) { grid-row: 2; grid-column: 1 / -1; }
    .screen-fresher #tab-screener .filter-row-bottom > .investor-filter-open { grid-row: 3; grid-column: 1 / -1; width: 100%; }
    .screen-fresher #tab-screener .screener-status-text { font-size: .75rem; }
    .screen-fresher #tab-screener > .table-card { display: none; }
    .screen-fresher #investorStockCards { display: grid; grid-template-columns: 1fr; gap: 12px; }
    .screen-fresher #investorDataNote { margin: 10px 0 12px; }
}

.investor-stock-card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--investor-radius);
    background: var(--bg-surface);
    padding: 16px;
    box-shadow: 0 5px 18px rgba(15,23,42,.035);
}
.investor-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.investor-card-company { margin: 0; font-size: 1rem; line-height: 1.3; color: var(--text-primary); }
.investor-card-meta { margin-top: 5px; color: var(--text-muted); font-size: .72rem; line-height: 1.35; }
.investor-card-star { border: 1px solid var(--border-subtle); background: var(--bg-surface-elevated); color: var(--text-secondary); border-radius: 9px; min-width: 44px; min-height: 44px; cursor: pointer; }
.investor-card-star[aria-pressed="true"] { color: #d97706; }
.investor-card-price { font-size: 1.32rem; font-weight: 750; margin: 14px 0; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.investor-card-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.investor-card-metrics > div { padding: 10px 12px; border-radius: 9px; background: var(--bg-surface-elevated); }
.investor-card-metrics dt { color: var(--text-secondary); font-size: .72rem; }
.investor-card-metrics dd { margin: 4px 0 0; color: var(--text-primary); font-size: .97rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.investor-card-metric-date { display: block; margin-top: 4px; color: var(--text-muted); font-size: .65rem; line-height: 1.3; }
.investor-card-open { width: 100%; min-height: 43px; margin-top: 14px; border-radius: 9px; border: 1px solid var(--border-subtle); background: transparent; color: var(--text-primary); font-family: inherit; font-weight: 700; cursor: pointer; }
.investor-card-open:hover, .investor-card-open:focus-visible { border-color: var(--investor-positive); color: var(--investor-positive); }

/* One shared dossier with four accessible levels of detail. */
.dossier-market-cap { margin-top: 9px; color: var(--text-secondary); font-size: .87rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.investor-dossier-tabs { position: sticky; top: 0; z-index: 15; display: flex; gap: 7px; overflow-x: auto; margin: 18px 0 0; padding: 9px; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-surface); box-shadow: 0 7px 22px rgba(15,23,42,.06); scrollbar-width: thin; }
.investor-dossier-tab { flex: 1 0 auto; min-height: 44px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; color: var(--text-secondary); background: transparent; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.investor-dossier-tab[aria-selected="true"] { color: var(--investor-positive); background: rgba(21,128,61,.1); border-color: rgba(21,128,61,.2); }
.investor-dossier-tab:hover { color: var(--text-primary); background: var(--bg-surface-elevated); }
.investor-dossier-tab:focus-visible, .investor-metric-explain:focus-visible { outline: 3px solid var(--investor-positive); outline-offset: 2px; }
.investor-company-summary, .investor-company-panel, .investor-company-advanced { margin: 20px 0 28px; }
.investor-company-summary[hidden], .investor-company-panel[hidden], .investor-company-advanced[hidden] { display: none !important; }
.investor-company-summary h2, .investor-company-advanced h2 { margin: 0 0 6px; color: var(--text-primary); font-size: 1.32rem; letter-spacing: -.02em; }
.investor-summary-source { margin: 0 0 17px; color: var(--text-secondary); font-size: .81rem; line-height: 1.55; }
.investor-summary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.investor-summary-group { border: 1px solid var(--border-subtle); background: var(--bg-surface); border-radius: var(--investor-radius); padding: 18px 20px; min-width: 0; }
.investor-summary-group h3 { margin: 0 0 11px; color: var(--text-primary); font-size: .98rem; }
.investor-summary-context { margin: -5px 0 10px; color: var(--text-muted); font-size: .72rem; line-height: 1.4; }
.investor-summary-values { margin: 0; }
.investor-summary-metric { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--border-subtle); }
.investor-summary-metric-label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.investor-summary-metric dt { color: var(--text-secondary); font-size: .81rem; }
.investor-summary-metric dd { margin: 0; color: var(--text-primary); font-size: .94rem; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.investor-summary-metric p { grid-column: 1 / -1; margin: 1px 0 0; color: var(--text-muted); font-size: .73rem; line-height: 1.45; }
.investor-metric-explain { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--border-subtle); border-radius: 50%; color: var(--text-secondary); background: var(--bg-surface-elevated); font-size: .72rem; font-weight: 800; cursor: pointer; }
.investor-company-advanced { border: 1px solid var(--border-subtle); border-radius: var(--investor-radius); background: var(--bg-surface); padding: 18px; }
.investor-company-advanced .dossier-bento-grid { margin-top: 15px; }
.screen-fresher .investor-company-advanced .dossier-bento-card:last-child { display: none; }
.screen-fresher .dossier-metrics-table .dossier-contract-row { display: none; }
.screen-fresher #stockDossierView .dossier-actions-group > :not(#btnDossierWatchlist) { display: none; }
.dossier-peers-note { margin: 0 0 8px; color: var(--text-secondary); font-size: .75rem; line-height: 1.45; }
.dossier-peer-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--border-subtle); background: transparent; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.dossier-peer-row strong { display: block; font-family: var(--font-mono); font-size: .84rem; }
.dossier-peer-row small { display: block; color: var(--text-secondary); font-size: .72rem; line-height: 1.35; }
.dossier-peer-row > span:last-child { flex: none; font-family: var(--font-mono); font-size: .82rem; }
.dossier-peer-row:hover, .dossier-peer-row:focus-visible { color: var(--investor-positive); }
.dossier-peer-row:focus-visible { outline: 3px solid var(--investor-positive); outline-offset: 2px; }

/* Focused investor filters; technical controls stay in Pro. */
.screen-fresher #screenAdvanced { display: none; }
.investor-filter-open { display: none; min-height: 36px; border: 1px solid var(--border-subtle); border-radius: 9px; background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: .78rem; font-weight: 700; padding: 7px 13px; cursor: pointer; }
.screen-fresher .investor-filter-open { display: inline-flex; align-items: center; justify-content: center; }
.investor-filter-open:hover { border-color: var(--investor-positive); color: var(--investor-positive); }
.investor-filter-dialog { width: min(94vw, 440px); max-height: min(88vh, 780px); overflow: auto; margin: auto; padding: 22px; border: 1px solid var(--border-subtle); border-radius: 18px; background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 25px 70px rgba(8,20,38,.22); }
.investor-filter-dialog::backdrop { background: rgba(11,20,35,.52); }
.investor-filter-dialog h2 { margin: 0; font-size: 1.3rem; }
.investor-filter-intro { margin: 8px 0 20px; color: var(--text-secondary); font-size: .82rem; line-height: 1.5; }
.investor-filter-fields { display: grid; gap: 16px; }
.investor-filter-field { display: grid; gap: 7px; color: var(--text-primary); font-size: .82rem; font-weight: 650; }
.investor-filter-field select { width: 100%; min-height: 44px; border: 1px solid var(--border-subtle); border-radius: 9px; background: var(--bg-surface-elevated); color: var(--text-primary); padding: 8px 10px; font: inherit; font-weight: 500; }
.investor-filter-actions { position: sticky; bottom: -22px; display: flex; gap: 8px; margin: 20px -22px -22px; padding: 14px 22px; border-top: 1px solid var(--border-subtle); background: var(--bg-surface); }
.investor-filter-actions button { min-height: 42px; border-radius: 9px; padding: 8px 12px; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 700; }
.investor-filter-reset, .investor-filter-cancel { border: 1px solid var(--border-subtle); background: transparent; color: var(--text-secondary); }
.investor-filter-apply { flex: 1; border: 1px solid var(--investor-positive); background: var(--investor-positive); color: #fff; }
.investor-data-coverage summary:focus-visible, .investor-metric-help summary:focus-visible, .investor-filter-open:focus-visible, .investor-filter-dialog button:focus-visible, .investor-filter-field select:focus-visible, .investor-card-star:focus-visible, .investor-card-open:focus-visible { outline: 3px solid var(--investor-positive); outline-offset: 2px; }

@media (max-width: 768px) {
    .dossier-hero-card { padding: 18px 16px; }
    .dossier-sym-group, .dossier-identity-row > div:last-child { flex-wrap: wrap; }
    .dossier-quote-grid, .dossier-spectrum-wrap { min-width: 0; }
    .dossier-price-block { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
    .dossier-cmp-val { flex-basis: 100%; font-size: clamp(1.55rem, 7vw, 2.1rem); overflow-wrap: anywhere; }
    .dossier-market-cap { margin-top: 0; }
    .dossier-spectrum-wrap > div:first-child { flex-wrap: wrap; gap: 4px 10px; }
    .investor-dossier-tabs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); overflow: visible; margin-top: 12px; padding: 6px; }
    .investor-dossier-tab { min-width: 0; white-space: normal; padding: 8px 9px; font-size: .77rem; }
    .investor-summary-grid { grid-template-columns: 1fr; gap: 10px; }
    .investor-summary-group { padding: 15px 16px; }
    .investor-company-summary { margin: 16px 0; }
}

@media (prefers-reduced-motion: reduce) {
    .screen-fresher .fresher-qs-btn, .investor-card-open { transition: none !important; }
}
