/* Shared partner documentation layout, using the existing theme tokens. */
:root { --docs-sidebar-width: 268px; }
/* The existing gallery drawer owns its title, close action, and full-page link. */
.docs-embedded .docs-header, .docs-embedded #docs-sidebar, .docs-embedded #docs-toc,
.docs-embedded .docs-mobile-nav, .docs-embedded .operation-context { display: none !important; }
.docs-embedded .docs-main { margin: 0; padding: 24px; max-width: none; }
.docs-embedded .docs-main.is-operation { margin: 0; padding: 0; }
.docs-embedded .operation-frame { height: 100vh; }
* { box-sizing: border-box; }
body.docs-page, body.docs-renderer { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.65 var(--sans); }
.docs-page button, .docs-header button, #docs-search button { font: inherit; cursor: pointer; }
.docs-page a { color: inherit; }
.docs-page a:focus-visible, .docs-page button:focus-visible, .docs-header a:focus-visible,
.docs-header button:focus-visible, #docs-search :focus-visible,
.docs-gallery .sidebar a:focus-visible, .docs-gallery .sidebar button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.docs-header { height: 66px; display: flex; align-items: center; gap: 28px; padding: 0 28px;
  position: fixed; inset: 0 0 auto; z-index: 60; background: var(--bg); border-bottom: 1px solid var(--line-soft);
  color: var(--fg); font: 13px/1.4 var(--sans); }
.docs-brand { display: flex; gap: 10px; align-items: center; font-weight: 650; font-size: 16px; white-space: nowrap;
  text-decoration: none; color: var(--fg); }
.docs-brand span { color: var(--fg-2); font-weight: 400; font-size: 13px; }
.docs-brand .tn-mark { width: 22px; height: 22px; }
.docs-header nav { display: flex; height: 100%; gap: 22px; align-items: stretch; white-space: nowrap; }
.docs-header nav a { display: flex; align-items: center; color: var(--fg-2); text-decoration: none; position: relative; }
.docs-header nav a[aria-current] { color: var(--fg); font-weight: 600; }
.docs-header nav a[aria-current]::after { content: ''; position: absolute; bottom: -1px; height: 2px; background: var(--fg); inset-inline: 0; }
.docs-search-trigger { display: flex; align-items: center; gap: 10px; color: var(--fg-2); border: 0;
  border-radius: 8px; background: var(--card-2); padding: 9px 12px; width: min(340px, 30vw); margin-left: auto; text-align: left; }
.docs-search-trigger span { flex: 1; }
.docs-search-trigger kbd { color: var(--fg-2); font: 11px var(--sans); white-space: nowrap; }
.docs-header .theme-toggle { flex-shrink: 0; }
.docs-skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--inverse-bg); color: var(--inverse-fg); padding: 10px 16px; }
.docs-skip:focus { top: 10px; }
/* Navigation focuses this non-interactive reading pane for assistive technology.
   Do not draw a viewport-sized ring; interactive descendants keep their rings. */
#main-content:focus { outline: none; }
/* One rail style for both destinations; only positioning and navigation behavior differ. */
#docs-sidebar, .docs-gallery .sidebar { width: var(--docs-sidebar-width); overflow-y: auto; padding: 28px 18px 48px 24px;
  border-right: 1px solid var(--line-soft); background: var(--bg); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#docs-sidebar { position: fixed; top: 66px; bottom: 0; left: 0; }
.docs-nav-group, .docs-gallery .sidebar-group { margin-bottom: 28px; }
.docs-nav-group h2, .docs-gallery .sidebar-group-label {
  font: 600 12px/1.4 var(--sans); color: var(--fg); margin: 0 0 9px; padding: 0 10px;
  text-transform: none; letter-spacing: normal; }
.docs-nav-link, .docs-family summary, .docs-gallery .sidebar-link, .docs-gallery .sidebar-sublink {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  font: 13px/1.45 var(--sans); color: var(--fg-2) !important; text-decoration: none; border-radius: 7px;
  cursor: pointer; min-height: 34px; }
.docs-nav-link:hover, .docs-family summary:hover,
.docs-gallery .sidebar-link:hover, .docs-gallery .sidebar-sublink:hover {
  color: var(--fg) !important; background: var(--card-2); }
.docs-nav-link[aria-current=page], .docs-gallery .sidebar-link.active, .docs-gallery .sidebar-sublink.active {
  color: var(--fg) !important; background: var(--surface); font-weight: 550; }
.docs-nav-link svg, .docs-family summary svg, .docs-gallery .sidebar-icon {
  flex-shrink: 0; width: 16px; height: 16px; color: inherit; }
.docs-family summary { list-style: none; }
.docs-family summary::-webkit-details-marker { display: none; }
.docs-family summary span:first-of-type { flex: 1; }
.docs-family .chevron { font-size: 18px; color: var(--fg-2); }
.docs-family[open] .chevron { transform: rotate(90deg); }
.docs-family > div, .docs-gallery .sidebar-subnav { margin: 2px 0 8px 17px; }
.docs-family .family-overview, .docs-gallery .sidebar-sublink { padding-left: 12px; font-size: 12px; }
.operation-link { padding: 7px 8px; gap: 7px; font-size: 12px; align-items: flex-start; }
.method { background: var(--surface); color: var(--fg-2); border-radius: 4px; padding: 2px 4px; font: 9px/1.5 var(--mono); flex-shrink: 0; margin-top: 1px; }
.docs-main { margin-left: var(--docs-sidebar-width); margin-right: 204px; padding: 108px 48px 80px; min-width: 0; max-width: 1060px; }
.doc-breadcrumb { font-size: 12px; color: var(--fg-2); margin: 0 0 22px; }
.doc-breadcrumb span { margin: 0 9px; color: var(--fg-3); }
.doc-article { max-width: 730px; margin: 0 auto; }
.doc-article h1 { font: 400 42px/1.12 var(--serif); letter-spacing: -.025em; margin: 0 0 18px; text-wrap: balance; }
.doc-lead { font-size: 17px; line-height: 1.65; color: var(--fg-2); margin: 0 0 42px; max-width: 640px;
  text-wrap: balance; text-wrap: pretty; }
.doc-article section { margin: 38px 0; scroll-margin-top: 98px; }
.doc-article h2 { font: 600 20px/1.3 var(--sans); letter-spacing: -.018em; margin: 0 0 16px; }
.doc-article p { margin: 12px 0; color: var(--fg-2); }
.doc-article li { margin: 9px 0; color: var(--fg-2); }
.doc-article a:not(.doc-action) { text-decoration-color: var(--line); text-underline-offset: 4px; }
.doc-article a:hover { text-decoration-color: var(--fg); }
.doc-article code { font: .88em var(--mono); background: var(--card-2); padding: 3px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.doc-action { display: inline-flex; padding: 10px 16px; background: var(--surface); border-radius: 7px; text-decoration: none; margin-top: 10px; }
.doc-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.doc-path { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 16px 12px;
  padding: 22px; min-width: 0; border: 0; border-radius: var(--radius); background: var(--card); text-decoration: none; }
.doc-path-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 8px; background: var(--surface); color: var(--fg); }
.doc-path-copy { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
.doc-path strong { display: block; color: var(--fg); font-size: 15px; font-weight: 600; line-height: 1.4; text-wrap: balance; }
.doc-path-description { display: block; margin-top: 7px; color: var(--fg-2); font-size: 13px; line-height: 1.6; text-wrap: pretty; }
.doc-path-arrow { grid-column: 2; grid-row: 1; align-self: center; color: var(--fg-2); transition: transform .16s ease; }
.doc-path-primary { grid-column: 1 / -1; grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center; gap: 18px; padding: 24px; background: var(--surface); }
.doc-path-primary .doc-path-icon { background: var(--inverse-bg); color: var(--inverse-fg); }
.doc-path-primary .doc-path-copy { grid-column: 2; grid-row: 1; }
.doc-path-primary .doc-path-arrow { grid-column: 3; }
.doc-path-primary strong { font-size: 16px; }
.doc-path:hover { background: var(--surface-hover); }
.doc-path:hover .doc-path-arrow { color: var(--fg); transform: translate(2px, -2px); }
.family-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.family-index .doc-path { grid-template-columns: 32px minmax(0, 1fr) 16px; align-items: center;
  gap: 12px; min-height: 68px; padding: 14px; border-radius: 10px;
  transition: background .16s ease; }
.family-index .doc-path-icon { width: 32px; height: 32px; background: var(--surface-soft); color: var(--fg-2); }
.family-index .doc-path-glyph { width: 18px; height: 18px; }
.family-index .doc-path-copy { grid-column: 2; grid-row: 1; }
.family-index .doc-path strong { font-size: 12px; font-weight: 500; line-height: 1.5; text-wrap: pretty; }
.family-index .doc-path-arrow { grid-column: 3; width: 16px; height: 16px; color: var(--fg-3); }
.family-index .doc-path:hover .doc-path-icon, .family-index .doc-path:focus-visible .doc-path-icon { color: var(--fg); }
.doc-code { border-radius: 9px; background: var(--card-2); margin: 18px 0; overflow: hidden; }
.doc-code > div { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-size: 11px; color: var(--fg-2); }
.doc-code button { background: var(--surface); border: 0; border-radius: 5px; color: var(--fg); padding: 4px 9px; }
.doc-code pre { margin: 0; padding: 10px 18px 22px; overflow: auto; font: 12px/1.7 var(--mono); color: var(--code-fg); }
.doc-code pre code { padding: 0; font: inherit; overflow-wrap: normal; background: none; }
#docs-toc { position: fixed; top: 114px; right: 22px; width: 170px; font-size: 12px; }
#docs-toc p { font-weight: 600; margin: 0 0 14px; }
#docs-toc a { display: block; color: var(--fg-2); margin: 10px 0; text-decoration: none; line-height: 1.5; }
#docs-toc a:hover, #docs-toc a[aria-current] { color: var(--fg); }
.docs-main.is-operation { margin-right: 0; max-width: none; padding: 90px 30px 0; }
.operation-context { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 18px; }
.operation-context .doc-breadcrumb { margin: 0; }
.operation-context a { color: var(--fg-2); font-size: 12px; }
.operation-frame { width: 100%; height: calc(100vh - 138px); border: 0; display: block; background: var(--bg); }
.operation-list { display: grid; gap: 8px; }
.operation-list a { display: block; padding: 15px 18px; background: var(--card); border-radius: 8px; text-decoration: none; }
.operation-list strong { font-size: 14px; font-weight: 550; }
.operation-list p { margin: 7px 0 0; font-size: 13px; }
.operation-list code { background: none; color: var(--fg-2); font-size: 11px; padding: 0; }
.docs-mobile-nav, .docs-nav-backdrop { display: none; }
/* Shared search on both destinations. Native dialog supplies modal focus containment. */
#docs-search { color: var(--fg); background: var(--card); width: min(660px, calc(100vw - 32px)); max-height: 76vh;
  padding: 0; border: 0; border-radius: 13px; margin: 14vh auto 0; box-shadow: 0 22px 90px var(--shadow); font: 14px/1.5 var(--sans); }
#docs-search::backdrop { background: var(--backdrop-soft); }
.search-top { display: flex; align-items: center; padding: 15px 18px; gap: 12px; }
.search-top input { font: 16px var(--sans); background: transparent; color: var(--fg); min-width: 0; width: 100%; border: 0; padding: 6px 2px; }
.search-top button { background: var(--surface); color: var(--fg-2); font: 11px var(--sans); border: 0; border-radius: 4px; padding: 5px 7px; }
#search-status { color: var(--fg-2); font-size: 11px; margin: 0; padding: 2px 22px 10px; }
#search-results { max-height: 48vh; overflow: auto; padding: 0 10px 12px; }
.search-result { display: block; padding: 12px; border-radius: 7px; color: var(--fg); cursor: pointer; }
.search-result[aria-selected=true] { background: var(--surface); }
.search-result strong { display: block; font-size: 14px; font-weight: 550; }
.search-result small { display: block; color: var(--fg-2); font-size: 11px; margin-top: 4px; }
.search-result p { color: var(--fg-2); font-size: 12px; margin: 5px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-footer { display: flex; gap: 18px; padding: 12px 22px; border-top: 1px solid var(--line-soft); font-size: 10px; color: var(--fg-2); }
/* The gallery's data renderer, tabs, tooltips, and endpoint pairs remain intact. */
.docs-gallery .layout { padding-top: 66px; }
.docs-gallery .sidebar { flex: 0 0 var(--docs-sidebar-width); top: 66px; height: calc(100vh - 66px); }
.docs-gallery .sidebar-nav { gap: 0; }
.docs-gallery .sidebar-link, .docs-gallery .sidebar-sublink { border: 0; margin-left: 0; }
/* The shared display:flex must not reveal the inactive asset branch. */
.docs-gallery .sidebar-link[hidden] { display: none; }
.docs-gallery .sidebar-link:hover .sidebar-icon, .docs-gallery .sidebar-link.active .sidebar-icon { color: inherit; }
.docs-gallery [id^=row-], .docs-gallery #board { scroll-margin-top: 92px; }
.docs-gallery .cathead-sub, .docs-gallery .lede { text-wrap: balance; text-wrap: pretty; }
.docs-gallery .docs-header { z-index: 60; }
/* Scalar receives these tokens through its supported customCss option. */
.docs-renderer { --scalar-font: var(--sans); --scalar-font-code: var(--mono); }
.renderer-status { padding: 32px; color: var(--fg-2); }
@media (min-width: 1600px) { .docs-main { margin-left: max(var(--docs-sidebar-width), calc((100vw - 1160px) / 2)); } }
@media (max-width: 1180px) { #docs-toc { display: none; } .docs-main { margin-right: 0; } .docs-header { gap: 22px; } }
@media (max-width: 850px) {
  .docs-header { height: 62px; padding: 0 16px; gap: 18px; }
  .docs-brand { font-size: 14px; gap: 7px; } .docs-brand span { display: none; }
  .docs-header nav { gap: 16px; font-size: 12px; }
  .docs-search-trigger { margin-left: auto; width: 32px; padding: 8px; }
  .docs-search-trigger span, .docs-search-trigger kbd { display: none; }
  .docs-header .theme-toggle { width: 30px; height: 30px; }
  .docs-mobile-nav { display: block; position: sticky; top: 62px; z-index: 40; width: 100%; text-align: left; margin-top: 62px;
    border: 0; padding: 12px 22px; background: var(--bg); color: var(--fg-2); border-bottom: 1px solid var(--line-soft); }
  .docs-mobile-nav svg { vertical-align: middle; margin-right: 8px; }
  #docs-sidebar { display: none; top: 107px; width: min(310px, 86vw); z-index: 55; }
  body.nav-open #docs-sidebar { display: block; }
  .docs-nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 107px 0 0; background: var(--backdrop-soft); z-index: 50; border: 0; }
  .docs-main { margin: 0; padding: 34px 22px 60px; }
  .doc-article h1 { font-size: 34px; } .doc-lead { font-size: 15px; margin-bottom: 32px; }
  .docs-main.is-operation { padding: 24px 10px 0; margin: 0; }
  .operation-context { padding: 0 12px 16px; } .operation-frame { height: calc(100vh - 195px); }
  .docs-gallery .layout { padding-top: 62px; }
}
@media (max-width: 600px) {
  .doc-paths { grid-template-columns: 1fr; }
  .doc-path { grid-template-columns: 36px minmax(0, 1fr) 18px; align-items: center; gap: 12px; padding: 18px; }
  .doc-path-copy { grid-column: 2; grid-row: 1; }
  .doc-path-arrow { grid-column: 3; }
}
/* Three full-sized destinations get their own row on small screens. */
@media (max-width: 700px) {
  .docs-header { height: 104px; display: grid; grid-template-columns: 1fr 36px 36px; grid-template-rows: 58px 46px; gap: 0 10px; }
  .docs-header nav { grid-row: 2; grid-column: 1 / -1; gap: 26px; font-size: 13px; }
  .docs-search-trigger { grid-row: 1; grid-column: 2; margin: 0; }
  .docs-header .theme-toggle { grid-row: 1; grid-column: 3; }
  .docs-mobile-nav { top: 104px; margin-top: 104px; }
  #docs-sidebar { top: 149px; }
  .docs-nav-backdrop:not([hidden]) { inset: 149px 0 0; }
  .docs-gallery .layout { padding-top: 104px; }
  .docs-gallery [id^=row-], .docs-gallery #board, .docs-gallery #trade, .docs-gallery #deepdive { scroll-margin-top: 124px; }
  .doc-article section { scroll-margin-top: 166px; }
  .operation-frame { height: calc(100vh - 237px); }
}
@media (max-width: 600px) { .family-index { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
