/* Developer docs layout: header, left menu, article, "On this page" column. */
:root, :root[data-theme="dark"] {
  --d-bg: #0E1113;
  --d-panel: #181D21;
  --d-ink: #EDF0F2;
  --d-text: #C3CAD0;
  --d-muted: #8F99A2;
  --d-line: #2A3238;
  --d-line-strong: #67727C;
  --d-soft: rgba(237, 240, 242, .06);
  --d-primary: #EDF0F2;
  --d-active-bg: #11261B;
  --d-active: #EDF0F2;
  --d-foot: #13171A;
  --d-code-bg: #0A0C0E;
  --d-accent: #34D07F;
  --d-accent-ink: #06170E;
  --d-accent-text: #5EDC9B;
  --d-accent-line: #1F4A33;
  --d-focus: #7EE8B0;
  --d-warn: #E3B341;
  --d-warn-soft: #29210F;
  --d-warn-line: #4A3B14;
  --d-ok: #5EDC9B;
  --d-bad: #F28B8D;
  --d-display: Inter, ui-sans-serif, system-ui, sans-serif;
  --d-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --d-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color-scheme: dark;
}
/* Light reading mode, chosen from the theme switch: same graphite ink, darker green. */
:root[data-theme="light"] {
  --d-bg: #F5F6F7;
  --d-panel: #FFFFFF;
  --d-ink: #14181B;
  --d-text: #2E353B;
  --d-muted: #5A636B;
  --d-line: #D9DEE2;
  --d-line-strong: #8A939B;
  --d-soft: rgba(20, 24, 27, .05);
  --d-primary: #14181B;
  --d-active-bg: #E3F4EA;
  --d-active: #14181B;
  --d-foot: #ECEFF1;
  --d-code-bg: #FFFFFF;
  --d-accent: #157347;
  --d-accent-ink: #FFFFFF;
  --d-accent-text: #157347;
  --d-accent-line: #9FD3B6;
  --d-focus: #157347;
  --d-warn: #7A5300;
  --d-warn-soft: #FBF1D9;
  --d-warn-line: #E6C77A;
  --d-ok: #157347;
  --d-bad: #B42318;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body.docs { margin: 0; background: var(--d-bg); color: var(--d-text); font: 400 16px/1.5 var(--d-font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.docs a { color: inherit; text-decoration: none; }
.docs button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.docs :focus-visible { outline: 2px solid var(--d-focus); outline-offset: 2px; border-radius: 4px; }
.d-skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--d-panel); padding: 8px 12px; border-radius: 6px; }
.d-skip:focus { left: 8px; }

/* header */
.d-head { position: sticky; top: 0; z-index: 30; height: 64px; background: color-mix(in srgb, var(--d-bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--d-line); }
.d-head__in { max-width: 1440px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.d-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--d-ink) !important; font-family: var(--d-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; border-radius: 6px; }
.d-logo em { font-style: normal; font-family: var(--d-mono); font-weight: 500; font-size: 12px; letter-spacing: .04em; color: var(--d-muted); border: 1px solid var(--d-line); border-radius: 9999px; padding: 1px 8px; }
.d-head__right { display: flex; align-items: center; gap: 16px; }
.d-search { display: inline-flex; align-items: center; gap: 8px; width: 256px; height: 32px; padding: 0 6px 0 12px; border-radius: 8px; background: var(--d-soft) !important; color: var(--d-muted) !important; font-size: 14px !important; text-align: left; }
.d-search svg { flex: none; opacity: .7; }
.d-search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-search kbd, .d-search-dlg kbd { font: 500 11px/1 var(--d-font); color: var(--d-muted); background: var(--d-bg); border: 1px solid var(--d-line); border-radius: 4px; padding: 4px 6px; letter-spacing: .02em; }
.d-head__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--d-ink) !important; border-radius: 6px; }
.d-head__icon:hover { background: var(--d-soft); }
.d-menu-btn { display: none !important; }
.d-menu-btn .i-close { display: none; }
.d-menu-btn[aria-expanded="true"] .i-open { display: none; }
.d-menu-btn[aria-expanded="true"] .i-close { display: inline; }

/* layout */
.d-layout { max-width: 1440px; margin: 0 auto; display: flex; align-items: flex-start; }
.d-side { position: sticky; top: 64px; width: 256px; flex: none; height: calc(100vh - 64px); display: flex; flex-direction: column; padding: 16px 16px 0; }
.d-search--side { display: none; }
.d-side__nav { flex: 1; overflow-y: auto; }
.d-nav { list-style: none; margin: 0; padding: 0; }
.d-nav li + li { margin-top: 4px; }
.d-nav a { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 4px; font-size: 14px; line-height: 20px; color: var(--d-muted); transition: background .15s, color .15s; }
.d-nav a:hover { background: var(--d-soft); color: var(--d-ink); }
.d-nav a.is-active { background: var(--d-active-bg); box-shadow: inset 2px 0 0 var(--d-accent); color: var(--d-active); font-weight: 600; }
.d-nav svg { opacity: .7; }
.d-nav__group { margin: 32px 0 12px; padding: 0 8px; font-size: 14px; font-weight: 600; color: var(--d-ink); }
.d-nav__group + .d-nav { margin-bottom: 0; }
.d-nav__sep { border: 0; border-top: 1px solid var(--d-line); margin: 16px 8px 16px; }
.d-side__foot { display: flex; align-items: center; justify-content: space-between; margin: 0 -16px; padding: 16px 24px; border-top: 1px solid var(--d-line); }
.d-theme { display: inline-flex; align-items: center; gap: 8px; font-size: 12px !important; font-weight: 500 !important; color: var(--d-muted) !important; padding: 4px 6px !important; border-radius: 4px; }
.d-theme:hover, .d-collapse:hover { background: var(--d-soft) !important; color: var(--d-ink) !important; }
.d-collapse { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 4px; color: var(--d-muted) !important; }
body.side-collapsed .d-side { width: 64px; }
body.side-collapsed .d-side__nav, body.side-collapsed .d-theme span { display: none; }
body.side-collapsed .d-side__foot { flex-direction: column; gap: 8px; margin-top: auto; }

/* article */
.d-article { flex: 1; min-width: 0; padding: 16px 48px 32px; }
.d-crumb { margin-top: 16px; font-size: 14px; font-weight: 500; color: var(--d-ink); }
.d-titlerow { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.d-article h1 { margin: 8px 0 0; font: 600 38px/1.1 var(--d-display); letter-spacing: -.03em; color: var(--d-ink); }
.d-body { max-width: 832px; }
.d-titlerow { max-width: 832px; }
.d-crumb { max-width: 832px; }
.d-pager { max-width: 832px; }
.d-body > p, .d-body > .d-cards { margin-top: 24px; }
.d-body p { margin-bottom: 0; line-height: 28px; }
.d-body strong { color: var(--d-ink); font-weight: 600; }
.d-body h2 { margin: 40px 0 0; padding-bottom: 4px; border-bottom: 1px solid var(--d-line); font: 600 26px/1.2 var(--d-display); letter-spacing: -.025em; color: var(--d-ink); }
.d-body h2 + p, .d-body h2 + ul, .d-body h2 + ol, .d-body h2 + .d-cards { margin-top: 24px; }
.d-body ol, .d-body ul { margin: 24px 0 0; padding-left: 24px; }
.d-body ol { list-style: decimal; }
.d-body ul { list-style: disc; }
.d-body li { margin: 8px 0 0; line-height: 28px; }
.d-body ul li { line-height: 24px; }
.d-body li::marker { color: var(--d-ink); }
.d-body code { font-family: var(--d-mono); font-size: .875em; background: var(--d-soft); border: 1px solid var(--d-line); border-radius: 6px; padding: 1px 5px; color: var(--d-ink); word-break: break-word; }
.d-body a:not(.d-card) { color: var(--d-ink); text-decoration: underline; text-decoration-color: var(--d-line-strong); text-underline-offset: 3px; }
.d-body a:not(.d-card):hover { text-decoration-color: var(--d-accent); }

/* copy page */
.d-copy { position: relative; display: inline-flex; flex: none; margin-top: 10px; border: 1px solid var(--d-line); border-radius: 6px; background: var(--d-panel); }
.d-copy__main { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; font-size: 14px !important; font-weight: 500 !important; color: var(--d-ink) !important; }
.d-copy__more { display: inline-grid; place-items: center; padding: 0 8px; color: var(--d-muted) !important; }
.d-copy__main:hover, .d-copy__more:hover { background: var(--d-soft) !important; }
.d-copy__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 248px; padding: 4px; background: var(--d-panel); border: 1px solid var(--d-line); border-radius: 8px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5); }
.d-copy__menu button { display: block; width: 100%; text-align: left; padding: 8px 10px !important; border-radius: 6px; }
.d-copy__menu button:hover { background: var(--d-soft) !important; }
.d-copy__menu b { display: block; font-size: 14px; font-weight: 600; color: var(--d-ink); }
.d-copy__menu small { display: block; font-size: 12px; color: var(--d-muted); }

/* video placeholder */

/* cards */
.d-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.d-card { display: block; padding: 16px; border: 1px solid var(--d-line); border-radius: 4px; background: var(--d-panel); font-weight: 600; color: var(--d-ink) !important; transition: border-color .15s, background .15s; }
.d-card:hover { border-color: var(--d-line-strong); background: var(--d-soft); }

/* tables */

/* code */
.d-code { margin-top: 20px; border: 1px solid var(--d-line); border-radius: 8px; background: var(--d-code-bg); overflow: hidden; }
.d-code__bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--d-line); font-size: 12px; color: var(--d-muted); }
.d-code__copy { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px !important; border-radius: 4px; font-size: 12px !important; color: var(--d-muted) !important; }
.d-code__copy:hover { background: var(--d-soft) !important; color: var(--d-ink) !important; }
.d-code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.d-code pre code { background: none; border: 0; padding: 0; font: 13.5px/1.6 var(--d-mono); color: var(--d-ink); white-space: pre; word-break: normal; }
.d-tabs { margin-top: 20px; }
.d-tabs__list { display: flex; gap: 4px; border-bottom: 1px solid var(--d-line); overflow-x: auto; }
.d-tabs__list button { padding: 8px 12px !important; font-size: 14px !important; font-weight: 500 !important; color: var(--d-muted) !important; border-bottom: 2px solid transparent !important; margin-bottom: -1px; white-space: nowrap; }
.d-tabs__list button[aria-selected="true"] { color: var(--d-ink) !important; border-bottom-color: var(--d-accent) !important; }
.d-tabs__panel .d-code { margin-top: 12px; }

/* callouts */
.d-callout { display: flex; gap: 12px; margin-top: 24px; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--d-accent-line); background: var(--d-active-bg); color: var(--d-ink); font-size: 14px; }
.d-callout p { margin: 0 !important; line-height: 24px !important; }
.d-callout > span { flex: none; min-width: 20px; height: 20px; margin-top: 2px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font: 700 11px/1 var(--d-font); letter-spacing: .02em; background: var(--d-accent); color: var(--d-accent-ink); }
.d-callout--warn { border-color: var(--d-warn-line); background: var(--d-warn-soft); color: var(--d-ink); }
.d-callout--warn > span { background: var(--d-warn); color: var(--d-bg); }

/* license format check */
.d-ffl__out:not(:empty) { margin-top: 12px; font-size: 14px; }
.d-ffl__out dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0 0; }
.d-ffl__out dt { color: var(--d-muted); }
.d-ffl__out dd { margin: 0; color: var(--d-ink); font-weight: 500; }
.d-ffl__ok { color: var(--d-ok); font-weight: 600; }
.d-ffl__bad { color: var(--d-bad); font-weight: 600; }

/* pager */
.d-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--d-line); }
.d-pager a { display: inline-flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 500; color: var(--d-muted); padding: 8px 4px; transition: color .15s; }
.d-pager a:hover { color: var(--d-ink); text-decoration: underline; text-decoration-color: var(--d-accent); }

/* table of contents */
.d-toc { position: sticky; top: 64px; width: 256px; flex: none; max-height: calc(100vh - 64px); overflow-y: auto; padding: 32px 16px 16px 24px; font-size: 14px; }
.d-toc__title { margin: 0 0 16px; font-weight: 600; color: var(--d-ink); }
.d-toc ul { list-style: none; margin: 0; padding: 0; }
.d-toc li { margin: 8px 0 0; }
.d-toc li a { display: block; color: var(--d-muted); line-height: 20px; font-weight: 500; transition: color .15s; }
.d-toc li a:hover { color: var(--d-ink); }
.d-toc li a.is-active { color: var(--d-ink); text-decoration: underline; text-decoration-color: var(--d-accent); }
.d-toc__foot { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--d-line); display: flex; flex-direction: column; gap: 8px; }
.d-toc__foot a { font-size: 12px; font-weight: 500; color: var(--d-muted); display: inline-flex; align-items: center; gap: 4px; }
.d-toc__foot a:hover { color: var(--d-ink); }
.d-toc ul + .d-toc__foot { margin-top: 24px; }
.d-toc__foot a[data-top] { visibility: hidden; }
.d-toc.scrolled .d-toc__foot a[data-top] { visibility: visible; }

/* footer */
.d-foot { background: var(--d-foot); border-top: 1px solid var(--d-line); }
.d-foot__in { max-width: 1440px; margin: 0 auto; padding: 48px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--d-muted); }
.d-foot__in small { font-size: 12px; }

/* search dialog */
.d-search-dlg { position: fixed; inset: 0; z-index: 60; }
.d-search-dlg__bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.d-search-dlg__box { position: relative; width: min(560px, calc(100% - 32px)); margin: 80px auto 0; background: var(--d-panel); border: 1px solid var(--d-line); border-radius: 12px; box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .7); overflow: hidden; }
.d-search-dlg__field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--d-line); color: var(--d-muted); }
.d-search-dlg__field input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: none; color: var(--d-ink); font: 16px var(--d-font); }
.d-search-dlg__field input::-webkit-search-cancel-button { display: none; }
.d-search-dlg__res { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow-y: auto; }
.d-search-dlg__res a { display: block; padding: 8px 10px; border-radius: 6px; }
.d-search-dlg__res a b { display: block; font-size: 14px; font-weight: 600; color: var(--d-ink); }
.d-search-dlg__res a small { display: block; font-size: 12px; color: var(--d-muted); }
.d-search-dlg__res a.is-sel, .d-search-dlg__res a:hover { background: var(--d-active-bg); }
.d-search-dlg__res li.empty { padding: 16px 10px; font-size: 14px; color: var(--d-muted); }

.d-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; padding: 8px 14px; border-radius: 8px; background: var(--d-ink); color: var(--d-bg); font-size: 14px; font-weight: 500; }

/* responsive */
@media (max-width: 1279px) {
  .d-toc { display: none; }
}
@media (max-width: 767px) {
  .d-head__in { padding: 0 16px 0 24px; }
  .d-head .d-search { display: none; }
  .d-menu-btn { display: inline-grid !important; }
  .d-side { display: none; position: fixed; inset: 64px 0 0; z-index: 25; width: auto; height: auto; padding: 16px 16px 0; background: var(--d-bg); }
  body.menu-open { overflow: hidden; }
  body.menu-open .d-side { display: flex; }
  .d-search--side { display: inline-flex; width: 100%; margin-bottom: 16px; }
  .d-collapse { display: none; }
  .d-article { padding: 16px 16px 32px; }
  .d-body p, .d-body li { line-height: 28px; }
  .d-copy { margin-top: 6px; }
  .d-cards { grid-template-columns: 1fr; }
  .d-pager a { font-size: 16px; }
  .d-foot__in { flex-direction: column; text-align: center; }
}
@media (max-width: 380px) {
  .d-head__in { padding: 0 8px 0 16px; gap: 8px; }
  .d-head__right { gap: 4px; }
  .d-logo { font-size: 16px; gap: 6px; }
  .d-logo em { padding: 1px 6px; }
  .d-titlerow { flex-wrap: wrap; gap: 4px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .docs *, .docs *::before, .docs *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* The "Open the API tester" button inside a page. */
