:root {
  color-scheme: light;
  --paper: #f5f4ef;
  --ink: #272c28;
  --muted: #64675e;
  --green: #4f604c;
  --line: #d7d8ce;
  --serif: "Iowan Old Style", "Baskerville", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 20rem; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
button { font: inherit; }
::selection { color: var(--paper); background: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }
[id] { scroll-margin-top: 7rem; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  color: var(--paper);
  background: var(--green);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(76rem, calc(100% - 5rem));
  min-height: 6rem;
  margin-inline: auto;
}

.header-brand, .header-links { display: flex; align-items: center; gap: 1.5rem; }
.brand-link { display: block; flex-shrink: 0; }
.brand-link img { display: block; width: 6.5rem; height: auto; }
.section-label { padding-left: 1.5rem; border-left: 1px solid var(--line); font-size: 0.875rem; }
.header-links { font-size: 0.75rem; }
.header-links a { text-decoration: none; }
.header-links a:hover { text-decoration: underline; }
.header-links a span { margin-left: 0.4rem; }
.version { padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); white-space: nowrap; }

.docs-layout {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 50rem);
  gap: clamp(2rem, 5vw, 5rem);
  width: min(76rem, calc(100% - 5rem));
  margin: 3.5rem auto 0;
}

.sidebar { position: sticky; top: 8.75rem; align-self: start; max-height: calc(100dvh - 10rem); overflow-y: auto; padding: 0.25rem 0.5rem 0.5rem 0; }
.toc-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; color: var(--muted); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; cursor: pointer; list-style: none; }
.toc-panel summary::-webkit-details-marker { display: none; }
.toc-indicator { font-size: 1rem; font-weight: 400; line-height: 1; }
.toc-panel[open] .toc-indicator { transform: rotate(45deg); }
.toc ul { list-style: none; margin: 0.875rem 0 0; padding: 0; }
.toc li { margin: 0.2rem 0; }
.toc li ul { margin: 0.25rem 0 0.5rem 0.9rem; }
.toc a { display: block; border-left: 2px solid transparent; padding: 0.5rem 0.75rem; color: var(--muted); font-size: 0.8125rem; line-height: 1.6; text-decoration: none; overflow-wrap: anywhere; }
.toc a:hover, .toc a[aria-current="location"] { border-left-color: var(--green); color: var(--ink); background: #e9ebe2; }
.sidebar-note { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.6875rem; line-height: 1.9; }
main { min-width: 0; }
.eyebrow { margin: 0 0 1rem; color: var(--green); font-size: 0.6875rem; font-weight: 500; line-height: 1.6; letter-spacing: 0.16em; text-transform: uppercase; }
.api-content { font-size: 0.9375rem; line-height: 1.9; overflow-wrap: anywhere; }
.api-content h1, .api-content h2, .api-content h3 { font-family: var(--serif); font-weight: 400; line-height: 1.35; letter-spacing: -0.025em; }
.api-content h1 { margin: 0 0 1.5rem; font-size: clamp(2rem, 3.5vw, 2.75rem); }
.api-content h2 { margin: 3.5rem 0 1.25rem; padding-top: 2.25rem; border-top: 1px solid var(--line); font-size: 1.75rem; }
.api-content h3 { margin: 2rem 0 1rem; font-size: 1.25rem; }
.api-content p { margin: 1rem 0; }
.api-content > p:first-of-type { color: var(--muted); font-size: 1rem; }
.api-content ul, .api-content ol { padding-left: 1.35rem; }
.api-content li { padding-left: 0.25rem; margin: 0.5rem 0; }
.api-content strong { font-weight: 600; }
.api-content blockquote { margin: 1.5rem 0; padding: 0.25rem 1.25rem; border-left: 3px solid var(--green); color: var(--muted); background: #eceee5; }
.api-content code { padding: 0.15em 0.3em; border-radius: 3px; color: #344732; background: #e6e8df; font-family: var(--mono); font-size: 0.85em; }
.headerlink { margin-left: 0.5em; color: var(--muted); font-family: var(--sans); font-size: 0.65em; text-decoration: none; opacity: 0; }
h1:hover .headerlink, h2:hover .headerlink, h3:hover .headerlink, .headerlink:focus-visible { opacity: 1; }

.table-scroll { max-width: 100%; margin: 1.5rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
.table-scroll table { width: 100%; min-width: 36rem; border-collapse: collapse; font-size: 0.8125rem; line-height: 1.75; }
.api-content > .table-scroll:first-of-type table { min-width: 0; }
.table-scroll th { background: #e9ebe2; font-weight: 600; text-align: left; }
.table-scroll th, .table-scroll td { padding: 0.8rem 1rem; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-scroll tr:last-child td { border-bottom: 0; }
.table-scroll td:first-child { color: #354c39; }
.table-scroll code { font-size: 0.9em; }

.api-content pre { max-width: 100%; margin: 1.5rem 0; padding: 1.25rem 1.5rem; overflow-x: auto; border-radius: 4px; background: #26372d; color: #edf1e9; font-size: 0.8125rem; line-height: 1.8; tab-size: 4; }
.api-content pre code { display: block; padding: 0; border-radius: 0; color: inherit; background: transparent; font-size: inherit; white-space: pre; overflow-wrap: normal; }
.code-block { max-width: 100%; margin: 1.5rem 0; overflow: hidden; border: 1px solid #d2d8ca; border-radius: 4px; }
.code-block pre { margin: 0; border-radius: 0; }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2.75rem; padding: 0.4rem 0.75rem 0.4rem 1.25rem; background: #e9ebe2; }
.code-language { color: var(--green); font-family: var(--mono); font-size: 0.6875rem; }
.copy-button { min-width: 4.5rem; min-height: 2rem; padding: 0.25rem 0.6rem; border: 1px solid #c9cdbf; border-radius: 3px; color: var(--green); background: transparent; font-size: 0.6875rem; cursor: pointer; }
.copy-button:hover { border-color: var(--green); background: var(--paper); }
.copy-button:focus-visible { outline-offset: 2px; }
.docs-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: 4rem; padding: 1.5rem 0 2rem; border-top: 1px solid var(--line); font-size: 0.75rem; }
.docs-footer a { color: var(--muted); text-decoration: none; }
.docs-footer a:hover { color: var(--ink); text-decoration: underline; }
.docs-footer .footer-brand { color: var(--ink); font-family: var(--serif); font-size: 1.375rem; letter-spacing: -0.04em; }

@media (max-width: 56rem) {
  .header-inner, .docs-layout { width: calc(100% - 3rem); }
  .header-links { gap: 1rem; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; margin-top: 1.5rem; }
  .sidebar { position: static; max-height: none; padding: 0; }
  .sidebar-note { display: none; }
  .toc-panel { border: 1px solid var(--line); border-radius: 4px; }
  .toc-panel summary { padding: 0.875rem 1rem; }
  .toc-panel nav { padding: 0 0.5rem 0.75rem; }
  .toc ul { margin-top: 0; }
  .api-content h1 { font-size: 2.25rem; }
  .api-content h2 { margin-top: 3rem; padding-top: 1.75rem; }
}

@media (max-width: 36rem) {
  [id] { scroll-margin-top: 8.5rem; }
  .header-inner { flex-wrap: wrap; justify-content: flex-start; gap: 0.5rem; min-height: 0; padding: 0.75rem 0; }
  .header-brand { width: 100%; gap: 1rem; }
  .brand-link img { width: 5.5rem; }
  .section-label { padding-left: 1rem; font-size: 0.8125rem; }
  .header-links { width: 100%; gap: 1.25rem; font-size: 0.6875rem; }
  .version { font-size: 0.625rem; padding: 0.2rem 0.4rem; }
  .download-link { margin-left: auto; }
  .api-content { font-size: 0.875rem; }
  .api-content h1 { font-size: 1.875rem; }
  .api-content h2 { font-size: 1.5rem; }
  .api-content > p:first-of-type { font-size: 0.9375rem; }
  .api-content pre { padding: 1rem; font-size: 0.75rem; }
  .table-scroll th, .table-scroll td { padding: 0.7rem 0.75rem; }
  .table-scroll table { font-size: 0.75rem; }
  .headerlink { opacity: 0.6; }
}

@media print {
  body { background: white; }
  .site-header, .sidebar, .eyebrow, .copy-button, .headerlink, .docs-footer, .skip-link { display: none; }
  .docs-layout { display: block; width: 100%; margin: 0; }
  .api-content { font-size: 10pt; }
  .api-content h2 { break-after: avoid; }
  .table-scroll { overflow: visible; }
  .table-scroll table { min-width: 0; }
  .api-content pre, .api-content pre code { white-space: pre-wrap; overflow-wrap: anywhere; color: black; background: #f1f1ed; }
}
