.stats-hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stats-hero--wide {
    grid-template-columns: repeat(4, 1fr);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 48px;
}

.stats-grid__card {
    padding: 16px 18px;
    border: 1px solid var(--line);
    background: var(--white);
}

.stats-grid__label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-tertiary);
    margin-bottom: 8px;
}

.stats-grid__value {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.stats-rank {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
}

.stats-rank__row {
    display: grid;
    grid-template-columns: 32px minmax(120px, 1fr) auto auto 72px;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
}

.stats-rank__row:first-child {
    border-top: none;
}

.stats-rank__num {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-tertiary);
    text-align: center;
}

.stats-rank__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-rank__name:hover {
    border-bottom: 1px solid var(--ink);
}

.stats-rank__meta {
    font-size: 12px;
    color: var(--ink-tertiary);
    white-space: nowrap;
}

.stats-rank__value {
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.stats-breakdown__name {
    text-decoration: none;
    color: var(--ink);
}

.stats-breakdown__name:hover {
    border-bottom: 1px solid var(--ink);
}

.stats-hero__card {
    padding: 24px 22px;
    border: 1px solid var(--line);
    background: var(--white);
}

.stats-hero__card--primary {
    border-color: var(--ink);
}

.stats-hero__label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-tertiary);
    margin-bottom: 10px;
}

.stats-hero__value {
    margin: 0;
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--ink);
}

.stats-hero__value--sm {
    font-size: 36px;
}

.stats-hero__value-sub {
    font-size: 20px;
    font-weight: 400;
    color: var(--ink-tertiary);
}

.stats-hero__sub {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--ink-tertiary);
}

.stats-section {
    margin-bottom: 48px;
}

.stats-section__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stats-section__head .stats-section__title {
    margin-bottom: 6px;
}

.stats-section__head .stats-section__desc {
    margin-bottom: 0;
}

.stats-range {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.stats-range__btn {
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink-secondary);
    cursor: pointer;
}

.stats-range__btn:hover {
    color: var(--ink);
}

.stats-range__btn.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--white);
}

.stats-section__title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.stats-section__desc {
    margin: 0 0 20px;
    font-size: 13px;
    color: var(--ink-tertiary);
}

.stats-chart-wrap {
    position: relative;
    height: 240px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--white);
}

.stats-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.stats-chart-wrap--tall {
    height: 300px;
    margin-bottom: 16px;
}

.hwc-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hwc-card {
    padding: 20px;
    border: 1px solid var(--line);
    background: var(--white);
}

.hwc-section-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.hwc-section-desc {
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--ink-tertiary);
}

.hwc-chart-wrap--overview {
    height: 260px;
    margin-bottom: 0;
}

.hwc-chart-wrap--hourly {
    margin-bottom: 12px;
}

.hwc-overview-table-host {
    margin-bottom: 0;
}

.hwc-panel {
    margin-top: 0;
}

.hwc-dow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.hwc-dow__btn {
    min-width: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.hwc-dow__btn:hover {
    color: var(--ink);
    border-color: var(--ink-muted, #ccc);
}

.hwc-dow__btn.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--white);
}

.hwc-meta {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--ink-tertiary);
    line-height: 1.5;
}

.hwc-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    background: var(--white);
}

.hwc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.hwc-table th,
.hwc-table td {
    padding: 8px 10px;
    border-top: 1px solid var(--line);
    text-align: right;
    white-space: nowrap;
}

.hwc-table thead th {
    border-top: none;
    font-weight: 600;
    color: var(--ink-secondary);
    background: var(--bg);
}

.hwc-table tbody th {
    text-align: left;
    font-weight: 500;
    color: var(--ink);
    background: var(--white);
    position: sticky;
    left: 0;
    z-index: 1;
}

.hwc-change--up {
    color: #0a7a3e;
    font-weight: 600;
}

.hwc-change--down {
    color: #b42318;
    font-weight: 600;
}

.hwc-row--clickable {
    cursor: pointer;
}

.hwc-row--clickable:hover th,
.hwc-row--clickable:hover td {
    background: var(--bg);
}

.hwc-row--active th,
.hwc-row--active td {
    background: var(--bg);
}

.hwc-row--active th {
    font-weight: 600;
    color: var(--ink);
}

.stats-breakdown {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
}

.stats-breakdown__row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) 72px;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}

.stats-breakdown__row:first-child {
    border-top: none;
}

.stats-breakdown__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-breakdown__bar-wrap {
    height: 6px;
    background: var(--line);
}

.stats-breakdown__bar {
    display: block;
    height: 100%;
    background: var(--ink);
}

.stats-breakdown__value {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--ink);
}

@media (max-width: 900px) {
    .stats-hero,
    .stats-hero--wide,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-rank__row {
        grid-template-columns: 28px 1fr 64px;
    }

    .stats-rank__meta {
        display: none;
    }
}

@media (max-width: 640px) {
    .stats-hero--wide,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-breakdown__row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stats-breakdown__value {
        text-align: left;
    }

    .stats-rank__row {
        grid-template-columns: 28px 1fr 56px;
    }
}
