:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #61656e;
  --line: #e2e0d8;
  --accent: #c2410c;
  --accent-soft: #fdeee4;
  --link: #9a3412;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --surface: #1e2126;
    --text: #e9e7e1;
    --muted: #a0a3ab;
    --line: #2f333a;
    --accent: #fb923c;
    --accent-soft: #3a261a;
    --link: #fdba74;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
a { color: var(--link); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff; font-size: 15px; }
.top nav { display: flex; gap: 16px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--text); }

main { padding: 20px 0 48px; }
h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.15; margin: 12px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 21px; margin: 36px 0 12px; }
h2 small { font: 500 14px var(--mono); color: var(--muted); margin-left: 6px; }
.lede { font-size: 18px; color: var(--muted); max-width: 70ch; margin: 0 0 20px; }
.lede strong { color: var(--text); }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 2px; }

.hero { padding: 28px 0 8px; }
.search { position: relative; max-width: 680px; margin: 0 0 20px; }
.search input { width: 100%; font: inherit; font-size: 18px; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.search input:focus { outline: none; border-color: var(--accent); }
.results { margin-top: 8px; }
.results:empty { display: none; }
.results ol { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.results li a { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--text); border-top: 1px solid var(--line); }
.results li:first-child a { border-top: 0; }
.results li a:hover, .results li a:focus { background: var(--accent-soft); outline: none; }
.results .where { display: block; color: var(--muted); font-size: 14px; }
.results p { margin: 0; color: var(--muted); font-size: 15px; }

.code { font-family: var(--mono); font-weight: 600; }
a.code { text-decoration: none; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 4px; white-space: nowrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.card { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.card:hover { border-color: var(--accent); }
.card span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.toc a { font-size: 14px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; background: var(--surface); }
.note { background: var(--accent-soft); border-radius: var(--radius); padding: 4px 18px 8px; margin-top: 36px; }
.note h2 { margin-top: 14px; }

.map { height: 340px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.related { margin-top: 24px; }
.pager { display: flex; justify-content: space-between; margin-top: 28px; font-family: var(--mono); }
.button { display: inline-block; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; margin-right: 8px; }

.notice { background: var(--accent); color: #fff; font-size: 15px; }
.notice .wrap { padding-top: 8px; padding-bottom: 8px; }
.notice a { color: #fff; font-weight: 600; }
.ad { margin: 24px 0; text-align: center; overflow: hidden; }
.ad:empty { display: none; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 18px 0 32px; }
.foot a { color: var(--muted); }
