:root {
  color-scheme: light dark;
  --page: #f4f5ee;
  --surface: #fffef9;
  --text: #182a21;
  --muted: #52635a;
  --line: #d8dfd5;
  --accent: #235c41;
  --accent-soft: #e8efe3;
  --hero: #142c22;
  --hero-text: #f6f7ee;
  --hero-muted: #ccded1;
  --hero-line: #9cb8a34d;
  --hero-accent: #dcf3a4;
  --focus: #307653;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #101a16;
    --surface: #17251e;
    --text: #edf4ea;
    --muted: #b0c4b7;
    --line: #374b40;
    --accent: #afe2be;
    --accent-soft: #23392a;
    --focus: #b6e7bf;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.25rem; }
body { margin: 0; background: var(--page); color: var(--text); font: 1rem/1.55 var(--sans); }
a { color: var(--accent); text-underline-offset: .24em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p, dl { margin: 0; }
h2 { font-size: clamp(1.45rem, 3vw, 2.1rem); letter-spacing: -.045em; line-height: 1.18; }
h3 { font-size: 1.14rem; }
dd { margin: 0; }
code, pre, .mono { font-family: var(--mono); }
code, .mono { font-size: .88em; }
.wrap { width: min(100% - 3rem, 74rem); margin-inline: auto; }
.skip { position: absolute; left: .75rem; top: -5rem; z-index: 2; background: var(--surface); padding: .6rem 1rem; }
.skip:focus { top: .6rem; }

.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; min-height: 4.15rem; padding-block: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 750; text-decoration: none; }
.mark-img { border-radius: .4rem; vertical-align: middle; }
.mark { background: var(--hero); color: var(--hero-accent); border-radius: .35rem; padding: .13rem .45rem; font-size: 1.2rem; line-height: 1.4; }
nav, .footer div { display: flex; flex-wrap: wrap; gap: .45rem clamp(.8rem, 2.5vw, 1.8rem); }
nav a { color: var(--text); font-weight: 550; font-size: .875rem; text-decoration: none; padding: .37rem 0; }
nav a:hover { text-decoration: underline; }

.hero {
  color: var(--hero-text);
  background-color: var(--hero);
  background-image: linear-gradient(90deg, #142c22 24%, transparent),
    linear-gradient(90deg, #afdec015 1px, transparent 1px),
    linear-gradient(#afdec015 1px, transparent 1px);
  background-size: auto, 2.45rem 2.45rem, 2.45rem 2.45rem;
  border-bottom: 4px solid #739c72;
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, .51fr); align-items: end; gap: 2rem; padding-block: clamp(2.65rem, 6vw, 5rem); }
.eyebrow { color: var(--hero-accent); text-transform: uppercase; font: 650 .78rem/1.45 var(--mono); letter-spacing: .13em; }
.hero h1 { font-size: clamp(2.8rem, 7.7vw, 6.15rem); line-height: 1.01; letter-spacing: -.075em; margin: .5rem 0 .95rem; }
.hero-description { color: var(--hero-muted); font-size: clamp(1rem, 2vw, 1.16rem); max-width: 38ch; }
.snapshot { padding: 1.15rem 1.35rem; background: #142c22; border: 1px solid var(--hero-line); border-radius: .55rem; }
.snapshot h2 { color: var(--hero-text); font-size: 1.03rem; letter-spacing: -.01em; margin-bottom: .7rem; }
.snapshot dl { display: grid; gap: .3rem; margin-bottom: .85rem; }
.snapshot dl div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem .8rem; }
.snapshot dt { color: var(--hero-muted); font-size: .86rem; }
.snapshot dd { font: .78rem/1.6 var(--mono); }
.snapshot a { color: var(--hero-accent); font-size: .85rem; }
.hero :focus-visible { outline-color: var(--hero-accent); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 1.6rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.metrics:empty, #load-status:empty { display: none; }
.metrics div { min-width: 0; display: flex; flex-direction: column-reverse; padding: 1rem 1.25rem; }
.metrics div + div { border-inline-start: 1px solid var(--line); }
.metrics dt { color: var(--muted); font-size: .85rem; }
.metrics dd { font-size: clamp(1.45rem, 3.15vw, 2.35rem); letter-spacing: -.06em; font-weight: 720; font-variant-numeric: tabular-nums; line-height: 1.2; margin-bottom: .15rem; }

.section { padding-block: 2.15rem; border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: .55rem; }
.section > p, .detail-section > p, #load-status { color: var(--muted); max-width: 76ch; margin-bottom: 1rem; }
#load-status { margin-top: 1rem; }
#search { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; margin-bottom: .9rem; }
label { font-size: .91rem; color: var(--muted); font-weight: 600; }
input, button { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: .4rem; }
input { width: min(100%, 38rem); padding: .6rem .8rem; }
input::placeholder { color: var(--muted); }
button, .button { padding: .32rem .75rem; min-height: 2.3rem; font-size: .875rem; font-weight: 600; }
.button { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: .4rem; }
button:not(:disabled), summary { cursor: pointer; }
button:not(:disabled):hover, .button:hover { background: var(--accent-soft); }
button:disabled { opacity: .48; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; margin-top: .65rem; color: var(--muted); font-size: .86rem; }
.pager-buttons { display: flex; gap: .4rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .91rem; text-align: left; }
caption { text-align: left; padding: .55rem .8rem; color: var(--muted); font-weight: 600; }
th { background: var(--accent-soft); font-weight: 660; white-space: nowrap; }
th, td { padding: .62rem .8rem; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.address { white-space: nowrap; }
.address span { display: inline-block; }
.group { border: 1px solid var(--line); background: var(--surface); border-radius: .55rem; margin-bottom: .55rem; }
.group > summary { padding: .78rem 1rem; color: var(--accent); }
.group[open] > summary { border-bottom: 1px solid var(--line); background: var(--accent-soft); border-radius: .55rem .55rem 0 0; }
.group-title { color: var(--text); font-weight: 660; }
.group-meta { margin-inline-start: .65rem; color: var(--muted); font-size: .84rem; }
.group-body, .standard > p, #small-groups { margin: .8rem 1rem; }
.standard { margin-top: 1rem; }
.group-body > p { margin-bottom: .65rem; color: var(--muted); }
.footnote, .empty { font-size: .9rem; color: var(--muted); }

.detail { padding-block: 2rem; }
.detail h1 { font-size: clamp(1.75rem, 5vw, 3.45rem); line-height: 1.12; letter-spacing: -.05em; margin-block: .9rem .45rem; }
.detail .identity { color: var(--muted); overflow-wrap: anywhere; }
.detail-section { margin-top: 1.8rem; }
.detail-section h2 { margin-bottom: .6rem; font-size: 1.4rem; }
.detail .record { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); overflow: hidden; }
.record > div { padding: .65rem .9rem; border-bottom: 1px solid var(--line); }
.record dt { color: var(--muted); font-size: .84rem; margin-bottom: .2rem; }
.record .wide { grid-column: 1 / -1; overflow-wrap: anywhere; border-bottom: 0; }
.detail pre { background: var(--surface); border: 1px solid var(--line); border-radius: .55rem; overflow-x: auto; padding: .8rem .95rem; font-size: .88rem; line-height: 1.65; }
.relations { padding-left: 1.25rem; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding-block: 1.25rem 2rem; font-size: .86rem; color: var(--muted); }

@media (max-width: 48rem) {
  .hero-inner { grid-template-columns: 1fr; }
  .snapshot { width: min(100%, 27rem); }
}

@media (max-width: 36rem) {
  .wrap { width: calc(100% - 1.6rem); }
  .metrics, .detail .record { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics div:nth-child(3) { border-inline-start: 0; }
  .metrics div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .metrics div { padding: .75rem .8rem; }
  .group-meta { display: block; margin-inline-start: 1rem; }
}

.relations .address { white-space: normal; overflow-wrap: anywhere; }
