:root {
  --bg: #fff;
  --surface: #f7f7f8;
  --surface-strong: #efeff1;
  --text: #111214;
  --muted: #5c6169;
  --border: #d9dce1;
  --cta: #0b57d0;
  --cta-text: #fff;
  --danger: #a12222;
  --focus: #0b57d0;
  --shadow: 0 12px 35px rgb(20 25 35 / 10%);
  --radius: 3px;
  --control-radius: 3px;
  --content: 75rem;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b0d10;
  --surface: #14171c;
  --surface-strong: #20242b;
  --text: #f5f7fa;
  --muted: #b7bdc6;
  --border: #343a44;
  --cta: #8ab4f8;
  --cta-text: #07111f;
  --danger: #ff9b9b;
  --focus: #8ab4f8;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #0b0d10;
    --surface: #14171c;
    --surface-strong: #20242b;
    --text: #f5f7fa;
    --muted: #b7bdc6;
    --border: #343a44;
    --cta: #8ab4f8;
    --cta-text: #07111f;
    --danger: #ff9b9b;
    --focus: #8ab4f8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}
a { color: inherit; text-decoration: underline; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1 { max-width: 24ch; margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 2.25rem); line-height: 1.12; }
h2 { margin: 2rem 0 .75rem; font-size: clamp(1.35rem, 3vw, 1.65rem); }
h3 { font-size: 1.08rem; }
p { max-width: 72ch; }
.sr-only {
  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 {
  position: fixed; top: .5rem; left: .5rem; z-index: 1000; padding: .75rem 1rem;
  background: var(--text); color: var(--bg); transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.floating-nav {
  position: sticky; top: .75rem; z-index: 50; display: flex; align-items: center; gap: 1.25rem;
  width: min(calc(100% - 1.5rem), var(--content)); margin: .75rem auto 0; padding: .7rem 1rem;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: var(--radius); background: color-mix(in srgb, var(--bg) 82%, transparent);
  box-shadow: var(--shadow); backdrop-filter: blur(16px);
}
.brand { font-weight: 750; text-decoration: none; white-space: nowrap; }
.nav-menu { margin-left: auto; }
.nav-menu summary { display: none; cursor: pointer; }
.nav-links { display: flex; align-items: center; gap: .9rem; }
.nav-links a {
  padding: .3rem .15rem; border-bottom: 2px solid transparent;
  text-decoration: underline; text-decoration-thickness: 1px;
}
.nav-links a.is-active {
  border-bottom-color: currentColor; background: var(--surface-strong);
  font-weight: 750; text-decoration-thickness: 3px;
}
.theme-control select {
  min-height: 2.5rem; border: 1px solid var(--border); border-radius: var(--control-radius);
  background: transparent; padding: 0 .7rem;
}
.page-shell { width: min(calc(100% - 2rem), var(--content)); margin: 3rem auto 5rem; }
.narrow { max-width: 48rem; }
.hero { display: grid; gap: 1rem; padding: clamp(1.5rem, 5vw, 3rem) 0; }
.eyebrow { color: var(--muted); font-size: .9rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 1.2rem;
}
.card h2, .card h3 { margin-top: 0; }
.meta { color: var(--muted); font-size: .94rem; }
.badge {
  display: inline-flex; align-items: center; min-height: 1.8rem; padding: .1rem .65rem;
  border: 1px solid var(--border); border-radius: var(--control-radius); font-size: .84rem;
}
.button {
  display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center;
  padding: .65rem 1rem; border: 2px solid var(--cta); border-radius: var(--control-radius);
  background: var(--cta); color: var(--cta-text); font-weight: 700; text-decoration: none; cursor: pointer;
}
.button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.compact { min-height: 2.5rem; padding: .35rem .65rem; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.filter-bar {
  display: flex; align-items: center; gap: .5rem; min-height: 3.5rem;
  position: sticky; top: 5rem; z-index: 20; padding: .35rem .45rem; margin: 1rem 0 2rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 90%, transparent); box-shadow: 0 8px 24px rgb(20 25 35 / 8%);
  backdrop-filter: blur(14px);
}
fieldset {
  min-width: 0; margin: 0; padding: .75rem; border: 1px solid var(--border);
  border-radius: var(--control-radius);
}
legend { padding: 0 .35rem; font-weight: 700; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: 1.15rem; min-height: 1.15rem; }
label { display: grid; gap: .35rem; font-weight: 650; }
input, select, textarea {
  width: 100%; min-height: 2.75rem; border: 1px solid var(--border); border-radius: var(--control-radius);
  background: var(--bg); padding: .65rem .75rem;
}
textarea { min-height: 8rem; resize: vertical; }
.helptext { color: var(--muted); font-size: .9rem; }
.errorlist { color: var(--danger); }
.messages { width: min(calc(100% - 2rem), var(--content)); margin: 1rem auto; }
.notice { border-left: 4px solid var(--cta); background: var(--surface); padding: 1rem; }
.waterfall { display: grid; gap: 1rem; counter-reset: agenda; }
.waterfall .agenda-item { counter-increment: agenda; }
.waterfall .agenda-item::before {
  content: counter(agenda); display: grid; place-items: center; width: 2rem; height: 2rem;
  border: 1px solid var(--border); border-radius: var(--control-radius); font-weight: 700; margin-bottom: .75rem;
}
.progress { height: .5rem; overflow: hidden; background: var(--surface-strong); border-radius: var(--control-radius); }
.progress > span { display: block; height: 100%; background: var(--cta); }
.hero-image {
  position: relative; min-height: min(55vh, 32rem); overflow: hidden; border-radius: var(--radius);
  background: var(--surface-strong); background-position: center; background-size: cover;
}
.hero-overlay {
  position: absolute; left: 1rem; right: 1rem; bottom: 1rem; max-width: 42rem; padding: 1.25rem;
  border: 1px solid rgb(255 255 255 / 40%); border-radius: var(--radius);
  background: rgb(12 15 20 / 74%); color: #fff; backdrop-filter: blur(14px);
}
.detail-grid {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(17rem, 1fr);
  align-items: start; gap: 2rem; margin: 2rem 0;
}
.facts { position: sticky; top: 6rem; }
.facts dl { display: grid; grid-template-columns: minmax(6rem, auto) 1fr; gap: .5rem 1rem; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
.notification-card { margin-top: 3rem; }
.notification-form { display: grid; gap: 1rem; }
.status-danger { color: var(--danger); border-color: currentColor; }
.agenda-item form { display: grid; gap: 1rem; }
.site-footer { width: min(calc(100% - 2rem), var(--content)); margin: 3rem auto; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .6rem 1rem; }
.stake-filter {
  flex: 1 1 auto; overflow-x: auto; padding: 0; border: 0;
  scrollbar-width: thin;
}
.stake-options { display: flex; align-items: center; gap: .35rem; min-width: max-content; }
.stake-option {
  display: flex; grid-template-columns: auto auto; align-items: center; gap: .4rem;
  min-height: 2.5rem; padding: .25rem .55rem; border: 1px solid var(--border);
  border-radius: var(--control-radius); background: var(--bg); font-weight: 600;
}
.stake-option:has(input:checked) {
  border-color: var(--text); background: var(--surface-strong);
}
.stake-option input { width: 1rem; min-height: 1rem; margin: 0; }
.view-switch {
  display: flex; flex: 0 0 auto; gap: .25rem; padding: 0; border: 0;
}
.view-switch label {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--border); border-radius: var(--control-radius);
  background: var(--bg); cursor: pointer;
}
.view-switch input:checked + label {
  border: 2px solid var(--text); background: var(--surface-strong);
}
.view-switch input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; }
.view-switch img { width: 1.3rem; height: 1.3rem; }
.committee-steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
  padding: 0; list-style: none; counter-reset: none;
}
.committee-steps h2 { margin-top: .25rem; }
.committee-help-list { display: grid; gap: .75rem; padding-left: 1.25rem; }
.presentation-page { max-width: 70rem; }
.presentation-page .committee-steps { display: block; }
.presentation-page .presentation-step { min-height: min(58vh, 31rem); padding: clamp(1.5rem, 5vw, 4rem); }
.presentation-controls {
  position: sticky; bottom: 1rem; display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin: 1rem auto; padding: .5rem; width: fit-content;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px);
}
.presentation-controls output { min-width: 4rem; text-align: center; font-weight: 700; }
.legal-card address { font-style: normal; }
.contact-form { display: grid; gap: 1rem; }
.contact-trap {
  position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden;
}
.recipient-setting {
  display: grid; grid-template-columns: minmax(8rem, 1fr) repeat(2, minmax(10rem, 1fr)) auto;
  align-items: center; gap: .75rem; padding: .75rem 0; border-top: 1px solid var(--border);
}
.confidential-message {
  padding: .75rem; border-left: 3px solid var(--border); background: var(--bg);
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .floating-nav { border-radius: var(--radius); flex-wrap: wrap; top: .35rem; }
  .nav-menu { order: 3; width: 100%; margin: 0; }
  .nav-menu summary {
    display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0;
    font-weight: 700;
  }
  .nav-menu:not([open]) > .nav-links { display: none; }
  .nav-links { flex-direction: column; align-items: stretch; gap: .15rem; padding-top: .35rem; }
  .nav-links a { padding: .55rem; }
  .nav-current { color: var(--muted); font-weight: 600; }
  .theme-control { margin-left: auto; }
  .page-shell { margin-top: 2rem; }
  .filter-bar { position: static; flex-wrap: wrap; }
  .stake-filter { flex-basis: 100%; }
  .stake-options {
    min-width: 0; justify-content: space-between; gap: .25rem;
  }
  .stake-option {
    min-width: 0; min-height: 2.25rem; padding: .2rem .4rem;
    font-size: clamp(.75rem, 3.4vw, .9rem);
  }
  .view-switch { margin-left: auto; }
  .detail-grid { grid-template-columns: 1fr; }
  .facts { position: static; }
  .committee-steps { grid-template-columns: 1fr; }
  .presentation-page .presentation-step { min-height: auto; }
  .recipient-setting { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .stake-options { gap: .1rem; }
  .stake-option {
    padding-inline: .2rem; gap: .2rem; font-size: .72rem;
  }
  .stake-option input { width: .75rem; min-height: .75rem; }
}

html[data-theme="dark"] .view-switch img { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .view-switch img { filter: invert(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .floating-nav, .theme-control, .site-footer, .button { display: none !important; }
  body { background: #fff; color: #000; }
  .card { break-inside: avoid; border-color: #bbb; }
}
