/* Analytics-specific layouts; shared tokens and panel chrome live in styles.css. */
.analytics-figures, .analytics-bonus__summary { display: flex; flex-wrap: wrap; gap: 20px 48px; font-variant-numeric: tabular-nums; }
.analytics-figures div, .analytics-bonus__summary div { display: grid; gap: 6px; }
.analytics-figures strong, .analytics-bonus__summary strong { font-size: 26px; font-weight: 500; }
.analytics-figures span, .analytics-bonus__summary span { font-size: 11px; color: var(--ink-soft); max-width: 220px; }
.analytics-bonus .legend { padding: 14px 0 6px; }
/* One row per game. Columns: name · purchases/coverage · share-of-all bar · Up · Down · vs-all.
   Numbers are share of classified purchases; the bar is share of all, Unknown hatched. */
.analytics-bonus__rows { display: grid; gap: 6px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.analytics-bonus__row { display: grid; grid-template-columns: minmax(150px, 230px) 118px minmax(120px, 1fr) 62px 62px 68px; align-items: center; gap: 12px; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--line); }
.analytics-bonus__row.is-header { position: relative; padding-bottom: 8px; font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); border-bottom-color: var(--line-strong); }
.analytics-bonus__row.is-header span:nth-child(n+4) { text-align: right; }
.analytics-bonus__basis { position: absolute; right: 0; top: -12px; font-size: 9.5px; letter-spacing: 0; text-transform: none; color: var(--ink-faint); }
.analytics-bonus__row.is-baseline { background: var(--surface-sunk); border-radius: 4px; padding: 8px 6px; margin: 0 -6px; border-bottom: 0; font-weight: 500; }
.analytics-bonus__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.analytics-bonus__meta { color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.analytics-bonus__bar { display: flex; height: 14px; overflow: hidden; border-radius: 3px; background: var(--line); }
.analytics-bonus__bar i { display: block; height: 100%; }
.analytics-bonus__num { text-align: right; }
.analytics-bonus__delta { text-align: right; color: var(--ink-soft); font-size: 11px; }
.analytics-bonus__held { margin-top: 14px; }
@media (max-width: 760px) {
  .analytics-bonus__row { grid-template-columns: minmax(110px, 1fr) 1fr 56px 56px; }
  .analytics-bonus__meta, .analytics-bonus__delta, .analytics-bonus__row.is-header span:nth-child(2), .analytics-bonus__row.is-header span:nth-child(6) { display: none; }
}
.analytics-page { display: grid; gap: 24px; min-width: 0; }
.analytics-page > * { min-width: 0; }
.analytics-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.analytics-toolbar label { font-size: 13px; font-weight: 600; }
.analytics-toolbar select { max-width: 100%; min-width: 240px; padding: 10px 32px 10px 12px; font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
/* Footnotes read as commentary on the panel above them: a quiet block with
   its own padding, not a line of grey text hugging the table's last row. */
.analytics-note { font-size: 11.5px; line-height: 1.65; color: var(--ink-soft); margin: 18px 0 0; padding: 12px 16px; max-width: 92ch; background: var(--surface-sunk); border-left: 2px solid var(--line-strong); border-radius: 0 6px 6px 0; }
.analytics-note strong { color: var(--ink); font-weight: 500; }
.analytics-toolbar .analytics-note, .analytics-health-table .analytics-note { margin: 0; padding: 0; background: none; border: 0; max-width: none; }
.analytics-quality-note { margin: -12px 0 0; }
.analytics-overview { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
.analytics-overview > * { min-width: 0; }
.analytics-histogram { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 14px 0 0; }
.analytics-histogram__column { display: grid; grid-template-rows: 24px 155px 24px 20px; justify-items: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.analytics-histogram__column strong { color: var(--ink); font-size: 13px; }
.analytics-histogram__column small { color: var(--ink-faint); }
.analytics-histogram__track { width: 100%; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line-strong); margin-bottom: 6px; }
.analytics-histogram__track i { width: 100%; background: var(--series-4); border-radius: 3px 3px 0 0; }
.analytics-page .panel__head { flex-wrap: wrap; gap: 8px; }
.analytics-table-wrap { overflow-x: auto; }
.analytics-health-table, .analytics-depth-values { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.analytics-health-table { min-width: 760px; }
.analytics-health-table caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.analytics-health-table th, .analytics-health-table td { text-align: right; padding: 15px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.analytics-health-table th:first-child { text-align: left; padding-left: 0; max-width: 220px; }
.analytics-health-table thead th { font-size: 10px; color: var(--ink-soft); font-weight: 500; }
.analytics-health-table small { display: block; color: var(--ink-faint); font-size: 10px; margin-top: 5px; font-weight: 400; }
.analytics-health-table .analytics-note { font-size: 10px; font-weight: 400; margin: 3px 0 0; padding: 0; background: none; border: 0; }
.analytics-game-link { border: 0; padding: 0; background: none; text-align: left; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.analytics-page button:focus-visible, .analytics-page select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.analytics-load-range { height: 4px; position: relative; background: var(--surface-sunk); margin-top: 8px; width: 130px; margin-left: auto; }
.analytics-load-range i { position: absolute; height: 4px; background: var(--series-2); min-width: 2px; }
.analytics-load-range i::before { content: ''; position: absolute; height: 8px; width: 3px; top: -2px; left: 0; background: var(--series-1); }
.analytics-muted { color: var(--ink-faint); }
.analytics-depth { max-width: 100%; }
/* No max-height that the drawing can hit: `preserveAspectRatio` letterboxes
   when it does, centring the chart inside a full-width box — that was 373px of
   dead space either side of an 837px plot. The 925x230 viewBox is flat enough
   (4:1) that the natural height stays sensible at any panel width, and 925
   units keeps the render scale — and so every label size — where it was. */
.analytics-depth svg { display: block; width: 100%; max-height: 480px; overflow: visible; }
.analytics-depth-values { min-width: 580px; margin-top: 12px; }
/* Off the page, not out of the document: the depth numbers were the only way
   to read the curve without a pointer, and the tooltip needs one. */
.a11y-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; min-width: 0; }
.analytics-depth-values caption { text-align: left; font-size: 11px; color: var(--ink-soft); margin: 0 0 8px; }
.analytics-depth-values th, .analytics-depth-values td { padding: 9px; text-align: right; border-bottom: 1px solid var(--line); font-weight: 400; }
.analytics-depth-values th:first-child { text-align: left; padding-left: 0; }
.analytics-depth-values thead th { color: var(--ink-soft); font-size: 10px; }
.analytics-exits { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 14px; margin: 22px 0 0; }
.analytics-exits h3 { grid-column: 1 / -1; font-size: 12px; font-weight: 500; margin: 0; }
.analytics-exits > div { display: grid; gap: 7px; font-size: 11px; font-variant-numeric: tabular-nums; }
.analytics-exits span { color: var(--ink-soft); }
.analytics-exits i { height: 4px; background: linear-gradient(to right, var(--series-3) var(--share), var(--surface-sunk) var(--share)); }
.analytics-exits strong { font-weight: 500; }
@media (max-width: 1100px) { .analytics-overview { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .analytics-page { gap: 16px; }
  .analytics-toolbar select { width: 100%; min-width: 0; }
  .analytics-exits { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .analytics-histogram { gap: 7px; }
  .analytics-depth svg { min-width: 450px; }
  .analytics-depth { overflow-x: auto; }
}

/* Retention bands and the demographic rank tables. Both are ranked lists of
   counts, so they share the same inline share bar rather than inventing a
   second visual language for the same idea. */
.analytics-subhead { font-size: 12px; font-weight: 500; margin: 26px 0 0; }
.analytics-panel-body > .analytics-subhead:first-child, .panel__body > .analytics-subhead:first-child { margin-top: 4px; }
.analytics-dist { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; margin: 14px 0 0; }
.analytics-dist > div { display: grid; gap: 7px; font-size: 11px; font-variant-numeric: tabular-nums; }
.analytics-dist span { color: var(--ink-soft); }
.analytics-dist i { height: 4px; background: linear-gradient(to right, var(--series-1) var(--share), var(--surface-sunk) var(--share)); }
.analytics-dist strong { font-weight: 500; font-size: 14px; }
.analytics-dist small { color: var(--ink-faint); }
.analytics-demographics { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 20px; }
.analytics-demographics > * { min-width: 0; }
.analytics-rank-table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.analytics-rank-table th, .analytics-rank-table td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); font-weight: 400; }
.analytics-rank-table th:first-child { text-align: left; padding-left: 10px; max-width: 220px; font-weight: 500; }
.analytics-rank-table th:last-child, .analytics-rank-table td:last-child { padding-right: 10px; }
.analytics-rank-table thead th { font-size: 10px; color: var(--ink-soft); font-weight: 500; }
.analytics-rank-table tbody tr.is-other { color: var(--ink-soft); }
.analytics-rank-table small { display: block; color: var(--ink-faint); font-size: 10px; margin-top: 4px; }
.analytics-share { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.analytics-share i { flex: none; width: 56px; height: 4px; background: linear-gradient(to right, var(--series-1) var(--share), var(--surface-sunk) var(--share)); }
@media (max-width: 900px) { .analytics-demographics { grid-template-columns: 1fr; } }

/* Comparison chrome. The selection is a set of chips, each carrying its game's
   series colour, and that same colour identifies the game on every chart. */
.analytics-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.analytics-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; font: inherit; font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
.analytics-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-color, var(--ink-soft)); }
.analytics-chip b { color: var(--ink-soft); font-weight: 500; }
.analytics-chip:hover b { color: var(--ink); }
.analytics-chip.is-clear { color: var(--ink-soft); border-style: dashed; }
.analytics-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.analytics-game-link[aria-pressed="true"] { text-decoration-color: var(--chip-color, var(--accent)); text-decoration-thickness: 2px; }
.analytics-game-link[aria-pressed="true"]::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--chip-color, var(--accent)); }
.analytics-best { font-weight: 500; color: var(--accent); }
.analytics-compare__rows { display: grid; gap: 22px; }
.analytics-compare__row { display: grid; gap: 10px; font-variant-numeric: tabular-nums; }
.analytics-compare__label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.analytics-compare__label b { color: var(--ink-soft); font-size: 11px; font-weight: 400; }
.analytics-compare__values { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; font-size: 11px; }
.analytics-compare__values div { display: flex; gap: 6px; }
.analytics-compare__values dt { color: var(--ink-soft); }
.analytics-compare__values dd { margin: 0; }
.analytics-compare--nested { border: 0; padding: 0; margin: 26px 0 0; background: none; box-shadow: none; }
.analytics-grouped { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; padding: 8px 0 0; }
.analytics-grouped__column { display: grid; grid-template-rows: 150px auto; gap: 8px; justify-items: center; }
.analytics-grouped__bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; height: 100%; border-bottom: 1px solid var(--line-strong); }
.analytics-grouped__bars i { flex: 1 1 0; max-width: 22px; min-height: 1px; border-radius: 3px 3px 0 0; }
.analytics-grouped__column span { font-size: 11px; color: var(--ink-soft); text-align: center; }
/* Short percentage columns, so this needs far less room than the session-depth
   table it borrows its styling from. */
.analytics-compare__table { min-width: 380px; margin-top: 18px; }
.split-grid.is-comparing { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
@media (max-width: 900px) {
  .split-grid.is-comparing { grid-template-columns: 1fr; }
  .analytics-grouped { gap: 8px; }
}

/* Operator benchmarking. The gap column is the point of the table, so it is
   the only place colour carries a judgement — and only where the metric has a
   direction at all. */
.analytics-operator-picker { margin-left: auto; max-width: 100%; min-width: 260px; padding: 8px 30px 8px 10px; font: inherit; font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.analytics-benchmark .analytics-figures { padding: 8px 0 18px; }
.analytics-benchmark .analytics-table-wrap { margin-top: 8px; }
.analytics-benchmark-table { min-width: 720px; }
.analytics-benchmark-table td strong { font-weight: 500; font-size: 13px; }
.analytics-gap { font-weight: 500; }
.analytics-gap.is-good { color: var(--accent); }
.analytics-gap.is-bad { color: var(--negative); }
.analytics-benchmark__mix { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
.analytics-benchmark__mix .analytics-subhead { margin: 0 0 16px; }
.exits__sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: right; }
.exits__sort:hover, .exits__sort.is-active { color: var(--ink); }
.exits__sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Creative pot, founders' view. The matrix carries two values per cell — the
   money and the number of games behind it — because a person's total moving
   between halves usually means a game entered or left its window. */
.placeholder-list { margin: 12px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.9; color: var(--ink-soft); }
/* The game count sits beside the name, not under every amount — one line per
   row instead of two roughly halves the height of this table. */
.pot-matrix__toggle { display: flex; align-items: baseline; border: 0; padding: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; text-align: left; }
.pot-matrix__toggle::before { content: '▸'; display: inline-block; width: 16px; color: var(--ink-faint); transition: transform .15s ease; }
.pot-matrix__toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.pot-matrix__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pot-matrix__staff.is-open { background: var(--surface-sunk); }
.pot-matrix__game th:first-child { padding-left: 26px; font-weight: 400; font-size: 12px; color: var(--ink-soft); }
.pot-matrix__game td { color: var(--ink-soft); }
.pot-matrix__game b { font-size: 12px; font-weight: 400; }
/* The total row is the number that leaves this page, so it reads as a
   conclusion rather than as one more staff member. */
.pot-games { display: grid; gap: 0; }
.pot-games .analytics-note { margin-top: 14px; }

/* Platform mix — a zoomable partition. Widths are set as percentages inline;
   everything here is chrome, so no rule may set `width` on a band or label. */
.icicle { min-width: 0; }
.icicle__crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 22px; margin-bottom: 14px; }
.icicle__crumb { background: none; border: 1px solid var(--line); border-radius: 5px; padding: 2px 8px; font: inherit; font-size: 11px; color: var(--ink-soft); cursor: pointer; }
.icicle__crumb:hover { border-color: var(--line-strong); color: var(--ink); }
.icicle__crumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icicle__crumb.is-current { color: var(--ink); font-weight: 500; border-color: var(--line-strong); }
.icicle__crumb-sep { color: var(--ink-faint); font-size: 11px; }
.icicle__levels { position: relative; }
.icicle__level { position: relative; height: 26px; margin-bottom: 36px; }
.icicle__level:last-child { margin-bottom: 4px; }
.icicle__level-name { position: absolute; left: 0; top: -14px; font-size: 9.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); }
.icicle__band { position: absolute; top: 0; height: 26px; min-width: 1px; padding: 0; border: 0; border-radius: 3px; cursor: pointer; transition: opacity 120ms ease; }
.icicle__band.is-dim { opacity: 0.26; }
.icicle__band:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icicle__label { position: absolute; top: 29px; font-size: 10.5px; line-height: 1.2; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.icicle__label b { color: var(--ink); font-weight: 500; }
.icicle__readout { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.icicle__pct { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; }
.icicle__path { font-size: 12px; color: var(--ink-soft); }
.icicle__sub { font-size: 11px; color: var(--ink-faint); }
.icicle__tip { position: absolute; z-index: 20; display: grid; gap: 2px; max-width: 280px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); font-size: 11px; line-height: 1.45; pointer-events: none; box-shadow: 0 6px 18px rgb(0 0 0 / 18%); }
.icicle__tip[hidden] { display: none; }
.icicle__tip b { font-weight: 500; }
.icicle__tip span { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.platform-stack { display: grid; gap: 24px; min-width: 0; }

/* Session-depth crosshair and tooltip. `.analytics-depth` is the positioning
   context; the hit rect is the whole plot because the marks are ~2px. */
.analytics-depth { position: relative; }
.depth-hit { cursor: crosshair; }
.depth-crosshair { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.depth-crosshair[hidden] { display: none; }
.depth-tip { position: absolute; z-index: 20; display: grid; gap: 3px; min-width: 190px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); font-size: 11px; line-height: 1.4; pointer-events: none; box-shadow: 0 6px 18px rgb(0 0 0 / 18%); }
.depth-tip[hidden] { display: none; }
.depth-tip b { font-weight: 500; }
.depth-tip__row { display: grid; grid-template-columns: 8px 1fr auto auto; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.depth-tip__row i { width: 8px; height: 8px; border-radius: 2px; }
.depth-tip__label { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.depth-tip__value { font-weight: 500; }
.depth-tip__count { color: var(--ink-faint); }

/* Exit signals. Bars are CSS percentages, so no layout measurement. */
.exits__bars { display: grid; gap: 7px; font-variant-numeric: tabular-nums; }
.exits__bar { display: grid; grid-template-columns: minmax(120px, 250px) 1fr 58px 54px 44px; align-items: center; gap: 12px; font-size: 12px; }
.exits__bar.is-context { color: var(--ink-soft); }
.exits__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exits__track { height: 12px; border-radius: 3px; background: var(--line); overflow: hidden; }
.exits__track i { display: block; height: 100%; background: var(--series-1); }
.exits__bar.is-context .exits__track i { background: var(--line-strong); }
.exits__value { text-align: right; font-weight: 500; }
.exits__count { text-align: right; color: var(--ink-soft); font-size: 11px; }
.exits__lift { text-align: right; color: var(--ink-faint); font-size: 11px; }
.exits__view { min-width: 0; }

/* Diverging cells. color-mix with transparent keeps the number fully opaque;
   where it is unsupported the cell simply has no tint and still reads. */
.exits__heat td { text-align: right; font-variant-numeric: tabular-nums; }
.exits__heat td.is-up { background: color-mix(in oklab, var(--series-3) calc(var(--w, 0) * 1%), transparent); }
.exits__heat td.is-down { background: color-mix(in oklab, var(--series-4) calc(var(--w, 0) * 1%), transparent); }
.exits__heat th[scope="col"] { font-size: 10.5px; line-height: 1.25; vertical-align: bottom; }
@media (max-width: 700px) {
  .exits__bar { grid-template-columns: minmax(90px, 1fr) 1fr 52px 44px; }
  .exits__lift { display: none; }
}
.exits__heat td.is-flat { color: var(--ink-faint); }

/* Donuts: fixed SVG beside an HTML legend, so no width measurement. */
.donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut__svg { flex: none; width: 200px; height: 200px; }
.donut__slice { transition: opacity 120ms ease; }
.donut__slice.is-dim { opacity: 0.3; }
.donut__gap { stroke: var(--surface); stroke-width: 2; }
.donut__total { font-size: 20px; font-weight: 500; fill: var(--ink); }
.donut__legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 200px; flex: 1; font-size: 12px; font-variant-numeric: tabular-nums; }
.donut__legend li { display: grid; grid-template-columns: 9px 1fr auto auto; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 4px; cursor: default; }
.donut__legend li.is-active { background: var(--surface-sunk); }
.donut__legend i { width: 9px; height: 9px; border-radius: 2px; }
.donut__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut__share { font-weight: 500; }
.donut__value { color: var(--ink-soft); font-size: 11px; }
.analytics-demographics { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }

.analytics-benchmark-table tr.is-section th { padding-top: 18px; padding-bottom: 6px; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; border-bottom-color: var(--line-strong); }
.analytics-benchmark-table tr.is-section:first-child th { padding-top: 6px; }

/* Ten ranked donut slots: five categorical hues, then the same five tinted
   toward the theme's own far end — white on light, ink on dark. Mixing toward
   the *surface* in dark mode would darken them instead, which drops them out
   of the usable lightness band and collapses adjacent-pair separation to 2.8
   ΔE under deuteranopia. Assigned in rank order and never cycled. */
.analytics-demographics {
  --slice-tint: #ffffff;
  --slice-1: var(--series-1);
  --slice-2: var(--series-2);
  --slice-3: var(--series-3);
  --slice-4: var(--series-4);
  --slice-5: var(--series-5);
  --slice-6: color-mix(in oklab, var(--series-1) 78%, var(--slice-tint));
  --slice-7: color-mix(in oklab, var(--series-2) 78%, var(--slice-tint));
  --slice-8: color-mix(in oklab, var(--series-3) 78%, var(--slice-tint));
  --slice-9: color-mix(in oklab, var(--series-4) 78%, var(--slice-tint));
  --slice-10: color-mix(in oklab, var(--series-5) 78%, var(--slice-tint));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .analytics-demographics { --slice-tint: var(--d-ink); }
}
:root[data-theme="dark"] .analytics-demographics { --slice-tint: var(--d-ink); }

/* ---- Live page ----------------------------------------------------------- */
.live-status { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--series-3, #2fa36b); box-shadow: 0 0 0 0 rgba(47,163,107,.5); animation: live-pulse 2s ease-out infinite; }
.live-dot.is-stale { background: var(--ink-faint); animation: none; box-shadow: none; }
.live-dot.is-error { background: var(--series-1, #d9534f); animation: none; box-shadow: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(47,163,107,.45); } 70% { box-shadow: 0 0 0 9px rgba(47,163,107,0); } 100% { box-shadow: 0 0 0 0 rgba(47,163,107,0); } }
.live-tiles .stat { position: relative; overflow: hidden; }
.live-tile-note { color: var(--ink-faint); font-size: 10.5px; }
.live-flash { animation: live-flash 1.1s ease-out; }
@keyframes live-flash { 0% { background-color: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background-color: transparent; } }
.live-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.live-grid > * { min-width: 0; }
.live-table { min-width: 0; }
.live-table th:first-child { max-width: none; }
.live-table tbody tr { transition: background-color .3s; }
/* A Stake row reads like any other game's: same ink, nothing struck through
   (Andy, 8 Sep). The source is in the note under the table. */
.live-table tbody tr.is-portal th { color: var(--ink); text-decoration: none; }
.live-portal-tag { display: block; margin-top: 3px; font-size: 10px; font-weight: 400; color: var(--ink-faint); }
.live-table tbody tr.is-pending td { color: var(--ink-faint); }
.live-mix { display: grid; gap: 18px; }
.live-mix--four { grid-template-columns: 1fr 1fr; }
.live-grid--three { grid-template-columns: 1fr 1.2fr 1fr; }
.live-figures { flex-direction: column; gap: 14px; }
.live-wins th[scope=row] { text-align: left; padding-left: 0; font-weight: 500; }
.live-mix h3 { margin: 0 0 8px; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; }
.live-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.live-list li { display: grid; grid-template-columns: minmax(80px, 140px) 1fr 40px; align-items: center; gap: 10px; }
.live-list li i { display: block; height: 8px; border-radius: 3px; background: var(--series-4); min-width: 2px; transition: width .6s ease; }
.live-list li b { text-align: right; font-weight: 500; }
.live-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12px; font-variant-numeric: tabular-nums; max-height: 520px; overflow: auto; }
.live-feed__row { display: grid; grid-template-columns: 76px minmax(120px, 1.2fr) minmax(140px, 1fr) minmax(80px, .8fr); gap: 12px; align-items: center; padding: 7px 8px; border-radius: 4px; border-bottom: 1px solid var(--line); }
.live-feed__row time { color: var(--ink-faint); }
.live-feed__game { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.live-feed__where { color: var(--ink-soft); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-feed__row.is-win .live-feed__detail { color: var(--series-3, #2fa36b); }
.live-feed__row.is-big-win { background: color-mix(in srgb, var(--series-3, #2fa36b) 10%, transparent); }
.live-feed__row.is-big-win .live-feed__detail { color: var(--series-3, #2fa36b); font-weight: 600; }
.live-feed__row.is-bonus-buy .live-feed__detail { color: var(--series-2); }
.live-feed__row.is-feature .live-feed__detail { color: var(--ink-soft); font-style: italic; }
.live-feed-note { margin-top: 10px; }
@media (max-width: 860px) { .live-grid, .live-grid--three, .live-mix--four { grid-template-columns: 1fr; } .live-feed__row { grid-template-columns: 64px 1fr 1fr; } .live-feed__where { display: none; } }
@media (prefers-reduced-motion: reduce) { .live-dot, .live-flash { animation: none; } }
.live-grid--wide { grid-template-columns: 2fr 1fr; }
.live-pulse { min-height: 240px; }
.live-pulse-chart { display: block; width: 100%; height: auto; overflow: visible; }
.live-pulse-grid { stroke: var(--line); }
.live-pulse-axis { font-size: 10px; fill: var(--ink-faint); }
.live-pulse-area { opacity: .12; }
.live-pulse-line { transition: none; animation: none; }
.live-pulse-hit { cursor: crosshair; }
.live-pulse-cursor { transition: opacity .12s; }
.live-grid--half { grid-template-columns: 1fr 1fr; }
.live-pulse-chart .live-pulse-tail { opacity: .55; }
.live-pulse-chart .live-pulse-value { font-size: 12px; font-weight: 600; }
.live-pulse-chart .live-pulse-glow { opacity: .35; transform-box: fill-box; transform-origin: center; animation: live-pulse-glow 1.4s ease-out infinite; }
.live-pulse-chart .live-pulse-point { animation: live-pulse-point 1.4s ease-in-out infinite; }
@keyframes live-pulse-glow { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes live-pulse-point { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (max-width: 860px) { .live-grid--wide, .live-grid--half { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .live-pulse-chart .live-pulse-glow, .live-pulse-chart .live-pulse-point { animation: none; } }
.live-charts-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: -10px; }
.live-charts-span { font-size: 11.5px; color: var(--ink-soft); }
.live-grain { margin-left: auto; }
@media (max-width: 620px) { .live-charts-head { justify-content: flex-start; } .live-grain { margin-left: 0; } }

/* ---- Live: first-load overlay -------------------------------------------- */
/* The page renders its empty shell underneath, so the blur has something to
   work on and the layout does not jump when the veil goes. */
.live-page { position: relative; }
.live-veil {
  position: absolute; inset: -8px; min-height: 480px; z-index: 5;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: clamp(80px, 20vh, 200px);
  background: color-mix(in srgb, var(--surface-sunk) 62%, transparent);
  backdrop-filter: blur(7px) saturate(115%);
  -webkit-backdrop-filter: blur(7px) saturate(115%);
  border-radius: var(--radius);
  transition: opacity .35s var(--ease);
}
/* No backdrop-filter (older Safari, Firefox with it disabled): fall back to an
   opaque panel rather than showing an unreadable half-transparent one. */
@supports not (backdrop-filter: blur(1px)) {
  .live-veil { background: color-mix(in srgb, var(--surface-sunk) 94%, transparent); }
}
.live-veil.is-gone { opacity: 0; pointer-events: none; }
.live-veil__card {
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 30px 40px; min-width: 260px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.live-veil__card strong { font-size: 15px; font-weight: 600; }
.live-veil__detail { font-size: 12px; color: var(--ink-soft); max-width: 30ch; line-height: 1.5; min-height: 1.5em; }
.live-veil__ring { position: relative; width: 48px; height: 48px; margin-bottom: 4px; }
.live-veil__ring svg { width: 48px; height: 48px; transform: rotate(-90deg); }
.live-veil__track { fill: none; stroke: var(--line); stroke-width: 3; }
.live-veil__sweep {
  fill: none; stroke: var(--series-1); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 30 90; transform-origin: 24px 24px;
  animation: live-veil-spin 1.1s linear infinite;
}
/* The same heartbeat as the live charts' marker, so the wait reads as the
   same thing the page is about to show. */
.live-veil__dot {
  position: absolute; inset: 0; margin: auto; width: 8px; height: 8px;
  border-radius: 50%; background: var(--series-1);
  animation: live-veil-beat 1.6s ease-in-out infinite;
}
.live-veil.is-error .live-veil__sweep { stroke: var(--series-5); animation: none; }
.live-veil.is-error .live-veil__dot { background: var(--series-5); animation: none; }
@keyframes live-veil-spin { to { transform: rotate(360deg); } }
@keyframes live-veil-beat { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .live-veil__sweep { animation: none; stroke-dasharray: 120 0; opacity: .5; }
  .live-veil__dot { animation: none; }
  .live-veil { transition: none; }
}

/* Stake Engine card on the Client Analytics pages */
.stake-card .panel__title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stake-tag { display: inline-block; padding: 2px 8px; font-size: 10px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-soft); border: 1px solid var(--line-strong); border-radius: 999px; }
.stake-card__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px 32px; align-items: start; }
.stake-card__grid > * { min-width: 0; }
@media (max-width: 1000px) { .stake-card__grid { grid-template-columns: 1fr; } }
