:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a1f2b;
  --muted: #5b6475;
  --border: #e2e5eb;
  --accent: #0b5cad;
  --accent-soft: #e8f0fa;
  --todo-bg: #fff3bf;
  --todo-text: #6b4e00;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131a;
    --surface: #161b24;
    --text: #e6e9ef;
    --muted: #9aa3b5;
    --border: #2a3140;
    --accent: #6aa9ec;
    --accent-soft: #1a2636;
    --todo-bg: #4a3b00;
    --todo-text: #ffe28a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 16px;
}
.brand { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.lang { display: flex; gap: 4px; font-size: .875rem; }
.lang a, .lang strong {
  padding: 4px 10px; border-radius: 6px; text-decoration: none;
}
.lang strong { background: var(--accent-soft); color: var(--accent); }
.lang a { color: var(--muted); }
.lang a:hover { color: var(--text); }

main.wrap { padding-top: 40px; padding-bottom: 56px; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.015em; }
h1:has(+ nav.toc) { margin-bottom: 28px; }
.meta { color: var(--muted); font-size: .9375rem; margin: 0 0 32px; }

nav.toc {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 32px;
}
nav.toc h2 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
nav.toc ol { margin: 0; padding-left: 20px; }
nav.toc li { margin: 2px 0; }

section {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 24px; margin-bottom: 20px;
}
section h2 { font-size: 1.1875rem; margin: 0 0 12px; line-height: 1.35; scroll-margin-top: 16px; }
section h3 { font-size: 1rem; margin: 24px 0 8px; }
section dl.contact + p { margin-top: 16px; }
section p { margin: 0 0 12px; }
section p:last-child, section ul:last-child { margin-bottom: 0; }
section ul { margin: 0 0 12px; padding-left: 20px; }
section li { margin: 3px 0; }

section .callout {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 12px 0;
}

dl.contact { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 10px 20px; margin: 0; }
dl.contact dt { color: var(--muted); font-size: .9375rem; }
dl.contact dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  dl.contact { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.contact dd { margin-bottom: 10px; }
}
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; overflow-wrap: anywhere; }

mark.todo { background: var(--todo-bg); color: var(--todo-text); padding: 0 4px; border-radius: 3px; }

footer.site { border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; padding: 20px 0 32px; }
footer.site p { margin: 4px 0; }

@media print {
  body { background: #fff; color: #000; }
  header.site .lang, nav.toc, .skip { display: none; }
  section { border: none; padding: 0; margin-bottom: 16px; }
  a { color: #000; }
}

@media (max-width: 560px) {
  main.wrap { padding-top: 28px; padding-bottom: 40px; }
  section, nav.toc { padding: 18px 16px; }
}
