.documentation main {
  max-width: 1080px;
  margin: 2.5rem auto 6rem;
  width: 92%;
}
.doc-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.doc-title h1 {
  margin: 0;
  font:
    400 clamp(2.4rem, 5.5vw, 5rem)/1.04 var(--serif);
  letter-spacing: -0.045em;
}
.doc-title a,
.documentation article a,
.documentation nav [aria-current] {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.doc-lead {
  font-size: 1.1rem;
  line-height: 1.5;
  max-width: 65ch;
}
.doc-layout {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 3fr);
  gap: 5%;
}
.documentation aside {
  display: grid;
  align-content: start;
  gap: 1rem;
  position: sticky;
  top: 1rem;
  align-self: start;
  padding: 1.5rem 0;
  font-size: 0.92rem;
}
.documentation article section {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin: 1rem;
}
.documentation article h2 {
  font:
    400 clamp(1.65rem, 3vw, 2.2rem)/1.13 var(--serif);
  letter-spacing: -0.04em;
}
.documentation article h3 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 1.65rem 0 0.4rem;
  font-size: 1.15rem;
}
.documentation h3 span {
  display: inline-grid;
  flex: none;
  place-items: center;
  background: var(--ink);
  color: var(--accent);
  font: 700 0.86rem var(--mono);
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
}
.documentation article p {
  line-height: 1.6;
  margin: 0.6rem 0 0.9rem;
}
.snippet {
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}
.snippet pre {
  background: none;
  color: inherit;
  padding: 0;
  margin: 0 0 0.85rem;
  font: normal 0.93rem/1.55 var(--mono);
  white-space: pre-wrap;
}
.snippet button,
.agent-handoff button {
  background: var(--accent-soft);
  color: var(--ink);
  font: 600 0.85rem var(--mono);
  border: 0;
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
}
.documentation summary {
  cursor: pointer;
  font-weight: 650;
  padding: 0.5rem 0;
}
.documentation #copy-note:not(:empty) {
  position: fixed;
  bottom: 1rem;
  left: 4%;
  background: var(--ink);
  color: white;
  padding: 0.6rem;
}
@media (max-width: 700px) {
  .documentation main {
    margin-top: 1.4rem;
  }
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .documentation aside {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    padding-bottom: 0;
  }
  .doc-title {
    align-items: start;
  }
  .doc-title a {
    margin-top: 0.55rem;
  }
}

.agent-handoff button {
  border: 1px solid var(--line);
  padding: 0.65rem 1rem;
}
@media (max-width: 480px) {
  .documentation header {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 0 6px;
    gap: 6px;
  }
  .documentation nav {
    width: 100%;
    justify-content: space-between;
    gap: 5px;
  }
  .documentation nav a {
    padding: 9px 0;
  }
}
@media (max-width: 480px) {
  .doc-title {
    flex-direction: column-reverse;
    gap: 0.65rem;
  }
  .doc-title a {
    align-self: flex-end;
  }
}

.language-picker { position: relative; flex: none; }
.language-picker summary {
  display: flex; align-items: center; gap: .5em; list-style: none;
  padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 5px;
  font: .9rem var(--sans); cursor: pointer;
}
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary::after { content: "▾"; }
.language-picker ul {
  position: absolute; z-index: 3; inset-inline-end: 0; margin: .25rem 0 0;
  padding: .3rem; width: max-content; max-width: 90vw; max-height: min(55vh, 26rem);
  overflow: auto; list-style: none; background: var(--paper);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px #211f1c20;
}
.language-picker li a {
  display: block; padding: .45rem .75rem; margin: 0; text-align: start;
  text-decoration: none; border-radius: 3px;
}
.language-picker a:is(:hover,:focus-visible,[aria-current]) { background: var(--accent-soft); }
.doc-title, .documentation article { overflow-wrap: anywhere; }
@media (max-width: 480px) { .language-picker { align-self: flex-end; } }
