.nav-link.active {
    color: var(--accent);
}

.nav-link.active::after {
    width: 100%;
}

.stats-page {
    width: min(1020px, calc(100% - 40px));
    margin: 0 auto;
    padding: 58px 0 80px;
}

.stats-heading {
    margin-bottom: 34px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
}

.stats-eyebrow,
.stats-label {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.17em;
}

.stats-heading h1 {
    margin: 8px 0 7px;
    font-size: clamp(2.4rem, 6vw, 4.1rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.stats-heading p {
    margin: 0;
    font-size: 0.96rem;
}

.stats-live-row {
    box-sizing: border-box;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #0d0f13;
    color: var(--text-dim);
    font-size: 0.73rem;
    white-space: nowrap;
}

.stats-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--safe);
}

.stats-refresh {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #151922;
    color: #8eb8f5;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.stats-refresh:hover {
    border-color: #335b91;
    color: #b5d2fa;
}

.stats-refresh:disabled {
    cursor: wait;
    opacity: 0.55;
}

.stats-error {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid #6d3030;
    border-radius: 7px;
    background: #1b1113;
    color: #f0a6a6;
    text-align: center;
    font-size: 0.84rem;
}

.stats-dashboard {
    display: grid;
    gap: 16px;
}

.stats-dashboard[aria-busy="true"] {
    opacity: 0.7;
}

.stats-total-section,
.stats-family-section,
.stats-privacy {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0e1014;
}

.stats-total-section {
    padding: 32px 36px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
}

.stats-total {
    display: block;
    margin-top: 7px;
    color: #f3f4f6;
    font-size: clamp(3.8rem, 11vw, 6.8rem);
    line-height: 0.9;
    letter-spacing: -0.065em;
    font-variant-numeric: tabular-nums;
}

.stats-total-meta {
    padding-bottom: 4px;
    text-align: right;
}

.stats-total-meta p {
    margin: 0 0 8px;
}

.stats-total-meta span {
    color: #747d8b;
    font-size: 0.72rem;
}

.stats-family-section {
    padding: 30px 34px 34px;
}

.stats-section-heading {
    margin-bottom: 28px;
    padding-bottom: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    border-bottom: 1px solid var(--border);
}

.stats-section-heading h2 {
    margin: 7px 0 0;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    letter-spacing: -0.025em;
}

.stats-section-heading > p {
    max-width: 390px;
    margin: 0;
    text-align: right;
    font-size: 0.76rem;
    line-height: 1.55;
}

.stats-family-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 38px;
    align-items: center;
}

.stats-chart-column {
    display: grid;
    place-items: center;
    align-content: center;
}

.stats-family-chart-wrap {
    position: relative;
    width: min(100%, 260px);
    aspect-ratio: 1;
}

.stats-family-chart {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.stats-family-track,
.stats-family-segment {
    fill: none;
    stroke-width: 22;
}

.stats-family-track {
    stroke: #20242c;
}

.stats-family-segment {
    stroke-linecap: butt;
}

.stats-chart-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    pointer-events: none;
}

.stats-chart-center strong {
    color: #f3f4f6;
    font-size: 2.7rem;
    line-height: 1;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
}

.stats-chart-center span,
.stats-family-kinds {
    color: #747d8b;
    font-size: 0.72rem;
}

.stats-chart-center span {
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.stats-family-kinds {
    margin-top: 5px;
}

.stats-family-table {
    min-width: 0;
}

.stats-family-table-head,
.stats-family-row {
    display: grid;
    grid-template-columns: 34px 12px minmax(0, 1fr) 72px 74px;
    align-items: center;
    gap: 10px;
}

.stats-family-table-head {
    padding: 0 12px 10px 66px;
    grid-template-columns: minmax(0, 1fr) 74px;
    color: #747d8b;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stats-family-table-head span:last-child {
    text-align: right;
}

.stats-family-list {
    max-height: 390px;
    margin: 0;
    padding: 0;
    overflow: auto;
    border-top: 1px solid var(--border);
    list-style: none;
    scrollbar-color: #343a46 transparent;
    scrollbar-width: thin;
}

.stats-family-row {
    min-height: 50px;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
}

.stats-family-rank {
    color: #5f6876;
    font-family: monospace;
    font-size: 0.7rem;
}

.stats-family-marker {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stats-family-name {
    overflow: hidden;
    color: #d6dae1;
    font-size: 0.82rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-family-share {
    color: #747d8b;
    font-size: 0.7rem;
    text-align: right;
}

.stats-family-count {
    color: #f3f4f6;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.stats-family-empty {
    margin: 0;
    padding: 42px 18px;
    border: 1px dashed #303641;
    border-radius: 7px;
    text-align: center;
    font-size: 0.82rem;
}

.stats-history-note {
    margin: 0;
    color: #6f7784;
    font-size: 0.7rem;
    line-height: 1.5;
}

.stats-privacy {
    padding: 15px 18px;
    display: flex;
    gap: 7px;
    color: #747d8b;
    font-size: 0.72rem;
    line-height: 1.5;
}

.stats-privacy strong {
    color: #aab1bc;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .stats-page {
        width: min(100% - 28px, 1020px);
        padding-top: 36px;
    }

    .stats-heading,
    .stats-total-section,
    .stats-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-live-row {
        white-space: normal;
    }

    .stats-total-section {
        padding: 27px 24px;
    }

    .stats-total-meta,
    .stats-section-heading > p {
        text-align: left;
    }

    .stats-family-section {
        padding: 24px 20px 26px;
    }

    .stats-family-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .stats-family-chart-wrap {
        width: 230px;
    }
}

@media (max-width: 460px) {
    .stats-heading {
        gap: 22px;
    }

    .stats-live-row {
        width: 100%;
        justify-content: center;
    }

    .stats-family-table-head {
        padding-left: 46px;
    }

    .stats-family-row {
        grid-template-columns: 24px 9px minmax(0, 1fr) 54px 54px;
        gap: 8px;
        padding: 0 7px;
    }

    .stats-family-name {
        font-size: 0.75rem;
    }

    .stats-privacy {
        display: block;
    }

    .stats-privacy strong {
        margin-right: 4px;
    }
}
