:root {
  color-scheme: dark;
  --bg: #07100d;
  --panel: #0b1712;
  --panel-raised: #0f1e17;
  --line: #20362a;
  --line-bright: #315441;
  --text: #e2eee7;
  --muted: #96ab9e;
  --dim: #71877a;
  --green: #5cf0b2;
  --blue: #77d9ff;
  --amber: #e9c582;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 80% -12%, rgb(32 91 62 / 18%), transparent 38rem),
    linear-gradient(180deg, #07100d 0%, #08110e 44rem, #07100d 100%);
}

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: #a2ffd4; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 3px;
}

button, input { font: inherit; }
::selection { color: #06100b; background: var(--green); }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  transform: translateY(-160%);
  border: 1px solid var(--green);
  border-radius: 0.35rem;
  background: var(--panel-raised);
  color: var(--text);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  min-height: 4.4rem;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 3.5rem);
  border-bottom: 1px solid rgb(70 107 83 / 34%);
  background: rgb(7 16 13 / 92%);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 0.45rem;
  background: #0d2118;
  color: var(--green);
  font: 700 0.9rem var(--mono);
  box-shadow: inset 0 0 16px rgb(92 240 178 / 7%);
}
.brand-name { display: flex; align-items: baseline; gap: 0.75rem; font-size: 0.98rem; font-weight: 690; letter-spacing: -0.025em; }
.brand-product { color: var(--dim); font: 500 0.64rem var(--mono); letter-spacing: 0.11em; }
.topbar-meta { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font: 0.62rem var(--mono); letter-spacing: 0.15em; }
.status-light { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0.7rem rgb(92 240 178 / 52%); }

.site-shell {
  display: grid;
  width: min(100%, 1600px);
  min-height: calc(100vh - 8.6rem);
  grid-template-columns: minmax(200px, 245px) minmax(0, 790px) minmax(160px, 205px);
  gap: clamp(1.75rem, 4vw, 4.5rem);
  align-items: start;
  margin: 0 auto;
  padding: 2.8rem clamp(1.1rem, 4vw, 3.5rem) 4rem;
}

.sidebar { position: sticky; top: 6.9rem; max-height: calc(100vh - 8rem); overflow: auto; scrollbar-color: #294a37 transparent; scrollbar-width: thin; }
.nav-panel { border: 0; }
.nav-panel summary { display: none; }
.nav-panel-content { padding: 0 0.2rem 1.5rem; }
.search-label, .nav-group h2, .eyebrow, .article-kicker, .article-footer, .site-footer, .breadcrumbs, .page-toc summary {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.search-label { display: block; margin: 0 0 0.55rem; color: var(--dim); font-size: 0.62rem; }
.guide-search {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: #09140f;
  color: var(--text);
  font-size: 0.875rem;
}
.guide-search::placeholder { color: #71877a; }
.search-status { min-height: 1.1rem; margin: 0.3rem 0 1rem; color: var(--dim); font: 0.66rem var(--mono); }
.nav-group { margin: 0 0 1.4rem; }
.nav-group h2 { margin: 0 0 0.5rem; color: var(--blue); font-size: 0.61rem; font-weight: 550; }
.nav-group ul, .page-toc ul { display: grid; gap: 0.16rem; margin: 0; padding: 0; list-style: none; }
.nav-group a {
  display: block;
  padding: 0.4rem 0.55rem;
  border-left: 1px solid transparent;
  border-radius: 0 0.35rem 0.35rem 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.35;
  text-decoration: none;
}
.nav-group a:hover { border-color: var(--line-bright); background: rgb(92 240 178 / 5%); color: var(--text); }
.nav-group a[aria-current="page"] { border-color: var(--green); background: rgb(92 240 178 / 8%); color: var(--green); }
.nav-group [hidden] { display: none; }

.article-column { min-width: 0; padding: 0 0 1rem; }
.breadcrumbs { display: flex; align-items: center; gap: 0.55rem; min-height: 1.3rem; margin: 0 0 1.35rem; color: var(--dim); font-size: 0.6rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs [aria-current="page"] { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.article-kicker { display: flex; justify-content: space-between; margin: 0 0 0.75rem; color: var(--green); font-size: 0.6rem; }
.article-kicker span:last-child { color: var(--dim); }
.draft-notice { margin: 0 0 1.5rem; padding: 0.9rem 1rem; border: 1px solid rgb(233 197 130 / 55%); border-left: 3px solid var(--amber); border-radius: 0.35rem; background: rgb(75 56 23 / 28%); }
.draft-notice strong { display: block; color: var(--amber); font: 650 0.7rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.draft-notice p { margin: 0.35rem 0 0; color: #e7d7b7; font-size: 0.88rem; line-height: 1.55; }
.article-header { padding: 0 0 1.55rem; border-bottom: 1px solid var(--line); }
.article-header h1 { margin: 0; color: #f1f7f3; font-size: clamp(2.15rem, 4vw, 3.25rem); font-weight: 690; letter-spacing: -0.055em; line-height: 1.08; }
.article-description { max-width: 54rem; margin: 1rem 0 0; color: #a9bdaf; font-size: 1.03rem; line-height: 1.6; }
.prose { padding: 0.75rem 0 0; color: #d3e0d7; font-size: 1rem; line-height: 1.78; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 6.5rem; color: #edf5ef; font-weight: 620; letter-spacing: -0.025em; }
.prose h2 { margin: 2.8rem 0 0.8rem; padding-top: 0.25rem; font-size: 1.55rem; line-height: 1.3; }
.prose h3 { margin: 2rem 0 0.6rem; font-size: 1.18rem; line-height: 1.4; }
.prose h4 { margin: 1.6rem 0 0.5rem; font-size: 1rem; }
.prose p { margin: 0 0 1.1rem; }
.prose strong { color: #f0f8f2; font-weight: 670; }
.prose em { color: #c2d4c8; }
.prose code { padding: 0.12rem 0.35rem; border: 1px solid #294333; border-radius: 0.25rem; background: #0b1912; color: #a4f4cf; font: 0.88em var(--mono); }
.prose ul, .prose ol { margin: 0.5rem 0 1.35rem; padding-left: 1.4rem; }
.prose li { padding-left: 0.25rem; margin: 0.33rem 0; }
.prose li::marker { color: #6fbf91; }
.prose hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--line); }
.table-scroll { max-width: 100%; margin: 1.3rem 0 1.6rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 0.55rem; }
.prose table { width: 100%; border-collapse: collapse; background: rgb(10 23 16 / 75%); font-size: 0.88rem; line-height: 1.55; }
.prose th, .prose td { min-width: 9rem; padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: #102218; color: var(--green); font: 600 0.7rem var(--mono); letter-spacing: 0.035em; }
.prose tr:last-child td { border-bottom: 0; }
.article-footer { display: flex; justify-content: space-between; gap: 1rem; margin: 3.2rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line); color: var(--dim); font-size: 0.6rem; }
.article-footer a { color: var(--muted); text-decoration: none; }
.article-footer a:hover { color: var(--green); }

.toc-column { position: sticky; top: 7.2rem; }
.page-toc { padding: 0.15rem 0 0; }
.page-toc summary { margin-bottom: 0.75rem; color: var(--dim); font-size: 0.6rem; cursor: pointer; }
.page-toc ul { gap: 0.55rem; border-left: 1px solid var(--line); }
.page-toc li { padding-left: 0.75rem; line-height: 1.4; }
.page-toc li.toc-level-3 { padding-left: 1.35rem; }
.page-toc a { color: var(--muted); font-size: 0.72rem; text-decoration: none; }
.page-toc a:hover { color: var(--green); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem clamp(1rem, 4vw, 3.5rem);
  border-top: 1px solid rgb(70 107 83 / 28%);
  color: var(--dim);
  font-size: 0.59rem;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--green); }
.not-found { max-width: 42rem; margin: 12vh auto; padding: 2rem; }
.not-found .eyebrow { color: var(--green); font-size: 0.68rem; }
.not-found h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; }
.not-found p { color: var(--muted); }
.button-link { display: inline-flex; margin-top: 1rem; padding: 0.65rem 0.9rem; border: 1px solid var(--line-bright); border-radius: 0.4rem; text-decoration: none; }

@media (max-width: 1120px) {
  .site-shell { grid-template-columns: minmax(185px, 230px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); }
  .toc-column { display: none; }
}

@media (max-width: 720px) {
  .topbar { min-height: 3.9rem; padding-inline: 1rem; }
  .topbar-meta { font-size: 0.54rem; }
  .brand { gap: 0.55rem; }
  .brand-name { gap: 0.45rem; font-size: 0.9rem; }
  .brand-product { font-size: 0.55rem; }
  .brand-mark { width: 1.9rem; height: 1.9rem; }
  .site-shell { display: block; min-height: auto; padding: 1rem 1rem 3.2rem; }
  .sidebar { position: static; max-height: none; margin: 0 0 1.5rem; overflow: visible; }
  .nav-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 0.5rem; background: rgb(11 23 18 / 82%); }
  .nav-panel summary { display: flex; min-height: 2.9rem; align-items: center; justify-content: space-between; padding: 0.65rem 0.85rem; color: var(--text); font: 600 0.74rem var(--mono); letter-spacing: 0.06em; list-style: none; cursor: pointer; }
  .nav-panel summary::-webkit-details-marker { display: none; }
  .nav-summary-label::before { content: "// "; color: var(--green); }
  .nav-panel:not([open]) .nav-summary-icon { transform: rotate(-90deg); }
  .nav-summary-icon { color: var(--green); transition: transform 140ms ease; }
  .nav-panel-content { padding: 0.2rem 0.85rem 0.8rem; border-top: 1px solid var(--line); }
  .nav-group { margin: 1rem 0 0.8rem; }
  .nav-group h2 { margin-bottom: 0.35rem; }
  .nav-group ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0.4rem; }
  .nav-group a { padding: 0.43rem 0.5rem; font-size: 0.875rem; }
  .search-status { margin-bottom: 0.3rem; }
  .article-kicker { margin-bottom: 0.65rem; }
  .article-header { padding-bottom: 1.2rem; }
  .article-header h1 { font-size: clamp(2rem, 9vw, 2.65rem); }
  .article-description { margin-top: 0.75rem; font-size: 0.96rem; }
  .prose { font-size: 1rem; line-height: 1.72; }
  .prose h2 { margin-top: 2.25rem; font-size: 1.35rem; }
  .site-footer { padding: 1rem; font-size: 0.53rem; }
}

@media (max-width: 410px) {
  .topbar-meta { letter-spacing: 0.08em; }
  .brand-product { display: none; }
  .nav-group ul { grid-template-columns: 1fr; }
  .article-footer { font-size: 0.52rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

@media print {
  :root { color-scheme: light; --bg: white; --text: #111; --muted: #444; --dim: #555; }
  body { background: white; color: #111; }
  .topbar, .sidebar, .toc-column, .site-footer, .article-kicker, .article-footer { display: none !important; }
  .site-shell { display: block; min-height: 0; max-width: 52rem; padding: 0; }
  .article-header h1, .prose h2, .prose h3, .prose strong { color: #111; }
  .article-description, .prose { color: #222; }
  .prose a { color: #075b3b; }
}
