@font-face {
  font-family: Satoshi;
  src: url('assets/Satoshi-Variable.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: JetBrains;
  src: url('assets/JetBrainsMono-Regular.woff2') format('woff2');
  font-display: swap;
}
/* Colors: Variant C charcoal surfaces and terminal slate accents.
   Geometry: measured from opencode.ai/docs at 390, 768, 1024, 1440 and 1920px wide. */
:root {
  --sans: Satoshi, Arial, sans-serif;
  --mono: JetBrains, monospace;
  --bg: #111111;
  --surface: #191919;
  --line: #2a2a2a;
  --ink: #f2f2f2;
  --muted: #bababa;
  --subtle: #a4a9ae;
  --accent: #94a9c7;
  --code: #d1dff4;
  --tint: #222833;
  --slate-line: #384253;
  --gutter: 24px;
  --shell: 1728px;
  --rail: 20.14%;
  --sticky-offset: 0px;
  color-scheme: dark;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  scroll-padding-top: calc(var(--sticky-offset) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html:is([lang="ja"], [lang="zh-Hans"]) { --sans: system-ui, sans-serif; line-break: strict; }
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ul, ol, figure, pre { margin: 0; }
body { min-width: 320px; overflow-x: clip; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 9; top: 8px; left: 8px; padding: 8px 14px; background: var(--surface); }
html.search-open { overflow: hidden; }

/* Header: a 56px bar on narrow screens; on desktop the lockup sits over the left rail
   and the GitHub link over the right rail, as in the reference. */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wordmark, .github-link { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; }
.wordmark img { display: block; width: auto; height: 15px; }
.docs-link { border-inline-start: 1px solid var(--slate-line); padding-inline-start: 14px; font-size: 15px; font-weight: 600; line-height: 20px; text-decoration: none; }
.docs-link:hover { text-decoration: underline; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.github-link { width: 40px; }
.github-link img { filter: brightness(0) invert(1); opacity: .86; }
.github-link:hover img { opacity: 1; }
.doc-language { position: relative; flex: none; font-size: 13px; }
.doc-language summary { cursor: pointer; min-height: 40px; line-height: 40px; }
.doc-language > div { position: absolute; z-index: 9; inset-inline-end: 0; min-width: max-content; background: var(--surface); border: 1px solid var(--slate-line); }
.doc-language a { display: block; min-height: 40px; padding: 9px 12px; text-decoration: none; }
.doc-language a:hover, .doc-language a[aria-current] { background: var(--tint); }

/* Left navigation */
.layout { width: 100%; max-width: var(--shell); margin-inline: auto; }
#sidebar, .right-rail, #article { min-width: 0; }
#sidebar { color: var(--muted); font-size: 15px; line-height: 20px; }
.nav-group + .nav-group { margin-top: 32px; }
.nav-group h2, .toc > p { color: var(--subtle); font-size: 12px; font-weight: 600; line-height: 20px; letter-spacing: .08em; text-transform: uppercase; }
.nav-group h2 { margin-bottom: 7px; }
.nav-group ul, .toc ul, #search-results { list-style: none; padding: 0; margin: 0; }
.nav-group li + li { margin-top: 5px; }
.nav-group a { display: flex; align-items: flex-start; gap: 10px; padding-block: 5px; line-height: 20px; text-decoration: none; }
.nav-group a:hover, .nav-group a[aria-current] { color: var(--ink); }
.nav-group a[aria-current] { font-weight: 700; }
.marker { display: inline-flex; color: var(--subtle); font: 13px/20px var(--mono); flex: none; font-weight: 400; }
.marker span { display: inline-grid; place-items: center; width: 8px; }
.nav-group a[aria-current] .marker { color: var(--accent); }
.nav-group a[aria-current] .marker span::before { content: '−'; }

/* Article */
#article { padding-bottom: 48px; }
.article-body { color: var(--muted); }
.article-body > *, .article-section > * { max-width: 100%; }
.article-body :is(h1, h2, h3, p, ul, ol, .callout) { max-width: 42rem; }
.article-body :is(h1, h2, h3) { color: var(--ink); text-wrap: balance; }
.article-body h1 { font-size: 32px; font-weight: 500; line-height: 1.15; letter-spacing: -.02em; }
.article-body h2 { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.article-body h3 { font-size: 17px; font-weight: 600; line-height: 1.35; }
.intro > h1 { margin-bottom: 24px; }
.heading { display: flex; align-items: center; gap: 8px; }
.heading-2 { margin: 40px 0 12px; }
.heading-3 { margin: 28px 0 10px; }
.permalink { color: var(--accent); line-height: 0; opacity: 0; padding: 4px; border-radius: 3px; }
.heading:hover .permalink, .permalink:focus-visible { opacity: 1; }
.permalink svg { width: 15px; height: 15px; }
.article-body p, .article-body ul, .article-body ol, .article-body figure, .article-body .callout, .table-wrap { margin-bottom: 16px; }
.article-body strong { color: var(--ink); font-weight: 650; }
.article-body a:not(.permalink) { color: var(--code); }
.article-body :is(ul, ol) { padding-inline-start: 1.4em; }
.article-body li + li { margin-top: 6px; }
.article-body li::marker { color: var(--subtle); }
.article-body ol.steps { list-style: none; padding: 0; counter-reset: step; }
.article-body ol.steps > li { counter-increment: step; position: relative; padding-inline-start: 36px; }
.article-body ol.steps > li + li { margin-top: 10px; }
.article-body ol.steps > li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: .1em; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--slate-line); border-radius: 50%; color: var(--code); font: 12px/1 var(--mono); }
.article-body :is(p, li, td, th) code, .article-body kbd { font: .85em/1.4 var(--mono); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: .08em .34em; overflow-wrap: anywhere; }
.article-body kbd { border-bottom-width: 2px; white-space: nowrap; }

.code-block { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.code-block figcaption { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-inline: 14px 4px; border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 13px; line-height: 20px; }
.code-block figcaption > span, .copy-button { display: inline-flex; align-items: center; gap: 7px; }
.code-block figcaption svg { width: 15px; height: 15px; flex: none; color: var(--accent); }
.copy-button { min-height: 32px; padding: 4px 10px; border: 0; border-radius: 3px; background: transparent; color: var(--subtle); font-size: 13px; }
.copy-button:hover { background: var(--line); color: var(--ink); }
.copy-button:focus-visible { outline-offset: -2px; }
.copy-button[data-copied] { color: var(--code); }
.code-block pre { padding: 16px; overflow-x: auto; color: var(--code); font: 13px/1.6 var(--mono); white-space: pre; tab-size: 2; scrollbar-width: thin; }
.code-block pre:focus-visible { outline-offset: -2px; }
.code-block[data-label="Prompt"] pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.code-block code { font: inherit; }

.callout { padding: 12px 16px; background: var(--surface); border: 1px solid var(--slate-line); border-radius: 4px; }
.article-body .callout p { margin: 0; }
.article-body .callout p + p { margin-top: 4px; }
.callout-title { display: flex; align-items: center; gap: 8px; }
.callout-title svg { width: 16px; height: 16px; flex: none; color: var(--accent); }

.table-wrap { overflow-x: auto; scrollbar-width: thin; }
.table-wrap:focus-visible { outline-offset: 2px; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.article-body :is(th, td) { padding: 8px 12px; border: 1px solid var(--line); text-align: start; vertical-align: top; min-width: 7em; overflow-wrap: break-word; }
.article-body thead th { background: var(--surface); color: var(--subtle); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.article-body tbody th { color: var(--ink); font-weight: 500; }
.article-body tbody th:first-child { width: 32%; }

.pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.pagination a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.pagination a:hover { background: var(--surface); border-color: var(--slate-line); }
.pagination .next { grid-column: 2; text-align: end; grid-template-columns: minmax(0, 1fr) auto; }
.pagination .previous { grid-template-columns: auto minmax(0, 1fr); }
.pagination .page-direction { color: var(--subtle); font-size: 13px; line-height: 20px; }
.pagination .page-title { font-weight: 600; }
.pagination svg { grid-row: 1 / 3; width: 14px; color: var(--accent); }
.pagination .next svg { grid-column: 2; }
.pagination .previous svg { grid-column: 1; transform: rotate(180deg); }
.pagination .previous span { grid-column: 2; }
.article-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 13px; line-height: 1.6; }
.article-footer p + p { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.article-footer a { display: inline-flex; align-items: center; gap: 3px; overflow-wrap: anywhere; }
.external-icon { width: 13px; height: 13px; flex: none; }

/* Contents and search */
.right-rail { display: none; }
.toc a { display: block; padding: 5px 0 5px 14px; border-inline-start: 1px solid var(--line); color: var(--muted); font-size: 15px; line-height: 20px; text-decoration: none; }
.toc .toc-3 a { padding-inline-start: 28px; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current] { color: var(--ink); border-inline-start: 2px solid var(--accent); padding-inline-start: 13px; font-weight: 600; }
.toc .toc-3 a[aria-current] { padding-inline-start: 27px; }
.toc a:focus-visible { outline-offset: -2px; }
.search-button { border: 0; color: var(--muted); background: none; }
.search-button:hover { color: var(--ink); }
.desktop-search { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding-inline: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-size: 15px; text-align: start; }
.desktop-search:hover { background: var(--tint); }
.desktop-search kbd { margin-inline-start: auto; font: 11px var(--mono); white-space: nowrap; color: var(--subtle); }
.desktop-search svg, .search-field svg { width: 15px; height: 15px; flex: none; }
.mobile-search { display: inline-grid; place-items: center; width: 44px; height: 44px; }
.mobile-search span, .mobile-search kbd { display: none; }

#docs-search { width: min(calc(100% - 48px), 640px); max-width: none; max-height: 70vh; margin: min(15vh, 132px) auto 0; padding: 0; overflow: hidden; border: 1px solid var(--slate-line); border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px #0008; }
#docs-search[open] { display: flex; flex-direction: column; }
#docs-search::backdrop { background: #0006; }
.search-field { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 8px 4px 16px; color: var(--muted); border-bottom: 1px solid var(--line); }
.search-field input { flex: 1; min-width: 0; padding: 8px 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: 16px; }
.search-field input::placeholder { color: var(--subtle); }
.search-close { min-height: 36px; padding: 6px 8px; border: 0; background: none; color: var(--code); }
.escape-label { font: 12px var(--mono); }
.cancel-label { display: none; }
.search-body { overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 8px; }
.search-status:empty { display: none; }
.search-status { padding: 12px 8px; color: var(--muted); }
.search-result { display: block; padding: 8px 10px; border-radius: 4px; text-decoration: none; overflow-wrap: anywhere; outline-offset: -2px; }
.search-result:hover, .search-result:focus { background: var(--tint); }
.search-result :is(small, strong, span) { display: block; }
.search-result small { color: var(--accent); font-size: 12px; line-height: 18px; }
.search-result small:empty { display: none; }
.search-result strong { font-weight: 600; }
.search-result span { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Desktop: three columns, each side rail 20.14% of a 1728px-max shell. */
@media (min-width: 961px) {
  .site-header { position: fixed; z-index: 5; inset: 0 0 auto; max-width: var(--shell); height: 72px; margin-inline: auto; padding: 0 16px 0 22px; pointer-events: none; }
  .site-header > * { pointer-events: auto; }
  .lockup { padding-top: 2px; }
  .layout { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr) var(--rail); }
  #sidebar { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 72px); margin-top: 72px; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 24px 22px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  #article { padding: 82px 72px 48px 16px; }
  .right-rail { display: block; position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 82px 24px 24px 0; scrollbar-width: none; }
  .desktop-toc { margin-top: 32px; }
  .desktop-toc > p { margin-bottom: 7px; padding-inline-start: 14px; }
  .mobile-bars, .mobile-search { display: none !important; }
}
@media (min-width: 961px) and (max-width: 1248px) {
  .right-rail { padding-inline-end: 14px; }
  .site-header { padding-inline-end: 8px; }
}

/* Tablet and phone: sticky header, page and contents disclosure rows, one column. */
@media (max-width: 960px) {
  :root { font-size: 17px; line-height: 1.6; }
  .site-header { position: sticky; top: 0; z-index: 6; height: 56px; padding: 0 12px 0 var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line); }
  .mobile-bars { position: sticky; top: 56px; z-index: 5; background: var(--bg); }
  .mobile-toggle { width: 100%; height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-inline: var(--gutter); border: 0; border-bottom: 1px solid var(--line); background: var(--bg); font-size: 16px; text-align: start; }
  .mobile-toggle > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-toggle:first-child { font-weight: 600; }
  .mobile-toggle:focus-visible { outline-offset: -4px; }
  .mobile-toggle .chevron { width: 16px; flex: none; }
  .mobile-toggle[aria-expanded="true"] .chevron { transform: rotate(90deg); }
  #mobile-contents { position: absolute; inset: 100% 0 auto; max-height: calc(100vh - 154px); max-height: calc(100dvh - 154px); overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
  #mobile-contents a { padding: 12px var(--gutter); border: 0; font-size: 16px; }
  #mobile-contents .toc-3 a { padding-inline-start: calc(var(--gutter) + 16px); }
  #mobile-contents a[aria-current] { box-shadow: inset 2px 0 var(--accent); padding-inline-start: var(--gutter); }
  #mobile-contents .toc-3 a[aria-current] { padding-inline-start: calc(var(--gutter) + 16px); }
  #mobile-contents a:focus-visible { outline-offset: -3px; }
  #sidebar { padding: 24px var(--gutter) 32px; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 24px; }
  .enhanced #sidebar { display: none; }
  .enhanced[data-menu="navigation"] { overflow: hidden; }
  .enhanced[data-menu="navigation"] #sidebar { display: block; position: fixed; z-index: 4; inset: 105px 0 0; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border: 0; }
  .nav-group li + li { margin-top: 0; }
  .nav-group a { min-height: 44px; padding-block: 10px; }
  #article { padding: 71px var(--gutter) 48px; }
  .article-body h1 { font-size: clamp(28px, calc(.55vw + 26.6px), 30px); }
  .article-body h2 { font-size: 20px; }
  .article-body table { font-size: 15px; }
  .code-block pre { font-size: 14px; }
  .copy-button { min-height: 40px; }
}
@media (max-width: 640px) {
  #article { padding-top: 43px; }
  .article-body h1 { font-size: 28px; }
  .pagination { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pagination .next { grid-column: 1; }
  .article-body :is(th, td) { padding: 8px 10px; }
  #docs-search { width: 100%; height: 100%; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .cancel-label { display: inline; font-size: 16px; }
  .escape-label { display: none; }
  .search-close { min-height: 44px; }
}
@media (max-width: 359px) {
  :root { --gutter: 16px; }
}
