:root {
  --bg: #fdfdfb;
  --fg: #1d1f21;
  --muted: #6b6f75;
  --line: #d9dbd6;
  --panel: #f3f4f0;
  --code-bg: #f1f2ee;
  --accent: #1f5fa8;
  --top: #1e2a38;
  --top-fg: #e9eef4;
  --ok: #2e7d32;
  --partial: #a66a00;
  --raw: #9a3b3b;
  --yes: #dff0d8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181c;
    --fg: #e3e5e8;
    --muted: #9aa0a8;
    --line: #2e333a;
    --panel: #1c2026;
    --code-bg: #1f242b;
    --accent: #7fb2ec;
    --top: #0f1318;
    --top-fg: #e3e5e8;
    --ok: #7bc47f;
    --partial: #e0a84a;
    --raw: #e08b8b;
    --yes: #24402a;
  }
}
:root[data-theme="dark"] {
  --bg: #15181c; --fg: #e3e5e8; --muted: #9aa0a8; --line: #2e333a; --panel: #1c2026;
  --code-bg: #1f242b; --accent: #7fb2ec; --top: #0f1318; --top-fg: #e3e5e8; --ok: #7bc47f;
  --partial: #e0a84a; --raw: #e08b8b; --yes: #24402a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, monospace; font-size: 0.92em; }

header.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem;
  padding: 0.6rem 1rem; background: var(--top); color: var(--top-fg);
}
header.top a { color: var(--top-fg); }
.brand { font-weight: 700; letter-spacing: 0.01em; }
.brand span { font-weight: 400; opacity: 0.75; }
header.top nav { display: flex; gap: 1rem; font-size: 0.95rem; }
.search { margin-left: auto; }
.search input { padding: 0.3rem 0.6rem; border-radius: 4px; border: 1px solid #3a4756; background: #283545; color: var(--top-fg); width: 14rem; max-width: 100%; }

main { max-width: 88rem; margin: 0 auto; padding: 1rem 16px 3rem; }
footer { max-width: 88rem; margin: 0 auto; padding: 1rem 16px 2rem; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }

h1 { font-size: 1.9rem; margin: 0.3rem 0 0.4rem; font-family: ui-monospace, Menlo, monospace; font-weight: 600; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; margin: 1.8rem 0 0.5rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--line); }
h3 { font-size: 1rem; margin: 1.2rem 0 0.4rem; }
.crumbs { color: var(--muted); font-size: 0.9rem; }
.summary { font-size: 1.1rem; margin: 0.3rem 0; }
.defined { color: var(--muted); margin: 0.2rem 0 0; }
.status { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.badge { display: inline-block; font-size: 0.75rem; padding: 0.05rem 0.45rem; border-radius: 999px; border: 1px solid currentColor; color: var(--muted); vertical-align: middle; }
.badge.ok { color: var(--ok); }
.badge.partial { color: var(--partial); }
.badge.raw { color: var(--raw); }
.warn { color: var(--raw); }
.muted { color: var(--muted); font-size: 0.85rem; }
.empty, .note { color: var(--muted); font-style: italic; }

pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 4px; padding: 0.7rem 0.9rem; overflow-x: auto; line-height: 1.4; }
pre.syntax { border-left: 3px solid var(--accent); }

table { border-collapse: collapse; margin: 0.6rem 0; }
table.data td, table.portability td, table.portability th { border: 1px solid var(--line); padding: 0.25rem 0.6rem; vertical-align: top; }
table.data td:first-child { white-space: nowrap; font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; }
table.portability th { background: var(--panel); font-weight: 600; font-size: 0.9rem; }
table.portability td { text-align: center; min-width: 4.5rem; }
table.portability td.yes { background: var(--yes); }

ul.see-also { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
code.unresolved { color: var(--muted); text-decoration: underline dotted; }
ul.warnings { color: var(--raw); font-size: 0.9rem; }
.permalink { margin-top: 2rem; color: var(--muted); font-size: 0.85rem; }

.entry-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 1100px) {
  .entry-layout { grid-template-columns: minmax(0, 52rem) minmax(0, 1fr); }
  .scans { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
.scans h2 { margin-top: 0.5rem; }
.scans figure { margin: 0 0 1rem; }
.scans img { width: 100%; height: auto; border: 1px solid var(--line); background: #fff; display: block; }
.scans figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }

.filter { display: flex; gap: 1rem; align-items: center; margin: 1rem 0; }
.filter input { flex: 1; max-width: 32rem; padding: 0.45rem 0.7rem; font-size: 1rem; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--fg); }
#count { color: var(--muted); font-size: 0.9rem; }
details.headers { margin: 0.5rem 0 1rem; }
ul.header-list { columns: 14rem; padding-left: 1.2rem; }
table.index { width: 100%; }
table.index td, table.index th { border-bottom: 1px solid var(--line); padding: 0.3rem 0.6rem 0.3rem 0; text-align: left; vertical-align: top; }
table.index td:first-child { white-space: nowrap; }
@media (max-width: 700px) {
  table.index td:first-child { white-space: normal; }
  table.index th:nth-child(2), table.index td:nth-child(2) { display: none; }
}
.report table td, .report table th { border: 1px solid var(--line); padding: 0.2rem 0.5rem; }
