:root {
    --bg: #f3efe6;
    --ink: #161513;
    --muted: #6d685f;
    --card: #fffcf7;
    --line: #e2dcd0;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1200px 500px at 10% -10%, #efe6d4 0%, transparent 50%),
        var(--bg);
    color: var(--ink);
    font-family: Outfit, system-ui, sans-serif;
}
header, main { max-width: 1040px; margin: 0 auto; padding: 28px 24px; }
.kicker {
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0 0 8px;
}
h1 {
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 400;
    line-height: 1.05;
    margin: 0 0 10px;
}
.hint { color: var(--muted); margin: 0 0 22px; }
.crumb, .nations { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.crumb a, .nations a, .crumb span {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
}
.crumb a:hover, .nations a:hover { border-bottom-color: var(--ink); }
.nations a.on { border-bottom-color: var(--ink); font-weight: 600; }
.stage {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 28px 24px 18px;
}
.country-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.country-card h2 {
    font-family: "Instrument Serif", Georgia, serif;
    font-size: 1.8rem;
    font-weight: 400;
    margin: 0 0 4px;
}
.country-card h2 a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.chart-wrap { position: relative; max-width: 560px; margin: 0 auto; }
canvas { cursor: pointer; }
.empty { text-align: center; padding: 64px 16px; color: var(--muted); }
.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    margin-top: 18px;
}
.legend button, .legend a {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.swatch { width: 10px; height: 10px; border-radius: 100px; flex: 0 0 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
th { color: var(--muted); font-weight: 500; }
.count { color: var(--muted); font-size: 0.95rem; margin-top: 8px; }
.demo-flag { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
@media (max-width: 800px) { .country-grid { grid-template-columns: 1fr; } }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mode-card { color: inherit; text-decoration: none; display: block; }
.mode-card h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 1.8rem; }
.mode-card p { color: var(--muted); }
.group-form label { display: block; margin: 8px 0; }
.group-form input[type="text"] { font: inherit; padding: 8px; width: min(320px, 100%); }
.tick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; margin: 12px 0; }
.button, .group-form button, .inline-form button {
    font: inherit;
    padding: 8px 12px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: inline-block;
}
.inline-form { display: inline; }
.group-list { padding-left: 20px; }
.legend span { display: flex; align-items: center; gap: 8px; }
@media (max-width: 800px) { .mode-grid { grid-template-columns: 1fr; } }
