/* CustosHUB API docs: shared portal tokens, isolated document layout. */
body.docs-page { height: auto; min-height: 100vh; overflow: visible; background: var(--bg); }
.docs-page { --docs-header: 72px; --docs-sidebar: 250px; }
.docs-page a { color: var(--accent); text-decoration: none; }
.docs-page a:hover { color: var(--accent-hover); }
.docs-page button, .docs-page input, .docs-page select { font: inherit; }
.docs-page button { cursor: pointer; }
.docs-page button:disabled { cursor: wait; opacity: .6; }
.docs-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.docs-page [hidden] { display: none !important; }
.docs-page code, .docs-page pre, .docs-page kbd { font-family: var(--font-mono); }
.docs-page p code, .docs-page td code { font-size: .85em; color: var(--text-strong); padding: 2px 5px; background: var(--bg-hover); border-radius: 4px; overflow-wrap: anywhere; }
.docs-page p { color: var(--text-muted); line-height: 1.8; }
.docs-page h1, .docs-page h2, .docs-page h3 { color: var(--text-strong); }
.docs-page h2 { font-size: 26px; line-height: 1.3; letter-spacing: -.8px; margin: 8px 0 14px; }
.docs-page h3 { font-size: 15px; margin: 0 0 6px; line-height: 1.5; }
.docs-page section { scroll-margin-top: calc(var(--docs-header) + 28px); }
#docs-request-code { scroll-margin-top: calc(var(--docs-header) + 28px); }
.docs-skip { position: fixed; top: -70px; left: 20px; z-index: 100; padding: 12px 20px; background: var(--bg-panel); border: 1px solid var(--accent); border-radius: 8px; }
.docs-skip:focus { top: 10px; }
.docs-header { position: sticky; top: 0; z-index: 40; height: var(--docs-header); display: flex; align-items: center; gap: 22px; padding: 0 30px; background: var(--bg-elevated); border-bottom: 1px solid var(--border-strong); }
.docs-brand { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.docs-brand span { display: grid; }
.docs-brand small { color: var(--text-dim); font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.docs-brand strong { color: var(--text-strong); font-size: 19px; line-height: 1.2; letter-spacing: -.6px; }
.docs-header-divider { height: 25px; width: 1px; background: var(--border-strong); }
.docs-header-title { color: var(--text-muted); font-size: 13px; }
.docs-version { font: 10px var(--font-mono); border: 1px solid var(--border-strong); border-radius: 5px; padding: 4px 7px; color: var(--text-dim); }
.docs-header-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.docs-portal-link { color: var(--text) !important; font-size: 12px; font-weight: 500; }
.docs-portal-link span { margin-left: 12px; }
.docs-icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border-strong); border-radius: 9px; background: transparent; color: var(--text-muted); }
.docs-icon-button:hover { background: var(--bg-hover); color: var(--text-strong); }
.docs-icon-button svg { width: 17px; height: 17px; }
.docs-menu-button { display: none; }
.docs-sidebar { position: fixed; top: var(--docs-header); bottom: 0; width: var(--docs-sidebar); padding: 28px 20px; overflow-y: auto; background: var(--bg-elevated); border-right: 1px solid var(--border); z-index: 30; }
.docs-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-input); padding: 9px 10px; margin-bottom: 32px; }
.docs-search:focus-within { border-color: var(--accent); }
.docs-search svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-dim); }
.docs-search input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.docs-search input::placeholder { color: var(--text-dim); }
.docs-search kbd { font-size: 10px; color: var(--text-dim); padding: 0 4px; border: 1px solid var(--border-strong); border-radius: 3px; }
.docs-nav-label { font-size: 9px; letter-spacing: 1.4px; font-weight: 700; margin: 28px 10px 10px; color: var(--text-dim) !important; }
.docs-nav-heading { display: flex; align-items: center; justify-content: space-between; }
.docs-nav-heading > span { color: var(--text-dim); font: 10px var(--font-mono); margin-top: 18px; margin-right: 10px; }
.docs-guide-link { display: flex; justify-content: space-between; padding: 9px 10px; margin: 2px 0; border-radius: 7px; color: var(--text-muted) !important; font-size: 12px; }
.docs-guide-link:hover, .docs-guide-link.is-active { color: var(--text-strong) !important; background: var(--bg-hover); }
.docs-guide-link.is-active { box-shadow: inset 2px 0 var(--accent); }
.docs-endpoint-link { width: 100%; display: flex; align-items: center; gap: 9px; text-align: left; padding: 9px 10px; margin: 2px 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text-muted); font-size: 11px !important; }
.docs-endpoint-link:hover { background: var(--bg-hover); color: var(--text-strong); }
.docs-endpoint-link.is-selected { color: var(--text-strong); background: var(--focus-ring); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.docs-nav-note { font-size: 12px; padding: 0 10px; }
.docs-method { font: 9px var(--font-mono); font-weight: 500; color: #67b59e; background: rgba(50, 164, 126, .10); border-radius: 4px; padding: 3px 5px; min-width: 34px; text-align: center; display: inline-block; flex-shrink: 0; }
.docs-method.post { color: #8aaafb; background: rgba(80, 128, 234, .14); }
[data-theme="light"] .docs-method { color: #087258; background: #e2f3ed; }
[data-theme="light"] .docs-method.post { color: #2456b8; background: #e4ecff; }
.docs-sidebar-card { border: 1px solid var(--border-strong); border-radius: 12px; padding: 16px; margin-top: 34px; background: var(--bg-panel); }
.docs-small-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--accent); font-family: var(--font-mono); }
.docs-sidebar-card strong { display: block; font-size: 12px; color: var(--text-strong); margin-top: 12px; }
.docs-sidebar-card p { font-size: 11px; margin: 7px 0 12px; }
.docs-sidebar-card a { font-size: 11px; font-weight: 600; }
.docs-sidebar-card a span { margin-left: 12px; }
.docs-main { margin-left: var(--docs-sidebar); max-width: 1580px; padding: 0 52px; }
.docs-hero { padding: 60px 0 0; border-bottom: 1px solid var(--border-strong); position: relative; background: radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, .045), transparent 65%); }
.docs-eyebrow { display: flex; align-items: center; gap: 8px; font: 10px var(--font-mono); letter-spacing: 1.6px; color: var(--text-muted); }
.docs-eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: #64b99b; box-shadow: 0 0 0 4px rgba(100, 185, 155, .08); }
.docs-hero h1 { font-size: clamp(34px, 3.25vw, 54px); font-weight: 600; letter-spacing: -2px; line-height: 1.14; margin: 20px 0; }
.docs-hero h1 span { color: var(--text-muted); }
.docs-lead { max-width: 610px; font-size: 15px; line-height: 1.9 !important; }
.docs-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin: 27px 0 38px; }
.docs-primary { display: inline-flex; align-items: center; gap: 22px; padding: 12px 16px; color: white !important; font-size: 12px; font-weight: 600; background: #557dea; border: 1px solid #7393ee; border-radius: 8px; box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.docs-primary:hover { background: #466bdd; }
.docs-text-link { font-size: 12px; color: var(--text) !important; }
.docs-text-link span { margin-left: 10px; }
.docs-source-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; padding: 19px 0; border-top: 1px solid var(--border); }
.docs-source-strip > span { font: 9px var(--font-mono); letter-spacing: 1.2px; color: var(--text-dim); margin-right: 8px; }
.docs-source-strip b { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.docs-reading-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, .83fr); gap: 44px; align-items: start; }

@media (min-width: 1021px) {
  .docs-guide-content,
  .docs-example-column {
    position: sticky;
    top: calc(var(--docs-header) + 12px);
    max-height: calc(100vh - var(--docs-header) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}
.docs-guide-content { min-width: 0; }
.docs-section { padding: 45px 0; border-bottom: 1px solid var(--border); }
.docs-section-kicker { font: 9px var(--font-mono); color: var(--text-dim); letter-spacing: 1.1px; }
.docs-section > p { font-size: 13px; margin: 0 0 20px; }
.docs-steps { list-style: none; padding: 0; margin: 26px 0; }
.docs-steps li { display: flex; gap: 16px; position: relative; padding: 0 0 26px; }
.docs-steps li:last-child { padding-bottom: 0; }
.docs-steps li:not(:last-child)::before { content: ""; position: absolute; top: 32px; bottom: 5px; left: 14px; border-left: 1px solid var(--border-strong); }
.docs-step-number { display: grid; place-items: center; flex: 0 0 29px; height: 29px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--text-muted); background: var(--bg-panel); font: 11px var(--font-mono); }
.docs-steps h3 { font-size: 13px; margin-top: 4px; }
.docs-steps p { margin: 5px 0 0; font-size: 12px; }
.docs-callout { display: flex; gap: 12px; padding: 16px; border: 1px solid color-mix(in srgb, var(--accent) 23%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--accent) 5%, var(--bg)); margin: 24px 0 0; }
.docs-callout > span { font: 12px var(--font-mono); flex-shrink: 0; border: 1px solid var(--accent); color: var(--accent); border-radius: 50%; text-align: center; width: 17px; height: 17px; margin-top: 3px; }
.docs-callout p { font-size: 12px; margin: 0; }
.docs-callout strong { color: var(--text); font-weight: 600; }
.docs-warning { border-color: var(--warn); margin-bottom: 20px; }
.docs-warning .docs-secondary { margin-top: 12px; }
.docs-header-example { padding: 16px; display: grid; gap: 10px; background: var(--bg-panel); border: 1px solid var(--border-strong); border-radius: 8px; margin: 20px 0; }
.docs-header-example > span { font: 9px var(--font-mono); letter-spacing: 1px; color: var(--text-dim); }
.docs-header-example code { font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
.docs-field-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 7px; }
.docs-select { width: 100%; min-width: 0; padding: 12px; color: var(--text); background: var(--bg-panel); border: 1px solid var(--border-strong); border-radius: 8px; font-size: 12px !important; }
.docs-endpoint { margin-top: 24px; }
.docs-endpoint-title { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; }
.docs-endpoint-title code { font-size: 12px; overflow-wrap: anywhere; line-height: 2; }
.docs-endpoint h3 { font-size: 18px; letter-spacing: -.3px; }
.docs-endpoint > p { font-size: 12px; white-space: pre-line; }
.docs-auth-note { display: inline-block; color: var(--text-muted); padding: 5px 8px; background: var(--bg-panel); border: 1px solid var(--border-strong); border-radius: 5px; font-size: 10px; margin-bottom: 14px; }
.docs-endpoint h4 { font-size: 12px; font-weight: 600; color: var(--text); margin: 26px 0 10px; }
.docs-schema-fields { border-top: 1px solid var(--border-strong); }
.docs-schema-field { padding: 13px 0; border-bottom: 1px solid var(--border); }
.docs-property-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.docs-property-heading code { color: var(--text-strong); font-size: 11px; overflow-wrap: anywhere; }
.docs-property-type { color: var(--text-dim); font: 10px var(--font-mono); overflow-wrap: anywhere; }
.docs-required { font-size: 9px; color: var(--warn); }
.docs-property-description { font-size: 11px; margin: 5px 0 0; }
.docs-property-meta { font: 10px var(--font-mono); color: var(--text-muted); line-height: 1.8; margin-top: 5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.docs-schema-field .docs-details { margin-top: 9px; }
.docs-schema-field .docs-schema-fields { margin: 8px 0 0 8px; padding-left: 12px; border-left: 1px solid var(--border-strong); border-top: none; }
.docs-details { border: 1px solid var(--border-strong); border-radius: 8px; padding: 12px; margin: 12px 0; }
.docs-details summary { cursor: pointer; font-size: 11px; color: var(--text); line-height: 1.8; overflow-wrap: anywhere; }
.docs-details > p { font-size: 12px; margin-bottom: 0; }
.docs-media-type { color: var(--text-dim); font: 10px var(--font-mono); margin-bottom: 8px; }
.docs-outcomes > div { display: grid; grid-template-columns: 138px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); align-items: start; }
.docs-outcomes p { margin: 0; font-size: 12px; }
.docs-outcome { font: 10px var(--font-mono); padding: 5px 7px; border-radius: 4px; width: fit-content; background: var(--bg-panel); color: var(--text-muted); border: 1px solid var(--border-strong); }
.docs-outcome.exact { color: #f18c80; border-color: rgba(241, 140, 128, .2); }
.docs-outcome.potential { color: #e9ac67; border-color: rgba(233, 172, 103, .2); }
.docs-outcome.possible { color: #d7c16f; border-color: rgba(215, 193, 111, .2); }
.docs-outcome.clear { color: #74bc9e; border-color: rgba(116, 188, 158, .2); }
[data-theme="light"] .docs-outcome.exact { color: #b43223; }
[data-theme="light"] .docs-outcome.potential { color: #9b560a; }
[data-theme="light"] .docs-outcome.possible { color: #79630b; }
[data-theme="light"] .docs-outcome.clear { color: #0f7450; }
.docs-tip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.docs-tip-grid article { padding: 16px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--bg-panel); min-width: 0; }
.docs-tip-grid h3 { font-size: 12px; }
.docs-tip-grid p { font-size: 11px; margin: 7px 0 0; }
.docs-table-scroll { overflow-x: auto; }
.docs-table { border-collapse: collapse; width: 100%; margin: 18px 0 26px; font-size: 11px; text-align: left; }
.docs-table th { padding: 10px 8px; color: var(--text-dim); font-size: 10px; border-bottom: 1px solid var(--border-strong); }
.docs-table td { padding: 12px 8px; color: var(--text-muted); border-bottom: 1px solid var(--border); vertical-align: top; }
.docs-table td:first-child { white-space: nowrap; }
.docs-example-column { min-width: 0; align-self: stretch; padding-top: 46px; }
.docs-example-sticky { position: sticky; top: calc(var(--docs-header) + 24px); }
.docs-base { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 13px 14px; background: var(--bg-panel); border: 1px solid var(--border-strong); border-radius: 9px; margin-bottom: 16px; }
.docs-base > span { font: 8px var(--font-mono); color: var(--text-dim); letter-spacing: .8px; }
.docs-base code { font-size: 10px; color: var(--text); overflow-wrap: anywhere; }
.docs-base .docs-copy { margin-left: auto; }
.docs-code-card { border: 1px solid var(--border-strong); border-radius: 11px; background: var(--bg-input); overflow: hidden; margin-bottom: 18px; }
.docs-code-heading { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.docs-code-heading > span { font: 9px var(--font-mono); letter-spacing: .8px; color: var(--text-muted); }
.docs-copy, .docs-secondary { border: 1px solid var(--border-strong); color: var(--text-muted); background: var(--bg-panel); border-radius: 5px; font-size: 10px !important; padding: 4px 8px; }
.docs-copy:hover, .docs-secondary:hover { color: var(--text-strong); background: var(--bg-hover); }
.docs-code-tabs { display: flex; gap: 17px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.docs-code-tabs button { background: transparent; border: 0; color: var(--text-dim); padding: 11px 0; font-size: 11px; border-bottom: 2px solid transparent; }
.docs-code-tabs button[aria-pressed="true"] { color: var(--text-strong); border-bottom-color: var(--accent); }
.docs-example-path { display: flex; align-items: flex-start; gap: 9px; padding: 16px 16px 0; }
.docs-example-path > code { font-size: 10px; line-height: 2; color: var(--text-muted); overflow-wrap: anywhere; }
.docs-code-card pre { margin: 0; padding: 16px; font-size: 10.5px; line-height: 1.85; color: var(--text); overflow: auto; max-height: 380px; white-space: pre; tab-size: 2; }
.docs-code-card pre code { font-size: inherit; background: none; color: inherit; padding: 0; }
.docs-code-note { border-top: 1px solid var(--border); padding: 11px 16px; margin: 0; font-size: 10px; line-height: 1.7 !important; color: var(--text-dim) !important; }
.docs-sandbox-link { display: flex; gap: 11px; align-items: center; padding: 14px 0; color: var(--text-muted) !important; }
.docs-sandbox-link strong { display: block; font-size: 11px; color: var(--text); font-weight: 500; }
.docs-sandbox-link small { display: block; margin-top: 5px; font-size: 10px; color: var(--text-dim); }
.docs-sandbox-link > span:last-child { margin-left: auto; }
.docs-muted { color: var(--text-dim); font-size: 12px; }
.docs-footer { display: flex; flex-wrap: wrap; gap: 15px; justify-content: space-between; padding: 26px 0 38px; font-size: 10px; color: var(--text-dim); }
.docs-toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); z-index: 80; border-radius: 8px; background: var(--bg-panel); color: var(--text-strong); box-shadow: var(--shadow-pop); font-size: 12px; max-width: 90vw; }
.docs-toast:not(:empty) { padding: 12px 20px; border: 1px solid var(--border-strong); }
@media (min-width: 1800px) { .docs-main { margin-right: auto; margin-left: max(var(--docs-sidebar), calc((100vw - 1540px) / 2)); } }
@media (max-width: 1200px) {
  .docs-page { --docs-sidebar: 225px; }
  .docs-main { padding: 0 30px; }
  .docs-reading-grid { gap: 25px; grid-template-columns: minmax(0, 1fr) minmax(280px, .85fr); }
  .docs-outcomes > div { grid-template-columns: 1fr; gap: 7px; }
  .docs-tip-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1020px) {
  .docs-reading-grid { display: flex; flex-direction: column; }
  .docs-example-column { order: -1; width: 100%; padding-top: 28px; }
  .docs-example-sticky { position: static; }
  .docs-guide-content,
  .docs-example-column {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .docs-code-card pre { max-height: 310px; }
  .docs-response-card, .docs-sandbox-link { display: none; }
  .docs-guide-content { width: 100%; }
  .docs-tip-grid { grid-template-columns: 1fr 1fr; }
  .docs-outcomes > div { grid-template-columns: 138px 1fr; }
}
@media (max-width: 700px) {
  .docs-page { --docs-header: 62px; }
  .docs-header { padding: 0 16px; gap: 12px; }
  .docs-header-divider, .docs-header-title, .docs-version, .docs-portal-link { display: none; }
  .docs-header-actions { gap: 9px; }
  .docs-menu-button { display: grid; }
  .docs-sidebar { display: none; width: min(320px, 90vw); box-shadow: var(--shadow-pop); }
  .docs-sidebar.is-open { display: block; }
  .docs-main { margin-left: 0; padding: 0 20px; }
  .docs-hero { padding-top: 36px; }
  .docs-hero h1 { font-size: 36px; letter-spacing: -1.5px; }
  .docs-lead { font-size: 13px; }
  .docs-hero-actions { gap: 18px; margin-bottom: 27px; }
  .docs-primary, .docs-text-link { font-size: 11px; }
  .docs-source-strip { gap: 10px 15px; }
  .docs-source-strip > span { width: 100%; }
  .docs-section { padding: 32px 0; }
  .docs-page h2 { font-size: 24px; }
  .docs-tip-grid, .docs-outcomes > div { grid-template-columns: 1fr; }
  .docs-outcomes > div { gap: 8px; }
  .docs-schema-field .docs-schema-fields { margin-left: 0; padding-left: 8px; }
}
@media (prefers-reduced-motion: reduce) { .docs-page { scroll-behavior: auto; } html:has(.docs-page) { scroll-behavior: auto; } }
