:root {
    --teal: #10a5c5;
    --teal-dark: #0d849e;
    --ink: #222;
    --muted: #666;
    --line: #dde3e6;
    --bg: #f0f2f5;
    --ok: #2e8b57;
    --fail: #c0392b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: var(--teal-dark);
}

.top {
    background: #fff;
    border-bottom: 2px solid var(--teal);
}

.top-inner {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    min-width: 0;
}

.logo img {
    display: block;
    width: 130px;
    height: auto;
}

nav {
    flex: none;
    margin-left: auto;
    white-space: nowrap;
    font-size: 14px;
}

nav a {
    text-decoration: none;
    padding: 6px 0;
}

.card {
    max-width: 640px;
    margin: 24px auto;
    padding: 24px 20px 32px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.card > :first-child {
    margin-top: 0;
}

h1 {
    margin: 0 0 12px;
    font-size: 1.75rem;
    font-weight: normal;
    line-height: 1.2;
}

h2 {
    margin: 28px 0 8px;
    font-size: 1.25rem;
    font-weight: normal;
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
}

p {
    margin: 0 0 12px;
}

.note {
    margin-top: 24px;
    font-size: .9rem;
}

.error {
    color: var(--fail);
    font-weight: bold;
}

.notice {
    color: var(--ok);
    font-weight: bold;
}

form {
    margin: 16px 0;
}

button {
    min-height: 44px;
    margin-top: 16px;
    padding: 8px 24px;
    font: inherit;
    font-weight: bold;
    color: #fff;
    background: var(--teal);
    border: 1px solid var(--teal-dark);
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: var(--teal-dark);
}

.footer {
    max-width: 640px;
    margin: 0 auto 32px;
    padding: 0 20px;
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .top-inner {
        padding: 10px 16px;
    }

    .logo img {
        width: 110px;
    }

    .card {
        margin: 0;
        padding: 20px 14px 28px;
        border-radius: 0;
        box-shadow: none;
    }

    h1 {
        font-size: 1.4rem;
    }

    h2 {
        margin-top: 24px;
        font-size: 1.1rem;
    }

    form {
        margin: 12px 0;
    }

    button {
        width: 100%;
        min-height: 42px;
    }

    .footer {
        margin-top: 20px;
    }
}

.description {
    margin: 0 0 20px;
    overflow-wrap: anywhere;
}

.description hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.thanks {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: var(--bg);
    border-left: 6px solid var(--ok);
    border-radius: 4px;
}

.thanks hr {
    margin: 16px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.elections {
    list-style: none;
    margin: 0;
    padding: 0;
}

.elections li {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.election-name {
    font-size: 1.1rem;
}

.closed {
    color: var(--muted);
}

.count {
    color: var(--muted);
}

.meta {
    font-size: .9rem;
    color: var(--muted);
}

.results {
    width: 100%;
    border-collapse: collapse;
}

.results th,
.results td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.choice {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border-bottom: 1px solid var(--line);
}

.choice input {
    flex: none;
    width: 20px;
    height: 20px;
}

.choice label {
    flex: 1;
    padding: 8px 0;
    cursor: pointer;
}

.chosen {
    padding: 12px 16px;
    font-size: 1.15rem;
    font-weight: bold;
    background: var(--bg);
    border-radius: 4px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.actions form {
    margin: 0;
}

.actions button {
    margin-top: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 24px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
}

.button.secondary {
    color: var(--teal-dark);
    background: #fff;
    border: 1px solid var(--teal-dark);
}

@media (max-width: 480px) {
    .actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .actions form button,
    .button {
        width: 100%;
    }
}
