:root {
  color-scheme: dark;
  --bg: #0e171c;
  --surface: #172229;
  --raised: #213038;
  --line: #33464d;
  --text: #edf2f7;
  --muted: #bac8d0;
  --quiet: #a0b0bb;
  --accent: #45d4bf;
  --accent-ink: #102b29;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.65 "Segoe UI", Arial, sans-serif; }
::selection { background: #45d4bf45; color: #fff; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.18; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -.045em; font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.45rem); letter-spacing: -.035em; font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 650; }
img { max-width: 100%; }

.shell { width: min(1320px, calc(100% - clamp(32px, 8vw, 96px))); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -80px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); border-radius: 6px; }
.skip-link:focus { top: 16px; color: var(--accent-ink); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; letter-spacing: -.025em; flex-shrink: 0; }
.brand img { flex-shrink: 0; }
.site-header nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 30px); font-size: .9rem; }
.site-header nav a { min-height: 44px; display: inline-flex; align-items: center; }
.nav-download { gap: 12px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 6px; }
.nav-download:hover { border-color: var(--accent); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 48px; padding: 10px 18px; border: 1px solid transparent; border-radius: 6px; font-weight: 600; font-size: .95rem; line-height: 1.35; transition: background .16s, border-color .16s; }
.button span { font-size: 1.15em; font-weight: 400; flex-shrink: 0; }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { background: #73e3d1; color: var(--accent-ink); }
.secondary { background: var(--raised); border-color: #50636a; color: var(--text); }
.secondary:hover { border-color: var(--accent); color: var(--text); }
.text-link { display: inline-flex; align-items: baseline; gap: 10px; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; font-size: .92rem; }
.text-link span { text-decoration: none; }

.site-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-block: 24px; border-top: 1px solid var(--line); color: var(--quiet); font-size: .84rem; }
.footer-brand { color: var(--text); font-size: 1.05rem; }
.site-footer > a:last-of-type { margin-left: auto; }
.footer-legal { flex-basis: 100%; font-size: .78rem; }

.guide-header { padding-block: clamp(32px, 6vw, 64px) 28px; }
.guide-header h1 { font-size: clamp(2rem, 4.5vw, 3.45rem); }
.guide-header .lead { max-width: 68ch; margin-top: 14px; color: var(--muted); }
.guide-layout { display: grid; grid-template-columns: minmax(185px, 235px) minmax(0, 76ch); gap: clamp(28px, 5vw, 64px); align-items: start; padding-bottom: 64px; border-top: 1px solid var(--line); }
.guide-toc { position: sticky; top: 20px; padding-block: 24px; }
.guide-toc a { display: flex; align-items: center; min-height: 38px; padding: 6px 12px; font-size: .9rem; line-height: 1.4; color: var(--muted); border-left: 1px solid var(--line); }
.guide-toc a:hover, .guide-toc a:focus-visible { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.guide { min-width: 0; }
.guide section { padding-block: 28px; border-bottom: 1px solid var(--line); }
.guide h2 { font-size: clamp(1.42rem, 2.3vw, 1.75rem); margin-bottom: 16px; text-wrap: initial; }
.guide h3 { margin: 24px 0 12px; }
.guide p, .guide li { color: var(--muted); font-size: .96rem; }
.guide p + p, .guide li + li { margin-top: 12px; }
.guide strong { color: var(--text); }
.guide ol, .guide ul { padding-left: 24px; margin: 0 0 16px; }
.guide li { padding-left: 4px; }
.guide li::marker { color: var(--accent); }
.guide code { overflow-wrap: anywhere; color: var(--text); background: var(--raised); padding: 2px 4px; border-radius: 3px; font-size: .88em; }
.guide a:not(.button) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.guide .callout { border-left: 3px solid var(--accent); padding: 16px 18px; background: var(--surface); margin-block: 20px; border-radius: 0 6px 6px 0; }
.guide .guide-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

@media (max-width: 760px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .guide-toc { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; border-bottom: 1px solid var(--line); padding-block: 14px; }
  .guide-toc a { min-height: 42px; border: 0; border-radius: 4px; padding-inline: 8px; }
}
@media (max-width: 625px) {
  .site-header { flex-direction: column; align-items: start; gap: 8px; padding-block: 12px; }
  .brand { font-size: 1.12rem; }
  .brand img { width: 32px; height: 32px; }
  .site-header nav { width: 100%; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; font-size: .84rem; }
  .nav-download { gap: 6px; padding-inline: 8px; }
  .site-footer { align-items: start; flex-direction: column; }
  .site-footer > a:last-of-type { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
