/* Docs shares the global appearance preference and keeps its editorial palette. */
html[data-shareai-docs] {
  --doc-paper: light-dark(#fffcf8, #161616);
  --doc-surface: light-dark(#fffdfa, #1c1c1b);
  --doc-ink: light-dark(#242b35, #d6d5d0);
  --doc-title: light-dark(#202731, #f0eee8);
  --doc-body: light-dark(#655f59, #bdbab3);
  --doc-muted: light-dark(#77736d, #aaa59c);
  --doc-faint: light-dark(#9b9289, #8e887f);
  --doc-line: light-dark(#e9e1d8, #30302d);
  --doc-border: light-dark(#e4dbd1, #393733);
  --doc-hover-border: light-dark(#ccab91, #6f5544);
  --doc-control: light-dark(#f8f3ed, #242422);
  --doc-hover: light-dark(#f3ece5, #2c2b28);
  --doc-selected: light-dark(#f8e7d9, #3b2b21);
  --doc-accent: light-dark(#ce470d, #ffad74);
  --doc-accent-ink: light-dark(#b8420f, #ffbf93);
  --doc-callout: light-dark(#fff5e9, #261f19);
  --doc-callout-line: light-dark(#eed6c2, #4e3827);
  --doc-callout-accent: light-dark(#e97532, #e88d4f);
  --doc-card-end: light-dark(#fdf4ea, #211d19);
  --doc-scrollbar: light-dark(#d5cfc7, #53504a);
  --doc-shadow: light-dark(#40291426, #00000055);
  --doc-backdrop: light-dark(#2d24164d, #00000080);
  --doc-syntax-string: light-dark(#a0440a, #efb077);
  --doc-syntax-keyword: light-dark(#8052a5, #c4a3e8);
  --doc-syntax-number: light-dark(#08796e, #8dcbbb);
  --doc-syntax-comment: light-dark(#7c8079, #9b9f94);
}
.sai-doc-header {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 64px;
  padding: 0 22px;
  border-bottom: 0;
  background: color-mix(in srgb, var(--sai-background) 88%, transparent);
  backdrop-filter: blur(18px);
}
.sai-doc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--doc-title) !important;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.sai-doc-brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  aspect-ratio: 1;
  flex: 0 0 32px;
}
.sai-doc-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}
.sai-doc-header-navigation { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; flex: 1; }
.sai-doc-header .sai-doc-bases { flex: 0 1 auto; gap: 3px; padding: 6px 0; }
.sai-doc-header .sai-doc-bases > a { padding: 5px 10px; font-size: 13px; }
.sai-doc-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sai-doc-header-search { display: none; }
.sai-doc-header .sai-doc-dropdown summary { height: 36px; }
.sai-doc-dropdown { position: relative; font-size: 13px; }
.sai-doc-dropdown > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 8px;
  color: var(--doc-ink);
  cursor: pointer;
  border-radius: 7px;
  list-style: none;
  white-space: nowrap;
}
.sai-doc-dropdown summary::-webkit-details-marker { display: none; }
.sai-doc-dropdown[open] > summary, .sai-doc-dropdown > summary:hover { background: var(--doc-hover); }
.sai-doc-dropdown-panel {
  position: absolute;
  inset: calc(100% + 7px) 0 auto auto;
  z-index: 100;
  width: max-content;
  min-width: 158px;
  max-width: min(300px, calc(100vw - 32px));
  max-height: min(460px, 65dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--doc-border);
  border-radius: 10px;
  background: var(--doc-surface);
  box-shadow: 0 12px 34px var(--doc-shadow);
  scrollbar-width: thin;
}
.sai-doc-dropdown-panel :is(button, a) {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--doc-ink);
  font: inherit;
  text-decoration: none;
}
.sai-doc-dropdown-panel :is(button, a):hover { background: var(--doc-hover); }
.sai-doc-dropdown-panel :is(button, a) > span:not(.sai-doc-choice-check) { flex: 1; }
.sai-doc-choice-check { margin-left: auto; color: var(--doc-accent); visibility: hidden; }
[aria-pressed="true"] > .sai-doc-choice-check { visibility: visible; }
.sai-doc-language .sai-doc-dropdown-panel { display: flex; flex-direction: column; min-width: 246px; overflow: hidden; }
.sai-doc-language-options { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sai-doc-language [hidden] { display: none !important; }
.sai-doc-language-search {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  margin: 0 0 5px;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--doc-line);
  color: var(--doc-muted);
}
.sai-doc-language-search > svg { flex-shrink: 0; }
.sai-doc-language-search:focus-within { border-color: var(--doc-accent); color: var(--doc-accent); }
.sai-doc-language-search input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: var(--doc-ink);
  font: inherit;
  font-size: 16px;
}
.sai-doc-language-search input::placeholder { color: var(--doc-muted); opacity: 1; }
.sai-doc-language-empty { margin: 0; padding: 16px 10px; color: var(--doc-muted); font-size: 13px; }
.sai-doc-language [aria-current] > svg:last-child { color: var(--doc-accent); margin-left: auto; }
.sai-doc-language img.sai-doc-language-flag {
  display: block;
  flex: 0 0 20px;
  width: 20px;
  height: 15px;
  object-fit: contain;
  opacity: 1;
  filter: none;
}
.sai-doc-console {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid var(--doc-border);
  border-radius: 7px;
  background: var(--doc-control);
  color: var(--doc-title) !important;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}
.sai-doc-console:hover { background: var(--doc-hover); border-color: var(--doc-hover-border); }
.sai-doc-resources { flex-shrink: 0; }
.sai-doc-resources .sai-doc-dropdown-panel ul { position: static; min-width: 0; padding: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: none; }
.sai-doc-resources .sai-doc-dropdown-panel ul ul { padding-left: 12px; }
.sai-doc-mobile-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 18px; border-top: 1px solid var(--doc-line); }
[data-doc-drop-up] > .sai-doc-dropdown-panel { top: auto; bottom: calc(100% + 7px); }
.sai-doc-mobile-tools .sai-doc-appearance .sai-doc-dropdown-panel { left: 0; right: auto; }
.sai-doc-mobile-tools .sai-doc-language .sai-doc-dropdown-panel { left: 50%; right: auto; transform: translateX(-50%); }
.sai-doc-mobile-resources { padding: 0 18px 18px; }
.sai-doc-mobile-resources ul { list-style: none; padding: 0; margin: 0; }
.sai-doc-mobile-resources li a { display: block; padding: 8px 10px; font-size: 13px; }
.sai-doc-mobile-resources ul ul { padding-left: 14px; }
/* Code blocks inherit the documentation palette, including syntax tokens. */
.sai-doc-content hr { border: 0; border-top: 1px solid var(--doc-line); margin: 2em 0; }
.sai-docs .sai-code-tabs { border-color: var(--doc-border); background: var(--doc-surface); color: var(--doc-ink); }
.sai-docs .sai-code-toolbar { border-color: var(--doc-border); background: var(--doc-control); }
.sai-docs .sai-code-toolbar button { color: var(--doc-muted); }
.sai-docs .sai-code-toolbar :is([aria-selected="true"], button:hover) { background: var(--doc-surface); color: var(--doc-accent); }
.sai-docs .sai-syntax-string { color: var(--doc-syntax-string); }
.sai-docs .sai-syntax-keyword { color: var(--doc-syntax-keyword); }
.sai-docs .sai-syntax-number { color: var(--doc-syntax-number); }
.sai-docs .sai-syntax-comment { color: var(--doc-syntax-comment); }
@media (max-width: 1199px) {
  .sai-doc-header { gap: 16px; }
  .sai-doc-header-navigation { display: none; }
  .sai-doc-header .sai-doc-back { display: none; }
  .sai-doc-header-actions { margin-left: auto; }
  .sai-doc-header .sai-doc-mobile-toggle, .sai-doc-header-search { display: grid; }
  .sai-doc-header .sai-doc-icon-button { width: 36px; height: 36px; }
}
@media (max-width: 900px) {
  .sai-doc-header { min-height: 60px; padding: 0 16px; gap: 12px; }
  .sai-doc-brand { font-size: 17px; gap: 8px; }
  .sai-doc-brand-mark { width: 28px; height: 28px; flex-basis: 28px; }
  .sai-doc-header-actions { gap: 0; }
  .sai-doc-header-actions > :is(.sai-doc-dropdown, .sai-doc-console, .sai-doc-login, .sai-doc-api, .sai-appearance) { display: none; }
  .sai-doc-header .sai-doc-icon-button { width: 40px; height: 44px; }
  .sai-doc-dropdown-panel :is(button, a), .sai-doc-mobile-tools > .sai-doc-console, .sai-doc-mobile-tools summary { min-height: 44px; }
}
@media (max-width: 370px) {
  .sai-doc-header { padding: 0 12px; gap: 4px; }
  .sai-doc-brand { font-size: 15px; gap: 6px; }
  .sai-doc-brand-mark { width: 26px; height: 26px; flex-basis: 26px; }
  .sai-doc-header .sai-doc-icon-button { width: 36px; }
  .sai-doc-mobile-tools { padding-inline: 12px; gap: 2px; }
}


.sai-docs { background: transparent; }
.sai-doc-navigation .sai-doc-category-link { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 36px; width: 100%; border-radius: 6px; padding: 6px 10px; margin: 0; line-height: 1.5; }
.sai-doc-category-link > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sai-doc-category-link > svg { width: 14px; height: 14px; opacity: .65; flex-shrink: 0; }
.sai-doc-category-link:hover { background: var(--doc-hover); color: var(--doc-accent); }
.sai-doc-category-link > svg:last-child { width: 12px; margin-left: auto; }
.sai-doc-navigation .sai-doc-category-heading { padding: 0; }
.sai-doc-branch, .sai-doc-branch-content { min-width: 0; }
.sai-doc-branch-row { display: flex; align-items: stretch; gap: 2px; min-width: 0; }
.sai-doc-branch-row > :is(a, .sai-doc-menu-label) { flex: 1; min-width: 0; width: auto; border-radius: 6px; padding: 6px 10px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.sai-doc-branch-row > a { display: flex; align-items: center; }
.sai-doc-branch-toggle { display: grid; place-items: center; flex: 0 0 32px; width: 32px; min-height: 36px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--doc-muted); }
.sai-doc-branch-toggle:hover { background: var(--doc-hover); color: var(--doc-accent); }
.sai-doc-branch-toggle > svg { width: 16px; height: 16px; transform: rotate(-90deg); }
.sai-doc-branch-toggle[aria-expanded="true"] > svg { transform: none; }
@media (max-width: 800px) {
  .sai-doc-navigation .sai-doc-category-link, .sai-doc-branch-row > :is(a, .sai-doc-menu-label) { min-height: 44px; padding-block: 10px; }
  .sai-doc-branch-toggle { flex-basis: 44px; width: 44px; min-height: 44px; }
}
.sai-doc-content :is(blockquote, .wp-block-quote) { border: 0; border-left: 2px solid var(--doc-callout-accent); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--doc-callout) 68%, transparent); }
.sai-doc-api, .sai-doc-back, .sai-doc-login { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; min-height: 36px; padding: 6px 9px; font-size: 13px; border-radius: 7px; }
.sai-doc-login { background: var(--doc-ink); color: var(--doc-surface) !important; }
.sai-doc-api:hover, .sai-doc-back:hover { background: var(--doc-hover); }
.sai-doc-mobile-account { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 18px 18px; }
.sai-doc-mobile-account .sai-doc-back { flex-basis: 100%; }
.sai-doc-mobile-account a { min-height: 44px; }
.sai-doc-layout--index .sai-doc-main { padding-top: 32px; }
.sai-doc-base-card { background: color-mix(in srgb, var(--doc-surface) 55%, transparent); }
@media(max-width: 800px) { .sai-doc-layout--index .sai-doc-main { padding-top: 24px; } }

/* Keep the compact search control and content entrance aligned with the docs grid. */
.sai-doc-search-trigger { height: 36px; min-height: 36px; padding: 6px 9px; line-height: 20px; }
.sai-doc-search-trigger > span { flex: 1; min-width: 0; }
.sai-doc-search-trigger kbd { margin-left: 0; font: 10px/1.2 ui-monospace, monospace; padding: 3px 4px; }
.sai-doc-sidebar-search {
  position: sticky;
  top: 0;
  z-index: 2;
  width: 100%;
  padding: 12px 17px;
  background: var(--doc-paper);
}
.sai-doc-sidebar-search > .sai-doc-search-trigger { margin: 0; }
.sai-doc-sidebar > .sai-doc-navigation { padding: 18px 17px 0; }
.sai-doc-navigation > .sai-doc-menu > .sai-doc-group:first-child { margin-top: 0 !important; }
.sai-doc-group h2 .sai-doc-category-link { display: flex; }
.sai-docs [data-page-actions] { margin: 12px 0 24px; }
.sai-docs[data-base=""] .sai-doc-header-search { display: grid; }
.sai-doc-search-form { padding: 6px 12px; gap: 10px; }
.sai-doc-search-form:focus-within { box-shadow: inset 0 -2px var(--doc-accent); }
.sai-doc-search-form input { padding: 8px 0; font-size: 16px; line-height: 24px; appearance: none; box-shadow: none; border-radius: 0; }
.sai-doc-search-form input:focus-visible { outline: none; }
.sai-doc-search-result { position: relative; padding-right: 36px; }
.sai-doc-search-result.is-selected::after { content: "↵"; position: absolute; top: 17px; right: 14px; color: var(--doc-muted); }
.sai-doc-search-retry { margin: 0 20px 16px; align-self: flex-start; min-height: 40px; padding: 7px 14px; border: 1px solid var(--doc-border); border-radius: 7px; background: var(--doc-control); color: var(--doc-ink); }
@media (max-width: 800px) { .sai-doc-menu-dialog > .sai-doc-search-trigger { height: 44px; } }
