:root {
  --bg: #fbfaf6; --ink: #1c1c1c; --muted: #5d5d5d; --line: #d9d6cc; --card: #ffffff;
  --lci: #8fd3c3; --lci-d: #0f6b5b;
  --enr: #f6c89a; --enr-d: #a9491a;
  --fed: #c9c4e8; --fed-d: #4a3b8c;
  --off: #e6e3db; --off-d: #8a877f;
  --lean1: #ffe08a; --lean2: #f4a259; --lean3: #c8553d;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.4; }
a { color: inherit; }
header.site { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 24px 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
header .title { min-width: 0; }
header h1 { font-family: var(--serif); font-weight: normal; font-size: 22px; margin: 0; letter-spacing: .01em; }
header .sub { margin: 2px 0 8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 720px; }
nav.tabs { display: flex; gap: 2px; }
nav.tabs a { text-decoration: none; padding: 8px 14px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; color: var(--muted); }
nav.tabs a.on { background: var(--card); border-color: var(--line); color: var(--ink); margin-bottom: -1px; }
main { padding: 16px 24px 40px; max-width: 1440px; margin: 0 auto; }
footer.site { padding: 12px 24px 28px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: stretch; }
.hero-map { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.map-wrap { width: 100%; aspect-ratio: 975 / 610; position: relative; }
.map-wrap.small { max-width: 100%; }
.map-wrap svg { width: 100%; height: 100%; display: block; }
.map-controls { display: flex; flex-direction: column; gap: 6px; padding: 6px 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 12.5px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #f3f1ea; color: var(--ink); cursor: pointer; }
.chip:hover { background: #e9e6dc; }
.chip.on { background: #dfe9e4; border-color: #9fbfb3; }
.chip[data-g="lci"].on { background: var(--lci); border-color: var(--lci-d); }
.chip[data-g="enr"].on { background: var(--enr); border-color: var(--enr-d); }
.chip[data-g="fed"].on { background: var(--fed); border-color: var(--fed-d); }
.yearbar { display: flex; align-items: center; gap: 8px; }
.yearbar input { flex: 1; }
.yearbar .yval { font-family: var(--serif); font-size: 18px; min-width: 44px; text-align: right; }
.ylab { color: var(--muted); font-size: 12px; }
.playrow { display: flex; align-items: center; gap: 10px; }
.pill { font: inherit; font-size: 12px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.pill:hover { background: #f1efe8; }

.readout { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.readout .step { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bignums { display: flex; flex-direction: column; gap: 12px; }
.bignum .v { font-family: var(--serif); font-size: 40px; line-height: 1; }
.bignum .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.bignum.lci .v { color: var(--lci-d); } .bignum.enr .v { color: var(--enr-d); } .bignum.fed .v { color: var(--fed-d); }
.readout .note { color: var(--muted); font-size: 12.5px; margin: auto 0 0; }

.tip { position: fixed; pointer-events: none; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; max-width: 280px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.tip b { display: block; font-weight: 600; }
.tip .m { color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0; min-width: 0; }
.card.wide { grid-column: 1 / -1; }
figcaption { font-weight: 600; margin-bottom: 6px; }
.fine { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.muted { color: var(--muted); }
svg text { font-family: var(--sans); font-size: 11.5px; fill: var(--ink); }
.axis path, .axis line { stroke: var(--line); }
.axis text { fill: var(--muted); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 4px 0; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: var(--sw); border: 1px solid var(--sb); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar input[type=search], .toolbar select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.toolbar input[type=search] { min-width: 240px; }
.count { color: var(--muted); font-size: 12.5px; }
.orgs { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; }
.orglist { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.orglist table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.orglist th { text-align: left; font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--line); background: #f6f4ee; position: sticky; top: 0; }
.orglist td { padding: 5px 8px; border-bottom: 1px solid #efede6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.orglist td.num, .orglist th.num { text-align: right; }
.orglist tr { cursor: pointer; }
.orglist tr:hover td { background: #f7f5ef; }
.orglist tr.sel td { background: #ece9df; }
.orglist .more { padding: 8px; text-align: center; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid; }
.dot.lci { background: var(--lci); border-color: var(--lci-d); } .dot.enr { background: var(--enr); border-color: var(--enr-d); } .dot.fed { background: var(--fed); border-color: var(--fed-d); }
.lvl { display: inline-block; min-width: 18px; text-align: center; border-radius: 3px; padding: 0 4px; font-size: 11px; border: 1px solid var(--line); }
.lvl.l0 { background: #fff; color: var(--muted); } .lvl.l1 { background: var(--lean1); } .lvl.l2 { background: var(--lean2); } .lvl.l3 { background: var(--lean3); color: #fff; }
.orgdetail { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; }
.orgdetail h2 { font-family: var(--serif); font-weight: normal; font-size: 20px; margin: 0 0 2px; }
.orgdetail .dom { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.orgdetail dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0; font-size: 12.5px; }
.orgdetail dt { color: var(--muted); }
.orgdetail dd { margin: 0; }
.orgdetail h3 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.strip { display: grid; grid-template-columns: repeat(19, 1fr); gap: 2px; }
.strip .y { height: 18px; border-radius: 2px; border: 1px solid var(--line); }
.strip .y.u { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #eee 3px, #eee 6px); } .strip .y.n { background: #fff; }
.strip .y.l1 { background: var(--lean1); } .strip .y.l2 { background: var(--lean2); } .strip .y.l3 { background: var(--lean3); }
.striplab { display: grid; grid-template-columns: repeat(19, 1fr); font-size: 9px; color: var(--muted); text-align: center; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #f0eee6; border: 1px solid var(--line); }
.tag.spec { background: var(--lean1); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; margin-top: 16px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 12.5px; }
.pcard h3 { font-family: var(--serif); font-weight: normal; font-size: 16px; margin: 0 0 2px; }
.pcard .meta { color: var(--muted); margin-bottom: 6px; }
.pcard blockquote { margin: 8px 0 0; padding-left: 10px; border-left: 3px solid var(--lean1); font-style: italic; color: #333; }
.pcard .src { font-size: 11px; color: var(--muted); margin-top: 6px; }
.case { border-left: 3px solid var(--lean2); padding: 4px 10px; margin: 8px 0; font-size: 12.5px; }
.case .h { font-weight: 600; }
.case .p { color: #333; font-style: italic; }

.prose { font-size: 13.5px; max-width: 980px; }
.prose h2 { font-family: var(--serif); font-weight: normal; font-size: 20px; margin: 14px 0 6px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 12.5px; margin: 6px 0 12px; }
.prose th, .prose td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; background: #f6f4ee; }
.prose ul { padding-left: 18px; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .orgs { grid-template-columns: 1fr; }
  .orgdetail { position: static; max-height: none; }
  header .sub { white-space: normal; }
}
@media (max-width: 600px) {
  header.site, main { padding-left: 12px; padding-right: 12px; }
  .bignum .v { font-size: 30px; }
  nav.tabs a { padding: 6px 8px; font-size: 12.5px; }
}

.pages { padding-left: 16px; margin: 4px 0; font-size: 12px; }
.pages li { margin-bottom: 3px; word-break: break-all; }
.share { display: grid; grid-template-columns: 150px 1fr 36px; gap: 6px; align-items: center; font-size: 11.5px; margin: 2px 0; }
.share .k { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share .bar { height: 8px; background: #f0eee6; border-radius: 4px; overflow: hidden; }
.share .bar span { display: block; height: 100%; background: var(--fed); border-right: 1px solid var(--fed-d); }
.share .v { text-align: right; }
.gap { height: 6px; }
a.tag { text-decoration: none; background: #e8f1ee; }
a.tag:hover { background: #d7e8e2; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--ink); text-decoration: underline; }
th.sortable .arr { font-size: 9px; margin-left: 2px; }
.maplegend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 11.5px; color: var(--muted); padding: 2px 2px 0; min-height: 20px; }
.maplegend .t { font-weight: 600; color: var(--ink); }
.maplegend div { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.maplegend svg { flex: none; width: 18px; height: 18px; }
