/* Stitch statistics performance: real local-first data, light + dark, no invented Elo. */
.statistics-page {
  --stats-navy:var(--app-accent-ink,var(--brand-violet));
  --stats-line:var(--line);
  --stats-muted:var(--text-secondary);
  --stats-panel:var(--surface);
}
:where(.statistics-page .statistics-hero){
  display:flex;align-items:center;justify-content:space-between;gap:22px;
  margin-top:22px;padding:24px 26px;
  background:var(--stats-panel);border:1px solid var(--stats-line);border-radius:14px;
  box-shadow:var(--shadow-soft);
}
:where(.statistics-page .statistics-hero>div:first-child){max-width:760px}
:where(.statistics-page .statistics-hero h1){font-size:clamp(1.9rem,3.5vw,3rem);line-height:1.1;letter-spacing:-.048em}
:where(.statistics-page .statistics-hero p){font-size:clamp(.82rem,1.1vw,.98rem)}
.statistics-page .statistics-local-badge {padding:5px 10px;font-size:.7rem}
.statistics-page .statistics-scope {margin-top:18px;border-left-width:3px}
.statistics-page .statistics-kpis {gap:16px;margin-top:23px}
.statistics-page .statistics-kpi {border-top:0;border-radius:9px;min-height:152px;position:relative;padding:20px}
.statistics-page .statistics-kpi::before {
  content:"";position:absolute;inset:0 0 auto;pointer-events:none;border-top:3px solid var(--brand-violet);border-radius:9px 9px 0 0
}
.statistics-page .statistics-kpi:nth-child(4n + 2)::before {border-color:var(--brand-aqua)}
.statistics-page .statistics-kpi:nth-child(4n + 3)::before {border-color:var(--brand-yellow)}
.statistics-page .statistics-kpi:nth-child(4n + 4)::before {border-color:var(--brand-coral)}
.statistics-page .statistics-kpi strong {font-variant-numeric:tabular-nums;font-weight:750}
.statistics-page .statistics-card {border-radius:11px;padding:clamp(18px,2vw,26px)}
.statistics-page .statistics-card-head {margin-bottom:16px;align-items:center}
.statistics-page .statistics-card-head h2 {font-size:clamp(1.05rem,1.75vw,1.4rem);font-weight:740;line-height:1.25}
.statistics-page .statistics-card .kicker {font-size:.65rem}
.stitch-stats-insights {display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:16px;margin-top:16px}
.stitch-stats-insights>article {min-width:0;min-height:385px;display:flex;flex-direction:column}
.stitch-stats-panel-code {
  display:inline-block;flex:none;background:var(--surface-soft);color:var(--text-subtle);
  padding:5px 7px;border-radius:4px;font:700 .64rem/1.2 ui-monospace,monospace;letter-spacing:.045em
}
.stitch-stats-card-description {margin:-4px 0 15px;max-width:690px;color:var(--stats-muted);font-size:.77rem;line-height:1.55}
.stitch-stats-radar {display:grid;place-items:center;flex:1;min-height:275px;max-width:100%;overflow:hidden}
.stitch-stats-radar svg {display:block;width:min(100%,500px);height:auto;max-height:320px;overflow:visible}
.stitch-stats-radar .stitch-radar-grid {fill:none;stroke:var(--stats-line);stroke-width:1}
.stitch-stats-radar .stitch-radar-axis {stroke:var(--line-strong);stroke-width:1}
.stitch-stats-radar .stitch-radar-data {fill:var(--brand-violet);fill-opacity:.16;stroke:var(--brand-violet);stroke-width:2.3}
.stitch-stats-radar .stitch-radar-point {fill:var(--brand-yellow);stroke:var(--brand-violet);stroke-width:1.5}
.stitch-stats-radar text {fill:var(--text-secondary);font:600 11px/1.1 system-ui,sans-serif}
.stitch-stats-radar-viz {display:grid;justify-items:center;width:100%;min-width:0;gap:6px}
.stitch-stats-radar-key {list-style:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 9px;margin:0;padding:0;width:100%}
.stitch-stats-radar-key li {display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;padding:7px 9px;border-radius:8px;background:var(--surface-soft);color:var(--text-secondary);font-size:.73rem;line-height:1.3}
.stitch-stats-radar-key li span {min-width:0;overflow-wrap:anywhere}
.stitch-stats-radar-key li strong {flex:none;color:var(--text);font-variant-numeric:tabular-nums}
@media(max-width:520px) {
  .stitch-stats-radar-key {grid-template-columns:minmax(0,1fr)}
}
.stitch-stats-footnote {margin:auto 0 0;border-top:1px solid var(--stats-line);padding-top:12px;color:var(--text-subtle);
  font-size:.68rem;line-height:1.5}
.stitch-stats-times {display:flex;flex-direction:column;flex:1;gap:14px;min-width:0}
.stitch-stats-time-row {padding:12px 14px;border:1px solid var(--stats-line);background:var(--surface-soft);border-radius:7px}
.stitch-stats-time-head {display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.stitch-stats-time-head strong {color:var(--text);font-weight:750;font-size:.79rem;overflow-wrap:anywhere}
.stitch-stats-time-head span {flex:none;font-size:.72rem;color:var(--stats-navy);font-variant-numeric:tabular-nums;font-weight:800}
.stitch-stats-time-track {height:9px;border-radius:20px;background:var(--line);overflow:hidden;position:relative}
.stitch-stats-time-track>span {display:block;height:100%;background:var(--brand-violet);border-radius:inherit}
.stitch-stats-time-row:nth-child(4n+2) .stitch-stats-time-track>span {background:var(--brand-aqua)}
.stitch-stats-time-row:nth-child(4n+3) .stitch-stats-time-track>span {background:var(--brand-yellow)}
.stitch-stats-time-row:nth-child(4n+4) .stitch-stats-time-track>span {background:var(--brand-coral)}
.stitch-stats-time-meta {display:flex;justify-content:space-between;flex-wrap:wrap;gap:7px;margin-top:7px;
  color:var(--text-subtle);font-size:.67rem}
.stitch-stats-empty {width:100%;min-height:180px;display:grid;place-items:center;text-align:center;
  padding:22px;border:1px dashed var(--stats-line);border-radius:8px;background:var(--surface-soft);
  color:var(--text-secondary);font-size:.8rem;line-height:1.5}
.stitch-stats-calendar-card {margin-top:16px}
.stitch-stats-calendar-card .statistics-card-head {flex-wrap:wrap}
.stitch-stats-calendar-summary {display:inline-flex;align-items:center;flex:none;padding:8px 12px;
  background:var(--surface-soft);border-radius:5px;color:var(--stats-navy);font-size:.71rem;font-weight:750;
  font-variant-numeric:tabular-nums}
.stitch-stats-heatmap {display:grid;grid-template-columns:26px minmax(0,1fr);gap:12px;max-width:100%;padding:16px 0;
  overflow-x:auto;scrollbar-width:thin}
.stitch-stats-weekday-labels {display:grid;grid-template-rows:repeat(7,minmax(0,1fr));gap:5px;align-items:center;
  color:var(--text-subtle);font:650 .65rem/1 system-ui,sans-serif}
.stitch-stats-weekday-labels span {height:16px;line-height:16px}
.stitch-stats-week-grid {display:grid;grid-template-columns:repeat(16,minmax(0,1fr));gap:5px;min-width:430px}
.stitch-stats-week {display:grid;grid-template-rows:repeat(7,16px);gap:5px}
.stitch-heatmap-day {display:block;height:16px;min-width:0;background:var(--surface-soft);border:1px solid var(--stats-line);
  border-radius:3px}
.stitch-heatmap-day[data-level="1"],.stitch-stats-calendar-legend [data-level="1"] {background:rgba(103,48,194,.22)}
.stitch-heatmap-day[data-level="2"],.stitch-stats-calendar-legend [data-level="2"] {background:var(--brand-violet)}
.stitch-heatmap-day[data-level="3"],.stitch-stats-calendar-legend [data-level="3"] {background:var(--brand-aqua)}
.stitch-heatmap-day[data-level="4"],.stitch-stats-calendar-legend [data-level="4"] {background:var(--brand-yellow)}
.stitch-heatmap-day[data-future="true"] {opacity:.18}
.stitch-stats-calendar-legend {display:flex;gap:5px;align-items:center;justify-content:flex-end;flex-wrap:wrap;
  color:var(--text-subtle);font-size:.65rem}
.stitch-stats-calendar-legend i {display:inline-block;width:12px;height:12px;border:1px solid var(--stats-line);border-radius:2px;
  background:var(--surface-soft)}
.statistics-page .statistics-grid {gap:16px;margin-top:16px}
.statistics-page .statistics-grid--primary {grid-template-columns: minmax(0,5fr) minmax(0,7fr)}
.statistics-page .statistics-history-row {border-radius:5px}
.statistics-page .statistics-data-note {padding:21px 24px;margin-top:16px;border:1px solid var(--stats-line);
  border-radius:9px;background:var(--surface);gap:18px}
@media(max-width:1000px) {
 .stitch-stats-insights {grid-template-columns:1fr}
 .stitch-stats-insights>article {min-height:300px}
 .stitch-stats-radar svg {max-height:300px}
}
@media(max-width:700px) {
 .statistics-page .statistics-hero {padding:18px;align-items:stretch;flex-direction:column}
 .statistics-page .statistics-hero-actions {justify-content:flex-start}
 .statistics-page .statistics-kpis {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .statistics-page .statistics-kpi {padding:14px;min-height:121px}
 .statistics-page .statistics-kpi strong {font-size:clamp(1.4rem,5vw,2rem)}
 .statistics-page .statistics-card {padding:16px}
 .stitch-stats-insights {gap:12px}
 .statistics-page .statistics-grid--primary {grid-template-columns:1fr}
 .stitch-stats-panel-code {font-size:.57rem}
 .stitch-stats-week-grid {min-width:360px}
 .stitch-stats-week {grid-template-rows:repeat(7,13px);gap:4px}
 .stitch-heatmap-day {height:13px}
 .stitch-stats-heatmap {gap:7px}
}
@media(prefers-reduced-motion:reduce) {
 .statistics-page .stitch-stats-radar *,
 .statistics-page .stitch-stats-times * {transition:none!important}
}


/* Navigation geometry belongs exclusively to puzzles-app-shell.css. */



/* Stitch keeps the filters compact; hidden selectors must stay truly hidden. */
.statistics-page .statistics-scope-selectors label[hidden] {display:none!important}
@media(min-width:1000px) {
  .statistics-page .statistics-hero {padding:18px 22px;gap:15px;min-height:140px}
  :where(.statistics-page .statistics-hero h1){font-size:clamp(2rem,3vw,2.8rem);margin:.08em 0 .12em}
  :where(.statistics-page .statistics-hero p){font-size:.83rem;line-height:1.5}
  .statistics-page .statistics-local-badge {margin-top:8px}
  .statistics-page .statistics-scope {
    display:grid;grid-template-columns:minmax(225px,.92fr) minmax(0,1.75fr);
    align-items:center;column-gap:20px;row-gap:5px;padding:14px 20px;
    margin-top:12px
  }
  .statistics-page .statistics-section-heading {
    grid-column:1;grid-row:1 / 3;align-items:flex-start;flex-direction:column;gap:5px
  }
  .statistics-page .statistics-section-heading h2 {font-size:1.18rem;line-height:1.2}
  .statistics-page .statistics-scope-badge {padding:4px 9px}
  .statistics-page .statistics-scope-tabs {
    grid-column:2;grid-row:1;justify-self:start;margin:0
  }
  .statistics-page .statistics-scope-selectors {
    grid-column:2;grid-row:2;margin:0
  }
  .statistics-page .statistics-scope-selectors:has(> label:not([hidden])) {margin-top:4px}
  .statistics-page .statistics-scope-selectors label {min-width:min(100%,260px)}
  .statistics-page .statistics-scope-selectors select {min-height:38px;border-radius:6px}
  .statistics-page .statistics-scope-copy {
    grid-column:1 / -1;margin:2px 0 0;font-size:.73rem
  }
  .statistics-page .statistics-kpis {margin-top:15px}
  .statistics-page .statistics-kpi {min-height:120px;padding:15px}
}
