@font-face {
    font-family: 'Barlow Condensed';
    src: url('./fonts/BarlowCondensed-SemiBold.ttf') format('truetype');
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

:root {
    color-scheme: light;
    --paper: #f7f5fa;
    --white: #fff;
    --ink: #231a32;
    --muted: #665971;
    --line: #ded6e8;
    --accent: #6239a1;
    --accent-dark: #49267e;
    --accent-soft: #eee5f9;
    --verified: #24614c;
    --danger: #a22d55;
    --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; background: var(--paper); color: var(--ink); line-height: 1.5; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
:target { scroll-margin-top: 1.25rem; }
h1, h2, p { margin: 0; }
h1, h2, .display-number { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: clamp(2.5rem, 7vw, 4.65rem); line-height: 1; overflow-wrap: anywhere; }
h2 { font-size: 1.7rem; line-height: 1.14; overflow-wrap: anywhere; }
.wrap { width: min(100% - clamp(1.75rem, 8vw, 5rem), 74rem); margin-inline: auto; }
.main { padding-block: clamp(1.5rem, 5vw, 3.75rem); min-height: 72vh; }
.narrow { max-width: 46rem; margin-inline: auto; }
.stack { display: grid; gap: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.number { font-variant-numeric: tabular-nums; }
.break-word { overflow-wrap: anywhere; }
.skip { position: absolute; top: -10rem; left: 1rem; z-index: 5; }
.skip:focus { top: 1rem; }

.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; min-height: 4.25rem; padding-block: .55rem; }
.brand { display: inline-flex; gap: .65rem; align-items: center; color: var(--ink); font-size: 1.05rem; font-weight: 760; text-decoration: none; }
.brand-mark { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: .4rem; background: var(--accent-dark); color: white; }
.brand-mark::after { content: ''; display: block; width: .48rem; height: .86rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(40deg) translate(-1px, -1px); }
.nav-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .75rem; }
.nav-actions form, .actions form { margin: 0; }
.nav-actions a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); }
.footer { border-top: 1px solid var(--line); color: var(--muted); padding-block: 1.15rem; font-size: .875rem; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .56rem .95rem; border: 1px solid var(--line); border-radius: .35rem; color: var(--ink); background: var(--white); font-weight: 650; font-size: .9rem; text-decoration: none; text-align: center; }
.button:hover:not(:disabled) { background: var(--accent-soft); border-color: #bfaed1; }
.button-primary { background: var(--accent); border-color: var(--accent); color: white; }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); color: white; border-color: var(--accent-dark); }
.button-quiet { background: transparent; border-color: transparent; }
.button-danger, .error-text { color: var(--danger); }
.text-link { font-weight: 650; text-underline-offset: .22em; }
.notice { padding: .85rem 1rem; margin-bottom: 1rem; border-left: 3px solid var(--verified); background: #e7f2ec; color: #214938; overflow-wrap: anywhere; }
.notice-error { border-color: var(--danger); color: #76243c; background: #f9e9ef; }

.hero { position: relative; isolation: isolate; overflow: hidden; background: #2b1a43; color: #fff; border-radius: .7rem; padding: clamp(1.4rem, 6vw, 4.3rem); min-height: 17rem; display: grid; align-content: center; }
.hero-content { max-width: 37rem; position: relative; z-index: 1; }
.hero h1 { max-width: 14ch; }
.hero p { max-width: 32rem; color: #e5d8f2; margin-top: .95rem; font-size: 1.05rem; }
.hero-art { --art-line: #c2a3e1; position: absolute; inset: 0 0 0 auto; width: 39%; display: grid; place-items: center; background: repeating-linear-gradient(0deg, #aa83d117 0 1px, transparent 1px 22px); }
.ballot-art { width: min(68%, 17rem); rotate: -10deg; padding: 1rem; border: 1px solid var(--art-line); border-radius: .55rem; background: #41295e; box-shadow: .48rem .52rem 0 #946cb4; display: grid; gap: .65rem; }
.ballot-art i { display: flex; gap: .5rem; align-items: center; height: 2.25rem; border: 1px solid #7f5ca2; border-radius: .3rem; padding-inline: .65rem; }
.ballot-art i::before { content: ''; width: .65rem; height: .65rem; border-radius: 50%; border: 1px solid var(--art-line); }
.ballot-art i::after { content: ''; width: 55%; height: 3px; background: #b693d8; }
.ballot-art i:nth-child(2) { background: #e5d5f4; }
.ballot-art i:nth-child(2)::before, .ballot-art i:nth-child(2)::after { background: #67428b; }
.section-head, .page-head, .card-footer { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .75rem 1rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head p { margin-top: .65rem; }
.section-head { margin-block: 2rem 1rem; }
.result-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .65rem; }
.poll-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: .55rem; padding: clamp(1rem, 3vw, 1.5rem); min-width: 0; }
.poll-card { display: grid; grid-template-rows: auto 1fr auto; gap: 1.15rem; }
.poll-card h2 a { color: var(--ink); text-decoration: none; }
.poll-card h2 a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: .15em; }
.poll-card .status { margin-top: .45rem; }
.status { color: var(--verified); font-size: .875rem; font-weight: 650; }
.status-pending { color: var(--muted); }
.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; align-content: start; }
.result-label { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; font-size: .9rem; }
.result-label strong { flex-shrink: 0; }
.result-track { height: .4rem; background: var(--accent-soft); border-radius: 1rem; margin-top: .3rem; overflow: hidden; }
.result-track span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.card-footer { border-top: 1px solid var(--line); padding-top: .9rem; align-items: center; }

.field, .form-stack { display: grid; gap: .4rem; }
.field { font-weight: 650; }
.form-stack { gap: 1rem; }
.control { width: 100%; min-width: 0; border: 1px solid #9d8caf; border-radius: .35rem; min-height: 2.8rem; padding: .6rem .7rem; background: var(--white); color: var(--ink); font-weight: 400; }
.control[aria-invalid="true"] { border-color: var(--danger); }
.fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.fieldset legend { font-weight: 700; margin-bottom: .65rem; }
.options { display: grid; gap: .55rem; }
.option { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .7rem; cursor: pointer; padding: .75rem; border: 1px solid var(--line); border-radius: .35rem; overflow-wrap: anywhere; }
.option:has(:checked) { background: var(--accent-soft); border-color: var(--accent); }
.option input { accent-color: var(--accent); width: 1.15rem; height: 1.15rem; margin: 0; }
.option-edit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .65rem; }
.form-help { margin-bottom: .55rem; }
.login { max-width: 31rem; margin-inline: auto; }
.login header { margin-bottom: 1.2rem; }
.login h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); margin-bottom: .55rem; }

.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--white); border-radius: .5rem; overflow: hidden; }
.summary > div { padding: .9rem clamp(.65rem, 3vw, 1.5rem); border-top: 3px solid var(--accent); }
.summary > div + div { border-left: 1px solid var(--line); }
.summary dt { color: var(--muted); font-size: .875rem; }
.summary dd { margin: .25rem 0 0; font-size: clamp(1.6rem, 5vw, 2.8rem); line-height: 1; }
.admin-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, 1fr); gap: .85rem 1.25rem; align-items: start; }
.admin-row h2 { font-size: 1.32rem; }
.admin-meta { display: grid; gap: .2rem; }
.admin-row .actions { justify-content: end; }
.answer-lines { padding-left: 1.1rem; margin: .6rem 0 0; overflow-wrap: anywhere; }

@media (max-width: 45rem) {
    .poll-grid, .admin-row { grid-template-columns: 1fr; }
    .hero-art { display: none; }
    .hero { min-height: 0; }
    .admin-row .actions { justify-content: start; }
}
@media (max-width: 27rem) {
    .nav-actions { width: 100%; gap: .25rem; }
    .option-edit { grid-template-columns: 1fr; }
    .option-edit button { justify-self: start; }
}
