:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --rule: #e3e0d8;
  --accent: #9a3412;
  --accent-soft: #fff4ec;
  --link: #1d4ed8;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1c1f23;
    --text: #e6e3dc;
    --muted: #9ba1a8;
    --rule: #30343a;
    --accent: #f0a167;
    --accent-soft: #2a211b;
    --link: #8ab4ff;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

header.site,
main,
footer.site {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

header.site {
  padding-top: 18px;
  padding-bottom: 6px;
}

header.site a {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

footer.site {
  margin-top: 48px;
  padding-top: 16px;
  padding-bottom: 32px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85em;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 12px 0 8px;
}

h2 {
  font-size: 1.25rem;
  margin: 36px 0 10px;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 46em;
}

p,
ul {
  max-width: 46em;
}

.crumbs {
  color: var(--muted);
  font-size: 0.9em;
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
}

.stat b {
  display: block;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.stat span {
  color: var(--muted);
  font-size: 0.85em;
}

.links {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

.links li {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
}

.links li span {
  display: block;
  color: var(--muted);
  font-size: 0.9em;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--surface);
  font-size: 0.92em;
}

.table-scroll {
  overflow-x: auto;
}

th,
td {
  border-bottom: 1px solid var(--rule);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface);
  font-weight: 600;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.states {
  max-width: 720px;
}

table.volumes td.files .src {
  display: block;
  white-space: nowrap;
}

table.volumes tr.withheld td {
  color: var(--muted);
}

td.status {
  font-style: italic;
}

.none {
  color: var(--muted);
}

input[type="search"] {
  font: inherit;
  padding: 6px 10px;
  width: min(360px, 100%);
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

#count {
  color: var(--muted);
  font-size: 0.9em;
  margin-left: 8px;
}

table.columns td:first-child,
table.volumes td:first-child {
  white-space: nowrap;
}
