:root {
  --ink: #14181f;
  --muted: #5b6472;
  --line: #e3e6eb;
  --bg: #f5f6f8;
  --card: #ffffff;
  --code-bg: #f0f2f5;
  --brand: #0b5cff;
  --brand-ink: #ffffff;
  --ok: #1d7a3a;
  --bad: #c0262d;
  --prod: #b45309;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e9ee;
    --muted: #9aa3b2;
    --line: #2a303a;
    --bg: #0f1216;
    --card: #171b21;
    --code-bg: #1e232b;
    --brand: #4d8bff;
    --ok: #4cc27a;
    --bad: #ff6b6b;
    --prod: #f59e0b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
body.prod .top { border-bottom: 3px solid var(--prod); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.env { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); }

.layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.side { position: sticky; top: 76px; align-self: start; display: grid; gap: 4px; }
.side a { color: var(--muted); text-decoration: none; padding: 4px 8px; border-radius: 6px; }
.side a:hover { color: var(--ink); background: var(--card); }
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; display: flex; flex-wrap: wrap; }
}

section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-bottom: 20px; }
h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 20px 0 6px; }
p, li { max-width: 72ch; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 0.92rem; border-left: 3px solid var(--line); padding-left: 12px; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
pre.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.84rem; background: var(--code-bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow-x: auto; margin: 8px 0; white-space: pre; }
pre.code .base { color: var(--brand); }

table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 0.92rem; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

.panel { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 12px 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 0.9rem; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
fieldset { border: none; padding: 0; margin: 0; display: grid; gap: 6px; }
legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--card); padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; min-width: 0; width: 100%; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.84rem; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; }
.env select { width: auto; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

button { font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; justify-self: start; }
.primary { background: var(--brand); color: var(--brand-ink); }
.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button:disabled { opacity: 0.6; cursor: wait; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.result { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.checks { padding-left: 18px; }
.checks li { font-weight: 500; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 8px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86rem; overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--brand); margin: 6px 0; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tabs button { background: none; color: var(--muted); border-radius: 8px 8px 0 0; padding: 8px 12px; }
.tabs button[aria-selected=true] { color: var(--ink); border: 1px solid var(--line); border-bottom-color: var(--card); margin-bottom: -1px; background: var(--card); }
