@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("inter.woff2") format('woff2');
  }
  @font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url("space-grotesk.woff2") format('woff2');
  }
  :root, html[data-theme="dark"] {
    --bg: #0a0d05;
    --panel: #101208;
    --card: #14170d;
    --text: #eef2e2;
    --muted: #aab494;
    --muted2: #8a9375;
    --faint: #79825f;
    --accent: #c9f158;
    --accent-ink: #101208;
    --accent-text: #c9f158;
    --border: rgba(255,255,255,0.09);
    --border-strong: rgba(255,255,255,0.16);
    --tint: rgba(201,241,88,0.07);
    --tint-border: rgba(201,241,88,0.35);
    --code-bg: rgba(255,255,255,0.06);
  }
  html[data-theme="light"] {
    --bg: #faf9f4;
    --panel: #ffffff;
    --card: #ffffff;
    --text: #14170d;
    --muted: #4b5540;
    --muted2: #5f6b52;
    --faint: #5b6350;
    --accent: #c9f158;
    --accent-ink: #101208;
    --accent-text: #4d7a1a;
    --border: rgba(0,0,0,0.09);
    --border-strong: rgba(0,0,0,0.16);
    --tint: rgba(201,241,88,0.14);
    --tint-border: rgba(140,180,40,0.45);
    --code-bg: rgba(0,0,0,0.05);
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
  }
  html[data-theme="light"] a:focus-visible,
  html[data-theme="light"] button:focus-visible,
  html[data-theme="light"] summary:focus-visible { outline-color: var(--accent-text); }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15.5px;
    line-height: 1.65;
    transition: background 0.25s ease, color 0.25s ease;
  }
  #theme-toggle {
    position: fixed; top: 20px; right: 24px; z-index: 100;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-strong); background: var(--bg);
    font-size: 16px; border-radius: 50%; cursor: pointer; padding: 0;
  }
  .layout { display: flex; min-height: 100vh; max-width: 1240px; margin: 0 auto; }

  /* ---------- sidebar ---------- */
  aside {
    width: 264px; flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 28px 20px 40px 28px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
  }
  .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
  .brand span { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
  .brand-sub { font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin: 0 0 26px 38px; }
  .nav-group { margin-bottom: 22px; }
  .nav-group > div {
    font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--faint); margin-bottom: 8px;
  }
  aside a {
    display: block; padding: 10px 10px; margin-left: -10px; border-radius: 7px;
    color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500;
  }
  aside a:hover { color: var(--text); background: var(--code-bg); }
  aside a.active { color: var(--accent-text); background: var(--tint); font-weight: 600; }

  /* Collapsed sidebar disclosure — a no-op on desktop, the nav control at ≤900px. */
  .mobile-nav > summary { display: none; list-style: none; }
  .mobile-nav > summary::-webkit-details-marker { display: none; }

  /* Top nav on non-sidebar pages */
  .top-nav { display: flex; gap: 20px; align-items: center; font-size: 13.5px; }
  .top-nav a { color: var(--accent-text); font-weight: 500; text-decoration: none; }
  .top-nav a:hover, .top-nav a:focus { text-decoration: underline; }

  /* ---------- main ---------- */
  main { flex: 1; min-width: 0; padding: 44px 56px 90px; }
  .crumbs { font-size: 12.5px; color: var(--faint); margin-bottom: 18px; }
  .crumbs b { color: var(--muted); font-weight: 600; }
  h1 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
    margin-bottom: 10px;
  }
  .lede { font-size: 17px; color: var(--muted); max-width: 640px; margin-bottom: 8px; }
  .meta-line { font-size: 12.5px; color: var(--faint); margin-bottom: 36px; }

  section { margin-bottom: 52px; scroll-margin-top: 24px; }
  h2 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
    padding-bottom: 10px; margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
  }
  h2 .num { color: var(--accent-text); margin-right: 8px; }
  h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 16px; font-weight: 600; margin: 24px 0 10px; }
  p { margin-bottom: 12px; color: var(--text); max-width: 700px; }
  p.soft, li.soft { color: var(--muted); }

  /* in-body links */
  main a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
  main a:hover, main a:focus { text-decoration: underline; }

  /* steps — ol counts, ul gets a marker-free lime dot */
  ol.steps, ul.steps { list-style: none; margin: 18px 0 6px; max-width: 700px; }
  ol.steps { counter-reset: step; }
  ol.steps > li, ul.steps > li {
    position: relative;
    padding: 0 0 22px 52px;
  }
  ol.steps > li { counter-increment: step; }
  ol.steps > li::before {
    content: counter(step);
    position: absolute; left: 0; top: -2px;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--tint); border: 1px solid var(--tint-border);
    color: var(--accent-text); font-weight: 800; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
  }
  ol.steps > li:not(:last-child)::after {
    content: ''; position: absolute; left: 15.5px; top: 34px; bottom: 4px;
    width: 1px; background: var(--border);
  }
  ul.steps > li::before {
    content: ''; position: absolute; left: 11px; top: 7px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent); border: 1px solid var(--tint-border);
  }
  ul.steps > li:not(:last-child)::after {
    content: ''; position: absolute; left: 16.5px; top: 26px; bottom: 4px;
    width: 1px; background: var(--border);
  }
  ol.steps b, ol.steps strong, ul.steps b, ul.steps strong { font-weight: 700; }
  ol.steps .step-title, ul.steps .step-title { font-weight: 700; display: block; margin-bottom: 3px; }
  ol.steps p, ul.steps p { margin-bottom: 6px; }

  ul.plain { margin: 10px 0 12px 20px; max-width: 680px; }
  ul.plain li { margin-bottom: 8px; color: var(--text); }

  /* callouts */
  .callout {
    display: flex; gap: 12px; align-items: flex-start;
    border-radius: 12px; padding: 14px 18px; margin: 16px 0; max-width: 700px;
    background: var(--tint); border: 1px solid var(--tint-border);
    font-size: 14px;
  }
  .callout.note { background: var(--code-bg); border-color: var(--border-strong); }
  .callout .ico { font-size: 16px; line-height: 1.5; }
  .callout b { font-weight: 700; }
  .callout p { margin: 0 0 6px; font-size: 14px; }
  .callout p:last-child { margin-bottom: 0; }

  /* ui chips & code */
  kbd.ui {
    display: inline-block; padding: 1px 8px; border-radius: 6px;
    background: var(--code-bg); border: 1px solid var(--border-strong);
    font-family: inherit; font-size: 0.9em; font-weight: 600; white-space: nowrap;
  }
  code {
    font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.88em; background: var(--code-bg);
    padding: 2px 7px; border-radius: 6px;
  }

  /* tables */
  .tbl-wrap { overflow-x: auto; max-width: 700px; margin: 14px 0; }
  table { border-collapse: collapse; width: 100%; font-size: 14px; }
  th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
  th { font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
  td:first-child { white-space: nowrap; font-weight: 600; }
  td { color: var(--muted); }
  td b, td kbd { color: var(--text); }

  /* footer nav between pages */
  .page-footer {
    margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
    font-size: 13px; color: var(--faint); max-width: 700px;
  }
  .page-footer a { color: var(--accent-text); text-decoration: none; font-weight: 600; }
  .page-footer a:hover { text-decoration: underline; }

  .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: baseline; border: 1px solid var(--border-strong); }
  .status-dot--ok      { background: #7ddb63; }
  .status-dot--warn    { background: #e0b14b; }
  .status-dot--stopped { background: #8a8f98; }

  /* CTA buttons — lifted from 404.html's local pattern; one lime primary per page */
  .btn {
    display: inline-block; text-align: center; text-decoration: none;
    font-size: 14px; font-weight: 600; padding: 12px 18px; border-radius: 10px;
    border: 1px solid transparent; cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }
  .btn:hover, .btn:focus { text-decoration: none; }
  .btn:active { transform: scale(0.98); }
  .btn.primary { background: var(--accent); color: var(--accent-ink); }
  .btn.primary:hover, .btn.primary:focus { border-color: var(--accent-ink); }
  .btn.ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
  .btn.ghost:hover, .btn.ghost:focus { background: var(--code-bg); border-color: var(--accent-text); }

  @media (max-width: 900px) {
    body { font-size: 16px; }
    .layout { flex-direction: column; }
    aside {
      display: block; position: static; width: auto; height: auto; overflow: visible;
      border-right: none; border-bottom: 1px solid var(--border);
      padding: 16px 88px 16px 22px;
    }
    .mobile-nav > summary {
      display: flex; align-items: center; min-height: 44px; padding: 0 16px;
      border: 1px solid var(--border-strong); border-radius: 10px;
      font-weight: 600; cursor: pointer;
    }
    .mobile-nav > summary::after { content: '\25BE'; margin-left: auto; color: var(--faint); }
    .mobile-nav[open] > summary { margin-bottom: 16px; }
    .mobile-nav[open] > summary::after { content: '\25B4'; }
    main { padding: 32px 22px 70px; }
    h1 { font-size: 28px; }
  }
