:root {
    color-scheme: light dark;
    --bg: #f4f6f9;
    --panel: #ffffff;
    --border: #e5e8ef;
    --fg: #1b2430;
    --muted: #66707e;
    --accent: #2f5bd0;
    --gold: #c6a257;
    --navy: #1b2c54;
    --up: #1f9d55;
    --down: #e5484d;
    --unknown: #9aa4b2;
    --icon-bg: #ffffff;
    --icon-ring: rgba(20, 30, 50, 0.10);
    --shadow: 0 1px 2px rgba(20, 30, 50, 0.06), 0 4px 16px rgba(20, 30, 50, 0.05);
    --radius: 14px;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d1117;
        --panel: #161b22;
        --border: #262c36;
        --fg: #e6edf3;
        --muted: #8b949e;
        --accent: #4d78e6;
        --icon-bg: #232a35;
        --icon-ring: rgba(255, 255, 255, 0.1);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.28);
    }
}
:root[data-theme="dark"] {
    --bg: #0d1117;
    --panel: #161b22;
    --border: #262c36;
    --fg: #e6edf3;
    --muted: #8b949e;
    --accent: #4d78e6;
    --icon-bg: #232a35;
    --icon-ring: rgba(255, 255, 255, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable both-edges; }
html, body { margin: 0; }
body {
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 76rem;
    margin: 0 auto;
    padding: 2.25rem 1.5rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: 0.9rem; }
.crest { width: 44px; height: 44px; border-radius: 10px; }
.brand-text h1 { font-size: 1.4rem; font-weight: 680; margin: 0; letter-spacing: -0.01em; }
.brand-text p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.9rem; }

.controls { display: flex; align-items: center; gap: 0.9rem; }
.theme {
    width: 38px; height: 38px;
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    color: var(--fg);
    box-shadow: var(--shadow);
}
.theme:hover { border-color: var(--accent); }

.stats { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.stats b { color: var(--fg); font-weight: 620; }
.stats .good b { color: var(--up); }
.stats .bad b { color: var(--down); }

.toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 76rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.toolbar input[type="search"], .toolbar select {
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--fg);
    font: inherit;
    box-shadow: var(--shadow);
}
.toolbar input[type="search"] { flex: 1; min-width: 200px; }
.toolbar input[type="search"]::placeholder { color: var(--muted); }
.toolbar input[type="search"]:focus, .toolbar select:focus { outline: none; border-color: var(--accent); }
.toolbar select {
    min-width: 140px;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2366707e' stroke-width='1.5'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 12px;
    cursor: pointer;
}
.count { color: var(--muted); font-size: 0.9rem; margin-left: auto; }

.content { max-width: 76rem; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }

.empty { color: var(--muted); padding: 3rem 0; text-align: center; }
.banner-error {
    padding: 1rem;
    background: color-mix(in srgb, var(--down) 15%, transparent);
    border: 1px solid var(--down);
    border-radius: var(--radius);
    color: var(--down);
    margin-bottom: 1.5rem;
}

.foot { max-width: 76rem; margin: 0 auto; padding: 0 1.5rem 3rem; color: var(--muted); font-size: 0.8rem; }
