:root {
    --bg: #f6f5f2;
    --card: #ffffff;
    --text: #1d1d1f;
    --muted: #6b6b70;
    --line: #e4e2dc;
    --accent: #2f5bea;
    --accent-text: #ffffff;
    --danger: #c62828;
    --ok-bg: #e7f6ec;
    --ok-text: #1e6b3a;
    --err-bg: #fdecec;
    --err-text: #a12626;
    --info-bg: #eaf0fe;
    --info-text: #1f3f9e;
    --radius: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121214;
        --card: #1c1c1f;
        --text: #f2f2f4;
        --muted: #a0a0a8;
        --line: #2e2e33;
        --accent: #6b8cff;
        --accent-text: #0b0b0d;
        --danger: #ff6b6b;
        --ok-bg: #12301f;
        --ok-text: #8fe0ab;
        --err-bg: #3a1616;
        --err-text: #ffb3b3;
        --info-bg: #17223f;
        --info-text: #b8c8ff;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
code { font-size: .9em; background: var(--line); padding: .1em .35em; border-radius: 6px; }

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--line);
    background: var(--card);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
nav { display: flex; align-items: center; gap: 1rem; }
nav a { text-decoration: none; }

main { max-width: 960px; margin: 0 auto; padding: 2rem 1rem 3rem; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 1rem 2rem; }

.hero { text-align: center; padding: 2rem 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0 0 .5rem; }
.lead { color: var(--muted); max-width: 36rem; margin: 0 auto 1.5rem; font-size: 1.1rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.card h3 { margin-top: 0; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }

label { display: block; margin-bottom: 1rem; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea {
    display: block;
    width: 100%;
    margin-top: .35rem;
    padding: .7rem .8rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.button, button.button {
    display: inline-block;
    padding: .7rem 1.2rem;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.button.small { padding: .4rem .8rem; font-size: .9rem; }
.button.wide { width: 100%; }
.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.button.danger { background: var(--danger); color: #fff; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
form.inline { display: inline; margin: 0; }

.flash { padding: .75rem 1rem; border-radius: 10px; background: var(--info-bg); color: var(--info-text); }
.flash.success { background: var(--ok-bg); color: var(--ok-text); }
.flash.error { background: var(--err-bg); color: var(--err-text); }

details.danger summary { cursor: pointer; color: var(--danger); font-weight: 600; }
details.danger form { margin-top: 1rem; }

.answer { margin-top: 1rem; padding: 1rem; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 8px; }
