body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
}

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

.stats-page header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.stats-page h1 { margin: 0; font-size: 36px; }

.stats-page button {
    min-height: 40px;
    padding: 10px 18px;
    border: 0;
    border-radius: 4px;
    background-color: var(--button-background-color);
    color: var(--button-text-color);
    cursor: pointer;
    font: inherit;
}

.stats-page button:hover { background-color: var(--button-hover-background-color); }
.stats-page button:focus-visible {
    outline: 2px solid var(--button-background-color);
    outline-offset: 2px;
}
.stats-page button:disabled { cursor: not-allowed; opacity: 0.7; }

.stats-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    max-width: 1040px;
}

.stats-page .stat-item {
    display: grid;
    gap: 8px;
    border: 1px solid var(--input-border-color);
    border-radius: 8px;
    padding: 18px;
    background: var(--input-background-color);
}

.stats-page .stat-item span { font-size: 13px; color: var(--text-sub-color); }
.stats-page .stat-item strong { font-size: 28px; color: var(--input-text-color); }
.stats-page .recent-section { margin-top: 28px; max-width: 860px; }
.stats-page .recent-section h2 { margin: 0 0 12px; font-size: 20px; }
.stats-page .recent-section h3 { margin: 28px 0 12px; font-size: 17px; }

.stats-page .table-wrap {
    overflow-x: auto;
    border: 1px solid var(--input-border-color);
    border-radius: 8px;
    background: var(--input-background-color);
}

.stats-page table { width: 100%; border-collapse: collapse; min-width: 560px; }
.stats-page th, .stats-page td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--input-border-color);
    text-align: left;
}

.stats-page th { font-size: 12px; color: var(--text-sub-color); font-weight: 600; }
.stats-page td { color: var(--input-text-color); }
.stats-page tr:last-child td { border-bottom: 0; }
.stats-page .domain-cell { font-weight: 600; overflow-wrap: anywhere; }
.stats-page .status { margin: 16px 0; }
.stats-page .status.error { color: #b3261e; }
.stats-explanation { color: var(--text-sub-color); font-size: 13px; }
.noscript-refresh { text-align: center; color: var(--text-sub-color); }

.app-footer {
    position: fixed;
    right: 24px;
    bottom: 14px;
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.app-footer a { color: var(--text-sub-color); text-decoration: none; }
.app-footer a:hover { color: var(--text-color); text-decoration: underline; }

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

@media (max-width: 560px) {
    .stats-page { width: min(100% - 28px, 1320px); padding: 28px 0 56px; }
    .stats-page header { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
    .stats-page h1 { font-size: 30px; }
    .stats-page button { width: 100%; }
    .stats-page .stats-grid { grid-template-columns: 1fr; }
    .stats-page .stat-item { padding: 14px; }
    .stats-page .stat-item strong { font-size: 24px; }
}
