:root {
  --paper: #f4efe4;
  --paper-2: #fffdf8;
  --ink: #1c1c1c;
  --ink-soft: #5c5648;
  --rule: #ddd3c0;
  --rule-strong: #c9bda6;
  --city: #cf4520;
  --school: #2f6f3e;
  --state: #1a49c4;
  --shadow: 0 1px 0 var(--rule-strong), 0 14px 36px rgba(60, 48, 24, 0.08);
  --nav-h: 56px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse 55% 40% at 0% 0%, rgba(207, 69, 32, 0.14), transparent 55%),
    radial-gradient(ellipse 40% 30% at 100% 0%, rgba(47, 111, 62, 0.12), transparent 50%),
    var(--paper);
  min-height: 100dvh;
}

h1, h2, h3 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.4em;
}

p { margin: 0 0 0.75em; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--city); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding: 10px 18px;
  padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1.5px solid var(--rule);
  background: rgba(244, 239, 228, 0.94);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav-brand, .nav-logo, .nav-section {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.nav-logo { font-size: 13px; }
.nav-section { font-family: Fraunces, Georgia, serif; font-weight: 600; }
.nav-links { display: flex; gap: 14px; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12px;
}
.nav-links a:hover { color: var(--ink); }

.kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.hero, .shell, .legal {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
}
.hero { padding: 36px 0 12px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); max-width: 18ch; }
.lede { max-width: 62ch; color: var(--ink-soft); }

.lookup {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 22px 0 10px;
  padding: 16px;
  background: var(--paper-2);
  border: 1.5px solid var(--rule);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.lookup-field { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; }
.lookup-field span { font-size: 11px; color: var(--ink-soft); }
.lookup input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
}
.lookup button, .match-btn {
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper-2);
  cursor: pointer;
}
.lookup button:hover { filter: brightness(1.08); }
.status { min-height: 1.4em; color: var(--ink-soft); font-size: 13px; }
.status.is-error { color: var(--city); }

.matches { display: grid; gap: 8px; margin: 8px 0 18px; }
.match-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--paper-2);
  color: var(--ink);
  border: 1.5px solid var(--rule);
  text-align: left;
}
.match-btn small { color: var(--ink-soft); font-weight: 400; }

.shell { display: grid; gap: 28px; padding: 8px 0 48px; }
.summary, .year-bar, .bill, .dest, .history, .sources {
  background: var(--paper-2);
  border: 1.5px solid var(--rule);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.summary, .year-bar, .bill {
  display: grid;
  gap: 16px;
}
@media (min-width: 760px) {
  .summary, .year-bar, .bill { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 0;
}
.facts div { margin: 0; }
.facts dt { font-size: 11px; color: var(--ink-soft); }
.facts dd { margin: 0; font-size: 15px; }

.range { display: flex; gap: 12px; flex-wrap: wrap; }
.range label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.range select {
  min-height: 44px;
  min-width: 7.5rem;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--rule-strong);
  background: #fff;
  font-size: 16px;
}
.blurb { color: var(--ink-soft); font-size: 13px; }

.bill-amount {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}
.meta { color: var(--ink-soft); font-size: 13px; }

.cent-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  max-width: 280px;
}
.cent {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--rule);
}
.cent[title] { cursor: default; }

.dest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dest-row {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.dest-row:last-child { border-bottom: 0; }
.swatch { width: 12px; height: 12px; border-radius: 99px; }
.dest-name { display: flex; flex-direction: column; gap: 2px; }
.dest-name small { color: var(--ink-soft); }
.dest-cents { font-variant-numeric: tabular-nums; }
.dest-dollars { font-variant-numeric: tabular-nums; font-weight: 500; }

.parts { margin: 6px 0 0 22px; padding: 0; list-style: none; font-size: 12px; color: var(--ink-soft); }
.parts li { display: flex; justify-content: space-between; gap: 12px; }

.year-chart { display: grid; gap: 8px; margin-bottom: 16px; }
.year-bar-row { display: grid; grid-template-columns: 3.2rem 1fr 7rem; gap: 8px; align-items: center; font-size: 12px; }
.year-bar-track { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--rule); }
.year-bar-track span { display: block; height: 100%; }
.history { overflow-x: auto; }
.year-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.year-table th, .year-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.year-table th { color: var(--ink-soft); font-weight: 500; }
.year-table th:not(:first-child),
.year-table td:not(:first-child) { text-align: right; }

.sources p, .legal { color: var(--ink-soft); font-size: 13px; }
.legal { padding: 0 0 40px; }
.links { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 719px) {
  .nav-links a:nth-child(n+4) { display: none; }
  .dest-row { grid-template-columns: 12px 1fr auto; }
  .dest-cents { display: none; }
  .year-bar-row { grid-template-columns: 2.6rem 1fr; }
  .year-bar-row .amt { display: none; }
}
