/* Session Replay Viewer — charts. One look for the hand-drawn network trend (NetworkTrendChart) and the
   ApexCharts charts (ChartTheme.cs): series slots for identity, the reserved status hues for the error
   classes, a solid hairline grid, 2 px lines over a light wash, thin bars with a rounded data end.
   Palettes were validated for both card surfaces (#FFFFFF / #1A2540): series slots adjacent-pair,
   error classes all-pairs (CVD ΔE ≥ 10, normal-vision ΔE ≥ 16; the light 4xx amber is under 3:1 on white,
   so the legend, the tooltip and the Table view always name the classes). Loaded after viewer.css. */
.viz-root {
    --viz-s1: #2a78d6; --viz-s2: #eb6834; --viz-s3: #1baf7a;
    --viz-e5: #d03b3b; --viz-e4: #eda100; --viz-ec: #2a78d6;      /* 5xx critical · 4xx warning · client (no answer) */
    --viz-grid: #E9EDF4; --viz-base: var(--kt-border-strong); --viz-tick: var(--kt-muted); --viz-cross: var(--kt-ink);
}
html[data-theme="dark"] .viz-root {
    --viz-s1: #3987e5; --viz-s2: #d95926; --viz-s3: #199e70;
    --viz-e5: #d03b3b; --viz-e4: #c98500; --viz-ec: #3987e5;
    --viz-grid: #2A3654; --viz-base: var(--kt-border-strong);
}

/* Error-class keys (legend, tooltip, the Errors tile above the chart). */
.nt-key.e5, .nt-fill.e5 { background: var(--viz-e5); fill: var(--viz-e5); }
.nt-key.e4, .nt-fill.e4 { background: var(--viz-e4); fill: var(--viz-e4); }
.nt-key.ec, .nt-fill.ec { background: var(--viz-ec); fill: var(--viz-ec); }
.nt-key.none { background: transparent !important; }
.nt-key.band { width: 14px; height: 8px; border-radius: 2px; background: color-mix(in srgb, var(--viz-s1) 16%, transparent); }
.nt-split .nt-key.e5, .nt-split .nt-key.e4, .nt-split .nt-key.ec { margin-left: 0; }

/* Layout: air between the three panels; the keyboard focus ring sits on the whole chart. */
.nt-chart { outline: 0; border-radius: var(--kt-radius-md); }
.nt-chart:focus-visible { outline: 2px solid var(--kt-focus); outline-offset: 6px; }
.nt-geo { position: relative; }
.nt-geo.nt-narrow { display: none; }
.nt-chart .nt-panel-head { margin: 28px 0 6px; align-items: baseline; font-size: 12.5px; }
.nt-chart .nt-panel-head:first-child { margin-top: 4px; }
.nt-panel-title { font-weight: 600; font-size: 14px; }
.nt-facts b, .nt-card-facts b { color: var(--kt-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.nt-facts { color: var(--kt-muted); }
.nt-card-facts { font-weight: 400; font-size: 12px; color: var(--kt-muted); margin-left: 12px; white-space: nowrap; }

/* Marks. */
.nt-grid { stroke: var(--viz-grid); stroke-width: 1; stroke-dasharray: 3 4; }
.nt-grid.base { stroke-dasharray: none; }
.nt-grid.base { stroke: var(--viz-base); }
.nt-tick, .nt-end { font-size: 11px; }
.nt-tick.hot { fill: var(--kt-ink); font-weight: 600; }
.nt-line { stroke-width: 2; }
.nt-grad-a { stop-color: var(--viz-s1); stop-opacity: .22; }
.nt-grad-b { stop-color: var(--viz-s1); stop-opacity: .02; }
html[data-theme="dark"] .nt-grad-a { stop-opacity: .30; }
.nt-area { stroke: none; }
.nt-band { fill: var(--viz-s1); fill-opacity: .12; stroke: none; }
html[data-theme="dark"] .nt-band { fill-opacity: .18; }
.nt-dot { stroke: var(--kt-surface); stroke-width: 2; }
.nt-cross { stroke: var(--viz-cross); stroke-width: 1; opacity: .35; }
.nt-fill.hot { filter: brightness(1.08); }

/* One tooltip for the three panels: follows the hovered bucket, flips sides past the middle. */
.nt-tooltip { top: 34px; min-width: 190px; border-radius: var(--kt-radius-md); box-shadow: var(--kt-shadow-pop); padding: 10px 12px; }
.nt-tooltip.right { left: calc(56px + (100% - 106px) * var(--nt-x) / 100% + 14px); right: auto; }
.nt-tooltip.left { right: calc(50px + (100% - 106px) * (100% - var(--nt-x)) / 100% + 14px); left: auto; }
.nt-tt-row .nt-key { margin-left: 0; }
.nt-tooltip .nt-tt-row .nt-key.e5 { background: var(--viz-e5) !important; }
.nt-tooltip .nt-tt-row .nt-key.e4 { background: var(--viz-e4) !important; }
.nt-tooltip .nt-tt-row .nt-key.ec { background: var(--viz-ec) !important; }

/* Endpoint sparkline (Endpoints tab): calls in the first series slot, errors in the critical hue. */
.nt-spark-calls { fill: var(--viz-s1, #2a78d6); }
.nt-spark-errors { fill: var(--viz-e5, #d03b3b); }

/* Phones: the narrow geometry (readable labels at 1:1), legends wrap under the titles and the tooltip is a
   full-width strip above the chart, so nothing leaves the screen. */
@media (max-width: 699.98px) {
    .nt-geo.nt-wide { display: none; }
    .nt-geo.nt-narrow { display: block; }
    .nt-chart .nt-panel-head { flex-wrap: wrap; margin-top: 22px; }
    .nt-chart .nt-legend { margin-left: 0; flex-basis: 100%; flex-wrap: wrap; row-gap: 2px; }
    .nt-chart .nt-legend .nt-key:first-child { margin-left: 0; }
    /* The tooltip becomes a strip under the chart (it never covers a panel and never leaves the screen). */
    .nt-chart { display: flex; flex-direction: column; }
    .nt-tooltip, .nt-tooltip.left, .nt-tooltip.right {
        position: static; order: 2; box-sizing: border-box; width: 100%; min-width: 0; margin-top: 10px;
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px;
    }
    .nt-tooltip .nt-tt-when { grid-column: 1 / -1; }
    .nt-tooltip .nt-tt-row { white-space: normal; min-width: 0; }
    .nt-tooltip .nt-tt-row.sub { padding-left: 0; }
    .nt-card-facts { display: block; margin: 2px 0 0; white-space: normal; }
}

/* ApexCharts: tooltip and legend in the card language. */
.apexcharts-tooltip.apexcharts-theme-light, .apexcharts-tooltip.apexcharts-theme-dark {
    border: 1px solid var(--kt-border) !important; border-radius: var(--kt-radius-md) !important; box-shadow: var(--kt-shadow-pop) !important;
    background: var(--kt-surface) !important; color: var(--kt-ink) !important; font-family: "Poppins", sans-serif;
}
.apexcharts-tooltip .apexcharts-tooltip-title { background: transparent !important; border-bottom: 1px solid var(--kt-border) !important; font-weight: 600; font-size: 12px !important; color: var(--kt-ink); }
.apexcharts-tooltip .apexcharts-tooltip-text { font-size: 12px !important; color: var(--kt-muted); }
.apexcharts-tooltip .apexcharts-tooltip-text-y-value { color: var(--kt-ink); font-weight: 600; }
.apexcharts-xaxistooltip { display: none; }
.apexcharts-legend-text { color: var(--kt-ink) !important; }
