/* vote · PATZER "Ledger" look, from design/system/project/tokens.json (patzer-light / patzer-dark) */
@font-face {
  font-family: Quivira;
  src: url(/static/fonts/Quivira-400.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+2039-203A, U+2190, U+2192, U+2194, U+2197, U+21BA-21BB, U+21C4, U+21D2, U+2264-2265, U+22EF, U+2302, U+2399, U+23ED, U+2460-2462, U+25B2, U+25C6, U+25C8, U+25CB, U+25CF, U+2600, U+2605, U+2620, U+2630, U+263E, U+2691, U+2694, U+26A0, U+26BF, U+2713, U+2715, U+2726, U+2756, U+27E6-27E7, U+2B50;
}

:root {
  --color-bg: #ece5d6;
  --color-surface: #f8f3e8;
  --color-surface-alt: #efe7d6;
  --color-sunken: #e7dcc4;
  --color-text: #221c15;
  --color-text-muted: #4b4439;
  --color-text-subtle: #6e6655;
  --color-border: #c9bd9f;
  --color-border-control: #6e6655;
  --color-ink-rule: #221c15;
  --color-accent: #7a2118;
  --color-accent-strong: #5e1c16;
  --color-accent-subtle: #e4d1c7;
  --color-on-accent: #f7efe0;
  --color-highlight: #7c632b;
  --color-decor: #c8a24a;
  --color-success: #4a6b2f;
  --color-danger: #8a2018;
  --shadow-offset: 2px 2px 0 rgba(60, 45, 20, 0.1);
  --border-ink: 1.5px;
  --radius-md: 4px;
  --font-display: Quivira, Fraunces, "Iowan Old Style", Georgia, serif;
  --font-body: Quivira, Spectral, Georgia, "Times New Roman", serif;
  --font-num: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #161009;
    --color-surface: #211a11;
    --color-surface-alt: #191308;
    --color-sunken: #120d06;
    --color-text: #ece0c8;
    --color-text-muted: #a99a7d;
    --color-text-subtle: #908165;
    --color-border: #3b3020;
    --color-border-control: #908165;
    --color-ink-rule: #ece0c8;
    --color-accent: #cf6349;
    --color-accent-strong: #e0836b;
    --color-accent-subtle: #3d261a;
    --color-on-accent: #1a1109;
    --color-highlight: #d3a44f;
    --color-decor: #e0b866;
    --color-success: #8fae5c;
    --color-danger: #d6614a;
    --shadow-offset: 2px 2px 0 rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 15px/22px var(--font-body);
  -webkit-text-size-adjust: 100%;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

a { color: var(--color-accent); }
a:hover { color: var(--color-accent-strong); }

.vh {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* header bar */
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 24px;
  background: var(--color-surface);
  border-bottom: var(--border-ink) solid var(--color-ink-rule);
}
.mark {
  font: 600 18px/1 var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
}
.mark .glyph { color: var(--color-accent); }
.sub {
  font: 600 11px/1 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-subtle);
}
.mark + .sub { padding-left: 12px; border-left: 1px solid var(--color-border); }

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}

h1, h2, legend {
  font-family: var(--font-display);
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.02em;
  text-wrap: balance;
}
h1 { font-size: 30px; line-height: 36px; margin: 0 0 8px; }
h2 { font-size: 22px; line-height: 28px; margin: 0 0 4px; }

.lead { max-width: 68ch; margin: 0 0 24px; color: var(--color-text-muted); }
.meta { margin: 0 0 12px; font-size: 13.5px; color: var(--color-text-muted); }
.hint { margin: 4px 0 0; font-size: 13.5px; line-height: 20px; color: var(--color-text-muted); }

/* the options */
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend {
  font-size: 22px;
  line-height: 28px;
  padding: 0 0 8px;
  margin-bottom: 16px;
  width: 100%;
  border-bottom: 2px solid var(--color-decor);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  background: var(--color-surface);
  border: var(--border-ink) solid var(--color-ink-rule);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-offset);
}
.card:has(input:checked) {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1.5px var(--color-accent);
}
.thumb { display: block; cursor: pointer; }
.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 420;
  object-fit: cover;
  object-position: top left;
  background: var(--color-sunken);
  border: var(--border-ink) solid var(--color-ink-rule);
  border-radius: var(--radius-md);
}
.kicker {
  margin-top: 4px;
  font: 600 11px/1 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font: 600 18px/24px var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.02em;
}
.choice input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}
.desc { margin: 0 0 8px; color: var(--color-text-muted); }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  background: var(--color-surface);
  color: var(--color-text);
  border: var(--border-ink) solid var(--color-ink-rule);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-offset);
  font: 600 15px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.13s;
}
.btn:hover { background: var(--color-surface-alt); color: var(--color-text); }
.btn.primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 16px;
  padding: 0 24px;
}
.btn.primary:hover { background: var(--color-accent-strong); border-color: var(--color-accent-strong); }
.view { align-self: flex-start; margin-top: auto; }

/* panels and fields */
.panel {
  margin-top: 28px;
  padding: 16px;
  background: var(--color-surface);
  border: var(--border-ink) solid var(--color-ink-rule);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-offset);
}
.fields { max-width: 640px; display: grid; gap: 16px; }
.field label { display: block; margin-bottom: 4px; font-weight: 600; }
.opt { font-weight: 400; color: var(--color-text-muted); }
input[type="text"], input[type="password"], textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  background: var(--color-sunken);
  color: var(--color-text);
  border: var(--border-ink) solid var(--color-border-control);
  border-radius: var(--radius-md);
  font: 16px/22px var(--font-body);
}
textarea { min-height: 112px; resize: vertical; }
[aria-invalid="true"] { border-color: var(--color-danger); }
.fields .btn.primary { justify-self: start; }

/* notices */
.notice {
  max-width: 68ch;
  margin: 0 0 20px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: var(--border-ink) solid var(--color-ink-rule);
  border-radius: var(--radius-md);
  font-weight: 600;
}
.notice.ok { border-color: var(--color-success); }
.notice.ok span { color: var(--color-success); }
.notice.error { border-color: var(--color-danger); color: var(--color-danger); }

/* tally */
.tally { max-width: 760px; }
.tally ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tally li {
  display: grid;
  grid-template-columns: minmax(0, 15em) 1fr 3ch;
  align-items: center;
  gap: 12px;
}
.t-count {
  font: 600 15px/1 var(--font-num);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
meter {
  display: block;
  width: 100%;
  height: 16px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-sunken);
  border: var(--border-ink) solid var(--color-ink-rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}
meter::-webkit-meter-bar { background: transparent; border: 0; border-radius: 0; height: 100%; }
meter::-webkit-meter-optimum-value { background: var(--color-accent); }
meter::-moz-meter-bar { background: var(--color-accent); }

/* index and admin */
.polls { padding-left: 20px; }
.polls li { min-height: 44px; display: list-item; }
.tw { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--color-border); }
th { font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
td.n { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.comment { white-space: pre-wrap; min-width: 20ch; max-width: 60ch; overflow-wrap: anywhere; }

@media (max-width: 559px) {
  main { padding: 20px 12px 40px; }
  .top { padding: 0 12px; }
  h1 { font-size: 26px; line-height: 32px; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .tally li { grid-template-columns: 1fr 3ch; gap: 4px 12px; }
  .tally meter { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* a row of buttons (the delete confirm) */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
