:root {
  --bg: #f3efe6;
  --card: #fffcf7;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e4dccf;
  --accent: #1f4d3a;
  --warn: #7a4b12;
  --warn-bg: #f6e7c8;
  --focus: #1f4d3a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 "Segoe UI", system-ui, sans-serif;
}
a { color: var(--accent); }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.3rem; }
h2 { font-size: 1.05rem; margin: 0; }
p { margin: 0.4rem 0; }

.top {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}
.mark {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
}
.nav { display: flex; gap: 0.25rem; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}
.nav a.on, .nav a:hover { background: #e7f0ea; color: var(--accent); }
.search { margin-left: auto; }
.search input {
  width: 16rem;
  max-width: 40vw;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
}
.banner {
  background: var(--warn-bg);
  color: var(--warn);
  padding: 0.45rem 1.25rem;
  font-size: 0.92rem;
}
main { max-width: 1080px; margin: 0 auto; padding: 1.25rem; }
.lede { color: var(--muted); max-width: 42rem; }
.row { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 0.8rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 1rem; }
.filters a, .btn, button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}
.filters a.on, .btn.primary, button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
}
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th { color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
table.data tr.click:hover { background: #f7f3ea; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.78rem;
  background: #eceae4;
}
.pill.active { background: #dcecde; color: #1f4d3a; }
.pill.prospective { background: #f3e6c8; color: #7a4b12; }
.pill.pending { background: #e4e7ef; color: #2c3a55; }
.pill.closed { background: #eceae4; color: #57534e; }
.flash { background: #dcecde; color: #1f4d3a; padding: 0.5rem 0.7rem; border-radius: 8px; margin-bottom: 0.8rem; }
.err { background: #f8e4e0; color: #7f1d1d; padding: 0.5rem 0.7rem; border-radius: 8px; margin-bottom: 0.8rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem 1rem; }
.grid label, .stack label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.82rem; color: var(--muted); }
.grid input, .grid select, .stack input, .stack select, .stack textarea, .inline input, .inline select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  width: 100%;
}
.span2 { grid-column: span 2; }
.actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.8rem; }
.years { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.years table { border-collapse: collapse; width: 100%; min-width: 680px; }
.years th, .years td { border-bottom: 1px solid var(--line); }
.years th { background: #f7f4ee; text-align: right; padding: 0.7rem 0.8rem; font-variant-numeric: tabular-nums; }
.years td.lab, .years th.lab {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fbfaf7;
  color: var(--muted);
  font-size: 0.86rem;
  width: 12rem;
  padding: 0.35rem 0.8rem;
  z-index: 1;
}
.years input, .years select {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  padding: 0.65rem 0.8rem;
  font-variant-numeric: tabular-nums;
}
.years input:focus, .years select:focus { outline: 2px solid var(--focus); outline-offset: -2px; background: #fffdf6; }
.years .gap { text-align: right; padding: 0.65rem 0.8rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.note { border-top: 1px solid var(--line); padding: 0.6rem 0; }
.note p { margin: 0.15rem 0; white-space: pre-wrap; }
.inline { display: flex; gap: 0.4rem; align-items: end; }
.inline label { flex: 1; }
.links a { margin-right: 0.8rem; }
.reset summary { cursor: pointer; color: var(--muted); }
@media (max-width: 720px) {
  .top { flex-wrap: wrap; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; max-width: none; }
  .grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
}
