:root {
  --bg: #ffffff;
  --fg: #1b1b1f;
  --muted: #5c5f6b;
  --line: #e3e5ea;
  --accent: #1e58a8;
  --card: #f6f7f9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --fg: #e8e9ed;
    --muted: #a1a5b0;
    --line: #2c2e35;
    --accent: #7aa7ef;
    --card: #1e2025;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 20px 64px;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.page-header,
main,
.page-footer {
  max-width: 760px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand a {
  color: inherit;
  text-decoration: none;
}

/* Shown only when JavaScript runs; without it every language stays visible. */
.js-only {
  display: none;
}

html.js .js-only {
  display: flex;
}

/* The `js` class is set by an inline script in <head>, before first paint, so
   the three language sections never flash one after another. */
html.js main > [data-lang] {
  display: none;
}

html.js main > [data-lang].is-visible {
  display: block;
}

.lang-switch {
  gap: 6px;
}

.lang-switch button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.lang-switch button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--card);
}

h1 {
  margin: 32px 0 4px;
  font-size: 26px;
  line-height: 1.25;
}

h2 {
  margin: 32px 0 8px;
  font-size: 19px;
  line-height: 1.3;
}

.updated {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

p,
ul {
  margin: 0 0 14px;
}

ul {
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

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

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--card);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.card {
  margin: 24px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.link-list {
  padding: 0;
  list-style: none;
}

.link-list li {
  margin-bottom: 14px;
}

.link-list .sub {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.page-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

[hidden] {
  display: none !important;
}
