@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');
:root {
  --bg: #eef2f6; --surface: #ffffff; --surface-2: #e3e9f0; --border: #c9d3de;
  --ink: #16233a; --ink-soft: #4b5a71; --ink-faint: #7c8aa0;
  --accent: #2b5f8a; --accent-ink: #ffffff; --highlight: #d9722a; --highlight-soft: #fbe6d3;
  --req: #b3401f;
  --shadow: 0 1px 2px rgba(22,35,58,0.06), 0 4px 14px rgba(22,35,58,0.05);
}
:root:not([data-theme="light"]) { @media (prefers-color-scheme: dark) {
  --bg: #0e2a47; --surface: #123256; --surface-2: #163a63; --border: #2a5580;
  --ink: #dcecf7; --ink-soft: #a9c3db; --ink-faint: #7f9cb8;
  --accent: #6fb6e8; --accent-ink: #08233c; --highlight: #f0a860; --highlight-soft: #2e3f2c;
  --req: #ff9a72;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 14px rgba(0,0,0,0.25);
}}
:root[data-theme="dark"] {
  --bg: #0e2a47; --surface: #123256; --surface-2: #163a63; --border: #2a5580;
  --ink: #dcecf7; --ink-soft: #a9c3db; --ink-faint: #7f9cb8;
  --accent: #6fb6e8; --accent-ink: #08233c; --highlight: #f0a860; --highlight-soft: #2e3f2c;
  --req: #ff9a72;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 14px rgba(0,0,0,0.25);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'IBM Plex Sans', -apple-system, Segoe UI, sans-serif; line-height: 1.55; }
code, .mono { font-family: 'IBM Plex Mono', ui-monospace, Consolas, monospace; }
.wrap { max-width: 860px; margin: 0 auto; padding: 2.25rem 2rem 4rem; }
a.back { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-soft); text-decoration: none; font-size: 0.85rem; margin-bottom: 1.1rem; }
a.back:hover { color: var(--accent); }
a { color: var(--accent); }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
h1 { margin: 0.35rem 0 0.5rem; font-size: clamp(1.5rem, 2.6vw, 1.95rem); font-weight: 700; text-wrap: balance; }
p.sub { margin: 0 0 1.5rem; color: var(--ink-soft); max-width: 62ch; }
.why-banner {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 0.85rem 1.1rem; margin-bottom: 1.5rem; font-size: 0.88rem; color: var(--ink-soft); box-shadow: var(--shadow);
}
.why-banner strong { color: var(--ink); }

.toc {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.9rem 1.2rem; margin-bottom: 1.75rem; box-shadow: var(--shadow); font-size: 0.9rem;
}
.toc-title { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin-bottom: 0.4rem; }
.toc ol { margin: 0; padding-left: 1.3rem; columns: 2 16rem; column-gap: 2rem; }
.toc-part { list-style: none; margin-left: -1.1rem; margin-top: 0.5rem; font-weight: 600; color: var(--ink); font-size: 0.85rem; }
.toc li { margin-bottom: 0.2rem; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.part { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--highlight); font-weight: 600; margin: 2.2rem 0 0.6rem; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.1rem 1.3rem; margin-bottom: 0.9rem; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 0.5rem; font-size: 1.12rem; scroll-margin-top: 1rem; }
.card h3 { margin: 1rem 0 0.35rem; font-size: 0.97rem; }
.card p { margin: 0 0 0.6rem; color: var(--ink-soft); font-size: 0.92rem; }
.card p:last-child { margin-bottom: 0; }
.card ul, .card ol { margin: 0.3rem 0 0.6rem; padding-left: 1.2rem; color: var(--ink-soft); font-size: 0.9rem; }
.card li { margin-bottom: 0.25rem; }
.card strong { color: var(--ink); }
.path { font-family: 'IBM Plex Mono', monospace; background: var(--surface-2); border-radius: 6px; padding: 0.1rem 0.4rem; font-size: 0.82em; color: var(--ink); white-space: nowrap; }
.aside { background: var(--surface-2); border-radius: 8px; padding: 0.7rem 0.9rem; font-size: 0.85rem; color: var(--ink-soft); margin: 0.6rem 0; }
.aside strong { color: var(--ink); }
.aside.warn { border-left: 3px solid var(--highlight); }
.aside.warn strong { color: var(--highlight); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0.5rem 0 0.8rem; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 0.45rem 0.65rem; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
td { color: var(--ink-soft); }
td:first-child { color: var(--ink); font-weight: 500; }
tr:last-child td { border-bottom: none; }
.tag { display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; padding: 0.05rem 0.4rem; border-radius: 4px; background: var(--highlight-soft); color: var(--ink); margin-left: 0.25rem; white-space: nowrap; }

.layers { counter-reset: layer; list-style: none; padding-left: 0 !important; }
.layers li { counter-increment: layer; position: relative; padding-left: 2.4rem; margin-bottom: 0.7rem; }
.layers li::before {
  content: counter(layer); position: absolute; left: 0; top: 0;
  font-family: 'IBM Plex Mono', monospace; font-weight: 700; color: var(--accent-ink);
  background: var(--accent); border-radius: 50%; width: 1.7rem; height: 1.7rem;
  display: flex; align-items: center; justify-content: center; font-size: 0.82rem;
}
footer.page { margin-top: 2rem; padding-top: 1.5rem; color: var(--ink-faint); font-size: 0.8rem; border-top: 1px solid var(--border); }

@media (max-width: 600px) {
  .wrap { padding: 1.5rem 1rem 3rem; }
  .card { padding: 0.95rem 1rem; }
  .toc ol { columns: 1; }
}
