/* charts — the Activity usage/ratings/reports line chart, clickable snippets */
  /* --- Chart frame (y-axis, plot area, x-axis) --- */

  .rc-chart {
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }

  .rc-yaxis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 24px;
    text-align: right;
    font-size: 0.7rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }

  .rc-main { flex: 1; min-width: 0; position: relative; }

  .rc-xaxis {
    position: relative;
    height: 22px;
    margin-top: 4px;
  }

  /* Mirrors .rc-hits cell-for-cell so labels stay centered under columns. */
  .rc-xaxis-usage {
    display: flex;
    justify-content: space-between;
    gap: 1px;
    height: 16px;
  }

  .rc-usage-tick {
    flex: 1 1 0;
    max-width: 14px;
    min-width: 0;
    text-align: center;
    font-size: 0.67rem;
    color: var(--muted);
    white-space: nowrap;
  }

  .rc-legend {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--muted-strong);
    flex-wrap: wrap;
  }

  /* Legend text and axis labels wear the text tokens; only the dot beside them
     carries the series identity. */
  .rc-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
    background: currentColor;
  }

  /* --- Series identity ---
     One class per series sets `color`, and the stroke, the marker, the legend dot
     and the tooltip swatch all inherit it through currentColor — so a series can
     never be one hue in the plot and another in the legend. */

  .rc-s-messages { color: var(--series-messages); }
  .rc-s-ratings  { color: var(--series-ratings); }
  .rc-s-reports  { color: var(--series-reports); }
  .rc-s-review   { color: var(--series-review); }

  /* --- Stacked bar plot (linear time) ---
     The plot is plain positioned HTML, not svg: with every mark a rectangle
     there is no path geometry left, and a stretched viewBox would only distort
     the rounded caps. .rc-plot is the positioning context every layer inside it
     shares. */

  .rc-plot { position: relative; }

  /* Gridlines: a dashed rule at the mid y-axis label, a solid one on the
     baseline. Under the bars, so a bar sits on the grid rather than behind it. */
  .rc-grid {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed var(--border);
    pointer-events: none;
  }

  .rc-grid-base { border-top-style: solid; }

  /* One cell per bucket, mirroring .rc-hits so a bar and its hover column are
     the same slice of the panel at every width and bucket count.

     The bar's own width is a fraction of its cell, CAPPED in px: the granularity
     picker swings the bucket count from 30 to 12, and a pure percentage would
     make the monthly view's bars two and a half times heavier than the daily
     one's for no reason in the data. The cap keeps the panel's texture the same
     whichever granularity is selected. */
  .rc-bars {
    --rc-bar-w: min(60%, 14px);
    position: absolute;
    inset: 0;
    display: flex;
    gap: 1px;
    pointer-events: none;
  }

  .rc-bar-cell {
    flex: 1 1 0;
    min-width: 0;
    /* column-reverse packs from the bottom, so segments emitted in RC_SERIES
       order stack upward in the legend's order with no index arithmetic. */
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
  }

  .rc-seg {
    flex: 0 0 auto;
    width: var(--rc-bar-w);
    background: currentColor;
    /* The separator is an INSET shadow, not a flex gap or a border: a gap would
       add pixels the value does not have, so a four-part stack would out-measure
       its own y-axis. Drawn inside the segment, the bar stays exactly as tall as
       its total. */
    box-shadow: inset 0 2px 0 var(--bg);
  }

  /* The one segment that owns the bar's top edge. Square, like every other edge
     in the plot — its only job is to drop the separator, which up there would
     eat into the top edge instead of dividing anything. */
  .rc-seg-cap { box-shadow: none; }

  /* The in-progress final bucket is dimmed so its partial count does not read as
     a real drop. The whole stack fades together — its segments are all equally
     incomplete. */
  .rc-bar-current { opacity: 0.45; }

  .rc-legend-dot-current {
    background: var(--text);
    opacity: 0.45;
  }

  .rc-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 5px;
    background: currentColor;
    vertical-align: middle;
  }

  /* Invisible hover columns over the plot; mirrors .rc-bars cell-for-cell, so
     the column that lights up is exactly the bar under the pointer. */
  .rc-hits {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 1px;
  }

  .rc-hit {
    flex: 1 1 0;
    min-width: 0;
    cursor: default;
  }

  .rc-hit:hover { background: rgba(148, 163, 184, 0.10); }

  /* Placed by rcTooltipLeft, which computes an exact left rather than centring
     on the column — see there for why a stacked bar leaves no vertical dodge. */
  .rc-tooltip {
    position: absolute;
    top: 6px;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.75rem;
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.12s ease;
    z-index: 3;
  }

  /* The bar's height is the total, so the tooltip names it — set apart from the
     four series rows it sums. */
  .rc-tooltip-total {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid var(--divider);
    color: var(--muted-strong);
    font-variant-numeric: tabular-nums;
  }

  .rc-tooltip.visible {
    opacity: 1;
  }

  .rc-tooltip strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-weight: 700;
  }

  .rc-tooltip > div { margin-bottom: 2px; }

  /* --- Clickable snippets --- */

  .clickable {
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.12s;
  }

  .clickable:hover { color: var(--accent); }
