/* =========================================================
   CHART
========================================================= */

.chart-area {
    min-height: 270px;
    padding: 10px 16px 18px;
    position: relative;
}

.chart-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    margin-bottom: 8px;
}

.chart-filter {
    border: 1px solid var(--border);
    background: white;
    color: var(--text-2);
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
}

.chart-filter.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: #cfe6f9;
}

/* Height comes from each chart's own viewBox (core/charts.js sets width/
   height per chart type — 210 for a line chart, 190/150 for bar charts) —
   auto keeps the rendered box matching that instead of a hardcoded number
   that only happened to fit the line chart. */
.chart-svg {
    width: 100%;
    height: auto;
}

.chart-label {
    fill: var(--text-3);
    font-family: "Manrope", sans-serif;
    font-size: 9px;
}

.chart-grid {
    stroke: #edf1f5;
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Fill color + fill-opacity are set inline per series (core/charts.js) so
   each series gets its own soft wash under its line. */
.chart-area-fill {
    transition: fill-opacity var(--transition);
}

.chart-point {
    fill: white;
    stroke: var(--primary);
    stroke-width: 2;
}

/* Hover layer for the trend chart */
.chart-crosshair {
    stroke: var(--border-strong);
    stroke-width: 1;
    pointer-events: none;
}

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--text);
    color: var(--surface);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transform: translate(-50%, -130%);
    box-shadow: var(--shadow-md);
}

.chart-legend {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    padding: 0 16px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-2);
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
}

/* Sentiment donut */
.donut-ring circle {
    fill: none;
    stroke-width: 10;
}

.donut-segment {
    transition: stroke-dashoffset var(--transition);
}

.donut-center-label {
    font-family: "Manrope", sans-serif;
    fill: var(--text);
    font-weight: 800;
}

/* --- chart layer (core/charts.js) --- */

.chart-axis {
    fill: var(--text-3);
    font-family: "Manrope", sans-serif;
    font-size: 9px;
    font-weight: 600;
}

.chart-svg:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.chart-tip-head {
    font-size: 9px;
    color: var(--surface-soft);
    margin-bottom: 2px;
}

.chart-tip-row {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.chart-tip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: 0 0 auto;
}
