:root {
    --site-font: Aptos, "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --bg: #f2eee7;
    --bg-accent: radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), rgba(242, 238, 231, 0.28) 38%), linear-gradient(180deg, #f6f2eb 0%, #ece6dc 100%);
    --card: rgba(255, 255, 255, 0.7);
    --card-strong: rgba(255, 255, 255, 0.88);
    --text: #17191f;
    --muted: #626774;
    --accent: #305cd8;
    --accent-strong: #2448ab;
    --accent-soft: rgba(48, 92, 216, 0.12);
    --border: rgba(26, 31, 44, 0.12);
    --success: #1f7a52;
    --shadow: 0 18px 48px rgba(20, 24, 32, 0.08);
}

:root[data-theme="dark"] {
    --bg: #0f1218;
    --bg-accent: radial-gradient(circle at top left, rgba(89, 124, 255, 0.2), rgba(15, 18, 24, 0) 34%), linear-gradient(180deg, #151a24 0%, #0c0f15 100%);
    --card: rgba(17, 22, 31, 0.82);
    --card-strong: rgba(20, 26, 36, 0.96);
    --text: #edf2fb;
    --muted: #9aa5ba;
    --accent: #8cabff;
    --accent-strong: #c0d2ff;
    --accent-soft: rgba(140, 171, 255, 0.16);
    --border: rgba(164, 174, 197, 0.18);
    --success: #5fd1a4;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #0f1218;
        --bg-accent: radial-gradient(circle at top left, rgba(89, 124, 255, 0.2), rgba(15, 18, 24, 0) 34%), linear-gradient(180deg, #151a24 0%, #0c0f15 100%);
        --card: rgba(17, 22, 31, 0.82);
        --card-strong: rgba(20, 26, 36, 0.96);
        --text: #edf2fb;
        --muted: #9aa5ba;
        --accent: #8cabff;
        --accent-strong: #c0d2ff;
        --accent-soft: rgba(140, 171, 255, 0.16);
        --border: rgba(164, 174, 197, 0.18);
        --success: #5fd1a4;
        --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    }
}

* { box-sizing: border-box; }
html {
    color-scheme: light dark;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    margin: 0;
    font-family: var(--site-font);
    background: var(--bg-accent), var(--bg);
    color: var(--text);
    min-height: 100vh;
}
.container { max-width: 1160px; margin: 0 auto; padding: 24px; }
.site-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.brand-link {
    text-decoration: none;
    color: inherit;
    -webkit-text-fill-color: currentColor;
}
.brand-link,
.brand-link:link,
.brand-link:visited,
.brand-link:hover,
.brand-link:active {
    color: inherit;
    text-decoration: none;
    text-decoration-color: transparent;
    -webkit-text-fill-color: currentColor;
}
.wordmark {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
    line-height: 0.92;
    letter-spacing: 0.02em;
    font-weight: 750;
}
.wordmark-dot {
    position: relative;
    display: inline-flex;
    width: 0.16em;
    height: 0.16em;
    margin-left: 0.11em;
    flex: 0 0 auto;
    transform: translateY(0.06em);
}
.wordmark-dot::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: var(--accent-strong);
}
.theme-panel {
    margin-left: auto;
}
.theme-panel summary {
    list-style: none;
}
.theme-panel summary::-webkit-details-marker {
    display: none;
}
.theme-summary {
    display: none;
}
.theme-label {
    display: inline;
}
.theme-panel > :not(summary) {
    display: block;
}
.theme-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 144px;
    margin-left: auto;
    align-items: flex-end;
    text-align: right;
}
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 18px;
    backdrop-filter: blur(18px);
}
.hero-shell { display: grid; gap: 24px; }
.hero-copy { display: grid; gap: 10px; max-width: 52rem; }
.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.hero-shell h1 {
    margin: 0;
    font-size: clamp(2.6rem, 7vw, 5.4rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
    font-weight: 700;
}
.subtitle {
    margin: 2px 0 0;
    font-size: 1.18rem;
    font-weight: 700;
    max-width: 40rem;
}
.explainer,
.helper-copy {
    margin: 0;
    max-width: 48rem;
    line-height: 1.58;
}
.explainer { color: var(--text); font-size: 1.03rem; }
.helper-copy { color: var(--muted); font-size: 0.96rem; }
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-top: 6px;
}
.total-votes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    color: var(--muted);
}
.hero-home-link,
.site-link,
.site-footer-nav a {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    -webkit-text-fill-color: currentColor;
}
.hero-home-link:hover,
.hero-home-link:focus-visible,
.site-link:hover,
.site-link:focus-visible,
.site-footer-nav a:hover,
.site-footer-nav a:focus-visible,
.brand-link:hover .wordmark,
.brand-link:focus-visible .wordmark {
    color: var(--accent);
}
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}
.controls-shell {
    display: block;
}
.controls-shell[open] {
    padding-bottom: 22px;
}
.controls-shell summary {
    list-style: none;
}
.controls-shell summary::-webkit-details-marker {
    display: none;
}
.controls-summary {
    display: none;
}
label {
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
input,
select {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-strong);
    color: var(--text);
    font: inherit;
}
input::placeholder { color: var(--muted); }
.leaderboard-wrap { overflow: hidden; }
.feedback { min-height: 20px; color: var(--success); margin-bottom: 6px; }
.leaderboard {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}
th {
    font-size: 0.79rem;
    color: var(--muted);
    text-align: left;
    padding: 0 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
td {
    padding: 14px 10px;
    background: var(--card-strong);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
tr td:first-child { border-left: 1px solid var(--border); border-radius: 14px 0 0 14px; }
tr td:last-child { border-right: 1px solid var(--border); border-radius: 0 14px 14px 0; }
.tool { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tool strong { display: inline-block; word-break: break-word; }
.logo,
.initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.logo { object-fit: cover; background: rgba(255, 255, 255, 0.35); }
.initials {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}
.badge-new {
    font-size: 0.68rem;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: 1px solid rgba(48, 92, 216, 0.16);
    border-radius: 999px;
    padding: 3px 8px;
    margin-left: 6px;
    vertical-align: middle;
}
.vote-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.vote-btn {
    border: 1px solid var(--border);
    background: var(--card-strong);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
}
.vote-btn:hover,
.vote-btn:focus-visible {
    border-color: var(--accent);
    outline: none;
}
.vote-btn.active.up { background: rgba(95, 209, 164, 0.14); border-color: rgba(95, 209, 164, 0.3); color: var(--success); }
.vote-btn.active.down { background: rgba(235, 87, 87, 0.12); border-color: rgba(235, 87, 87, 0.26); color: #c43d3d; }
.mobile-list { display: none; gap: 12px; flex-direction: column; }
.mobile-row {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: var(--card-strong);
}
.mobile-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.88rem;
    margin: 10px 0;
    flex-wrap: wrap;
}
.site-footer {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.site-footer-copy-block {
    display: grid;
    gap: 10px;
    max-width: 40rem;
}
.wordmark-footer {
    font-size: clamp(1.25rem, 2.3vw, 1.7rem);
}
.site-footer-brand {
    display: inline-flex;
    width: fit-content;
}
.site-footer-copy {
    margin: 0;
    max-width: 40rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.7;
}
.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.site-topbar a,
.site-footer a,
.site-topbar a:link,
.site-topbar a:visited,
.site-topbar a:hover,
.site-topbar a:active,
.site-footer a:link,
.site-footer a:visited,
.site-footer a:hover,
.site-footer a:active {
    color: inherit;
    text-decoration: none;
}
a[x-apple-data-detectors],
a[x-apple-data-detectors]:link,
a[x-apple-data-detectors]:visited,
a[x-apple-data-detectors]:hover,
a[x-apple-data-detectors]:active {
    color: inherit;
    text-decoration: none;
    font: inherit;
}
.brand-link[x-apple-data-detectors],
.brand-link[x-apple-data-detectors]:link,
.brand-link[x-apple-data-detectors]:visited,
.brand-link[x-apple-data-detectors]:hover,
.brand-link[x-apple-data-detectors]:active {
    color: inherit;
    text-decoration: none;
    -webkit-text-fill-color: currentColor;
}
@media (max-width: 820px) {
    .desktop-only { display: none; }
    .mobile-list { display: flex; }
}
@media (max-width: 640px) {
    .container { padding: 14px; }
    .card { padding: 18px; border-radius: 20px; }
    .site-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 16px;
    }
    .brand-link {
        align-self: flex-start;
    }
    .wordmark {
        font-size: clamp(1.45rem, 9vw, 1.9rem);
        letter-spacing: 0.04em;
    }
    .wordmark-footer {
        font-size: clamp(1.15rem, 6vw, 1.35rem);
    }
    .wordmark-dot {
        width: 0.16em;
        height: 0.16em;
        margin-left: 0.08em;
        transform: translateY(0.04em);
    }
    .theme-panel {
        width: 100%;
        margin-left: 0;
    }
    .theme-panel[open] {
        padding-bottom: 0;
    }
    .theme-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0;
        cursor: pointer;
        color: var(--muted);
        font-size: 0.82rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }
    .theme-summary::after {
        content: "+";
        color: var(--accent);
        font-size: 1.1rem;
        line-height: 1;
    }
    .theme-panel[open] .theme-summary::after {
        content: "\2212";
    }
    .theme-label {
        display: none;
    }
    .theme-control,
    .theme-control select { width: 100%; }
    .theme-control {
        align-items: flex-start;
        text-align: left;
        gap: 6px;
        margin-top: 8px;
    }
    .theme-panel:not([open]) .theme-control {
        display: none;
    }
    .hero-meta { flex-direction: column; align-items: flex-start; }
    .subtitle { font-size: 1.03rem; }
    .controls-shell {
        padding: 0;
        overflow: hidden;
    }
    .controls-shell[open] {
        padding-bottom: 18px;
    }
    .controls-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 16px 18px;
        cursor: pointer;
        font-size: 0.92rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--text);
    }
    .controls-summary::after {
        content: "+";
        color: var(--accent);
        font-size: 1.1rem;
        line-height: 1;
    }
    .controls-shell[open] .controls-summary::after {
        content: "\2212";
    }
    .controls {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 18px 18px;
    }
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }
    .site-footer-nav {
        width: 100%;
        gap: 10px;
    }
    .site-footer-nav a {
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--card-strong);
        font-size: 0.88rem;
    }
    .site-footer-copy {
        font-size: 0.88rem;
    }
}

