:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #0f1b2d;
  --muted: #6b7a90;
  --line: #e4e8ee;
  --accent: #1d4ed8;
  --brand: #1d4ed8;
}
/* Same dark palette as the app. The inline script sets data-theme from the app's saved choice or
   the system setting; the media query covers pages loaded without JavaScript. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b111b;
  --surface: #121a27;
  --text: #e6edf7;
  --muted: #8a99ae;
  --line: #243044;
  --accent: #7aa2ff;
  --brand: #4f7cff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0b111b;
    --surface: #121a27;
    --text: #e6edf7;
    --muted: #8a99ae;
    --line: #243044;
    --accent: #7aa2ff;
    --brand: #4f7cff;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }
header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; text-decoration: none; }
.brand span {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 13px;
}
.lang { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.lang button {
  border: 0; border-radius: 999px; padding: 6px 12px; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--brand); color: #fff; }
article { padding-top: 8px; }
h1 { font-size: 30px; line-height: 1.2; margin: 24px 0 4px; }
h2 { font-size: 18px; margin: 28px 0 6px; }
p, li { overflow-wrap: anywhere; }
ul { padding-left: 22px; }
a { color: var(--accent); }
code { padding: 1px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.meta { color: var(--muted); font-size: 14px; }
footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer a { color: var(--muted); }
/* Both languages stay readable without JavaScript; the switch only hides the other one. */
.js article[hidden] { display: none; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
