/* Statistics uses one reading order on desktop, mobile and assistive technology. */
.stats-page .stats-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 24px;
}
.stats-page .stats-layout > .stats-card {
  grid-row: auto;
  grid-column: 1 / -1;
  order: 0;
  min-width: 0;
}
.stats-page .stats-layout > .stats-card--range { grid-column: auto; }
.stats-page .stats-filter-card { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-page .stats-control { min-width: 0; }
.stats-page .stats-control > span { padding-left: 0; }
.stats-page .stats-control--area { width: 190px; flex: 0 0 190px; }
.stats-page .stats-card__header { display: flex; align-items: start; gap: 16px; }
.stats-page .stats-card--snapshot .stats-card__header { display: none; }
.stats-page .stats-card__header p { margin-top: 6px; font-size: 13px; line-height: 1.5; }
.stats-page .stats-card--trend .stats-chart,
.stats-page .stats-card--activity .stats-chart { height: auto; min-height: 0; aspect-ratio: auto; }
.stats-page .stats-card--trend .stats-chart svg,
.stats-page .stats-card--activity .stats-chart svg { width: 100%; height: auto; min-height: 0; max-height: 400px; }
.stats-page .stats-chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.stats-page .stats-chart text { font-weight: 500; }
.stats-page .stats-legend { gap: 16px; margin-top: 12px; }
.stats-page .stats-legend__item { padding: 0; border: 0; background: none; font-size: 12px; }
.stats-page .stats-card--activity .stats-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-bottom: 20px; }
.stats-page .stats-card--activity .stats-kpi { padding: 0 0 12px; }
.stats-page .stats-range-row__title { white-space: normal; overflow-wrap: anywhere; }
.stats-page .stats-range-row__meta { font-size: 12px; }
.stats-page .stats-range-row__price { white-space: nowrap; }
.stats-page .stats-rank__fill { background: var(--accent); }
.stats-page .stats-data { border-top: 1px solid var(--line); margin-top: 20px; }
.stats-page .stats-data > summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.stats-page .stats-data > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stats-page .stats-data__scroll { max-height: 320px; overflow: auto; overscroll-behavior: contain; }
.stats-page .stats-data table,
.stats-page #stats-area-table table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.stats-page .stats-data th,
.stats-page .stats-data td,
.stats-page #stats-area-table th,
.stats-page #stats-area-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.stats-page .stats-data th:first-child,
.stats-page .stats-data td:first-child,
.stats-page #stats-area-table th:first-child,
.stats-page #stats-area-table td:first-child { padding-left: 0; text-align: left; }
.stats-page .stats-data thead th { position: sticky; top: 0; background: var(--bg-solid); color: var(--ink-soft); font-weight: 500; }
.stats-page .stats-data caption { text-align: left; padding: 8px 0; color: var(--ink-soft); }
.stats-page #stats-area-table button { min-height: 44px; }
.stats-page .stats-comparison-table { table-layout: fixed; }
.stats-page .stats-comparison-table th:first-child { width: 40%; }
.stats-page .stats-comparison-table th:last-child { width: 22%; }
.stats-page .stats-comparison-table button {
  display: block; width: 100%; padding: 8px 0; border: 0; border-radius: 4px;
  color: var(--ink); background: none; font: inherit; text-align: left;
  white-space: normal; overflow-wrap: anywhere; cursor: pointer;
}
.stats-page .stats-comparison-table button:hover { color: var(--accent); }
.stats-page .stats-comparison-table button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stats-page .stats-comparison-price { font-weight: 600; }
.stats-page .stats-comparison-bar { display: block; height: 3px; margin: 6px auto 0 0; background: var(--accent); }
@media (max-width: 720px) {
  .stats-page .stats-chart text { font-size: 18px; }
  .stats-page .stats-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .stats-page .stats-filter-card { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stats-page .stats-filter-card .stats-control { grid-column: auto; }
  .stats-page .stats-card__header { flex-wrap: wrap; }
  .stats-page .stats-control--area { width: 100%; flex-basis: 100%; }
  .stats-page .stats-card--snapshot { padding: 0; }
  .stats-page .stats-card--snapshot .stats-kpi { padding: 16px; }
  .stats-page .stats-card--snapshot .stats-kpi:nth-child(2n) { border-right: 0; }
  .stats-page .stats-card--snapshot .stats-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats-page .stats-card--snapshot .stats-kpi__value { font-size: clamp(17px, 5vw, 24px); overflow-wrap: anywhere; }
  .stats-page .stats-card--activity .stats-kpis { gap: 12px; }
  .stats-page .stats-card--activity .stats-kpi__value { font-size: 22px; }
  .stats-page .stats-card--activity .stats-kpi__top { font-size: 11px; overflow-wrap: anywhere; }
  .stats-page .stats-data table { min-width: 440px; }
  .stats-page #stats-area-table th,
  .stats-page #stats-area-table td { padding: 10px 4px; font-size: 12px; }
}
@media (max-width: 360px) {
  .stats-page .stats-filter-card .select-trigger { padding: 0 8px; gap: 4px; }
  .stats-page .stats-chart text { font-size: 21px; }
}
