/* ============================================================
   SiriInvest — Unified Light Theme Design System
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f8f9fb;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --accent-dark: #1d4ed8;
    --green: #16a34a;
    --green-bg: #dcfce7;
    --red: #dc2626;
    --red-bg: #fee2e2;
    --amber: #d97706;
    --amber-bg: #fef3c7;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.10);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --nav-height: 56px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Top Navigation
   ============================================================ */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    height: var(--nav-height);
}
.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}
.brand-icon { font-size: 22px; }
.brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}
.nav-links {
    display: flex;
    gap: 4px;
}
.nav-link {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}
.nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

/* Search in nav */
.nav-search {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}
.search-input {
    width: 200px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color 0.15s, width 0.2s;
}
.search-input:focus {
    border-color: var(--accent);
    width: 260px;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.search-input::placeholder { color: var(--text-muted); }
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    max-height: 320px;
    overflow-y: auto;
}
.search-item {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--accent-light); color: var(--accent); }

/* Mobile toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    gap: 4px;
    width: auto;
    box-shadow: none;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.2s;
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 24px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    padding: 20px 24px;
    margin-top: auto;
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}
.footer-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}
.footer-meta {
    font-size: 12px;
    color: var(--text-muted);
}
.footer-sep { margin: 0 6px; }

/* ============================================================
   Page Headers
   ============================================================ */
.page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.page-header .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================================
   Cards & Sections
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s;
}
.card:hover {
    box-shadow: var(--shadow);
}
.card .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.card .val {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.card .sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.card.accent-left-green { border-left: 3px solid var(--green); }
.card.accent-left-blue  { border-left: 3px solid var(--accent); }
.card.accent-left-red   { border-left: 3px solid var(--red); }
.card.accent-left-slate { border-left: 3px solid var(--text-muted); }

.section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.section h2 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.section p {
    margin: 0 0 10px;
    line-height: 1.65;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================================
   Grids
   ============================================================ */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }

/* ============================================================
   Key-Value Rows
   ============================================================ */
.kv {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13.5px;
    gap: 8px;
}
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-secondary); }
.kv .v { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }

/* ============================================================
   Utility Colors
   ============================================================ */
.upside-pos { color: var(--green) !important; }
.upside-neg { color: var(--red) !important; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ============================================================
   Badges
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.badge.green  { background: var(--green-bg); color: var(--green); border-color: transparent; }
.badge.amber  { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.badge.red    { background: var(--red-bg); color: var(--red); border-color: transparent; }
.badge.blue   { background: var(--accent-light); color: var(--accent); border-color: transparent; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    width: auto;
    box-shadow: none;
}
.btn:hover { background: var(--bg); border-color: var(--text-muted); text-decoration: none; }
.btn.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn.primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ============================================================
   Form Controls
   ============================================================ */
select, input[type="text"], input[type="number"] {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}
select:focus, input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ============================================================
   Score Pills (Screener)
   ============================================================ */
.score-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
    min-width: 50px;
    text-align: center;
}
.score-pill.s90 { background: var(--green-bg); color: var(--green); }
.score-pill.s75 { background: #d1fae5; color: #059669; }
.score-pill.s60 { background: var(--accent-light); color: var(--accent); }
.score-pill.s40 { background: var(--amber-bg); color: var(--amber); }
.score-pill.s0  { background: var(--red-bg); color: var(--red); }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap thead { background: var(--bg); position: sticky; top: 0; z-index: 1; }
.table-wrap th {
    text-align: left;
    padding: 12px 14px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table-wrap th:hover { color: var(--accent); }
.table-wrap th.sorted-asc::after { content: " \25B2"; color: var(--accent); }
.table-wrap th.sorted-desc::after { content: " \25BC"; color: var(--accent); }
.table-wrap td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light);
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}
.table-wrap tbody tr { cursor: pointer; transition: background 0.1s; }
.table-wrap tbody tr:hover { background: var(--bg); }
.table-wrap td.ticker { font-weight: 600; color: var(--text); }

/* ============================================================
   Loading / Error / Empty
   ============================================================ */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 15px;
}
.error-state {
    background: var(--red-bg);
    border: 1px solid #fecaca;
    color: var(--red);
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 500;
    margin-bottom: 16px;
}
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.empty-state h3 { color: var(--text); margin-bottom: 8px; }

/* ============================================================
   Metadata bar
   ============================================================ */
.metadata {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    padding: 14px 16px;
    margin-top: 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
}

/* ============================================================
   Chart containers
   ============================================================ */
.chart-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    min-height: 400px;
}

/* ============================================================
   Chart Controls (metric picker + time range)
   ============================================================ */
.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.chart-controls .control-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}
.metric-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.metric-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    width: auto;
    box-shadow: none;
}
.metric-toggle:hover { border-color: var(--accent); color: var(--accent); }
.metric-toggle.active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}
.metric-toggle input { display: none; }

.time-range-btns {
    display: flex;
    gap: 4px;
    margin-left: auto;
}
.time-range-btn {
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    width: auto;
    box-shadow: none;
}
.time-range-btn:hover { border-color: var(--accent); color: var(--accent); }
.time-range-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ============================================================
   Analysis Summary (sidebar-style on Charts page)
   ============================================================ */
.analysis-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}
.analysis-panel h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    text-align: center;
}
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.analysis-card {
    background: var(--bg);
    padding: 14px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.15s;
}
.analysis-card:hover { box-shadow: var(--shadow); }
.analysis-card .card-label {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}
.analysis-card .card-label { background: var(--accent-light); color: var(--accent); }
.analysis-card.target-base .card-label { background: var(--green-bg); color: var(--green); }
.analysis-card.target-bull .card-label { background: var(--accent-light); color: var(--accent); }
.analysis-card.target-bear .card-label { background: var(--red-bg); color: var(--red); }
.analysis-card.target-base { border-top: 3px solid var(--accent); }
.analysis-card.target-bull { border-top: 3px solid var(--green); }
.analysis-card.target-bear { border-top: 3px solid var(--red); }
.analysis-card h3 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.price-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text);
    margin: 6px 0;
}
.price-date { font-size: 12px; color: var(--text-muted); }
.upside { font-size: 13px; font-weight: 600; margin-top: 4px; }

.valuation-details {
    background: var(--bg);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border-light);
}
.valuation-item {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}
.valuation-item:last-child { border-bottom: none; }
.valuation-item .label { font-weight: 500; color: var(--text-secondary); }
.valuation-item .value { font-weight: 600; color: var(--accent); }

.sentiment-section {
    background: var(--bg);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border-light);
}
.sentiment-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}
.sentiment-text {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 13px;
}

.analysis-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    line-height: 1.6;
}

/* ============================================================
   Filter bar (Screener)
   ============================================================ */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    align-items: end;
    box-shadow: var(--shadow-sm);
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ============================================================
   Comparison grid
   ============================================================ */
.cmp-grid {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 18px;
}
.cmp-row { display: grid; background: var(--bg-card); }
.cmp-row.header-row { background: var(--bg); }
.cmp-row.header-row .cell {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 16px;
}
.cmp-row.group-header .cell {
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
}
.cell {
    padding: 10px 16px;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
    border-right: 1px solid var(--border-light);
}
.cell:last-child { border-right: none; }
.cell.label { color: var(--text-secondary); font-size: 13px; }
.cell.ticker-header {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    padding: 14px 16px;
}
.cell.ticker-header small {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    margin-top: 2px;
}

/* ============================================================
   Top 10 Recommendation Cards
   ============================================================ */
.rec-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 60px 1fr 220px 140px;
    gap: 20px;
    align-items: center;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}
.rec-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.rec-rank { font-size: 32px; font-weight: 700; color: var(--accent); text-align: center; }
.rec-rank.gold { color: #ca8a04; }
.rec-rank.silver { color: #94a3b8; }
.rec-rank.bronze { color: #ea580c; }
.rec-main h2 { margin: 0 0 6px; font-size: 20px; color: var(--text); }
.rec-thesis { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.rec-prices { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rec-prices .row { display: flex; justify-content: space-between; gap: 12px; }
.rec-prices .label { color: var(--text-muted); }
.rec-prices .val { color: var(--text); font-variant-numeric: tabular-nums; }
.rec-score { text-align: center; }
.rec-score .score-num { font-size: 36px; font-weight: 700; color: var(--green); line-height: 1; }
.rec-score .score-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}
.breakdown { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.breakdown .chip {
    background: var(--bg);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    border: 1px solid var(--border-light);
}
.breakdown .chip strong { color: var(--text); margin-left: 4px; }

/* ============================================================
   Weights panel (Top 10)
   ============================================================ */
.weights-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}
.weights-panel .w-item { display: inline-block; margin-right: 16px; }
.weights-panel .w-item strong { color: var(--text); }

/* ============================================================
   Earnings table
   ============================================================ */
.earnings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.earnings-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border);
}
.earnings-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border-light);
    font-variant-numeric: tabular-nums;
}
.earnings-table tr:last-child td { border-bottom: none; }
.earnings-table tr:hover td { background: var(--bg); }
.beat { color: var(--green); }
.miss { color: var(--red); }
.inline { color: var(--text-muted); }
.report-time {
    font-size: 10px;
    background: var(--bg);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================================
   Analyst ratings bar
   ============================================================ */
.ratings-bar { display: flex; gap: 0; border-radius: 6px; overflow: hidden; height: 10px; margin-top: 10px; }
.ratings-bar span { display: block; }
.r-sb { background: #166534; }
.r-b  { background: #4ade80; }
.r-h  { background: #94a3b8; }
.r-s  { background: #f87171; }
.r-ss { background: #7f1d1d; }
.ratings-legend { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); margin-top: 6px; flex-wrap: wrap; }
.ratings-legend span { display: flex; align-items: center; gap: 4px; }
.ratings-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* 52-week range */
.range-bar { position: relative; height: 6px; background: var(--border); border-radius: 3px; }
.range-dot {
    position: absolute; top: -3px; width: 12px; height: 12px;
    background: var(--accent); border-radius: 50%; transform: translateX(-50%);
    border: 2px solid var(--bg-card);
}

/* Mini ratings bar (compare) */
.mini-ratings { display: flex; gap: 0; border-radius: 4px; overflow: hidden; height: 8px; width: 100%; }

/* ============================================================
   Ticker input bar (Compare)
   ============================================================ */
.input-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}
.input-bar label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.ticker-inputs { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.ticker-input {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    width: 100px;
    outline: none;
    transition: border-color 0.15s;
}
.ticker-input:focus { border-color: var(--accent); }
.ticker-input::placeholder { color: var(--text-muted); font-weight: 400; text-transform: none; }

/* Legend (Compare chart) */
.legend { display: flex; gap: 16px; margin-bottom: 4px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; }

/* ============================================================
   Tabbed sections (Ticker Detail full analysis)
   ============================================================ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.tab-btn {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.15s;
    width: auto;
    box-shadow: none;
    border-radius: 0;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Web search sources */
.sources { display: flex; flex-direction: column; gap: 6px; }
.sources a {
    color: var(--accent);
    font-size: 13px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: border-color 0.15s;
    word-break: break-all;
    text-decoration: none;
}
.sources a:hover { border-color: var(--accent); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
    .grid4 { grid-template-columns: 1fr 1fr; }
    .grid3 { grid-template-columns: 1fr; }
    .grid2 { grid-template-columns: 1fr; }
    .rec-card { grid-template-columns: 1fr; }
    .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 8px; box-shadow: var(--shadow); }
    .nav-links.open { display: flex; }
    .nav-toggle { display: flex; }
    .nav-search { display: none; }
    .page-header h1 { font-size: 22px; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .main-content { padding: 20px 16px; }
}
@media (max-width: 600px) {
    .grid4 { grid-template-columns: 1fr; }
    .analysis-grid { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr; }
}
