:root {
  --page: #ffffff; --text: #1d2420; --muted: #5b6660; --line: #dfe5e1; --code: #f3f6f4; --accent: #1f7a4d; --nav: #f7f9f8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --page: #121614; --text: #e4ebe7; --muted: #9aa6a0; --line: #2a322e; --code: #1b211e; --accent: #5cc894; --nav: #161b18; color-scheme: dark; }
}
:root[data-theme="dark"] { --page: #121614; --text: #e4ebe7; --muted: #9aa6a0; --line: #2a322e; --code: #1b211e; --accent: #5cc894; --nav: #161b18; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
header img { width: 32px; height: 32px; border-radius: 7px; }
header strong { font-size: 18px; }
header span { color: var(--muted); font-size: 14px; }
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); max-width: 1200px; margin: 0 auto; }
nav { background: var(--nav); border-right: 1px solid var(--line); padding: 16px; min-height: calc(100vh - 57px); }
nav a { display: block; padding: 4px 8px; border-radius: 6px; text-decoration: none; color: var(--text); font-size: 15px; }
nav a[aria-current="page"] { background: var(--code); color: var(--accent); font-weight: 600; }
nav h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 8px 4px; }
main { padding: 24px 32px 64px; min-width: 0; }
main h1 { margin-top: 0; }
pre, code { font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code); border-radius: 6px; }
code { padding: 1px 4px; }
pre { padding: 12px; overflow-x: auto; }
pre code { padding: 0; }
table { border-collapse: collapse; display: block; overflow-x: auto; margin: 12px 0; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
footer { color: var(--muted); font-size: 14px; }
.viewer { min-height: 80vh; }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  nav { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 16px; }
}
