:root {
  --bg: #fbfbf9;
  --fg: #1d1f21;
  --muted: #5f6368;
  --line: #dcdcd6;
  --panel: #ffffff;
  --accent: #1f5fbf;
  --accent-fg: #ffffff;
  --warn-bg: #fff4e0;
  --warn-line: #e3a33b;
  --note-bg: #eef3fb;
  --term-bg: #111417;
  --term-fg: #d7dde3;
  --verified: #1d7a46;
  --supported: #1f5fbf;
  --code: #9a6a00;
  --placeholder: #6b6b6b;
  --none: #9aa0a6;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #e6e8ea;
    --muted: #9aa0a6;
    --line: #2e3237;
    --panel: #1c1f23;
    --accent: #6ea2ff;
    --accent-fg: #0b1220;
    --warn-bg: #2c2414;
    --warn-line: #b8862d;
    --note-bg: #1a2433;
    --term-bg: #0b0d0f;
    --verified: #4cc38a;
    --supported: #6ea2ff;
    --code: #e0b043;
    --placeholder: #9aa0a6;
    --none: #6b7178;
  }
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

code, pre { font-family: var(--mono); font-size: 0.88em; }

code {
  background: color-mix(in srgb, var(--line) 45%, transparent);
  padding: 0.05em 0.3em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.top, main, .bottom { max-width: 980px; margin: 0 auto; padding: 0 20px; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 800; letter-spacing: 0.04em; text-decoration: none; color: var(--fg); font-size: 1.15rem; }

.top nav { display: flex; gap: 18px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--fg); }

main { padding-top: 12px; padding-bottom: 48px; }

.bottom { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; padding-top: 16px; padding-bottom: 32px; }

h1 { font-size: 2rem; line-height: 1.2; margin: 0.6em 0 0.3em; }
h2 { font-size: 1.3rem; margin: 1.8em 0 0.5em; }
h3 { font-size: 1.05rem; margin: 0 0 0.3em; }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 46em; }
.muted { color: var(--muted); }

.hero { padding: 24px 0 8px; }
.hero h1 { font-size: 2.4rem; }

.how {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  list-style: none;
  counter-reset: how;
  padding: 0;
  margin: 24px 0 0;
}
.how li {
  counter-increment: how;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.how li::before {
  content: counter(how);
  display: inline-grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
  font-size: 0.85em;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card p { margin: 0.4em 0; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.1em 0.55em;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.badge.verified { color: var(--verified); }
.badge.supported { color: var(--supported); }
.badge.code { color: var(--code); }
.badge.placeholder { color: var(--placeholder); }
.badge.none, .badge.unknown { color: var(--none); }
.badge.derived { font-style: italic; border-style: dashed; }

.tag { font-size: 0.78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 0.4em; margin-left: 4px; }

.crumbs { font-size: 0.9rem; color: var(--muted); margin-top: 18px; }
.crumbs a { color: var(--muted); }

.page-head { margin-bottom: 8px; }

.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 20px 16px;
  margin: 18px 0;
}
.step h2 { margin-top: 0.8em; display: flex; align-items: center; gap: 10px; }
.step h2 .num {
  display: inline-grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 0.85em;
}
.step section h2 { font-size: 1.05rem; }

.notice, .warning {
  border-left: 4px solid var(--accent);
  background: var(--note-bg);
  padding: 10px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 14px 0;
}
.warning { border-left-color: var(--warn-line); background: var(--warn-bg); }

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.5em 1em;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button.secondary { background: transparent; color: var(--accent); }
.button.disabled, .button:disabled { opacity: 0.45; cursor: not-allowed; }
.button[hidden] { display: none; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
.hash { font-size: 0.8em; word-break: break-all; }

.accept { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; }
.accept input { margin-top: 0.35em; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; }
.pins { max-width: 560px; }

details.features { border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; background: var(--panel); }
details.features summary { cursor: pointer; padding: 10px 14px; font-weight: 600; }
details.features table { margin: 0 0 8px; }
details.features th { width: 40%; font-weight: 500; }

.methods { padding-left: 1.2em; }
.methods li { margin: 0.6em 0; }

details.more { margin-top: 28px; }
details.more > summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; }
.method { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px; }

pre.commands, pre.log {
  background: color-mix(in srgb, var(--line) 35%, transparent);
  border-radius: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  white-space: pre;
}

.console { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 12px 0; }
.console-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.console-state { margin-right: auto; color: var(--muted); font-size: 0.9rem; }
.console-state::before { content: ""; display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--none); margin-right: 6px; }
.console-state.on::before { background: var(--verified); }
.terminal {
  margin: 0;
  height: 340px;
  overflow: auto;
  background: var(--term-bg);
  color: var(--term-fg);
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
}
.console-input { display: flex; gap: 8px; padding: 8px 10px; background: var(--panel); border-top: 1px solid var(--line); }
.console-input input { flex: 1; min-width: 0; }

input[type=text], input[type=password] {
  font: inherit;
  padding: 0.45em 0.6em;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
}

.setup { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.setup:first-child { border-top: 0; margin-top: 0; }
.setup label { display: flex; flex-direction: column; gap: 4px; max-width: 360px; margin: 8px 0; font-size: 0.92rem; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eula { max-width: 46em; }
.eula .draft { border-left-color: var(--warn-line); background: var(--warn-bg); }

@media (max-width: 600px) {
  html { font-size: 16px; }
  .hero h1 { font-size: 1.9rem; }
  .top nav { gap: 12px; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: 6px; }
}
