:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #171a22;
  --muted: #5b6373;
  --border: #dde1ea;
  --accent: #3b4cca;
  --accent-text: #ffffff;
  --accent-soft: #e9ecfb;
  --ok: #1a7f4b;
  --warn-bg: #fff6dd;
  --warn-border: #e5c56a;
  --error: #b3261e;
  --code-bg: #eef0f6;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10131a;
    --surface: #181c26;
    --text: #e9ecf3;
    --muted: #a2aabb;
    --border: #2b3140;
    --accent: #8f9bff;
    --accent-text: #0d1020;
    --accent-soft: #232a4a;
    --ok: #5fd39a;
    --warn-bg: #2e2812;
    --warn-border: #7a6520;
    --error: #ff8a80;
    --code-bg: #222838;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

main.wrap { padding-top: 32px; padding-bottom: 56px; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

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

.site-header, .site-footer { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-footer { border-top: 1px solid var(--border); border-bottom: 0; color: var(--muted); font-size: 0.9rem; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.bar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.bar nav a { color: var(--text); text-decoration: none; padding: 4px 0; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--accent-text); font-weight: 700; }

h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 1.4rem; margin: 40px 0 12px; }
h3 { font-size: 1.1rem; margin: 20px 0 6px; }
h4, h5, h6 { font-size: 1rem; margin: 14px 0 4px; }
p { margin: 0 0 12px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 70ch; }
.meta, .hint { color: var(--muted); font-size: 0.9rem; }
.hint { display: block; }
.crumbs { color: var(--muted); font-size: 0.9rem; }

.hero { padding: 16px 0 8px; }

code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--code-bg); padding: 12px 14px; border-radius: var(--radius); overflow-x: auto; }
pre code { background: none; padding: 0; }
.hash { word-break: break-all; }

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  margin: 4px 8px 4px 0;
}
.button.secondary { background: transparent; color: var(--accent); }
.button:hover { filter: brightness(1.08); }
.button[disabled] { opacity: 0.6; cursor: default; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card, .panel, .release, .issue {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card h3 { margin-top: 0; }
.release, .issue { margin-bottom: 14px; }
.release h3, .issue h3 { margin-top: 0; }
.panel { margin: 20px 0; }

.badge { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 10px; font-size: 0.82rem; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border: 1px solid var(--border); border-radius: 999px; padding: 0 9px; font-size: 0.8rem; color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin: 0 0 14px; }
.facts dt { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.facts dd { margin: 0; font-weight: 600; }

.toc { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; font-size: 0.95rem; }

.steps { padding-left: 22px; max-width: 75ch; }
.steps li { margin-bottom: 10px; }
.plain { padding-left: 20px; }
.plain li { margin-bottom: 8px; }

.notice { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius); padding: 10px 14px; }

.form { display: grid; gap: 14px; max-width: 760px; }
.form.inline { grid-template-columns: 1fr auto; align-items: end; max-width: 520px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
label { display: block; font-weight: 600; font-size: 0.95rem; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 11px;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
input[type="file"] { padding: 7px; }
textarea { resize: vertical; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
.error { display: block; color: var(--error); font-size: 0.85rem; font-weight: 400; min-height: 1.1em; }
.status { min-height: 1.5em; }
.status.bad { color: var(--error); }
.status.good { color: var(--ok); }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

[hidden] { display: none !important; }
