/* The funnel is the product: columns stay side by side and scroll horizontally at
   every width. A responsive reflow to a single stacked list would destroy the one
   thing a board shows that a filtered list does not. */

:root {
  color-scheme: light dark;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-soft: #5c6270;
  --ink-faint: #8b909c;
  --line: #dcdde2;
  --accent: #2f5d8a;
  --law: #1f7a4d;
  --veto: #a33a2c;
  --column-width: 260px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f25;
    --ink: #e8e9ec;
    --ink-soft: #a2a8b4;
    --ink-faint: #6f7684;
    --line: #2c3038;
    --accent: #7aa9d8;
    --law: #57c08a;
    --veto: #e0796a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.masthead {
  flex: none;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: baseline;
  justify-content: space-between;
}

.masthead h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }

/* A board is only as fresh as its last batch run, so say so on the page. */
.freshness { margin: 3px 0 0; font-size: 12px; color: var(--ink-faint); }

.controls { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-soft); }
.controls label { display: flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }

.board {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 10px;
  padding: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
}

.column {
  flex: 0 0 var(--column-width);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-snap-align: start;
}

.column-head {
  flex: none;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.column-name { font-size: 12px; font-weight: 650; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-soft); }
.column-count { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Spec 6: nothing is hidden silently -- every column says what it is not showing. */
.column-hidden { font-size: 11px; color: var(--ink-faint); }

.column-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 7px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 8px 9px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.card:hover { border-color: var(--accent); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.card-number { font-size: 12px; font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }
.card-title { margin: 2px 0 5px; font-size: 13px; line-height: 1.3; }
.card-meta { font-size: 11px; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 8px; }

/* Most of committee is dead but nothing marks it dead; the absence of action is
   the signal, so stalled cards recede rather than disappear. */
.card.stale { opacity: 0.5; border-left-color: var(--ink-faint); }
.card.law { border-left-color: var(--law); }
.card.vetoed, .card.veto_sustained { border-left-color: var(--veto); }

.badge { font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.03em; }
.badge.law { color: var(--law); }
.badge.vetoed, .badge.veto_sustained { color: var(--veto); }

.more { font-size: 12px; color: var(--ink-soft); background: none; border: 1px dashed var(--line); border-radius: 5px; padding: 6px; cursor: pointer; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(460px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 18px 20px 28px;
  overflow-y: auto;
  z-index: 20;
}
.drawer-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 24px; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.drawer h2 { margin: 0 0 2px; font-size: 16px; }
.drawer .sub { color: var(--ink-soft); font-size: 13px; margin: 0 0 14px; }
.drawer dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 0 0 16px; }
.drawer dt { color: var(--ink-faint); }
.drawer dd { margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.timeline li { padding: 7px 0 7px 12px; border-left: 2px solid var(--line); }
/* Actions that actually moved the measure are what the stage is derived from;
   everything else is procedure. Showing which is which makes the board auditable. */
.timeline li.moved { border-left-color: var(--accent); }
.timeline .when { color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 10; }

/* Drill-down filters narrow the board to a subject. They sit in their own panel,
   apart from the masthead toggles that shape the funnel, so the two kinds of
   filter are not confused. */
.filter-panel {
  flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 8px 18px;
  font-size: 13px;
}
.filter-panel > summary { cursor: pointer; color: var(--ink-soft); font-weight: 600; }
.filter-count { font-weight: 400; color: var(--accent); }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 8px; }
.filter-row input, .filter-row select {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 8px;
  min-width: 0;
}
#f-query { flex: 1 1 240px; }
#f-sponsor { flex: 0 1 230px; }
#f-committee { max-width: 300px; }
/* Typed text that matches no sponsor filters nothing; say so. */
#f-sponsor.unmatched { border-color: var(--veto); }

.party { display: inline-flex; }
.party button {
  font: inherit;
  font-weight: 600;
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 5px 10px;
  cursor: pointer;
}
.party button + button { border-left: 0; }
.party button:first-child { border-radius: 5px 0 0 5px; }
.party button:last-child { border-radius: 0 5px 5px 0; }
.party button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }

.holding { display: flex; align-items: center; gap: 5px; color: var(--ink-soft); white-space: nowrap; cursor: pointer; }
.holding:has(input:disabled) { opacity: 0.5; cursor: default; }

.filter-summary { margin-top: 6px; font-size: 12px; color: var(--ink-faint); display: flex; gap: 12px; align-items: baseline; }
.filter-summary button { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }

.drawer .committees { list-style: none; margin: 0 0 16px; padding: 0; font-size: 13px; }
.drawer .committees li { padding: 3px 0; }
.drawer .chamber { color: var(--ink-faint); }
.holding-tag { font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent); }

/* Phones: narrower columns, still horizontal. ~150px keeps three columns of the
   funnel legible at a 380px viewport. */
@media (max-width: 620px) {
  :root { --column-width: 158px; }
  .board { gap: 7px; padding: 8px; }
  .card-title { font-size: 12px; }
  .masthead { padding: 10px 12px; }
  .filter-panel { padding: 8px 12px; }
  #f-query, #f-sponsor, #f-committee { flex: 1 1 100%; max-width: none; }
}
