:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --wash: rgba(11, 11, 11, 0.04);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-8: #e34948;
  --deemph: #c3c2b7;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --critical: #d03b3b;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.1);
    --wash: rgba(255, 255, 255, 0.05);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
    --deemph: #52514e;
    --good-text: #0ca30c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.1);
  --wash: rgba(255, 255, 255, 0.05);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --deemph: #52514e;
  --good-text: #0ca30c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 14px/1.5 var(--font);
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--axis);
}
a:hover {
  border-bottom-color: var(--ink);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--series-1);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 30;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.skip:focus {
  left: 12px;
}

header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  gap: 24px;
  height: 52px;
  padding: 0 20px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 0;
}
.brand svg {
  display: block;
  flex: none;
}
nav.tabs {
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
nav.tabs a {
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--ink-2);
  padding: 0 12px;
  white-space: nowrap;
}
nav.tabs a:hover {
  color: var(--ink);
}
nav.tabs a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--series-1);
  font-weight: 600;
}
.site-search {
  align-self: center;
  margin-left: auto;
  flex: 0 1 220px;
  min-width: 120px;
}
.site-search input {
  width: 100%;
  min-width: 0;
}
#theme {
  align-self: center;
  flex: none;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}
.crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--axis);
}
.crumbs a {
  color: var(--ink-2);
}

.page-head {
  margin-bottom: 16px;
}
h1 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.lede {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
  max-width: 82ch;
  margin: 0;
}
.lede + .lede {
  margin-top: 8px;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 0;
}
.section-title + .grid,
.section-title + .tiles,
.section-title + .card,
.section-title + .chapters,
.section-title + .link-cols,
.section-title + .az {
  margin-top: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 16px;
  margin-top: 16px;
}
.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
}
.wide {
  grid-column: 1 / -1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  min-width: 0;
  container-type: inline-size;
}
.card + .card {
  margin-top: 16px;
}
.grid > .card + .card {
  margin-top: 0;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
@container (max-width: 360px) {
  .card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
.card h2,
.card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.card-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.chart {
  position: relative;
  min-width: 0;
}
.chart[hidden],
.table-wrap[hidden] {
  display: none;
}
.note {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 8px;
}
.card > .note:last-child {
  margin: 10px 0 0;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  font: inherit;
  font-size: 12px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink-2);
  padding: 3px 10px;
  cursor: pointer;
}
.seg button:hover {
  background: var(--wash);
}
.seg button[aria-pressed="true"] {
  background: var(--page);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--border);
}

.btn {
  display: inline-block;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 10px;
  cursor: pointer;
}
.btn:hover {
  background: var(--wash);
  border-color: var(--border);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.btn[hidden] {
  display: none;
}

select,
input[type="search"] {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 8px;
}
input[type="search"] {
  min-width: 240px;
}
select[hidden] {
  display: none;
}

.typeahead {
  position: relative;
}
.typeahead input {
  width: 100%;
}
.card-tools .typeahead {
  flex: 0 1 260px;
}
.card-tools .typeahead input {
  min-width: 200px;
}
.ta-list {
  position: absolute;
  z-index: 15;
  top: calc(100% + 4px);
  right: 0;
  width: max(100%, 380px);
  max-width: 90vw;
  max-height: 380px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.ta-list[hidden] {
  display: none;
}
.ta-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
}
.ta-list li.active,
.ta-list li:hover {
  background: var(--wash);
}
.ta-name {
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ta-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 16px;
  margin-top: 16px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 0;
}
.tile-label {
  color: var(--ink-2);
  font-size: 13px;
}
.tile-value {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tile-note {
  color: var(--muted);
  font-size: 12px;
}

.facts {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 0 20px;
  margin: 0;
  font-size: 13px;
}
.facts dt,
.facts dd {
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.facts dt {
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12px;
}
.facts dd {
  min-width: 0;
  overflow-wrap: anywhere;
}
.facts dt:last-of-type,
.facts dd:last-of-type {
  border-bottom: 0;
}

svg.viz {
  display: block;
  overflow: visible;
}
svg.viz text {
  font-family: var(--font);
  font-size: 11px;
  fill: var(--muted);
}
svg.viz text.lbl {
  fill: var(--ink-2);
  font-size: 12px;
}
svg.viz text.val {
  fill: var(--ink-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
svg.viz text.axis {
  font-variant-numeric: tabular-nums;
}
svg.viz text.note {
  fill: var(--ink-2);
}
svg.viz .grid line,
svg.viz line.grid {
  stroke: var(--grid);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
svg.viz line.baseline {
  stroke: var(--axis);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
svg.viz .row text,
svg.viz .row .mark {
  pointer-events: none;
}
svg.viz .row.lift .mark {
  opacity: 0.75;
}
svg.viz .node.lift text {
  fill: var(--ink) !important;
}
svg.viz .row.lift .hit,
svg.viz .hit.lift {
  fill: var(--wash);
}
svg.viz .hit {
  outline: none;
}
svg.viz .hit:focus-visible {
  stroke: var(--series-1);
  stroke-width: 1.5;
}
svg.viz .crosshair {
  stroke: var(--muted);
  stroke-width: 1;
  shape-rendering: crispEdges;
  pointer-events: none;
}
svg.viz .dot {
  stroke: var(--surface);
  stroke-width: 2;
}
svg.viz .overlay {
  fill: transparent;
  outline: none;
}
svg.viz .overlay:focus-visible {
  stroke: var(--series-1);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.legend i.dot {
  border-radius: 50%;
}

.sm-grid {
  display: grid;
  gap: 16px 20px;
}
.sm-cell h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.sm-cell h4 span {
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.tooltip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 8px 10px;
  font-size: 12px;
  max-width: 320px;
}
.tooltip[hidden] {
  display: none;
}
.tip-title {
  color: var(--ink-2);
  margin-bottom: 4px;
}
.tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tip-row strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.tip-row span.tip-label {
  color: var(--ink-2);
}
.tip-key {
  display: inline-block;
  width: 12px;
  height: 2px;
  border-radius: 1px;
}

.table-wrap {
  overflow-x: auto;
}
.table-wrap.tall {
  max-height: 640px;
  overflow-y: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
caption {
  caption-side: top;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 6px;
}
th,
td {
  text-align: left;
  padding: 5px 12px 5px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.table-wrap.tall thead th,
.dt thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td.nowrap {
  white-space: nowrap;
}
td.mono {
  font-family: var(--mono);
  font-size: 12px;
}
td.dim,
span.dim {
  color: var(--muted);
}
tbody tr:target td {
  background: var(--wash);
}
tbody tr:last-child td {
  border-bottom: 0;
}
th.sortable {
  padding: 0;
}
.dt-sort {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: none;
  border: 0;
  padding: 5px 12px 5px 0;
  cursor: pointer;
  width: 100%;
  text-align: inherit;
  white-space: nowrap;
}
.dt-sort:hover {
  color: var(--ink);
}
th[aria-sort="ascending"] .dt-sort::after {
  content: " (asc)";
  font-size: 10px;
}
th[aria-sort="descending"] .dt-sort::after {
  content: " (desc)";
  font-size: 10px;
}

.card.full-height {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
  min-height: 480px;
}
.card.full-height .chart {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dt-holder {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dt-holder[hidden] {
  display: none;
}
.dt {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dt-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.dt td {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt thead th {
  padding: 0;
}
.dt-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.dt-info {
  color: var(--ink-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  margin-right: auto;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.pager .dt-info {
  margin-right: auto;
}

.chips,
.az {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 1.4;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--page);
  white-space: nowrap;
}
a.chip:hover {
  background: var(--wash);
  border-color: var(--border);
}
.chip[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--series-1);
}
.chip .chip-n {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}

.link-cols {
  columns: 4 220px;
  column-gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}
.link-cols li {
  break-inside: avoid;
  padding: 3px 0;
  overflow-wrap: anywhere;
}
.link-cols .dim {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chapters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chapters li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.chapters .kicker {
  font-variant-numeric: tabular-nums;
}
.chapters h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}
.chapters p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 46rem) minmax(280px, 380px);
  justify-content: start;
  gap: 16px 56px;
  align-items: start;
}
.layout > aside {
  position: sticky;
  top: 68px;
}
.layout > aside .card + .card {
  margin-top: 16px;
}

.prose {
  font-size: 15px;
  line-height: 1.65;
  max-width: 76ch;
}
.prose p {
  margin: 0 0 14px;
}
.prose h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin: 28px 0 8px;
}
.prose h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 6px;
}
.prose ul,
.prose ol {
  margin: 0 0 14px;
  padding-left: 20px;
}
.prose li {
  margin-bottom: 6px;
}
.prose > :last-child {
  margin-bottom: 0;
}
cite {
  font-style: italic;
}
.card .prose {
  font-size: 14px;
  line-height: 1.6;
}
.prose.split {
  max-width: none;
  columns: 2 380px;
  column-gap: 40px;
}
.prose.split p {
  break-inside: avoid;
}
.next-prev {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.terms {
  margin: 0;
}
.terms dt {
  font-weight: 600;
  margin-top: 12px;
}
.terms dt:first-child {
  margin-top: 0;
}
.terms dd {
  margin: 2px 0 0;
  color: var(--ink-2);
}

.loading {
  color: var(--muted);
}
.error {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.error p {
  margin: 0 0 8px;
}
.error p:last-child {
  margin-bottom: 0;
}
code {
  font-family: var(--mono);
  font-size: 12px;
}

footer.foot {
  border-top: 1px solid var(--border);
  padding: 20px;
  color: var(--ink-2);
  font-size: 13px;
}
.foot-inner {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr));
  gap: 16px 32px;
  max-width: 1400px;
  margin: 0 auto;
}
.foot h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot li {
  padding: 2px 0;
}
.foot p {
  margin: 0 0 8px;
  max-width: 52ch;
}
.foot a {
  color: var(--ink-2);
  border-bottom-color: transparent;
}
.foot a:hover {
  color: var(--ink);
  border-bottom-color: var(--axis);
}
.foot .brand {
  display: inline-flex;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 6px;
}

@media (max-width: 1180px) {
  header.top {
    height: auto;
    flex-wrap: wrap;
    row-gap: 0;
  }
  .brand {
    height: 46px;
  }
  nav.tabs {
    order: 3;
    width: 100%;
    height: 40px;
  }
  .site-search,
  #theme {
    height: 46px;
    display: flex;
    align-items: center;
  }
  html {
    scroll-padding-top: 100px;
  }
  .layout > aside {
    top: 102px;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .layout > aside {
    position: static;
  }
  .foot-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  header.top {
    gap: 0 12px;
    padding: 0 16px;
  }
  .site-search {
    flex: 1 1 120px;
  }
  main {
    padding: 12px 16px 32px;
  }
  h1 {
    font-size: 22px;
  }
  input[type="search"] {
    min-width: 0;
  }
  .card-tools .typeahead input {
    min-width: 0;
  }
  .facts {
    grid-template-columns: minmax(96px, max-content) 1fr;
    gap: 0 12px;
  }
  .card.full-height {
    height: calc(100vh - 170px);
  }
}

@media (max-width: 520px) {
  #theme .seg button {
    padding: 3px 7px;
  }
  .foot-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

.js [data-chart]:not([data-view]) > .table-wrap {
  display: none;
}
.js [data-chart]:not([data-view]) > .chart {
  min-height: 220px;
}
[data-series] {
  display: none;
}
.js [data-series] {
  display: block;
}
tr[hidden] {
  display: none;
}

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}
.link-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.link-list li:last-child {
  border-bottom: 0;
}
