/* Stats page: server airplay + this browser's listening log. */
.stats-page .bar { grid-template-columns: 44px 1fr auto; }
.range { width: auto; padding: 6px 28px 6px 10px; font-family: var(--font-mono); font-size: 12px; border-radius: 999px; }
.stats { position: relative; z-index: 1; width: min(100%, 720px); margin: 0 auto; padding: 8px 16px 60px; display: grid; gap: 22px; }
.stats h2 { font-size: 13px; font-family: var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; }
.stats h2 small { text-transform: none; letter-spacing: 0; font-family: var(--font-body); color: var(--faint); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat-grid div { background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 12px; display: grid; gap: 2px; }
.stat-grid b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat-grid span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat-grid div.is-accent b { color: var(--accent); }
@media (max-width: 480px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; height: 96px; align-items: end; }
.bars div { position: relative; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: 0.85; transition: height 0.4s ease; }
.bars div.is-now { background: #fff; }
.bars div::after { content: attr(data-label); position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px; font-family: var(--font-mono); font-size: 9px; color: var(--faint); white-space: nowrap; }
.bars.hours div:nth-child(n)::after { visibility: hidden; }
.bars.hours div:nth-child(6n+1)::after { visibility: visible; }
.bars-wrap { padding-bottom: 18px; }

.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.ranked li { display: grid; grid-template-columns: 28px 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); cursor: pointer; }
.ranked li:first-child { border-top: 0; }
.ranked li::before { counter-increment: rank; content: counter(rank); font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: right; }
.ranked li.no-art { grid-template-columns: 28px minmax(0, 1fr) auto; }
.ranked img { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; background: rgba(255, 255, 255, 0.05); }
.ranked .n { min-width: 0; }
.ranked .n strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranked .n small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranked .n .meter { display: block; height: 3px; margin-top: 5px; border-radius: 2px; background: var(--accent); opacity: 0.7; }
.ranked .d { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 599px) { .two { grid-template-columns: 1fr; } }
.foot-note { color: var(--faint); font-size: 12px; line-height: 1.5; }

/* Hour-of-week heat map */
.heatmap { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.heatmap .hh, .heatmap .dd { font-family: var(--font-mono); font-size: 9px; color: var(--faint); }
.heatmap .hh { text-align: left; white-space: nowrap; overflow: visible; }
.heatmap i { display: block; aspect-ratio: 1; min-height: 8px; border-radius: 2px; background: var(--accent); }
.heatmap i.is-now { outline: 1px solid #fff; outline-offset: -1px; }
