/* ============================================================
   ChatMaxima API v2 docs (Scalar) - brand theme overrides
   Page: Api::docs  ->  /api/docs/
   Loaded via cm_css.tpl for $class == 'api' && $method == 'docs'
   ------------------------------------------------------------
   Scalar renders into the light DOM under #app, so these
   unlayered rules override Scalar's layered defaults without
   needing !important. Fonts (Manrope + Public Sans) are already
   loaded globally in cm_css.tpl, so no @import is required.
   ============================================================ */

/* Body / base font -> Public Sans (brand body font) */
#app,
.scalar-app
{
	--scalar-font: 'Public Sans', system-ui, -apple-system, sans-serif; /* base text font */
}

/* All Scalar headings -> Manrope (brand display font) */
#app h1,
#app h2,
#app h3,
#app h4,
#app h5,
#app h6
{
	font-family: 'Manrope', sans-serif; /* brand heading font */
	letter-spacing: -0.2px;
	color: var(--scalar-color-1) !important;
}

section {
    background-color: transparent !important;
}

/* Moderate cleanup: shrink the oversized doc section headings */
#app h1.section-header-label
{
	font-size: 30px; /* was 40px */
	line-height: 1.2;
}

#app h2.section-header-label
{
	font-size: 23px; /* was 32px */
	line-height: 1.25;
}

#app h3.section-header-label
{
	font-size: 18px; /* was 28px */
	line-height: 1.3;
}

/* Tame the cramped 32px request/section LABEL headings
   (Authentication, Cookies, Headers, Query Parameters,
   Request Body, Code Snippet) down to a real label size.
   These are h2 elements WITHOUT .section-header-label. */
#app h2:not(.section-header-label)
{
	font-size: 13px; /* was 32px with a cramped 20px line-height */
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.2px;
}

/* Reduce the huge 90px vertical padding between doc sections */
#app .section
{
	padding-top: 40px; /* was 90px */
	padding-bottom: 40px; /* was 90px */
}

/* Scalar pulls the collapsed-operations "Show More" pill up 48px, sized for its
   stock 90px section padding. With our 40px padding that ride-up lands the pill
   on top of the Operations card, so keep it in normal flow instead. */
#app button.show-more
{
	top: 0 !important; /* was -48px */
	margin-top: 8px;
}

/* Markdown tables in the description column (rate limits, header reference).
   Scalar ships table-layout:fixed + word-break:break-word, which in the ~410px
   description column split words mid-character ("300 / minut e", "WhatsA pp").
   Size columns to their content instead, and let a genuinely wide table scroll
   inside its own box rather than crushing the text. */
#app .markdown table
{
	table-layout: auto !important;
	display: block;
	overflow-x: auto;
	max-width: 100%;
}

#app .markdown table th,
#app .markdown table td
{
	word-break: normal !important; /* no mid-word splits */
	overflow-wrap: break-word; /* long unbroken tokens (URLs) still wrap */
}

/* Hide Scalar's "powered by" footer links */
.scalar-app footer,
.scalar-api-reference footer,
[class*="PoweredBy"],
[class*="powered-by"],
.powered-by,
a[href*="scalar.com"],
a[href*="openapi"]
{
	display: none !important;
}

/* Pretty-print API request/response examples: preserve indentation and wrap long
   lines. Scalar renders code via CodeMirror (one .cm-line div per line); the
   site's global CSS was collapsing those onto a single line. Scoped to the docs page. */
#app .cm-editor .cm-content,
.scalar-app .cm-editor .cm-content
{
	white-space: pre-wrap !important;
}

#app .cm-editor .cm-line,
.scalar-app .cm-editor .cm-line
{
	display: block !important;
	white-space: pre-wrap !important;
	word-break: break-word;
}

#app pre,
#app pre code,
#app code[class*="language-"],
.scalar-app pre,
.scalar-app pre code,
.scalar-api-reference pre,
.scalar-api-reference pre code
{
	white-space: pre-wrap !important;
	word-break: break-word;
}

/* Sticky sidebar that travels with the page scroll.
   Root cause of the "empty rail after the first scroll": the site's global CSS
   sets body { overflow-x: hidden; overflow-y: auto }, which makes body a
   non-scrolling scroll container - position: sticky inside it never engages,
   so the 353px nav list scrolled away and left Scalar's flex-1 filler (thousands
   of px of empty column) on screen. overflow-x: clip clips identically but does
   NOT create a scroll container, letting sticky work against the viewport.
   This stylesheet only loads on /api/docs/, so the body override is page-scoped. */
body
{
	overflow-x: clip !important; /* clip without becoming a scroll container (sticky killer) */
	overflow-y: visible !important;
}

#app .scalar-app .t-doc__sidebar
{
	position: sticky !important;
	top: 0 !important;
	height: 100vh !important;
	max-height: 100vh !important;
	overflow-y: auto !important; /* sidebar owns its internal scroll if the nav outgrows the viewport */
}

/* ============================================================
   API Reference - Scalar sticky sidebar
   ============================================================ */

/* Allow sticky to pass through the API page layout */
body.cm-datatable-design .main:has(#cm_api_docs_app),
body.cm-datatable-design .main:has(#cm_api_docs_app) > main.content,
body.cm-datatable-design .main:has(#cm_api_docs_app) .container-fluid,
body.cm-datatable-design .main:has(#cm_api_docs_app) .card,
body.cm-datatable-design .main:has(#cm_api_docs_app) .card-body,
body.cm-datatable-design .main:has(#cm_api_docs_app) .cm-api-docs-shell
{
	overflow: visible !important;
}

body.cm-datatable-design .main:has(#cm_api_docs_app) .card
{
	border-radius: var(--cmt-r-lg) !important;
	clip-path: inset(0 round var(--cmt-r-lg));
}

#cm_api_docs_app .t-doc__sidebar
{
	position: sticky !important;
	top: 80px !important;

	height: calc(100vh - 80px) !important;
	max-height: calc(100vh - 100px) !important;

	align-self: flex-start !important;

	overflow-y: auto !important;
	overflow-x: hidden !important;
}

/* Scalar navigation */
#cm_api_docs_app ul
{
	padding-left: 0 !important;
}

/* Section background */
#cm_api_docs_app section.section,
section.section
{
	background-color: transparent;
}

#cm_api_docs_app .section.introduction-section {
    padding-top: 50px !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
}

section[aria-labelledby^="scalar-client-"] h2 {
    font-size: 1rem !important;
    font-weight: 600;
}

.opacity-0
{
	opacity: 100% !important;
}