   STATS — Top Tracks / Top Artists / Dashboard / Library badges
   ============================================================= */
.meta-plays {
    color: var(--text-2);
}

.period-toolbar { padding: 8px 12px 0; }
.period-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.period-tabs::-webkit-scrollbar { display: none; }
.period-tab {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.period-tab.active {
    background: var(--accent);
    color: #06241f;
}

.rank-list {
    display: flex;
    flex-direction: column;
    /* #app-main already insets its bottom for the nav + mini-player, so this
       only needs a little breathing room — not the old 96px dead zone. */
    padding: 8px 0 24px;
}
.rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.rank-row:hover { background: var(--surface); }
.rank-num {
    width: 28px;
    text-align: right;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
}
.rank-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--surface-2);
    flex-shrink: 0;
}
.rank-thumb-text {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}
.rank-info { min-width: 0; flex: 1; }
.rank-title {
    font-size: 0.95rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rank-meta {
    font-size: 0.78rem;
    color: var(--text-3);
    margin-top: 2px;
}

/* Dashboard cards */
.dash-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px;
}
.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    text-align: center;
}
.dash-card-label {
    font-size: 0.72rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dash-card-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.dash-section {
    padding: 8px 14px 18px;
}
.dash-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-2);
    margin: 8px 0 10px;
}

/* Bar chart (top artists) */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bar-row {
    display: grid;
    grid-template-columns: 90px 1fr 36px;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}
.bar-label {
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bar-track {
    height: 10px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    border-radius: 999px;
    transition: width 0.3s var(--ease-out);
}
.bar-value {
    text-align: right;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

/* Heatmap */
.heatmap {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 8px;
}
.heatmap::-webkit-scrollbar { height: 4px; }
.heatmap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.hm-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}
.hm-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--surface-2);
}
.hm-l0 { background: var(--surface-2); }
.hm-l1 { background: rgba(20, 184, 166, 0.25); }
.hm-l2 { background: rgba(20, 184, 166, 0.5); }
.hm-l3 { background: rgba(20, 184, 166, 0.75); }
.hm-l4 { background: var(--accent); }
.hm-out { visibility: hidden; }

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--text-3);
}
.heatmap-legend .hm-cell { width: 10px; height: 10px; }
