/* Stats view (T14). Owned by the stats agent. */
.stats-page { font-family: var(--sans); }
.sp-hero { margin-block-start: 8px; }
.sp-top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.sp-big { font: 500 56px/1 var(--sans); letter-spacing: -.02em; font-variant-numeric: proportional-nums; }
.sp-of { font-size: 16px; opacity: var(--op-text); }
.sp-next { margin: 14px 0 0; font-size: var(--fs-body); opacity: var(--op-text); font-variant-numeric: tabular-nums; }
.sp-mbar { height: 4px; margin-block-start: 12px; border-radius: 2px; background: var(--track-off); overflow: hidden; }
.sp-mfill { display: block; height: 100%; min-width: 4px; border-radius: 2px; background: var(--accent); }
.sp-since { margin: 10px 0 0; font-size: var(--fs-small); opacity: var(--op-label); }
.sp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-block-start: 18px; font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.sp-li { display: inline-flex; align-items: center; gap: 6px; }
.sp-sep { opacity: var(--op-label); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.l { background: var(--accent); }
.dot.g { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.dot.n { background: var(--track-off); box-shadow: inset 0 0 0 1px rgba(113,61,28,.25); }

.sp-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 12px; margin-block-start: 40px; }
.sp-tile { text-align: start; min-width: 0; }
.sp-val { font: 500 26px/1.1 var(--sans); font-variant-numeric: proportional-nums; letter-spacing: -.01em; }
.sp-val small { font: 400 13px var(--sans); opacity: var(--op-text); letter-spacing: 0; }
.sp-lab { margin-block-start: 6px; font-size: var(--fs-label); line-height: 1.3; opacity: var(--op-label); }
.sp-note { margin-block-start: 4px; font-size: 11px; line-height: 1.3; opacity: var(--op-label); }

.sp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; opacity: 1; }
.sp-head > * { opacity: var(--op-label); }
.sp-total { font-variant-numeric: tabular-nums; }
.sp-empty { margin: 16px 0 0; font-size: var(--fs-small); opacity: var(--op-label); }

.sp-chart { display: flex; gap: 0; margin-block-start: 18px; }
.sp-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; cursor: default; outline-offset: 1px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.sp-col:hover, .sp-col:focus-visible { background: rgba(113,61,28,.05); }
.sp-area { height: 136px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border-block-end: 1px solid color-mix(in srgb, var(--text) 15%, transparent); }
.sp-bar-c { position: relative; width: min(24px, 100%); min-height: 3px; background: var(--accent); border-radius: 4px 4px 0 0; }
.sp-v { position: absolute; inset-block-end: 100%; inset-inline: -8px; text-align: center; margin-block-end: 3px; font-size: 11px; line-height: 1; }
.sp-dl { padding-block: 6px 4px; text-align: center; font-size: 11px; line-height: 1.2; opacity: var(--op-label); white-space: nowrap; overflow: hidden; }
.sp-col.today .sp-dl { opacity: .75; font-family: var(--sans); font-weight: 600; }


/* Your path */
.sp-path { list-style: none; margin: 22px 0 0; padding: 0; display: flex; position: relative; }
.sp-path::before { content: ""; position: absolute; inset-inline: 10%; inset-block-start: 6px; height: 1px; background: color-mix(in srgb, var(--text) 18%, transparent); }
.sp-pi { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; font-variant-numeric: tabular-nums; }
.sp-pdot { width: 13px; height: 13px; border-radius: 50%; box-sizing: border-box; background: var(--bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 25%, transparent); }
.sp-pi.reached .sp-pdot { background: var(--accent); box-shadow: none; }
.sp-pi.next .sp-pdot { background: var(--bg); box-shadow: inset 0 0 0 2px var(--accent); }
.sp-pi.later .sp-pdot { background: var(--track-off); box-shadow: none; }
.sp-pn { margin-block-start: 10px; font: 500 16px/1.2 var(--sans); }
.sp-pi.later .sp-pn { opacity: var(--op-label); }
.sp-ps { margin-block-start: 3px; min-height: 1.3em; font-size: 11px; line-height: 1.3; opacity: var(--op-label); }
.sp-pi.next .sp-ps { opacity: var(--op-text); }

/* Growth chart */
.sp-grow { margin-block-start: 24px; }
.sp-plot { position: relative; height: 140px; border-radius: 4px; outline-offset: 4px; touch-action: pan-y; cursor: crosshair; border-block-end: 1px solid color-mix(in srgb, var(--text) 15%, transparent); }
.sp-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sp-wash { fill: var(--accent); fill-opacity: .1; }
.sp-line { stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sp-edot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--accent); }
.sp-end { position: absolute; inset-inline-end: 0; transform: translateY(-170%); font: 500 13px/1 var(--sans); font-variant-numeric: tabular-nums; }
.sp-cursor { position: absolute; inset-block: 0; width: 1px; margin-inline-start: -.5px; background: color-mix(in srgb, var(--text) 30%, transparent); pointer-events: none; }
.sp-tip { position: absolute; inset-block-start: -4px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; font-size: 12px; line-height: 1.2; background: var(--text); color: var(--bg); pointer-events: none; font-variant-numeric: tabular-nums; z-index: 2; }
.sp-cursor[hidden], .sp-tip[hidden] { display: none; }
.sp-axis { display: flex; justify-content: space-between; padding-block-start: 6px; font-size: 11px; opacity: var(--op-label); }
.sp-grow-one { display: flex; align-items: center; gap: 12px; height: 80px; border-block-end: 1px solid color-mix(in srgb, var(--text) 15%, transparent); margin-block-start: 24px; }
.sp-grow-one .sp-empty { margin: 0; }
.sp-one-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }

/* Achievements */
.sp-ach { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.sp-badge { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sp-badge[hidden] { display: none; }
.sp-bic { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.sp-badge.earned .sp-bic { background: var(--accent); color: #fff; }
.sp-badge.locked .sp-bic { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 22%, transparent); color: color-mix(in srgb, var(--text) 40%, transparent); }
.sp-btx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-bt { font-size: var(--fs-small); line-height: 1.25; }
.sp-bs { font-size: 11px; line-height: 1.25; opacity: var(--op-label); font-variant-numeric: tabular-nums; }
.sp-badge.locked .sp-bt { opacity: var(--op-text); }
.sp-more { margin-block-start: 18px; padding: 0; border: 0; background: none; font: inherit; font-size: var(--fs-small); color: var(--text); opacity: var(--op-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sp-more:hover { opacity: 1; }
.stats-page .sp-head { margin-block-start: 44px; }

@media (max-width: 600px) {
  .sp-tiles { grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
  .sp-big { font-size: 56px; }
  .sp-ach { grid-template-columns: 1fr; gap: 14px; }
  .sp-path::before { inset-inline: 10%; }
  .sp-dl { font-size: 9px; }
  .sp-col.today .sp-dl, .sp-col:nth-child(2) .sp-dl { font-size: 8px; letter-spacing: -.02em; }
}
