.analytics-page { padding: var(--spacing-8) 0 var(--spacing-16); min-height: 80vh; }

/* Gate */
.analytics-gate {
    text-align: center;
    padding: 80px 24px;
    background: var(--color-dark-2);
    border: 1px solid rgba(168,85,247,0.2);
    border-radius: var(--radius-xl);
    max-width: 480px;
    margin: 60px auto;
}
.analytics-gate h2 { margin-bottom: 8px; }
.analytics-gate p  { color: var(--color-text-muted); }

/* Header */
.analytics-header { text-align: center; margin-bottom: var(--spacing-6); }
.analytics-header h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 8px; }
.analytics-header p  { color: var(--color-text-muted); }

/* Insight banner */
.analytics-insight-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(168,85,247,0.04));
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    margin-bottom: var(--spacing-6);
    font-weight: 600;
    font-size: 0.95rem;
}
.analytics-insight-icon { font-size: 1.4rem; }

/* Stats grid */
.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: var(--spacing-6);
}
@media (min-width: 600px) {
    .analytics-stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.analytics-stat {
    background: var(--color-dark-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.analytics-stat-icon  { font-size: 1.4rem; }
.analytics-stat-value {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--color-text);
    line-height: 1.1;
}
.analytics-stat-denom { font-size: 1rem; font-weight: 600; color: var(--color-text-muted); }
.analytics-stat-value.streak { color: #f97316; }
.analytics-stat-value.xp     { color: #a855f7; }
.analytics-stat-label { font-size: 0.7rem; color: var(--color-text-muted); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em; }

/* Section */
.analytics-section {
    background: var(--color-dark-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 22px 20px;
    margin-bottom: 14px;
}
.analytics-section-header { margin-bottom: 18px; }
.analytics-section-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}
.analytics-section-sub { font-size: 0.78rem; color: var(--color-text-muted); }

/* ── Training Rhythm chart ── */
.rhythm-chart { display: flex; flex-direction: column; gap: 10px; }
.rhythm-row   { display: grid; grid-template-columns: 36px 1fr 28px; align-items: center; gap: 10px; }
.rhythm-label { font-size: 0.72rem; font-weight: 700; color: var(--color-text-muted);
    text-transform: uppercase; letter-spacing: 0.04em; }
.rhythm-bar-wrap {
    height: 12px;
    background: var(--color-dark-3);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.rhythm-bar-fill {
    height: 100%;
    background: rgba(249,115,22,0.4);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}
.rhythm-bar-fill.is-max { background: linear-gradient(90deg, var(--color-primary), #ea580c); }
.rhythm-count { font-size: 0.75rem; font-weight: 700; color: var(--color-text-muted); text-align: right; }

/* ── Weekly Momentum chart (vertical bars) ── */
.momentum-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 100px;
    padding-bottom: 4px;
}
.momentum-col   { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.momentum-count-top { font-size: 0.7rem; font-weight: 700; color: var(--color-text-muted); }
.momentum-bar-wrap {
    width: 100%;
    flex: 1;
    background: var(--color-dark-3);
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    min-height: 6px;
}
.momentum-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, #a855f7, #7c3aed);
    border-radius: 6px 6px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
}
.momentum-label { font-size: 0.62rem; font-weight: 600; color: var(--color-text-muted);
    text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ── Program Phases ── */
.phases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    text-align: center;
}
.phase-card { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.phase-ring { width: 88px; height: 88px; }
.phase-name { font-size: 0.78rem; font-weight: 800; color: var(--color-text); text-transform: uppercase; letter-spacing: 0.05em; }
.phase-range { font-size: 0.7rem; color: var(--color-text-muted); }

/* ── Bottom two-column grid ── */
.analytics-bottom-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.analytics-bottom-grid .analytics-section { flex: 1; min-width: 220px; }

/* Session stats */
.session-stats-list { display: flex; flex-direction: column; gap: 10px; }
.session-stat-row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--color-dark-3);
    border-radius: var(--radius-md);
}
.session-stat-icon  { font-size: 1rem; }
.session-stat-label { font-size: 0.8rem; color: var(--color-text-muted); }
.session-stat-val   { font-size: 0.9rem; font-weight: 800; color: var(--color-text); }

/* Streak history */
.streak-history-list { display: flex; flex-direction: column; gap: 10px; }
.streak-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--color-dark-3);
    border-radius: var(--radius-md);
}
.streak-flame        { font-size: 1.2rem; }
.streak-history-info { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.streak-history-len  { font-size: 0.85rem; font-weight: 800; color: var(--color-text); }
.streak-history-date { font-size: 0.7rem; color: var(--color-text-muted); }
.streak-dots         { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.streak-dot {
    width: 7px; height: 7px; border-radius: 2px;
    background: linear-gradient(135deg, #f97316, #ea580c);
}
.streak-dot-more { font-size: 0.65rem; color: var(--color-text-muted); }
