:root {
  --bg: #fbfaf7;
  --fg: #1d1d1b;
  --muted: #5c5c57;
  --line: #dddad2;
  --accent: #1f6f5c;
  --panel: #f1efe9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --fg: #ecebe6;
    --muted: #a8a69e;
    --line: #34332f;
    --accent: #6cc4a8;
    --panel: #1d1c1a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header.site {
  border-bottom: 1px solid var(--line);
}

header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.logo svg { color: var(--accent); }

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-right: 1rem;
}

nav a:last-child { margin-right: 0; }

nav a:hover,
nav a[aria-current="page"] { color: var(--fg); }

main { padding: 2rem 0 3rem; }

h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.3rem; margin: 2.25rem 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.25rem; }

a { color: var(--accent); }

.lead { font-size: 1.15rem; color: var(--muted); }

.status {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 1rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { font-weight: 600; white-space: nowrap; }

td.empty {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem;
}

pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  white-space: pre-wrap;
  font-size: 0.9rem;
}

code { font-size: 0.92em; }

footer.site {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem 0 2.5rem;
}

footer.site p { margin: 0 0 0.5rem; }

.footer-links a,
.footer-links span { margin-right: 1rem; }

.promise { margin: 0 0 0.35rem; color: var(--muted); }

.edition-name { margin: 0.15rem 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; color: var(--muted); }

.edition-stats { color: var(--muted); font-size: 0.95rem; }
.edition-stats strong { color: var(--fg); }

.crumbs { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.75rem; }
.crumbs a { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.chips a {
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  font-size: 0.85rem;
}
.chips a:hover { border-color: var(--accent); }
.chips .n,
.archive .n { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }

.cards { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.7rem 0.35rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 0.75rem;
}
.card:target { background: var(--panel); }
.rank {
  flex: 0 0 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  font: 600 0.8rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.card-main { min-width: 0; }
.who { margin: 0; font-weight: 650; }
.who a { color: var(--fg); text-decoration: none; }
.who a:hover { color: var(--accent); }
.summary { margin: 0.15rem 0; }
.meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font: 0.8rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.meta span + span::before,
.meta time::before { content: " · "; }
a.post-link {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.85rem;
}
a.post-link:hover { border-color: var(--accent); color: var(--accent); }
.safety {
  display: inline-block;
  margin: 0.4rem 0 0;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.85rem;
}

.newsletter {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin: 1.75rem 0 0.5rem;
}
.newsletter > :first-child { margin-top: 0; }
.newsletter > :last-child { margin-bottom: 0; }

.archive { padding-left: 1.2rem; }
.archive a[aria-current="page"] { font-weight: 650; }

.summary a { color: var(--fg); text-decoration-color: var(--line); }
.summary a:hover { color: var(--accent); text-decoration-color: currentColor; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0;
}
.stats dt { color: var(--muted); font-size: 0.8rem; }
.stats dd { margin: 0; font: 600 1rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.related { padding-left: 1.2rem; }
.related .n { font: 0.8rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }
