:root {
    color-scheme: light;
    --paper: #f5f5ef;
    --white: #fff;
    --ink: #202d29;
    --muted: #52635a;
    --green: #194f44;
    --green-dark: #103b32;
    --green-soft: #e3efe8;
    --line: #d4ded5;
    --control-line: #83978a;
    --danger: #872c2c;
    --radius: 20px;
    --shadow: 0 12px 30px rgb(34 55 42 / 6%);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    font-size: 1rem;
}
a { color: var(--green); text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid #256eaa; outline-offset: 3px; }
h1, h2, h3, p { margin: 0 0 0.75rem; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.9rem, 4.9vw, 3.05rem); line-height: 1.09; letter-spacing: -0.045em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.2; letter-spacing: -0.025em; }
h3 { font-size: 1.05rem; line-height: 1.35; }
.shell { width: min(100% - 2rem, 54rem); margin-inline: auto; }
.admin-site .shell { width: min(100% - 2rem, 72rem); }
main { flex: 1; padding-block: clamp(1.45rem, 5vw, 3.6rem) 1.5rem; min-width: 0; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.masthead { min-height: 70px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--ink); text-decoration: none; line-height: 1.2; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 0.83rem; margin-top: 0.2rem; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: white; background: var(--green); font-size: 1.25rem; font-weight: 730; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); border-top: 1px solid var(--line); font-size: 0.875rem; padding-block: 0.85rem 1.1rem; }
.panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 4.5vw, 2.5rem); box-shadow: var(--shadow); margin-bottom: 1rem; }
.entry { max-width: 33rem; margin: min(4.5vh, 2rem) auto 1rem; }
.welcome { padding-block: clamp(1.25rem, 5vw, 3rem); }
.lede { color: var(--muted); max-width: 70ch; }
.eyebrow { display: block; font-size: 0.875rem; font-weight: 740; color: var(--green); letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 0.6rem; }
.muted { color: var(--muted); }
.multiline { white-space: pre-wrap; }
.spaced { margin-top: 1.4rem; }
.stack { display: grid; align-items: start; gap: 0.6rem; }
.stack label:not(.check) { display: grid; gap: 0.28rem; font-weight: 600; }
.stack .button { justify-self: start; margin-top: 0.35rem; }
button, input, select, textarea, summary { font: inherit; }
button, summary { cursor: pointer; }
input:not([type=radio], [type=checkbox], [type=hidden]), select, textarea {
    width: 100%; padding: 0.65rem 0.75rem; min-height: 45px; border: 1px solid var(--control-line);
    border-radius: 10px; background: white; color: var(--ink); font-weight: 400;
}
textarea { resize: vertical; display: block; margin-block: 0.3rem 0.8rem; }
.code { font-family: ui-monospace, monospace; letter-spacing: 0.05em; }
.button, .quiet {
    min-height: 44px; padding: 0.6rem 0.95rem; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; border-radius: 10px; font-weight: 680; text-decoration: none; line-height: 1.25;
}
.button { background: var(--green); color: white; }
.button:hover { background: var(--green-dark); }
.button.secondary { background: white; color: var(--green); border-color: var(--control-line); }
.button.secondary:hover, .quiet:hover { background: var(--green-soft); }
.button:disabled { opacity: 0.65; cursor: wait; }
.quiet { color: var(--green); background: transparent; padding-inline: 0.55rem; text-align: center; }
.notice { background: var(--green-soft); color: var(--green-dark); border-radius: 10px; padding: 0.75rem 1rem; margin-block: 0.7rem 1rem; }
.notice.error { background: #f9e9e7; color: var(--danger); }
.success-mark { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 1rem; color: var(--green); background: var(--green-soft); border-radius: 100%; font-size: 1.65rem; }
.welcome-steps { margin-block: 1.45rem; padding-inline-start: 1.55rem; }
.welcome-steps li { padding-inline-start: 0.35rem; margin-bottom: 0.9rem; }
.welcome-steps li::marker { font-weight: 750; color: var(--green); }
.welcome-steps span { display: block; color: var(--muted); }
.ballot-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.ballot-heading .eyebrow { margin: 0; }
.phase { font-weight: 730; }
progress, meter { accent-color: var(--green); }
progress { border: none; background: var(--green-soft); height: 8px; border-radius: 999px; width: 100%; overflow: hidden; }
progress::-webkit-progress-bar { background: var(--green-soft); }
progress::-webkit-progress-value { background: var(--green); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 999px; }
.ballot-progress { display: block; margin-block: 0.65rem 1rem; }
.candidate-focus { display: grid; place-content: center; text-align: center; min-height: clamp(135px, 25vw, 225px); padding: 1rem 0.35rem; }
.candidate-focus h1 { font-size: clamp(1.65rem, 6vw, 3.65rem); margin: 0; overflow-wrap: anywhere; }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
.rating { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.rating legend { text-align: center; margin-block-end: 0.65rem; font-weight: 680; }
.rating-option { cursor: pointer; position: relative; display: flex; min-width: 0; }
.rating-option input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.rating-tile { width: 100%; min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; border: 1px solid var(--control-line); border-radius: 12px; padding: 0.45rem 0.25rem; text-align: center; line-height: 1.2; font-size: 0.875rem; }
.rating-tile strong { font-size: 1.45rem; }
.rating-option input:hover + .rating-tile { background: var(--green-soft); }
.rating-option input:checked + .rating-tile { background: var(--green); color: white; border-color: var(--green); }
.rating-option input:focus-visible + .rating-tile { outline: 3px solid #256eaa; outline-offset: 2px; }
.choices { display: grid; gap: 0.55rem; margin-top: 1rem; }
.favorite-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice, .check { display: flex; align-items: center; gap: 0.7rem; min-height: 44px; cursor: pointer; }
.choice { border: 1px solid var(--control-line); border-radius: 10px; padding: 0.65rem 0.75rem; overflow-wrap: anywhere; }
.choice:hover, .choice:has(:checked) { background: var(--green-soft); border-color: var(--green); }
.choice small { display: block; color: var(--muted); font-size: 0.875rem; }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; margin: 0; flex: none; accent-color: var(--green); }
.selection-count { display: inline-block; background: var(--green-soft); color: var(--green-dark); border-radius: 999px; padding: 0.35rem 0.75rem; }
.ballot-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem; border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 1.4rem; }
.save-feedback { color: var(--muted); font-size: 0.875rem; flex: 1; min-width: 4rem; overflow-wrap: anywhere; }
.save-feedback [hidden] { display: none; }
.review-list { margin-block: 1rem; }
.review-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: clamp(0.45rem, 2vw, 0.9rem); border-bottom: 1px solid var(--line); min-height: 47px; overflow-wrap: anywhere; }
.review-item a { min-height: 44px; display: flex; align-items: center; }
.review-group { border: 1px solid var(--line); border-radius: 10px; margin-block: 0.65rem; padding-inline: 0.75rem; }
.review-group ul { margin: 0; padding: 0.5rem 0; list-style: none; }
.review-group li { display: flex; justify-content: space-between; gap: 0.5rem; overflow-wrap: anywhere; }
.admin-heading { margin-bottom: 0.8rem; }
.admin-heading .quiet { padding-inline: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.admin-grid > .panel { margin-bottom: 0.15rem; }
.admin-grid { margin-bottom: 1rem; }
.admin-grid.nested { margin-block: 1rem 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.tabs a { min-height: 44px; display: flex; align-items: center; padding: 0.45rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: white; text-decoration: none; font-weight: 650; }
.tabs a[aria-current], .tabs a:hover { border-color: var(--green); background: var(--green-soft); }
.pill { display: inline-block; padding: 0.16rem 0.6rem; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.pill.open { background: var(--green-soft); color: var(--green-dark); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55rem; }
.stat-grid div { border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem; }
.stat-grid dt { color: var(--muted); font-size: 0.875rem; }
.stat-grid dd { margin: 0; font-size: 1.55rem; font-weight: 730; }
.completion { margin-block: 1rem; }
.completion progress { display: block; margin-top: 0.35rem; }
details { border: 1px solid var(--line); border-radius: 10px; padding-inline: 0.65rem; margin-block: 0.5rem; }
summary { font-weight: 650; min-height: 44px; padding-block: 0.62rem; }
details > form { padding-bottom: 0.75rem; }
.line-list { padding: 0; margin: 0; list-style: none; }
.line-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.45rem; padding-block: 0.45rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.line-list li > a { display: flex; align-items: center; min-height: 44px; }
.person-row, .inventory-group { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.person-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 19rem); gap: 0.8rem; }
.person-actions { justify-self: stretch; }
.inline-form { margin-block: 0.3rem; }
.line-list .inventory-item { display: block; }
.inset-form { max-width: 34rem; }
.result-group { margin-block: 1.3rem; }
.table-scroll { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
th, td { padding: 0.35rem 0.65rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
thead { background: var(--green-soft); }
thead button { min-height: 44px; border: 0; color: var(--green-dark); font-weight: 700; background: transparent; padding-inline: 0.15rem; }
th[aria-sort=ascending] button::after { content: " ↑"; }
th[aria-sort=descending] button::after { content: " ↓"; }
tbody tr:last-child > * { border-bottom: 0; }
.chart { padding-bottom: 0.35rem; }
.chart-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(2rem, 1.1fr) 2.6rem; gap: 0.5rem; align-items: center; font-size: 0.875rem; overflow-wrap: anywhere; margin-block: 0.35rem; }
.chart-row meter { width: 100%; height: 1rem; }
.chart-row meter::-webkit-meter-optimum-value { background: var(--green); }
.chart-row meter::-moz-meter-bar { background: var(--green); }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: absolute; z-index: 2; left: 1rem; top: 0.5rem; background: white; padding: 0.7rem; }
@media (max-width: 580px) {
    .panel { border-radius: 15px; }
    .rating { grid-template-columns: 1fr; gap: 0.38rem; }
    .rating-tile { min-height: 44px; flex-direction: row; justify-content: start; gap: 0.65rem; padding: 0.45rem 0.7rem; }
    .rating-tile strong { font-size: 1.15rem; min-width: 1.3rem; text-align: center; }
    .candidate-focus { min-height: 128px; }
    .favorite-choices, .admin-grid, .person-row { grid-template-columns: minmax(0, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .review-item span, .review-group li span { font-size: 0.875rem; }
    .ballot-navigation .save-feedback { order: 3; flex-basis: 100%; }
    .ballot-navigation .button:last-child { margin-left: auto; }
}

