:root {
  color-scheme: light;
  --paper: #faf8f2;
  --surface: #fffefa;
  --ink: #261d32;
  --muted: #62596b;
  --line: #e3dce7;
  --plum: #5937a3;
  --plum-hover: #462984;
  --lavender: #eee5f9;
  --lime: #e1f58e;
  --lime-pale: #f1f7d5;
  --green: #365413;
  --radius: 18px;
  --sans: "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  font: 100%/1.52 var(--sans);
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; display: flex; flex-direction: column; min-height: 100vh; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3, p, label, strong, a { overflow-wrap: anywhere; }
a { color: var(--plum); text-underline-offset: 3px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
fieldset { padding: 0; border: 0; min-inline-size: 0; margin: 0; }
.shell { width: min(100% - 3rem, 1140px); margin-inline: auto; }
.icon { width: 1.125rem; height: 1.125rem; flex: 0 0 auto; vertical-align: middle; }
.muted { color: var(--muted); }
.full { width: 100%; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-inner {
  min-height: 72px; display: grid; align-items: center;
  grid-template-columns: 1fr auto 1fr; gap: 1.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem; justify-self: start;
  color: var(--ink); text-decoration: none; font-weight: 825; letter-spacing: -.045em; font-size: 1.36rem;
}
.brand-punctuation { color: var(--plum); }
.nav, .header-actions { display: flex; align-items: center; gap: .45rem; }
.header-actions { justify-self: end; gap: .75rem; }
.nav a {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 .85rem;
  border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 650; font-size: .90rem;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--lavender); color: var(--plum); }
.button, .plain, .soft-button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  text-decoration: none; border: 1px solid transparent; border-radius: 8px;
  padding: .62rem 1.05rem; min-height: 44px; font-weight: 700; line-height: 1.3;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.button.small { font-size: .90rem; }
.ink { color: white; background: var(--ink); }
.ink:hover { background: #40314e; }
.primary { color: white; background: var(--plum); }
.primary:hover { background: var(--plum-hover); }
.outline { background: transparent; color: var(--ink); border-color: #cfc4d6; }
.outline:hover { background: var(--lavender); border-color: #b7a1d0; }
.plain { background: transparent; color: var(--plum); padding-inline: .65rem; }
.plain:hover { background: var(--lavender); }
.header-signin { font-size: .9rem; color: var(--ink); white-space: nowrap; }
.soft-button {
  font-size: .875rem; background: #f7f0fd; border-color: #d9cce8; color: #47365c;
  padding-inline: .72rem;
}
.soft-button:hover { background: white; }
.icon-button { min-width: 44px; padding: 0; background: var(--lavender); color: var(--plum); }
.icon-button:hover { background: #e0d1f1; }

.main { margin-block: 2.1rem 4rem; flex: 1; }
.page-heading {
  display: flex; align-items: end; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.3rem;
}
.eyebrow {
  color: var(--plum); font-size: .8125rem; line-height: 1.3; font-weight: 800;
  letter-spacing: .115em; text-transform: uppercase; margin-bottom: .42rem;
}
.page-heading h1 { font: 700 clamp(2.25rem, 5vw, 3.55rem)/1.02 var(--serif); letter-spacing: -.055em; }
.heading-dot { color: var(--plum); }
.issue-date {
  display: inline-flex; align-items: center; gap: .45rem;
  padding-bottom: .22rem; color: var(--muted); font-weight: 650; font-size: .9rem;
}
.issue-date .icon { color: var(--plum); }
.hero {
  display: grid; grid-template-columns: 1.11fr 1fr; min-height: 335px;
  border-radius: var(--radius); overflow: hidden; border: 1px solid #ded3e8;
  background: var(--lavender);
}
.hero-copy {
  min-width: 0; padding: clamp(1.45rem, 3.7vw, 3rem); display: flex;
  flex-direction: column; justify-content: center; align-items: start;
}
.tags, .hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.tag {
  display: inline-flex; align-items: center; padding: .24rem .61rem; min-height: 26px;
  border-radius: 999px; background: var(--lavender); color: #4b2c80;
  font-size: .78rem; line-height: 1.22; font-weight: 725;
}
.hero .tag { background: #e4d4f5; }
.tag.lime, .hero .tag.lime { background: var(--lime); color: #283810; }
.tag.subtle, .hero .tag.subtle { background: #f1edf1; color: var(--muted); }
.hero h2 {
  margin-block: .7rem .75rem; font: 700 clamp(2.1rem, 4.1vw, 3.35rem)/1.01 var(--serif);
  letter-spacing: -.05em; text-wrap: pretty;
}
.hero p { color: #51455f; max-width: 41ch; }
.hero-actions { margin-top: 1.35rem; }
.copy-status { color: var(--plum); font-size: .875rem; font-weight: 650; }
.copy-status:empty { display: none; }
.copy-status input { margin-block: .25rem; }
.hero-image { min-width: 0; min-height: 100%; position: relative; background: var(--lime); }
.hero-image img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.cover-art { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.cover-art span { position: absolute; width: 52%; aspect-ratio: 1.35; border: 1px solid var(--ink); border-radius: 28px; }
.cover-art span:first-child { transform: rotate(18deg) translate(8%, 6%); background: #b68fe9; }
.cover-art span:nth-child(2) { transform: rotate(-13deg) translate(-8%, -2%); background: #fff8e8; box-shadow: 5px 8px 0 var(--ink); }
.cover-art strong { z-index: 1; transform: rotate(-13deg) translateX(-10%); font: 700 clamp(5rem, 11vw, 9rem)/1 var(--serif); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.content-grid { display: grid; grid-template-columns: 1.93fr 1fr; gap: 1.4rem; margin-top: 1.4rem; align-items: start; }
.vote-panel, .recent, .sidebar-callout, .manage-panel { padding: clamp(1rem, 2.35vw, 1.65rem); }
.vote-panel { scroll-margin-top: 1rem; }
.section-heading { display: flex; gap: .82rem; align-items: center; margin-bottom: 1.05rem; }
.section-heading > div:nth-child(2) { min-width: 0; flex: 1; }
.section-heading h2, .sidebar h2 { line-height: 1.15; font-size: 1.34rem; letter-spacing: -.033em; }
.section-heading p, .sidebar .muted { margin-top: .28rem; font-size: .92rem; }
.section-icon {
  display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px;
  border-radius: 11px; background: var(--lime); color: var(--ink);
}
.section-icon .icon { width: 1.25rem; height: 1.25rem; }
.section-icon.plum { background: var(--lavender); color: var(--plum); }
.status {
  align-self: start; display: inline-flex; align-items: center; gap: .38rem;
  border-radius: 6px; padding: .24rem .53rem; background: var(--lime-pale);
  color: var(--green); font-size: .78rem; font-weight: 800; white-space: nowrap;
}
.status i { width: .42rem; height: .42rem; border-radius: 50%; background: #557b1a; }
.status.closed { color: var(--muted); background: #efeaf0; }
.options { display: grid; gap: .57rem; }
.option {
  display: flex; align-items: center; position: relative; gap: .76rem; min-height: 49px;
  padding: .55rem .75rem; border: 1px solid #dcd2e3; border-radius: 8px;
  font-weight: 650; cursor: pointer; transition: border-color .18s ease, background-color .18s ease;
}
.option:hover { border-color: #b59dc9; background: #fbf6ff; }
.option:has(input:checked) { border-color: var(--plum); background: #f2eafa; }
.option:has(input:focus-visible) { outline: 3px solid var(--plum); outline-offset: 2px; }
.option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.radio-marker {
  display: grid; place-items: center; flex: 0 0 19px; height: 19px; border: 1.5px solid #8a7999; border-radius: 50%;
}
.option input:checked + .radio-marker { border-color: var(--plum); box-shadow: inset 0 0 0 4px var(--surface); background: var(--plum); }
.custom-option { color: var(--plum); border-style: dashed; }
.custom-option .radio-marker { border: 0; box-shadow: none !important; }
.custom-option input:checked + .radio-marker { color: white; }
.custom-option .icon { width: .83rem; height: .83rem; }
#write-in { margin-top: .9rem; }
.field-note { margin-top: .25rem; font-size: .875rem; }
.vote-actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; margin-top: 1.02rem; }
.vote-note { color: var(--muted); font-size: .83rem; margin-left: .22rem; }
.result-list { margin: 0 0 1rem; padding: 0; list-style: none; display: grid; gap: .85rem; }
.result-row > div { display: flex; align-items: baseline; gap: .5rem; justify-content: space-between; }
.result-row > div > span { font-weight: 650; }
.result-row progress { display: block; width: 100%; height: 9px; border: none; border-radius: 999px; overflow: hidden; appearance: none; margin-top: .3rem; }
.result-row progress::-webkit-progress-bar { background: #ece5f1; }
.result-row progress::-webkit-progress-value { background: var(--plum); border-radius: 999px; }
.result-row progress::-moz-progress-bar { background: var(--plum); border-radius: 999px; }
.result-count { color: var(--muted); font-size: .8rem; }
.community-results { padding-top: 1rem; border-top: 1px solid var(--line); }
.community-results h3 { display: flex; align-items: center; gap: .4rem; }
.community-results > p { font-size: .9rem; margin: .15rem 0 .8rem; }
.community-results progress::-webkit-progress-value { background: #678934; }
.community-results progress::-moz-progress-bar { background: #678934; }

.sidebar { display: grid; gap: 1rem; }
.sidebar .section-icon { margin-bottom: .65rem; }
.recent-list { margin: .5rem 0 1rem; }
.poll-row {
  color: var(--ink); display: flex; align-items: center; gap: .68rem; min-height: 65px;
  text-decoration: none; padding: .57rem 0; border-bottom: 1px solid var(--line);
}
.poll-row:hover .row-copy strong { color: var(--plum); text-decoration: underline; }
.row-date {
  width: 42px; flex: 0 0 42px; min-height: 42px; display: grid; align-content: center;
  text-align: center; line-height: 1.08; background: #f5eef9; color: var(--plum); border-radius: 8px;
}
.row-date strong { font-size: 1rem; }
.row-date span { font-size: .70rem; font-weight: 700; text-transform: uppercase; }
.row-copy { display: grid; line-height: 1.24; gap: .25rem; }
.row-copy strong { font-size: .94rem; }
.row-copy > span { color: var(--muted); font-size: .8rem; }
.recent .full { margin-top: .4rem; }
.sidebar-callout { background: var(--lime-pale); border-color: #dbe5b8; }
.sidebar-callout p { margin: .3rem 0 .6rem; }
.sidebar-callout a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 750; }
.archive-intro { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin: .1rem 0 1.3rem; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.filters a { display: inline-flex; align-items: center; min-height: 44px; border-radius: 8px; padding: .4rem .72rem; text-decoration: none; color: var(--ink); font-size: .89rem; }
.filters a:hover, .filters a[aria-current="page"] { background: var(--lavender); color: var(--plum); }
.archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.archive-card { display: flex; flex-direction: column; min-height: 170px; gap: .75rem; padding: 1.2rem; color: var(--ink); text-decoration: none; }
.archive-card:hover { border-color: #b59dc9; }
.archive-card > strong { flex: 1; font: 700 1.45rem/1.2 var(--serif); letter-spacing: -.02em; }
.archive-top { display: flex; justify-content: space-between; align-items: center; gap: .4rem; color: var(--muted); font-size: .84rem; }
.archive-meta { color: var(--muted); font-size: .85rem; }
.more { margin-block: 1.25rem; text-align: center; }

.loading, .empty { padding: clamp(1.2rem, 4vw, 3rem); }
.empty h1, .empty h2 { font-family: var(--serif); }
.empty p { margin: .5rem 0 1rem; color: var(--muted); }
.empty .section-icon { margin-bottom: .7rem; }
.footer { margin-top: auto; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; min-height: 82px; color: var(--muted); font-size: .875rem; padding-block: 1rem; }
.footer .brand { font-size: 1.13rem; }
.footer a { min-height: 44px; display: inline-flex; align-items: center; }

label { display: block; font-weight: 650; font-size: .92rem; }
input:not([type="checkbox"], [type="radio"]), textarea {
  display: block; width: 100%; min-width: 0; min-height: 44px; padding: .58rem .69rem;
  margin-top: .25rem; border: 1px solid #a797b4; border-radius: 8px; background: var(--surface);
}
textarea { resize: vertical; }
input[type="checkbox"] { accent-color: var(--plum); width: 1rem; height: 1rem; flex: 0 0 auto; }
.stack { display: grid; gap: .78rem; }
.form-error { color: #903449; font-size: .9rem; margin-top: .35rem; }
.form-error:empty { display: none; }
.notice { margin-block: .4rem; padding: .66rem .8rem; background: var(--lime-pale); border-radius: 8px; font-size: .95rem; }
dialog {
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
  background: var(--surface); width: min(100% - 2rem, 440px); padding: 1.55rem;
}
dialog::backdrop { background: #251b3299; }
dialog h2 { font: 700 1.8rem/1.08 var(--serif); padding-right: 2.1rem; }
dialog .muted { margin-block: .55rem 1rem; }
.dialog-close { position: absolute; right: .65rem; top: .65rem; }
#new-code { text-align: left; justify-content: start; margin-top: .55rem; }
.manage-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 1.1rem; }
.manage-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .7rem; }
.create-options legend { padding: 0; font-weight: 750; }
.create-option { display: flex; align-items: end; gap: .4rem; margin: .48rem 0; }
.create-option label { flex: 1; min-width: 0; }
.managed-row { border-bottom: 1px solid var(--line); padding: .75rem 0; }
.managed-title { display: flex; align-items: start; justify-content: space-between; gap: .4rem; }
.managed-row .muted { font-size: .9rem; }
.row-actions { display: flex; gap: .24rem .4rem; flex-wrap: wrap; align-items: center; }
.row-actions a { min-height: 44px; display: inline-flex; align-items: center; }
.row-actions .plain, .row-actions a { font-size: .85rem; }
.load-more { margin-top: .8rem; }
.review-panel { margin-top: 1rem; }
.review-panel #draft-ai { margin-top: .65rem; }
.review-drafts, .review-manual { margin-top: 1rem; }
.review-items { max-height: 340px; overflow: auto; padding: .2rem .3rem; }
.draft-group, .checkbox { border: 1px solid var(--line); border-radius: 8px; padding: .65rem; }
.checkbox { display: flex; align-items: center; gap: .48rem; min-height: 44px; cursor: pointer; }
.draft-group label { margin-bottom: .5rem; }
summary { cursor: pointer; min-height: 44px; padding-block: .6rem; }

@media (max-width: 850px) {
  .shell { width: min(100% - 2rem, 1140px); }
  .topbar-inner { grid-template-columns: 1fr 1fr; gap: .2rem .4rem; padding-block: .55rem .4rem; }
  .header-actions { grid-column: 2; grid-row: 1; gap: .3rem; }
  .nav { grid-column: 1 / -1; }
  .content-grid { grid-template-columns: 1.65fr 1fr; gap: .9rem; }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 1.4rem); }
  .topbar-inner { grid-template-columns: auto 1fr; }
  .brand { font-size: 1.14rem; gap: .32rem; }
  .brand img { width: 30px; height: 30px; }
  .header-actions .button { padding-inline: .54rem; text-align: center; }
  .header-signin { padding-inline: .38rem; }
  .nav a { padding-inline: .72rem; }
  .main { margin-top: 1.25rem; }
  .page-heading { align-items: start; flex-direction: column; gap: .55rem; margin-bottom: .87rem; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero h2 { text-wrap: initial; }
  .hero-image { aspect-ratio: 2.1; }
  .hero-image img { object-position: center 45%; }
  .content-grid, .manage-grid { grid-template-columns: 1fr; }
  .content-grid { margin-top: .9rem; }
  .archive-grid { grid-template-columns: 1fr; }
  .archive-card { min-height: 135px; }
  .vote-note { flex-basis: 100%; margin-left: 0; }
  .footer-inner { gap: .45rem .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
