.stats-page {
    width: min(1180px, calc(100% - 28px));
    margin: 30px auto 72px;
}

.stats-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 28px;
    align-items: end;
    padding: 34px;
    border: 1px solid #dbe7f3;
    border-radius: 26px;
    background:
        radial-gradient(circle at 92% 5%, rgba(22,140,255,.18), transparent 32%),
        radial-gradient(circle at 58% 115%, rgba(34,197,94,.07), transparent 28%),
        linear-gradient(180deg, #fff, #f5faff);
    box-shadow: 0 20px 52px rgba(31,83,130,.08);
}

.stats-kicker,
.stats-section-kicker {
    color: #0b69c7;
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .13em;
}

.stats-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34,197,94,.11);
}

.stats-hero h1 {
    margin: 9px 0 0;
    font-size: clamp(3rem, 8vw, 5.8rem);
    line-height: .88;
    letter-spacing: -.075em;
}

.stats-hero h1 span {
    color: #168cff;
}

.stats-hero-copy > p {
    max-width: 760px;
    margin: 18px 0 0;
    color: #64748b;
    line-height: 1.65;
}

.stats-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 19px;
}

.stats-hero-chips > span {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid #dbe7f3;
    border-radius: 999px;
    background: rgba(255,255,255,.88);
    color: #64748b;
    font-size: .68rem;
    font-weight: 850;
}

.stats-hero-chips > span b {
    color: #0b69c7;
}

.stats-hero-chips > span i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
}

.stats-hero-chips > span.is-good {
    color: #178548;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.stats-hero-chips > span.is-good i {
    background: #22c55e;
}

.stats-hero-chips > span.is-bad {
    color: #b42318;
    border-color: #fecaca;
    background: #fff7f7;
}

.stats-hero-meta {
    overflow: hidden;
    border: 1px solid #cfe0ec;
    border-radius: 18px;
    background: rgba(255,255,255,.9);
}

.stats-hero-meta > div {
    padding: 13px 15px;
    border-bottom: 1px solid #edf2f7;
}

.stats-hero-meta span,
.stats-hero-meta strong {
    display: block;
}

.stats-hero-meta span {
    color: #8393a3;
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .07em;
}

.stats-hero-meta strong {
    margin-top: 4px;
    color: #334155;
    font-size: .78rem;
}

.stats-hero-meta small {
    display: block;
    padding: 12px 15px;
    color: #64748b;
    font-size: .68rem;
    line-height: 1.45;
}

.stats-live-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
    margin-top: 15px;
}

.stats-live-card {
    min-width: 0;
    padding: 17px;
    border: 1px solid #dbe7f3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(31,83,130,.045);
}

.stats-live-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.stats-live-card > header > span {
    color: #64748b;
    font-size: .64rem;
    font-weight: 950;
    letter-spacing: .08em;
}

.stats-live-card > strong {
    display: block;
    margin-top: 8px;
    color: #0d1b2a;
    font-size: 2.05rem;
    line-height: 1;
    letter-spacing: -.05em;
}

.stats-live-card > small {
    display: block;
    margin-top: 6px;
    color: #8090a1;
    font-size: .67rem;
}

.stats-live-card.is-highlight {
    border-color: #bfdbfe;
    background: linear-gradient(145deg, #eff6ff, #fff);
}

.stats-live-card.is-highlight > strong {
    color: #0b69c7;
}

.stats-live-card.is-network {
    border-color: #bae6fd;
    background:
        radial-gradient(circle at 100% 0, rgba(14,165,233,.10), transparent 42%),
        #fff;
}

.stats-live-card.is-network > strong {
    color: #0369a1;
}

.stats-trend {
    min-height: 23px;
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    border-radius: 999px;
    font-size: .6rem;
    font-style: normal;
    font-weight: 950;
    white-space: nowrap;
}

.stats-trend.is-up {
    background: #ecfdf3;
    color: #178548;
}

.stats-trend.is-down {
    background: #fff1f2;
    color: #be123c;
}

.stats-trend.is-flat {
    background: #f1f5f9;
    color: #64748b;
}

.stats-trend.is-blue {
    background: #eff6ff;
    color: #0b69c7;
}

.stats-runtime {
    margin-top: 15px;
    padding: 20px;
    border: 1px solid #dbe7f3;
    border-radius: 20px;
    background: linear-gradient(180deg, #fff, #fbfdff);
}

.stats-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
}

.stats-section-head.compact {
    align-items: center;
}

.stats-section-head h2 {
    margin: 4px 0 0;
    font-size: 1.7rem;
    letter-spacing: -.035em;
}

.stats-section-head p {
    max-width: 650px;
    margin: 7px 0 0;
    color: #64748b;
    font-size: .79rem;
    line-height: 1.55;
}

.stats-section-head > p {
    max-width: 520px;
    text-align: right;
}

.stats-runtime-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.stats-runtime-grid > div {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 9px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5edf5;
    border-radius: 13px;
    background: #f8fbff;
}

.stats-runtime-grid i {
    grid-row: 1 / 3;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #94a3b8;
}

.stats-runtime-grid span {
    color: #64748b;
    font-size: .66rem;
}

.stats-runtime-grid strong {
    font-size: .76rem;
}

.stats-runtime-grid .is-good {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.stats-runtime-grid .is-good i {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,.09);
}

.stats-runtime-grid .is-good strong {
    color: #178548;
}

.stats-runtime-grid .is-bad {
    border-color: #fecaca;
    background: #fff7f7;
}

.stats-runtime-grid .is-bad i {
    background: #e11d48;
}

.stats-runtime-grid .is-bad strong {
    color: #be123c;
}

.stats-insight-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-top: 15px;
}

.stats-insight-grid article {
    padding: 13px 14px;
    border: 1px solid #dbe7f3;
    border-radius: 14px;
    background: #fff;
}

.stats-insight-grid span,
.stats-insight-grid strong,
.stats-insight-grid small {
    display: block;
}

.stats-insight-grid span {
    color: #8090a1;
    font-size: .6rem;
    font-weight: 950;
    letter-spacing: .07em;
}

.stats-insight-grid strong {
    margin-top: 5px;
    color: #334155;
    font-size: 1.15rem;
}

.stats-insight-grid small {
    margin-top: 3px;
    color: #94a3b8;
    font-size: .62rem;
}

.stats-card {
    margin-top: 15px;
    padding: 22px;
    border: 1px solid #dbe7f3;
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(31,83,130,.05);
}

.stats-period-tabs {
    display: flex;
    gap: 6px;
}

.stats-period-tabs button {
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid #dbe7f3;
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    font: inherit;
    font-size: .71rem;
    font-weight: 900;
    cursor: pointer;
}

.stats-period-tabs button.is-active {
    border-color: #168cff;
    background: #168cff;
    color: #fff;
}

.stats-chart-wrap {
    position: relative;
    margin-top: 18px;
    padding: 10px;
    border: 1px solid #edf2f7;
    border-radius: 15px;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(226,232,240,.25) 0,
            rgba(226,232,240,.25) 1px,
            transparent 1px,
            transparent 54px
        ),
        linear-gradient(180deg, #fbfdff, #f7fbff);
}

.stats-chart-main {
    height: 320px;
}

.stats-chart-secondary {
    height: 255px;
}

#statsActivityChart,
#statsCommunityChart {
    width: 100%;
    height: 100%;
    display: block;
}

.stats-chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    color: #64748b;
}

.stats-chart-empty strong {
    color: #334155;
    font-size: 1.1rem;
}

.stats-chart-empty span {
    margin-top: 5px;
    font-size: .77rem;
}

.stats-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    color: #64748b;
    font-size: .7rem;
    font-weight: 800;
}

.stats-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stats-chart-legend i {
    width: 19px;
    height: 4px;
    border-radius: 999px;
    background: #168cff;
}

.stats-chart-legend .legend-cams {
    background: #94a3b8;
}

.stats-chart-legend .legend-regs {
    background: #22c55e;
}

.stats-chart-legend .legend-pm {
    background: #8b5cf6;
}

.stats-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stats-facts,
.stats-sync-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin-top: 16px;
}

.stats-facts > div,
.stats-sync-panel > div {
    padding: 13px;
    border: 1px solid #e5edf5;
    border-radius: 13px;
    background: #f8fbff;
}

.stats-facts span,
.stats-facts strong,
.stats-sync-panel span,
.stats-sync-panel strong {
    display: block;
}

.stats-facts span,
.stats-sync-panel span {
    color: #64748b;
    font-size: .68rem;
}

.stats-facts strong,
.stats-sync-panel strong {
    margin-top: 4px;
    font-size: 1.24rem;
}

.stats-sync-note {
    margin: 12px 0 0;
    color: #64748b;
    font-size: .7rem;
    line-height: 1.5;
}

.stats-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 10px;
    margin-top: 18px;
}

.stats-podium article {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border: 1px solid #dbe7f3;
    border-radius: 17px;
    background: #f8fbff;
}

.stats-podium article.rank-1 {
    border-color: #93c5fd;
    background:
        radial-gradient(circle at 100% 0, rgba(22,140,255,.13), transparent 38%),
        #eff6ff;
}

.stats-podium-rank {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff;
    color: #0b69c7;
    font-size: .66rem;
    font-weight: 950;
}

.stats-podium article > strong,
.stats-podium article > small {
    display: block;
}

.stats-podium article > strong {
    margin-top: 12px;
    color: #0b69c7;
    font-size: 1.35rem;
}

.stats-podium article > small {
    margin-top: 3px;
    color: #64748b;
}

.stats-podium article > div {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #dbe7f3;
    color: #64748b;
    font-size: .67rem;
}

.stats-podium article > div b {
    color: #334155;
}

.stats-channel-list {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.stats-channel-row {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) 68px 68px 68px 68px auto;
    gap: 9px;
    align-items: center;
    padding: 11px;
    border: 1px solid #e5edf5;
    border-radius: 13px;
    background: #fbfdff;
}

.stats-rank {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #eaf4ff;
    color: #0b69c7;
    font-weight: 950;
}

.stats-channel-copy {
    min-width: 0;
}

.stats-channel-copy strong,
.stats-channel-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-channel-copy strong {
    color: #0b69c7;
}

.stats-channel-copy span {
    margin-top: 2px;
    color: #64748b;
    font-size: .71rem;
}

.stats-channel-metric {
    text-align: center;
}

.stats-channel-metric strong,
.stats-channel-metric span {
    display: block;
}

.stats-channel-metric strong {
    font-size: .98rem;
}

.stats-channel-metric span {
    color: #64748b;
    font-size: .59rem;
}

.stats-channel-row > a {
    color: #0b69c7;
    font-size: .7rem;
    font-weight: 900;
}

.stats-channel-empty {
    padding: 25px;
    text-align: center;
    color: #64748b;
}

.stats-milestones {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.stats-milestones > div {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid #e5edf5;
    border-radius: 12px;
    background: #f8fbff;
}

.stats-milestones i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #168cff;
    box-shadow: 0 0 0 4px rgba(22,140,255,.08);
}

.stats-milestones span {
    color: #64748b;
    font-size: .7rem;
}

.stats-milestones strong {
    font-size: .74rem;
}

.stats-milestones .is-peak {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.stats-privacy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 15px;
    padding: 23px;
    border: 1px solid #bbf7d0;
    border-radius: 21px;
    background:
        radial-gradient(circle at 90% 0, rgba(34,197,94,.08), transparent 35%),
        #f0fdf4;
}

.stats-privacy > div:first-child > span {
    color: #178548;
    font-size: .65rem;
    font-weight: 950;
    letter-spacing: .1em;
}

.stats-privacy h2 {
    margin: 5px 0 0;
}

.stats-privacy p {
    max-width: 760px;
    margin: 7px 0 0;
    color: #547260;
    font-size: .79rem;
    line-height: 1.55;
}

.stats-privacy-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 1000px) {
    .stats-live-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .stats-insight-grid {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }

    .stats-runtime-grid {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }

    .stats-channel-row {
        grid-template-columns: 38px minmax(0,1fr) repeat(4,58px);
    }

    .stats-channel-row > a {
        grid-column: 2 / -1;
    }
}

@media (max-width: 760px) {
    .stats-page {
        width: min(100% - 20px, 1180px);
        margin-top: 18px;
    }

    .stats-hero {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .stats-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-runtime-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .stats-section-head,
    .stats-section-head.compact {
        align-items: stretch;
        flex-direction: column;
    }

    .stats-section-head > p {
        text-align: left;
    }

    .stats-period-tabs {
        width: 100%;
    }

    .stats-period-tabs button {
        flex: 1;
    }

    .stats-podium {
        grid-template-columns: 1fr;
    }

    .stats-privacy {
        align-items: stretch;
        flex-direction: column;
    }

    .stats-privacy-actions {
        width: 100%;
    }

    .stats-privacy-actions .btn {
        flex: 1;
    }
}

@media (max-width: 560px) {
    .stats-live-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .stats-live-card {
        padding: 13px;
    }

    .stats-live-card > header {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-live-card > strong {
        font-size: 1.7rem;
    }

    .stats-insight-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .stats-runtime {
        padding: 15px;
    }

    .stats-runtime-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stats-card {
        padding: 16px;
    }

    .stats-chart-main {
        height: 255px;
    }

    .stats-chart-secondary {
        height: 225px;
    }

    .stats-facts,
    .stats-sync-panel {
        grid-template-columns: 1fr 1fr;
    }

    .stats-channel-row {
        grid-template-columns: 34px minmax(0,1fr) 54px;
    }

    .stats-channel-metric:nth-of-type(n+3) {
        display: none;
    }

    .stats-channel-row > a {
        grid-column: 2 / -1;
    }
}

.stats-hero-chips > span:first-child b {
    color: inherit;
}
