:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f3f5f8;
  --text: #16181d;
  --muted: #464c57;
  --border: #6b7280;
  --rule: #d5d9e0;
  --primary: #0b5cad;
  --on-primary: #ffffff;
  --danger: #a4161a;
  --on-danger: #ffffff;
  --focus: #0b5cad;
  --code-bg: #eef1f5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --surface: #1c2026;
    --text: #e9ebef;
    --muted: #b4b9c2;
    --border: #8b929d;
    --rule: #333943;
    --primary: #6cb0ff;
    --on-primary: #08101a;
    --danger: #ff9a9a;
    --on-danger: #1a0505;
    --focus: #8cc2ff;
    --code-bg: #232831;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--primary); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: var(--on-primary);
  z-index: 10;
}
.skip-link:focus { top: 0.5rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.brand { font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.site-header nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0; padding: 0; align-items: center; }
aside[aria-label="Alpha notice"] {
  max-width: 64rem;
  margin: 1rem auto;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  background: var(--surface);
  border-left: 4px solid var(--primary);
  font-size: 0.875rem;
}
main { max-width: 64rem; margin: 0 auto; padding: 1rem; }
.site-footer { max-width: 64rem; margin: 0 auto; padding: 1rem; color: var(--muted); border-top: 1px solid var(--rule); }
h1 { font-size: 1.75rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1.1rem; }
.live:empty { display: none; }
.live { padding: 0.5rem 0.75rem; margin-bottom: 1rem; background: var(--surface); border-left: 4px solid var(--primary); }
.stack > * + * { margin-top: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; max-width: 28rem; }
label { font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], select {
  font: inherit;
  padding: 0.5rem 0.625rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}
input[readonly] { background: var(--surface); }
fieldset { border: 1px solid var(--border); border-radius: 4px; max-width: 28rem; }
.check { display: flex; align-items: center; gap: 0.5rem; }
.check label { font-weight: 400; }
.button, button {
  font: inherit;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: 2px solid var(--primary);
  border-radius: 4px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.button.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; font-weight: 400; }
form.inline { display: inline; margin: 0; }
.errors { border: 2px solid var(--danger); border-radius: 4px; padding: 0.5rem 1rem; margin-bottom: 1rem; max-width: 40rem; }
.errors-title { margin: 0 0 0.25rem; font-size: 1.05rem; color: var(--danger); }
.secret { border: 2px solid var(--primary); border-radius: 4px; padding: 0.5rem 1rem; margin-bottom: 1rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code-bg); padding: 0.1rem 0.35rem; border-radius: 3px; overflow-wrap: anywhere; }
table { border-collapse: collapse; width: 100%; margin: 0.5rem 0; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { border-bottom: 2px solid var(--border); }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.05rem 0.5rem; border: 1px solid var(--border); border-radius: 999px; vertical-align: middle; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0 0 1rem; padding: 0; border-bottom: 1px solid var(--rule); }
.tabs a[aria-current="page"] { font-weight: 700; color: var(--text); }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; margin: 0.25rem 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.25rem; color: var(--muted); }
details { margin: 0.5rem 0; }
summary { cursor: pointer; }
.code { margin: 0; font: 0.875rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; overflow-x: auto; }
.code-view, .diff-table { font-size: 0.875rem; }
.code-view th, .code-view td, .diff-table th, .diff-table td { padding: 0 0.5rem; border-bottom: 0; }
.ln { width: 1%; text-align: right; color: var(--muted); white-space: nowrap; user-select: none; }
.ln a { color: var(--muted); }
.diff-add { background: color-mix(in srgb, #1a7f37 18%, var(--bg)); }
.diff-del { background: color-mix(in srgb, #cf222e 18%, var(--bg)); }
.diff-hunk { background: var(--surface); color: var(--muted); }
.diff { margin: 1.5rem 0; }
.diff-table-wrap, .diff table { display: block; overflow-x: auto; }
.markdown { overflow-wrap: anywhere; }
.markdown img { max-width: 100%; }
.markdown pre { overflow-x: auto; background: var(--code-bg); padding: 0.5rem; }
.message { white-space: pre-wrap; }
.note { border-left: 4px solid var(--danger); padding-left: 0.5rem; }
