:root {
    color-scheme: light dark;
    --bg: #f4f2ec;
    --surface: #fffdf8;
    --text: #191a18;
    --muted: #62645f;
    --line: #d9d8d1;
    --accent: #2c6755;
    --accent-soft: #d4ebdf;
    --danger: #9a342d;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}
a { color: inherit; }
.site-header, footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1180px;
    margin: auto;
    padding: 22px 24px;
}
.site-header nav { display: flex; gap: 22px; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.brand { font-weight: 760; letter-spacing: -.02em; text-decoration: none; }
main { max-width: 1180px; min-height: calc(100vh - 160px); margin: auto; padding: 48px 24px 72px; }
.hero { max-width: 780px; margin-bottom: 38px; }
.hero.narrow, .copy { max-width: 760px; }
h1 { margin: 4px 0 12px; font-size: clamp(2.3rem, 7vw, 5.5rem); line-height: .95; letter-spacing: -.055em; }
h2 { margin-top: 0; letter-spacing: -.025em; }
.hero p:not(.eyebrow), .copy p, .copy li { color: var(--muted); font-size: 1.05rem; }
.eyebrow { color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .16em; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs a, .pagination a, .button, button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 16px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.tabs a.active, .pagination a.active, button:not(.secondary):not(.danger), .button:not(.secondary) {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 15px 16px; border-bottom: 1px solid var(--line); text-align: right; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3) { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
.rank, .metric { font-size: 1.08rem; font-weight: 780; }
.metric { color: var(--accent); }
.badge { margin-left: 7px; border-radius: 999px; background: var(--accent-soft); color: #174c3d; padding: 3px 7px; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.method, .copy, .empty, .admin-login { margin-top: 48px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
footer { color: var(--muted); border-top: 1px solid var(--line); }
form label { display: grid; gap: 8px; color: var(--muted); }
input { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); padding: 8px 12px; font: inherit; }
.admin-login { max-width: 420px; margin: 80px auto; }
.admin-login form { display: grid; gap: 16px; }
.error { color: var(--danger); }
.admin-head, .actions, .inline-form { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-head h1 { font-size: clamp(2rem, 5vw, 4rem); }
.inline-form { border-top: 1px solid var(--line); padding: 12px 0; }
.inline-form span { flex: 1; }
.danger { background: var(--danger); border-color: var(--danger); color: white; }
.graph { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 18px; }
.graph svg { display: block; width: 100%; height: auto; }
.graph polyline { fill: none; stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.stats-grid div { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stats-grid span, dt { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.stats-grid strong { display: block; margin-top: 5px; font-size: 1.4rem; }
dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; }
dd { margin: 0; word-break: break-word; }

@media (max-width: 700px) {
    main { padding-top: 28px; }
    .site-header nav { gap: 10px; font-size: .9rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .admin-head, .actions, .inline-form { align-items: stretch; flex-direction: column; }
    dl { grid-template-columns: 1fr; }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121411;
        --surface: #1b1e1a;
        --text: #ecf0e9;
        --muted: #aeb5ac;
        --line: #353a34;
        --accent: #8bd1ba;
        --accent-soft: #28483e;
    }
    .badge { color: #c5f4e4; }
}

