:root {
  color-scheme: light;
  --ink: #15221c;
  --muted: #5c6b63;
  --line: #dbe3dc;
  --soft-line: #edf1ed;
  --paper: #fffdf8;
  --canvas: #f7f7f1;
  --green: #176b4d;
  --green-dark: #0e5038;
  --mint: #dff3e7;
  --amber: #8a4b08;
  --amber-bg: #fff2d8;
  --code: #10251d;
  --shadow: 0 14px 38px rgb(24 42 32 / 10%);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 8rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.17em;
}

a:hover {
  color: var(--green-dark);
  text-decoration-thickness: 2px;
}

a:focus-visible,
input:focus-visible {
  outline: 3px solid #76c89f;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  color: white;
  background: var(--green-dark);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.75rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: rgb(255 253 248 / 94%);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  width: 70px;
  height: 32px;
  display: block;
  flex: 0 0 70px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.environment-picker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.environment-picker select {
  min-height: 36px;
  padding: 0.32rem 1.75rem 0.32rem 0.58rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font: 0.82rem ui-sans-serif, system-ui, sans-serif;
}

.search {
  min-width: min(34vw, 410px);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.48rem 0.42rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: white;
}

.search:focus-within {
  border-color: #76c89f;
  box-shadow: 0 0 0 3px rgb(118 200 159 / 20%);
}

.search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}

kbd {
  padding: 0.05rem 0.42rem;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--muted);
  background: var(--canvas);
  font: 0.75rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

.agent-link {
  padding: 0.48rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green-dark);
  background: var(--mint);
  font-size: 0.87rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.search-results {
  position: fixed;
  z-index: 40;
  top: 61px;
  right: clamp(1rem, 3vw, 2.5rem);
  width: min(620px, calc(100vw - 2rem));
  max-height: min(72vh, 610px);
  padding: 0.5rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.search-results a {
  display: grid;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.search-results a:hover,
.search-results a:focus-visible {
  background: var(--canvas);
}

.search-section {
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-summary {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.search-empty {
  margin: 0;
  padding: 1.25rem;
  color: var(--muted);
  text-align: center;
}

.release-banner {
  position: relative;
  z-index: 10;
  padding: 0.54rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid #eed5a3;
  color: #673b0d;
  background: var(--amber-bg);
  font-size: 0.82rem;
  text-align: center;
}

.release-banner code {
  border-color: #eed5a3;
  color: #673b0d;
  background: rgb(255 255 255 / 45%);
}

.shell {
  width: 100%;
  display: grid;
  grid-template-columns: 245px minmax(0, 820px) 220px;
  justify-content: center;
  gap: clamp(2rem, 4vw, 4rem);
  padding: 2.8rem clamp(1rem, 3vw, 2.5rem) 5rem;
}

.sidebar,
.toc {
  position: sticky;
  top: 126px;
  align-self: start;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-section {
  display: grid;
  gap: 0.08rem;
  margin-bottom: 1.35rem;
}

.nav-section h2,
.toc h2 {
  margin: 0 0 0.35rem;
  color: #849087;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.nav-section a {
  padding: 0.36rem 0.55rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
  text-decoration: none;
}

.nav-section a:hover {
  color: var(--ink);
  background: var(--canvas);
}

.nav-section a[aria-current="page"] {
  color: var(--green-dark);
  background: var(--mint);
  font-weight: 700;
}

.downloads {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.content {
  min-width: 0;
}

article > :first-child {
  margin-top: 0;
}

article h1 {
  max-width: 17ch;
  margin-bottom: 1.35rem;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

article h2,
article h3,
article h4 {
  position: relative;
  scroll-margin-top: 8rem;
  letter-spacing: -0.025em;
}

article h2 {
  margin: 3.25rem 0 1rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--soft-line);
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.2;
}

article h3 {
  margin: 2.2rem 0 0.8rem;
  font-size: 1.28rem;
  line-height: 1.3;
}

article h4 {
  margin: 1.6rem 0 0.6rem;
  font-size: 1rem;
}

.heading-anchor {
  position: absolute;
  left: -1.15em;
  padding-right: 0.3rem;
  opacity: 0;
  color: #91a098;
  font-weight: 500;
  text-decoration: none;
}

h2:hover .heading-anchor,
h3:hover .heading-anchor,
h4:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
}

article p,
article li {
  color: #314239;
  overflow-wrap: anywhere;
}

article > p:first-of-type {
  color: #40544a;
  font-size: 1.1rem;
  line-height: 1.7;
}

article ul,
article ol {
  padding-left: 1.35rem;
}

article li {
  margin: 0.35rem 0;
  padding-left: 0.25rem;
}

.check {
  display: inline-block;
  width: 1.35rem;
  margin-left: -0.1rem;
  color: var(--green);
  font-weight: 800;
}

blockquote {
  margin: 1.6rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid #b9dec9;
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #f2fbf5;
}

blockquote p,
article > blockquote p:first-of-type {
  margin: 0;
  color: #274c3a;
  font-size: 0.94rem;
}

code {
  padding: 0.12em 0.32em;
  border: 1px solid #d9e3dc;
  border-radius: 5px;
  color: #124b36;
  background: #f2f6f3;
  font: 0.86em/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

pre {
  position: relative;
  margin: 1.3rem 0;
  padding: 1rem 1.15rem;
  overflow: auto;
  border: 1px solid #203c30;
  border-radius: var(--radius);
  color: #e9f8ef;
  background: var(--code);
  box-shadow: 0 8px 24px rgb(10 37 27 / 10%);
  tab-size: 2;
}

pre code {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: 0.82rem;
  line-height: 1.65;
  overflow-wrap: normal;
}

.copy-code {
  position: sticky;
  top: 0;
  right: 0;
  display: block;
  margin: -0.45rem 0 0.3rem auto;
  padding: 0.3rem 0.52rem;
  border: 1px solid #446356;
  border-radius: 6px;
  color: #dff3e7;
  background: #1b382c;
  font: 0.68rem ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.copy-code:hover,
.copy-code:focus-visible {
  color: white;
  border-color: #80c59f;
  outline: 0;
}

.table-scroll {
  margin: 1.35rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 0.72rem 0.82rem;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #46564d;
  background: var(--canvas);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.button {
  display: inline-block;
  padding: 0.62rem 0.9rem;
  border-radius: 8px;
  color: white;
  background: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.toc {
  display: grid;
  gap: 0.4rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.toc a {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover {
  color: var(--green-dark);
}

.toc-level-3 {
  padding-left: 0.75rem;
}

footer {
  margin-top: 4.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

footer p {
  margin: 0.35rem 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 220px minmax(0, 820px);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 10rem;
  }

  .topbar {
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
  }

  .brand span:last-child {
    display: none;
  }

  .top-actions {
    flex: 1;
    min-width: 0;
  }

  .environment-picker > span {
    display: none;
  }

  .environment-picker select {
    max-width: 118px;
  }

  .search {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  .agent-link,
  kbd {
    display: none;
  }

  .search-results {
    top: 59px;
    right: 0.75rem;
    width: calc(100vw - 1.5rem);
  }

  .release-banner {
    padding: 0.55rem 1rem;
    line-height: 1.4;
  }

  .shell {
    display: block;
    padding: 1.7rem 1.1rem 3.5rem;
  }

  .sidebar {
    position: static;
    display: flex;
    gap: 0.4rem;
    margin: 0 -1.1rem 2rem;
    padding: 0 1.1rem 0.8rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
  }

  .nav-section {
    display: contents;
  }

  .nav-section h2,
  .downloads {
    display: none;
  }

  .nav-section a {
    flex: 0 0 auto;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--line);
    white-space: nowrap;
  }

  article h1 {
    max-width: none;
    font-size: clamp(2.05rem, 12vw, 3rem);
  }

  .heading-anchor {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .topbar,
  .release-banner,
  .sidebar,
  .toc {
    display: none;
  }

  .shell {
    display: block;
    padding: 0;
  }

  body {
    background: white;
  }

  a {
    color: inherit;
  }
}
