/* ================================================================
   stock-charts.css — Price chart, valuation gauge, peer chart, P/E gauge,
   analyst chart, earnings chart, mini charts, tooltips, crosshairs
   ================================================================ */

    /* ── Header chart (right side) ────────────────────────────── */
    .header-chart {
        background: rgba(9,9,11,0.6);
        border-left: 1px solid var(--border-subtle);
        padding: 16px 20px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        position: relative;
        justify-content: space-between;
    }
    .header-chart svg { flex: 1; min-height: 80px; display: block; width: 100%; height: 120px; }
    .header-chart-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .header-chart-price {
        font-family: var(--font-mono);
        font-size: 15px;
        font-weight: 600;
        color: var(--text);
    }
    .header-chart-target { font-family: var(--font-mono); font-size: 12px; }
    .header-chart-target .target-label { color: var(--muted); }
    .header-chart-target .target-val { color: var(--green); font-weight: 600; }
    .header-chart-stats {
        display: flex;
        gap: 20px;
        font-family: var(--font-mono);
        font-size: 12px;
    }
    .header-chart-stats .stat-period { color: var(--muted); margin-right: 4px; }
    .header-chart-stats .stat-positive { color: var(--green); font-weight: 600; }
    .header-chart-stats .stat-negative { color: var(--red); font-weight: 600; }

    /* ── Mini Chart (overview) ────────────────────────────────── */
    .mini-chart-wrap {
        background: var(--surface);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius);
        padding: 14px;
        position: relative;
    }
    .mini-chart-wrap svg { display: block; width: 100%; height: 160px; }
    .mini-chart-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }
    .mini-chart-title {
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--muted);
    }
    .mini-chart-price {
        font-family: var(--font-mono);
        font-size: 13px;
        font-weight: 600;
        color: var(--text);
    }
    .mini-chart-controls { display: flex; gap: 2px; }
    .mini-chart-controls button {
        font-family: var(--font-mono);
        font-size: 10px;
        padding: 3px 8px;
        border-radius: var(--radius-xs);
        border: 1px solid var(--border-subtle);
        background: transparent;
        color: var(--muted);
        cursor: pointer;
        transition: all 0.15s;
    }
    .mini-chart-controls button:hover { color: var(--text); background: var(--surface-elevated); }
    .mini-chart-controls button.active { color: var(--blue); background: var(--blue-dim); border-color: var(--blue-border); }
    .mini-chart-stats { display: flex; gap: 16px; margin-top: 10px; }
    .mini-chart-stat { font-family: var(--font-mono); font-size: 11px; }
    .mini-chart-stat .stat-label { color: var(--muted); }
    .mini-chart-stat .stat-val { font-weight: 600; }
    .mini-chart-stat .stat-val.positive { color: var(--green); }
    .mini-chart-stat .stat-val.negative { color: var(--red); }

    /* ── Price Chart ──────────────────────────────────────────── */
    .chart-section { position: relative; }
    .chart-controls { display: flex; gap: 4px; margin-bottom: 16px; }
    .chart-controls button {
        font-family: var(--font-mono);
        font-size: 12px;
        padding: 6px 14px;
        border-radius: var(--radius-pill);
        border: 1px solid var(--border);
        background: transparent;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.15s;
    }
    .chart-controls button:hover { background: var(--surface); color: var(--text); }
    .chart-controls button.active { background: var(--blue-dim); color: var(--blue); border-color: var(--blue-border); }
    .price-chart-container {
        position: relative;
        background: var(--surface);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius);
        padding: 16px;
        overflow: hidden;
    }
    .price-chart-container svg { display: block; width: 100%; height: 300px; }
    .chart-line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
    .chart-area { fill: url(#chartGradient); opacity: 0.4; }
    .chart-grid-line { stroke: rgba(255,255,255,0.04); stroke-width: 1; }
    .chart-axis-text { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); }
    .chart-crosshair { stroke: var(--text-secondary); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0; transition: opacity 0.1s; }
    .chart-crosshair.visible { opacity: 1; }
    .chart-dot { fill: var(--blue); stroke: var(--bg); stroke-width: 2; r: 4; opacity: 0; transition: opacity 0.1s; }
    .chart-dot.visible { opacity: 1; }
    .chart-minmax { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); }

    /* ── Chart Tooltip ────────────────────────────────────────── */
    .chart-tooltip {
        position: fixed;
        pointer-events: none;
        background: rgba(24, 24, 27, 0.95);
        border: 1px solid var(--border);
        border-radius: var(--radius-xs);
        padding: 8px 12px;
        font-family: var(--font-mono);
        font-size: 12px;
        color: var(--text);
        opacity: 0;
        transition: opacity 0.15s;
        z-index: 20;
        white-space: nowrap;
        backdrop-filter: blur(8px);
    }
    .chart-tooltip.visible { opacity: 1; }
    .chart-tooltip .tt-date { color: var(--muted); font-size: 11px; }
    .chart-tooltip .tt-price { font-weight: 600; font-size: 14px; margin-top: 2px; }

    /* ── Snowflake Tooltip ────────────────────────────────────── */
    .sf-tooltip {
        position: fixed;
        pointer-events: none;
        background: rgba(24, 24, 27, 0.95);
        border: 1px solid var(--border);
        border-radius: var(--radius-xs);
        padding: 6px 10px;
        font-family: var(--font-mono);
        font-size: 12px;
        color: var(--text);
        opacity: 0;
        transition: opacity 0.15s;
        z-index: 100;
        backdrop-filter: blur(8px);
    }
    .sf-tooltip.visible { opacity: 1; }

    /* ── Peer Comparison Chart ────────────────────────────────── */
    .peer-chart { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-subtle); }
    .peer-chart-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
    .peer-chart-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
    .peer-bars { position: relative; }
    .peer-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
    .peer-bar-wrap { flex: 1; height: 36px; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; position: relative; }
    .peer-bar-fill { height: 100%; border-radius: var(--radius-sm); display: flex; align-items: center; padding: 0 10px; gap: 8px; min-width: fit-content; }
    .peer-bar-fill.target { background: rgba(34,197,94,0.35); border: 1px solid var(--green); }
    .peer-bar-fill.peer { background: rgba(34,197,94,0.15); }
    .peer-bar-pe { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
    .peer-bar-name { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .peer-bar-eg { font-family: var(--font-mono); font-size: 11px; width: 65px; text-align: right; flex-shrink: 0; }
    .peer-avg-label { font-family: var(--font-mono); font-size: 11px; color: var(--amber); background: rgba(251,191,36,0.15); border: 1px solid var(--amber); padding: 2px 8px; border-radius: var(--radius-xs); position: absolute; z-index: 2; top: -24px; transform: translateX(-50%); white-space: nowrap; }
    .peer-avg-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--amber); z-index: 1; opacity: 0.6; }
    .peer-header-row { display: flex; justify-content: flex-end; margin-bottom: 4px; padding-right: 0; }
    .peer-header-label { font-size: 10px; color: var(--muted); width: 65px; text-align: right; }

    /* ── P/E Gauge (semicircle) ──────────────────────────────── */
    .pe-gauge-wrap { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-subtle); text-align: center; }
    .pe-gauge-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; text-align: left; }
    .pe-gauge-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; text-align: left; }
    .pe-gauge-svg { max-width: 380px; margin: 0 auto; }
    .pe-gauge-verdict { margin-top: 12px; display: flex; justify-content: center; gap: 24px; }
    .pe-gauge-verdict span { font-size: 13px; padding: 6px 16px; border-radius: var(--radius-sm); }
    .pe-gauge-verdict .current-pe { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); font-weight: 600; }
    .pe-gauge-verdict .fair-pe { background: rgba(251,191,36,0.15); color: var(--amber); border: 1px solid rgba(251,191,36,0.3); font-weight: 600; }

    /* ── Analyst Target Chart ────────────────────────────────── */
    .analyst-chart-wrap { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-subtle); }
    .analyst-chart-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
    .analyst-chart-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
    .analyst-info { display: flex; justify-content: flex-end; gap: 20px; margin-bottom: 12px; font-size: 12px; color: var(--text-secondary); }
    .analyst-info .val { font-family: var(--font-mono); font-weight: 600; }
    .analyst-info .green { color: var(--green); }
    .analyst-info .red { color: var(--red); }

    /* ── Earnings Forecast Chart ─────────────────────────────── */
    .earnings-chart-wrap { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-subtle); }
    .earnings-chart-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
    .earnings-chart-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
    .earnings-bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding: 0 4px; }
    .earnings-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; height: 100%; justify-content: flex-end; }
    .earnings-bar-pair { display: flex; gap: 3px; align-items: flex-end; }
    .earnings-bar { width: 20px; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
    .earnings-bar.estimate { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-bottom: none; }
    .earnings-bar.actual { background: var(--green); }
    .earnings-bar.actual.miss { background: var(--red); }
    .earnings-bar.forecast { background: rgba(168,85,247,0.3); border: 1px dashed rgba(168,85,247,0.5); border-bottom: none; }
    .earnings-bar-label { font-family: var(--font-mono); font-size: 9px; color: var(--muted); text-align: center; white-space: nowrap; }
    .earnings-bar-value { font-family: var(--font-mono); font-size: 10px; color: var(--text); text-align: center; white-space: nowrap; }
    .earnings-surprise { font-family: var(--font-mono); font-size: 9px; font-weight: 600; text-align: center; margin-top: 2px; }
    .earnings-surprise.beat { color: var(--green); }
    .earnings-surprise.miss { color: var(--red); }
    .earnings-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--muted); }
    .earnings-legend span { display: flex; align-items: center; gap: 5px; }
    .earnings-legend .dot { width: 10px; height: 10px; border-radius: 2px; }
    .earnings-growth-row { display: flex; gap: 16px; margin-top: 16px; }
    .earnings-growth-card { flex: 1; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 14px 16px; }
    .earnings-growth-card .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
    .earnings-growth-card .value { font-family: var(--font-mono); font-size: 20px; font-weight: 600; }

    /* ── Chart legend items ───────────────────────────────────── */
    .chart-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 11px; color: var(--muted); }
    .chart-legend-item { display: flex; align-items: center; gap: 4px; }
    .chart-legend-dot { width: 10px; height: 2px; display: inline-block; }

    /* ── Earnings growth card inline values ────────────────── */
    .eg-detail { font-family: var(--font-mono); font-size: 13px; color: var(--text); margin-top: 4px; }
    .eg-range { font-size: 11px; color: var(--muted); margin-top: 2px; }

    /* Responsive .stock-header-bar handled in stock-report.css */
