:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --ink: #15201c;
  --muted: #5d6b66;
  --line: #e1e5e2;
  --brand: #155e4b;
  --brand-ink: #ffffff;
  --brand-soft: #e3f0eb;
  --est: #8a5a00;
  --est-soft: #fbf1dc;
  --ann: #1f5f99;
  --ann-soft: #e2edf8;
  --bad: #a3271f;
  --bad-soft: #fbe6e3;
  --focus: #2f8f73;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513; --surface: #161e1b; --ink: #e6ece9; --muted: #95a39e; --line: #26312d;
    --brand: #3fb08c; --brand-ink: #0b1210; --brand-soft: #173229; --est: #e2b45c; --est-soft: #33290f; --ann: #7fb6ea; --ann-soft: #172a3d;
    --bad: #f08a80; --bad-soft: #3a1c19; --focus: #5fd1aa; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1513; --surface: #161e1b; --ink: #e6ece9; --muted: #95a39e; --line: #26312d;
  --brand: #3fb08c; --brand-ink: #0b1210; --brand-soft: #173229; --est: #e2b45c; --est-soft: #33290f; --ann: #7fb6ea; --ann-soft: #172a3d;
  --bad: #f08a80; --bad-soft: #3a1c19; --focus: #5fd1aa; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
a { color: var(--brand); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* top bar + hero (dark green in both themes) */
:root { --deep: #0b3328; --deep-2: #12523f; --mint: #9fe0c6; --serif: Fraunces, Georgia, "Times New Roman", serif; }
.topbar { background: var(--deep); color: #fff; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 700; font-size: 21px; letter-spacing: 0.06em; }
.logo { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.logo .tick { stroke: var(--mint); stroke-width: 2.8; }
.nav { display: flex; gap: 4px; }
.nav a { color: #d4ece2; text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { background: rgb(255 255 255 / 0.08); color: #fff; }

.hero {
  position: relative; overflow: hidden; color: #e8f4ef; padding: 44px 0 84px;
  background:
    radial-gradient(900px 420px at 85% -10%, rgb(159 224 198 / 0.18), transparent 60%),
    linear-gradient(180deg, var(--deep) 0%, var(--deep-2) 100%);
}
/* faint calendar grid */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgb(255 255 255 / 0.05) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(100deg, transparent 35%, #000 90%);
}
.hero .wrap { position: relative; }
.eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mint); }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 6vw, 56px); line-height: 1.04; letter-spacing: -0.02em; margin: 0; max-width: 15ch; color: #fff; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--mint); }
.lede { margin: 16px 0 0; font-size: 17px; max-width: 46ch; color: #c5ddd3; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; }
.stat { display: flex; flex-direction: column; color: inherit; text-decoration: none; border-left: 2px solid rgb(159 224 198 / 0.45); padding: 2px 0 2px 12px; }
.stat b { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: #b3d0c4; }
.stat:hover { border-left-color: var(--mint); }
.stat:hover span { color: #fff; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px -12px rgb(6 40 30 / 0.35), 0 2px 6px rgb(0 0 0 / 0.05); }
.search { position: sticky; top: 8px; z-index: 2; margin-top: -52px; padding: 14px; }
.field { position: relative; }
.field svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
#q {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 14px 44px;
}
#q:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.filters button {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.filters button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.state-pick { flex: none; margin-left: auto; }
.state-pick select {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); background-color: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 28px 5px 12px; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 14px center, right 10px center; background-size: 4px 4px; background-repeat: no-repeat;
}
.state-pick select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.when .loc { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--brand); background: var(--brand-soft); padding: 1px 6px; border-radius: 4px; }
.summary { color: var(--muted); font-size: 13px; margin: 10px 0 0 2px; min-height: 1.5em; }
main.wrap > .results { margin-top: 8px; }

.month { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); margin: 30px 0 10px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: start; }
.row:first-child { border-top: 0; }
.when .d { font-weight: 600; font-variant-numeric: tabular-nums; }
.when .t { color: var(--muted); font-size: 13px; }
.who .code { font-weight: 700; letter-spacing: 0.02em; margin-right: 8px; color: var(--brand); text-decoration: none; }
.who .name { color: var(--ink); }
.who { min-width: 0; overflow-wrap: anywhere; }
.who .ind { color: var(--muted); font-size: 13px; }
.who mark { background: var(--brand-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.confirmed { background: var(--brand-soft); color: var(--brand); }
.badge.estimated { background: var(--est-soft); color: var(--est); }
.badge.announced { background: var(--ann-soft); color: var(--ann); }
.badge.unknown { background: var(--line); color: var(--muted); }
.links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1; text-decoration: none;
  padding: 6px 10px 6px 8px; border-radius: 999px; cursor: pointer;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s, color .15s, background .15s;
}
.btn svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #fff); color: var(--brand-ink); }
.btn.lg { font-size: 14px; padding: 9px 15px 9px 12px; gap: 7px; }
.btn.lg svg { width: 16px; height: 16px; }

.votes { grid-column: 2 / -1; margin-top: 4px; font-size: 13px; }
.votes summary { cursor: pointer; color: var(--muted); list-style: none; display: block; }
.votes summary .strike { margin-left: 6px; }
.votes summary::-webkit-details-marker { display: none; }
.votes summary::before { content: "▸"; display: inline-block; width: 14px; font-size: 10px; transition: transform .15s; }
.votes[open] summary::before { transform: rotate(90deg); }
.strike { background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: 12px; padding: 1px 7px; border-radius: 999px; }
.votes table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.votes th, .votes td { text-align: left; padding: 5px 8px 5px 0; border-top: 1px solid var(--line); vertical-align: top; }
.votes th { font-weight: 500; color: var(--muted); font-size: 12px; }
.votes td.n { text-align: right; white-space: nowrap; }
.votes th.n { text-align: right; }
.votes .bar { display: inline-block; width: 60px; height: 6px; background: var(--bad-soft); border-radius: 3px; vertical-align: middle; margin-left: 8px; overflow: hidden; }
.votes .bar i { display: block; height: 100%; background: var(--brand); }
.votes .lost { color: var(--bad); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.more { display: block; margin: 20px auto 0; font: inherit; font-weight: 500; color: var(--brand); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 18px; cursor: pointer; }

footer.site { color: var(--muted); font-size: 13px; padding-top: 32px; padding-bottom: 48px; }
footer.site p { margin: 0 0 8px; max-width: 70ch; }

@media (max-width: 640px) {
  .hero { padding: 32px 0 76px; }
  .lede { font-size: 16px; }
  .stat b { font-size: 24px; }
  .nav a { padding: 6px 8px; }
  /* one swipeable row, so the sticky search card stays short */
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 12px -14px 0; padding: 0 14px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; }
  #q { font-size: 16px; }
  .row { grid-template-columns: 78px minmax(0, 1fr); }
  .links { flex-wrap: wrap; white-space: normal; }
  .side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
  .side .links { justify-content: flex-start; }
  .votes { grid-column: 1 / -1; }
  .votes .bar { display: none; }
}

/* company pages */
.who .name a { color: inherit; text-decoration: none; }
.who .name a:hover { text-decoration: underline; }
.company h1 { font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; margin: 8px 0 2px; }
.company h1 .code { color: var(--brand); margin-right: 6px; }
.company h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
.company .card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-top: 18px; }
.company .big { font-family: var(--serif); font-size: 28px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
.company .links { justify-content: flex-start; gap: 8px; margin-top: 14px; }
.company .votes { overflow-x: auto; }
.company .votes table { min-width: 480px; }
.muted { color: var(--muted); }
.crumbs { margin: 24px 0 0; font-size: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a::before { content: "← "; }

@media (max-width: 640px) {
  .company .votes table { min-width: 0; font-size: 13px; }
  .company .votes th:first-child, .company .votes td:first-child { display: none; }
  .company .card { padding: 16px; }
}

/* spills, second-strike watch and protest votes */
.badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
a.badge { text-decoration: none; }
.badge.watch { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px currentColor; }
a.badge.watch:hover { background: var(--bad-soft); }
.tag { background: var(--line); color: var(--muted); font-weight: 600; font-size: 12px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.votes summary .tag { margin-left: 6px; }
.protest-count { color: var(--ink); font-weight: 600; }
.votes tr.protest td { background: color-mix(in srgb, var(--bad-soft) 55%, transparent); }
.votes tr.protest td.against { color: var(--bad); font-weight: 600; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend .key { width: 12px; height: 12px; border-radius: 3px; background: var(--bad-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 40%, transparent); }
.company .watch { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--bad-soft) 60%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 30%, var(--line)); }
.company .watch p { margin: 0 0 6px; }
.company .watch p:last-child { margin: 0; }

.spills .lede-sm { color: var(--muted); max-width: 70ch; margin: 10px 0 0; }
.spills .votes table { min-width: 560px; }
.spills .votes td.d { white-space: nowrap; }
.spills .votes .code { font-weight: 700; color: var(--brand); text-decoration: none; margin-right: 4px; }
.spills .votes .name { color: var(--ink); }
.spills .votes .strike { margin: 0; }
.codes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.codes a { font-size: 13px; font-weight: 600; text-decoration: none; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; }
.codes a:hover { border-color: var(--brand); }

@media (max-width: 640px) {
  .side .badges { justify-content: flex-start; }
  .spills .votes table { min-width: 0; }
  .spills .votes th:first-child, .spills .votes td:first-child { display: table-cell; }
  .spills .votes .name { display: none; }
}
