/* One stylesheet, no build step. Deliberately plain. */

:root {
  --ink: #1c1f24;
  --muted: #6b7280;
  --line: #dfe3e8;
  --bg: #f7f8fa;
  --card: #ffffff;
  --accent: #2f5d8a;
  --yes: #1f7a4d;
  --no: #a52a2a;
  --abstain: #6b7280;
  --warn: #8a5a00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent); }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- chrome */

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; text-decoration: none; color: var(--ink); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 1rem; flex: 1; }
.topbar nav a { text-decoration: none; color: var(--muted); padding-bottom: 2px; }
.topbar nav a.on { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.who { display: flex; gap: 0.6rem; align-items: center; font-size: 0.92rem; }

main { max-width: 62rem; margin: 0 auto; padding: 1.5rem; }

footer {
  max-width: 62rem;
  margin: 2rem auto 3rem;
  padding: 1rem 1.5rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

h1 { font-size: 1.6rem; margin: 0 0 0.35rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1rem; margin: 0 0 0.35rem; }

.lede { color: var(--muted); margin: 0 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.85rem 1rem; }
.stat .n { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat .k { color: var(--muted); font-size: 0.85rem; }

/* ----------------------------------------------------------------- pills */

.pill {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill.under-consideration { background: #eef1f5; color: #445; border-color: #d8dee7; }
.pill.under-review       { background: #fff3d6; color: var(--warn); border-color: #f0dcae; }
.pill.in-effect          { background: #dff3e6; color: var(--yes); border-color: #b6e0c6; }
.pill.repealed           { background: #f3e2e2; color: var(--no); border-color: #e2bcbc; }
.pill.unconstitutional   { background: #2b2b2b; color: #fff; border-color: #000; }
.pill.kind               { background: #ece7f6; color: #4b3a7a; border-color: #d5cbe8; }
.pill.on                 { background: var(--accent); color: #fff; }

.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.between { display: flex; gap: 0.75rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }

/* ----------------------------------------------------------------- forms */

label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0.9rem 0 0.25rem; }
input[type=text], input[type=number], select, textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 7rem; resize: vertical; }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

button, .btn {
  font: inherit;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: #f0f2f5; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #27506f; }
button.yes { border-color: #b6e0c6; color: var(--yes); font-weight: 600; }
button.no  { border-color: #e2bcbc; color: var(--no); font-weight: 600; }
button.linky {
  border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline;
}
form.inline { display: inline; }

/* The three-way vote control: one row of buttons, the current choice filled. */
.ballot { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.ballot button { min-width: 5.5rem; }
.ballot button.chosen { background: var(--accent); border-color: var(--accent); color: #fff; }
.ballot button.chosen.yes { background: var(--yes); border-color: var(--yes); }
.ballot button.chosen.no  { background: var(--no); border-color: var(--no); }
.ballot button.chosen.abstain { background: var(--abstain); border-color: var(--abstain); }

/* ------------------------------------------------------------------ misc */

.flash { padding: 0.7rem 0.95rem; border-radius: 6px; margin: 0 0 1.25rem; border: 1px solid; }
.flash.ok  { background: #dff3e6; border-color: #b6e0c6; color: var(--yes); }
.flash.err { background: #fbe6e6; border-color: #e5bebe; color: var(--no); }

.meter { height: 0.5rem; background: #eceff3; border-radius: 999px; overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; }
.meter i.y { background: var(--yes); }
.meter i.n { background: var(--no); }
.meter i.a { background: var(--abstain); }

code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
pre { background: #f3f4f6; border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.75rem; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

.server-pill { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; }
.server-pill.up   { background: #dff3e6; color: var(--yes); }
.server-pill.down { background: #fbe6e6; color: var(--no); }
.server-pill.na   { background: #eceff3; color: var(--muted); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0.5rem 0 0; }
dl.facts dt { color: var(--muted); font-size: 0.88rem; }
dl.facts dd { margin: 0; }

.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filters a {
  padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--muted); font-size: 0.88rem; background: #fff;
}
.filters a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty { color: var(--muted); font-style: italic; padding: 0.75rem 0; }
.errorpage { text-align: center; padding: 3rem 0; }
.errorpage .code { font-size: 3.5rem; font-weight: 800; color: var(--line); }
