/* Quik! Developer Documentation — custom theme
 * Same type and palette as the marketing site (quik-website):
 * Inter for text, Plus Jakarta Sans for headings, JetBrains Mono for code.
 * Navy (#13357F) is the action and link color. Red is the small-label accent
 * and the chat send button. Dark mode is the site's deep navy, not warm gray.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:ital,wght@0,600;0,700;1,600&display=swap');

:root,
.light-mode {
  --quik-navy: #13357F;
  --quik-navy-light: #8FAAD9;
  --quik-heading: #0B1A3F;
  --quik-red: #B5121B;
  --quik-red-dark: #E07B82;
  --quik-ink: #2B2926;
  --quik-offwhite: #F4F6F0;
  --quik-paper: #E2E9F9;
  --quik-chip-fill: #EAF4F7;
  --quik-chip-fill-dark: #0A142E;
  --quik-card-dark: #0C1D45;
  --quik-border-hover-dark: #8FAAD9;
  --quik-sage: #5E6E66;
  --quik-sage-600: #4F5C56;
  --quik-sand: #DBD4CA;

  --scalar-font: Inter, 'Helvetica Neue', Arial, sans-serif;
  --scalar-font-code: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --quik-font-heading: 'Plus Jakarta Sans', Inter, 'Helvetica Neue', Arial, sans-serif;

  --scalar-color-accent: #13357F;
  --scalar-background-accent: #13357F1a;

  --scalar-background-1: #F4F6F0;
  --scalar-background-2: #FFFFFF;
  --scalar-background-3: #EAF4F7;
  --scalar-color-1: #2B2926;
  --scalar-color-2: #5C5751;
  --scalar-color-3: #656364;

  --scalar-border-color: #DBD4CA;
  --scalar-border-width: 1px;

  --scalar-radius: 8px;
  --scalar-radius-lg: 12px;
}

.dark-mode {
  --quik-navy: #13357F;
  --quik-navy-light: #8FAAD9;
  --quik-heading: #FFFFFF;
  --quik-red: #B5121B;
  --quik-red-dark: #E07B82;
  --quik-ink: #2B2926;
  --quik-offwhite: #F4F6F0;
  --quik-paper: #E2E9F9;
  --quik-chip-fill: #EAF4F7;
  --quik-chip-fill-dark: #0A142E;
  --quik-card-dark: #0C1D45;
  --quik-border-hover-dark: #8FAAD9;
  --quik-sage: #5E6E66;
  --quik-sage-600: #4F5C56;
  --quik-sand: #DBD4CA;

  --scalar-font: Inter, 'Helvetica Neue', Arial, sans-serif;
  --scalar-font-code: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --quik-font-heading: 'Plus Jakarta Sans', Inter, 'Helvetica Neue', Arial, sans-serif;

  --scalar-color-accent: #8FAAD9;
  --scalar-background-accent: #8FAAD926;

  --scalar-background-1: #070D1D;
  --scalar-background-2: #0C1D45;
  --scalar-background-3: #132652;
  --scalar-color-1: #E2E9F9;
  --scalar-color-2: #C2D0F0;
  --scalar-color-3: #8FAAD9;

  --scalar-border-color: #1E3A73;

  --scalar-radius: 8px;
  --scalar-radius-lg: 12px;
  --scalar-border-width: 1px;
}

/* Body line-height matches design system spec */
html {
  /* Prevent iOS Safari from arbitrarily shrinking text when rotating / zooming */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body,
.scalar-app {
  font-family: var(--scalar-font);
  line-height: 1.6;
  color: var(--scalar-color-1);
  background-color: var(--scalar-background-1);
}

/* Home surfaces — light only. Never force off-white over dark-mode. */
html.light-mode:has(.quik-hero),
html.light-mode:has(.quik-hero) body,
.light-mode:has(.quik-hero),
.light-mode:has(.quik-hero) body,
html.light-mode:has(.quik-hero) .scalar-app,
html.light-mode:has(.quik-hero) .markdown,
html.light-mode:has(.quik-hero) .prose,
html.light-mode:has(.quik-hero) .references-markdown,
html.light-mode:has(.quik-hero) .t-editor,
html.light-mode:has(.quik-hero) .t-editor__page,
html.light-mode:has(.quik-hero) .content,
html.light-mode:has(.quik-hero) .t-prose,
html.light-mode:has(.quik-hero) .page-content,
html.light-mode:has(.quik-hero) article,
html.light-mode:has(.quik-hero) main,
.light-mode:has(.quik-hero) .scalar-app,
.light-mode:has(.quik-hero) .markdown,
.light-mode:has(.quik-hero) .prose,
.light-mode:has(.quik-hero) .content,
.light-mode:has(.quik-hero) .t-prose,
.light-mode:has(.quik-hero) article,
.light-mode:has(.quik-hero) main {
  background-color: var(--quik-offwhite, #F4F6F0) !important;
}

/* Dark hero — match or beat light specificity (body.dark-mode is Scalar's class). */
html.dark-mode:has(.quik-hero),
html.dark-mode:has(.quik-hero) body,
body.dark-mode:has(.quik-hero),
.dark-mode:has(.quik-hero),
html.dark-mode:has(.quik-hero) .scalar-app,
html.dark-mode:has(.quik-hero) .markdown,
html.dark-mode:has(.quik-hero) .prose,
html.dark-mode:has(.quik-hero) .references-markdown,
html.dark-mode:has(.quik-hero) .t-editor,
html.dark-mode:has(.quik-hero) .t-editor__page,
html.dark-mode:has(.quik-hero) .content,
html.dark-mode:has(.quik-hero) .t-prose,
html.dark-mode:has(.quik-hero) .page-content,
html.dark-mode:has(.quik-hero) article,
html.dark-mode:has(.quik-hero) main,
body.dark-mode:has(.quik-hero) .scalar-app,
body.dark-mode:has(.quik-hero) .markdown,
body.dark-mode:has(.quik-hero) .prose,
body.dark-mode:has(.quik-hero) .references-markdown,
body.dark-mode:has(.quik-hero) .t-editor,
body.dark-mode:has(.quik-hero) .content,
body.dark-mode:has(.quik-hero) .t-prose,
body.dark-mode:has(.quik-hero) .page-content,
body.dark-mode:has(.quik-hero) article,
body.dark-mode:has(.quik-hero) main,
.dark-mode:has(.quik-hero) .scalar-app,
.dark-mode:has(.quik-hero) .markdown,
.dark-mode:has(.quik-hero) .prose,
.dark-mode:has(.quik-hero) .content,
.dark-mode:has(.quik-hero) article,
.dark-mode:has(.quik-hero) main {
  background-color: var(--scalar-background-1) !important;
  color: var(--scalar-color-1, #e2e9f9);
}

/* Headings — Plus Jakarta Sans, the marketing site's heading face */
.markdown :is(h1, h2, h3, h4, h5, h6),
.prose :is(h1, h2, h3, h4, h5, h6),
.references-markdown :is(h1, h2, h3, h4, h5, h6),
.t-editor__h1,
.t-editor__h2,
.t-editor__h3 {
  font-family: var(--quik-font-heading);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--scalar-color-1);
}

.light-mode .markdown :is(h1, h2, h3, h4, h5, h6),
.light-mode .prose :is(h1, h2, h3, h4, h5, h6),
.light-mode .references-markdown :is(h1, h2, h3, h4, h5, h6),
.light-mode .t-editor__h1,
.light-mode .t-editor__h2,
.light-mode .t-editor__h3 {
  color: var(--quik-heading);
}

.markdown,
.prose,
.references-markdown {
  color: var(--scalar-color-1);
}

/* Respect notched phones; Scalar chrome still controls layout widths */
.scalar-app {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
}

/* --------------------------------------------------------------------------
 * Sidebar: make active/hover reads use brand accent (Scalar defaults are often gray-neutral)
 * See: https://github.com/scalar/scalar/blob/main/documentation/themes.md
 */
.light-mode .sidebar,
.dark-mode .sidebar {
  --scalar-sidebar-background-1: var(--scalar-background-2);
  --scalar-sidebar-color-1: var(--scalar-color-1);
  --scalar-sidebar-color-2: var(--scalar-color-2);
  --scalar-sidebar-border-color: var(--scalar-border-color);
  --scalar-sidebar-item-hover-color: var(--scalar-color-accent);
  --scalar-sidebar-item-hover-background: var(--scalar-background-1);
  --scalar-sidebar-item-active-background: var(--scalar-background-accent);
  --scalar-sidebar-color-active: var(--scalar-color-accent);
  --scalar-sidebar-search-background: var(--scalar-background-1);
  --scalar-sidebar-search-border-color: var(--scalar-border-color);
  --scalar-sidebar-search-color: var(--scalar-color-2);
}

/*
 * Scalar reserves a sidebar footer slot (border-t). When empty it still paints
 * a stray hairline under the last nav item — hide that empty chrome only.
 */
aside.sidebar > .border-t:not(:has(a, button, input, select, img, [role="button"])) {
  display: none !important;
}

/*
 * Docs articles have long titles. The nested guide line and its gutter
 * shove those titles into two tight lines. Drop the line, keep a small
 * indent so a group still reads as a group, and give each row more air.
 * Slightly smaller type lets more titles sit on one line.
 * On This Page links were one line with an ellipsis. Let those wrap too.
 */
aside.sidebar {
  --scalar-sidebar-indent: 12px;
}

aside.sidebar .scalar-sidebar-indent-border,
aside.sidebar .w-border.inset-y-0 {
  display: none !important;
}

aside.sidebar .scalar-sidebar-indent {
  margin-right: 0 !important;
}

aside.sidebar .group\/button-label {
  font-size: 13px !important;
  line-height: 1.5 !important;
}

aside.sidebar button.group\/button,
aside.sidebar a.group\/button,
aside.sidebar div.group\/button {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/*
 * Scalar paints this scroller's bar fully transparent. The list still
 * scrolls, but nothing shows that articles continue below the fold.
 */
aside.sidebar .custom-scroll {
  scrollbar-width: thin !important;
  scrollbar-color: var(--scalar-color-3) transparent !important;
  /* The light/dark knob hangs below its row. Without this it clips at the bottom. */
  padding-bottom: 20px;
  box-sizing: border-box;
}

aside.sidebar .custom-scroll::-webkit-scrollbar {
  width: 8px;
}

aside.sidebar .custom-scroll::-webkit-scrollbar-thumb {
  background: var(--scalar-color-3);
  border-radius: 8px;
}

aside.sidebar .custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/*
 * Quiet filter above the article list. Hidden rows stay out of the scroll.
 */
.quik-sidebar-filter {
  flex: 0 0 auto;
  padding: 10px 12px 6px;
}

.quik-sidebar-filter input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--scalar-sidebar-search-border-color, var(--scalar-border-color));
  border-radius: 6px;
  background: var(--scalar-sidebar-search-background, transparent);
  color: var(--scalar-sidebar-color-1, var(--scalar-color-1));
  font-family: var(--scalar-font);
  font-size: 13px;
  line-height: 1.4;
  outline: none;
}

.quik-sidebar-filter input::placeholder {
  color: var(--scalar-color-3);
}

.quik-sidebar-filter input:focus {
  border-color: var(--scalar-color-accent);
}

.quik-sidebar-filter__empty {
  margin: 8px 2px 0;
  color: var(--scalar-color-3);
  font-size: 12px;
  line-height: 1.4;
}

aside.sidebar li.group\/item[data-quik-filter-hidden="true"] {
  display: none !important;
}

aside.toc li {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

aside.toc a.anchor {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  height: auto !important;
  line-height: 1.45 !important;
}

/* Markdown / prose / CloudCannon t-editor links — unified brand accent */
.markdown a,
.prose a,
.references-markdown a,
.t-editor__anchor,
.t-editor__anchor:visited {
  color: var(--scalar-color-accent);
}

.markdown a:hover,
.prose a:hover,
.references-markdown a:hover,
.t-editor__anchor:hover {
  opacity: 0.88;
  text-decoration-thickness: 2px;
}

/* Keyboard focus matches brand interactive accent where Scalar exposes .scalar-app */
.scalar-app :is(a, button):focus-visible {
  outline: 2px solid var(--scalar-color-accent);
  outline-offset: 2px;
}

/* ============================================================================
 * Mobile / narrow viewports — complements Scalar’s responsive shell without
 * fighting layout-critical selectors outside prose/API chrome collision zones.
 */
.markdown,
.prose,
.references-markdown {
  /* Allows flex/grid children (incl. wide tables) to shrink instead of widening the page */
  min-width: 0;
}

.markdown img,
.prose img,
.references-markdown img,
.t-prose img,
.t-editor img,
.t-prose figure,
.t-prose .t-editor__image {
  max-width: 100%;
  height: auto;
}

.markdown img,
.prose img,
.references-markdown img,
.t-prose img,
.t-editor img {
  display: block;
  margin: 1.25rem 0 1.5rem;
  border-radius: 8px;
}

.markdown pre,
.prose pre,
.references-markdown pre,
.t-prose pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.markdown code:not(pre code),
.prose code:not(pre code),
.references-markdown code:not(pre code) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown p,
.markdown li,
.markdown td,
.markdown th,
.prose p,
.prose li,
.references-markdown p,
.references-markdown li {
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* Wide HTML tables: keep table semantics; shrink cell text on small screens */
.markdown table,
.prose table,
.references-markdown table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  background-color: var(--scalar-background-2);
  border: 1px solid var(--scalar-border-color);
  border-radius: var(--scalar-radius-lg);
  overflow: hidden;
}

.markdown table th,
.markdown table td,
.prose table th,
.prose table td,
.references-markdown table th,
.references-markdown table td {
  border: 1px solid var(--scalar-border-color);
  padding: 0.65rem 0.85rem;
  vertical-align: top;
  text-align: left;
  color: var(--scalar-color-1);
  background-color: var(--scalar-background-2);
}

.markdown table th,
.prose table th,
.references-markdown table th {
  background-color: var(--scalar-background-3);
  color: var(--scalar-color-1);
  font-weight: 600;
}

/* First column often carries section labels — keep readable, don't wash out */
.markdown table td:first-child,
.prose table td:first-child,
.references-markdown table td:first-child {
  font-weight: 600;
  color: var(--scalar-color-1);
  background-color: var(--scalar-background-2);
}

/* CloudCannon exports <p> inside table cells — strip margins/backgrounds */
.markdown table :is(th, td) p,
.prose table :is(th, td) p,
.references-markdown table :is(th, td) p {
  margin: 0;
  background-color: transparent;
  color: inherit;
}

/* --------------------------------------------------------------------------
 * Dark mode — keep content surfaces + prose in sync while scrolling
 */
html.dark-mode,
html.dark-mode body,
body.dark-mode,
.dark-mode .scalar-app {
  background-color: var(--scalar-background-1) !important;
  color: var(--scalar-color-1);
}

html.dark-mode :is(.markdown, .prose, .references-markdown, .content, .t-prose, .t-editor, .t-editor__page, .page-content, .page-body, .page-layout, .page-node, article, main),
body.dark-mode :is(.markdown, .prose, .references-markdown, .content, .t-prose, .t-editor, .t-editor__page, .page-content, .page-body, .page-layout, .page-node, article, main),
.dark-mode :is(.markdown, .prose, .references-markdown, .content, .t-prose, .t-editor, .page-content, article, main) {
  background-color: var(--scalar-background-1) !important;
  color: var(--scalar-color-1);
}

.dark-mode .markdown table,
.dark-mode .prose table,
.dark-mode .references-markdown table {
  background-color: var(--scalar-background-2);
  color: var(--scalar-color-1);
  border-color: var(--scalar-border-color);
}

.dark-mode .markdown table th,
.dark-mode .markdown table td,
.dark-mode .prose table th,
.dark-mode .prose table td,
.dark-mode .references-markdown table th,
.dark-mode .references-markdown table td {
  background-color: var(--scalar-background-2);
  color: var(--scalar-color-1);
  border-color: var(--scalar-border-color);
}

.dark-mode .markdown table th,
.dark-mode .prose table th,
.dark-mode .references-markdown table th {
  background-color: var(--scalar-background-3);
}

.dark-mode .markdown table td:first-child,
.dark-mode .prose table td:first-child,
.dark-mode .references-markdown table td:first-child {
  background-color: var(--scalar-background-2);
  color: var(--scalar-color-1);
}

.dark-mode .markdown :is(p, li, td, th, strong, h1, h2, h3, h4, h5, h6),
.dark-mode .prose :is(p, li, td, th, strong, h1, h2, h3, h4, h5, h6),
.dark-mode .references-markdown :is(p, li, td, th, strong, h1, h2, h3, h4, h5, h6) {
  color: var(--scalar-color-1);
}

@media (max-width: 768px) {
  body {
    line-height: 1.6;
  }

  .markdown table th,
  .markdown table td,
  .prose table th,
  .prose table td,
  .references-markdown table th,
  .references-markdown table td {
    padding: 0.4rem 0.5rem;
    overflow-wrap: anywhere;
    hyphens: auto;
  }
}

@media (max-width: 480px) {
  /* If Scalar maps this variable, slightly larger small text on phones */
  :root {
    --scalar-small: 15px;
  }

  .markdown a,
  .prose a,
  .references-markdown a {
    text-underline-offset: 0.15em;
  }
}

/* ============================================================================
 * Landing hero — chat-first composition, vertically centered
 *
 * Scalar's `.content` / `.t-prose` page column is capped (~680px), which
 * squeezes the hero vs local preview. Force full-width + center on home.
 */
html:has(.quik-hero) .markdown,
html:has(.quik-hero) .prose,
html:has(.quik-hero) .references-markdown,
html:has(.quik-hero) .t-editor,
html:has(.quik-hero) .t-editor__page,
html:has(.quik-hero) .page.t-editor,
html:has(.quik-hero) .page-body,
html:has(.quik-hero) .page-layout,
html:has(.quik-hero) .page-content,
html:has(.quik-hero) .page-node,
html:has(.quik-hero) .t-prose,
html:has(.quik-hero) .content,
html:has(.quik-hero) article,
html:has(.quik-hero) main {
  width: 100% !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

html:has(.quik-hero) .markdown,
html:has(.quik-hero) .prose,
html:has(.quik-hero) .references-markdown,
html:has(.quik-hero) .t-editor,
html:has(.quik-hero) .t-editor__page,
html:has(.quik-hero) article,
html:has(.quik-hero) main {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 4.5rem);
  min-height: calc(100vh - 4.5rem);
  padding-block: 2rem;
}

html:has(.quik-hero) .page.t-editor {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}

.quik-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  margin-top: auto;
  margin-bottom: auto;
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  background-color: transparent;
  box-sizing: border-box;
  flex: 0 1 auto;
}

.quik-hero__stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.dark-mode .quik-hero {
  background-color: transparent;
  color: var(--scalar-color-1);
}

.quik-hero .quik-hero__title,
.quik-hero h1.quik-hero__title,
.quik-hero__title.t-editor__heading,
.quik-hero__title.t-editor__page-title {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Body face (Inter), not Plus Jakarta Sans — conversational prompt, not a product title */
.quik-hero__title {
  font-family: var(--scalar-font) !important;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 400 !important;
  line-height: 1.3;
  letter-spacing: -0.01em !important;
  color: #13357f;
  margin: 0 0 20px;
}

.dark-mode .quik-hero__title,
html.dark-mode .quik-hero__title,
body.dark-mode .quik-hero__title {
  color: #e2e9f9 !important;
}

.light-mode .quik-hero__title,
html.light-mode .quik-hero__title,
body.light-mode .quik-hero__title {
  color: #13357f !important;
}

.quik-hero__chat {
  margin: 0 auto;
  width: 100%;
  max-width: 640px;
  align-self: stretch;
}

#quik-chat-hero {
  width: 100%;
  height: auto;
  margin: 0 auto;
  overflow: visible;
  box-sizing: border-box;
  background-color: transparent;
}

.dark-mode #quik-chat-hero {
  background-color: transparent;
}

/* Destination cards — Docs / API / Guides */
.quik-destinations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  max-width: 640px;
  margin: 64px 0 0;
  padding: 0;
}

/*
 * Mid-chat shell (Cursor-like):
 * - Page scroll locked; only the transcript scrolls
 * - Composer stays docked at the bottom of the viewport
 * - Shell sits BELOW Scalar's fixed header + tabs (--quik-chat-chrome-top)
 *
 * Scalar nests the hero under .page / .content / .t-prose. Those wrappers
 * must be viewport-bounded flex columns or the chat grows forever while
 * html/body overflow:hidden — content runs off-screen with no scroll.
 *
 * Important: do NOT flex-grow .page-nav (prev/next). The broad
 * `.content > div` rule used to split the viewport 50/50 with an empty
 * nav column, clipping the title under sticky chrome and leaving a huge
 * gap above the docked composer.
 */
html:has(#quik-chat-hero[data-quik-chat-active="true"]),
html:has(#quik-chat-hero[data-quik-chat-active="true"]) body {
  height: 100% !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

html:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-destinations {
  opacity: 0 !important;
  transform: translateY(8px);
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border: none !important;
}

/* Scalar page prev/next — hide mid-chat so it cannot steal flex height.
 * Specificity must beat `.page.t-editor > .content > div { display:flex !important }`. */
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page.t-editor > .content > div.page-nav,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page-nav {
  display: none !important;
  flex: 0 0 0 !important;
  width: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Soft exit when a conversation starts (instead of hard display:none). */
.quik-hero__title,
.quik-destinations {
  transition:
    opacity 280ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    max-height 320ms ease,
    margin 280ms ease,
    padding 280ms ease;
}

html:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero__title {
  opacity: 0 !important;
  transform: translateY(-8px);
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .quik-hero__title,
  .quik-destinations {
    transition: none !important;
  }
}

/*
 * Outermost shell: full viewport with padding-top for fixed header+tabs.
 * border-box so padding eats into 100dvh and content starts under chrome.
 */
html:has(#quik-chat-hero[data-quik-chat-active="true"]) main.content,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) main {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: none !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  padding-top: var(--quik-chat-chrome-top, 100px) !important;
  padding-bottom: 0 !important;
}

html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page-content,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page-layout,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page-body,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page.t-editor,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page.t-editor > .content,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page.t-editor > .content > div:not(.page-nav),
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page-node,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .t-prose,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .markdown,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .prose,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) .references-markdown,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) article {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 0% !important;
  height: auto !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  /* Kill welcome-hero padding-block so chat sits under Home/Docs/API chrome */
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-block: 0 !important;
}

html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page.t-editor {
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
  padding-top: 0 !important;
}

html:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero {
  max-width: 900px;
  width: 100%;
  flex: 1 1 0% !important;
  height: auto !important;
  max-height: 100% !important;
  min-height: 0 !important;
  justify-content: flex-start;
  padding-top: 0;
  padding-bottom: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

html:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero__stack {
  max-width: 820px;
  width: 100%;
  flex: 1 1 0% !important;
  height: auto !important;
  max-height: 100% !important;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden !important;
}

html:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero__chat,
html:has(#quik-chat-hero[data-quik-chat-active="true"]) #quik-chat-hero {
  max-width: 820px;
  width: 100%;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  /* Fill remaining flex space; JS caps max-height to the fold. */
  height: auto !important;
  max-height: calc(100dvh - var(--quik-chat-host-top, 180px) - 4px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch;
  overflow: hidden !important;
  background-color: var(--scalar-background-1, #f4f6f0) !important;
  /* Enter animation leaves transform:matrix(...) which traps position:fixed. */
  transform: none !important;
  animation: none !important;
  opacity: 1 !important;
}

html:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero__enter {
  transform: none !important;
  animation: none !important;
  opacity: 1 !important;
}

html.dark-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero,
html.dark-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero__stack,
html.dark-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) #quik-chat-hero,
body.dark-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero,
body.dark-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero__stack,
body.dark-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) #quik-chat-hero {
  background-color: var(--scalar-background-1) !important;
}

html.light-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero,
html.light-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero__stack,
html.light-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) #quik-chat-hero,
body.light-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero,
body.light-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero__stack,
body.light-mode:has(#quik-chat-hero[data-quik-chat-active="true"]) #quik-chat-hero {
  background-color: #f4f6f0 !important;
}

/* Scalar owns the theme toggle — hide any leftover custom header toggles. */
.header-right .quik-header-theme-toggle,
.header-right .quik-header-theme-toggle-fallback {
  display: none !important;
}

@media (max-width: 768px) {
  html:has(#quik-chat-hero[data-quik-chat-active="true"]) .page.t-editor {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    padding-top: 0 !important;
  }

  html:has(#quik-chat-hero[data-quik-chat-active="true"]) .quik-hero {
    padding-top: 0;
  }

  .quik-destinations {
    grid-template-columns: 1fr;
    margin-top: 2rem;
    max-width: 100%;
  }
}

.quik-destination {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 1.375rem 1.5rem;
  text-align: left;
  text-decoration: none !important;
  color: var(--scalar-color-1) !important;
  background: #FFFFFF;
  border: 1px solid var(--scalar-border-color);
  border-radius: var(--scalar-radius-lg, 8px);
  box-shadow: 0 1px 2px rgba(19, 53, 127, 0.04);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.dark-mode .quik-destination {
  background: var(--quik-card-dark, #0C1D45);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.quik-destination:hover {
  transform: translateY(-2px);
  border-color: var(--quik-navy);
  box-shadow: 0 8px 20px rgba(19, 53, 127, 0.12);
}

.dark-mode .quik-destination:hover {
  border-color: var(--quik-border-hover-dark, #7080A8);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.quik-destination__icon {
  display: inline-flex;
  color: var(--quik-navy);
  margin-bottom: 0.15rem;
}

.dark-mode .quik-destination__icon {
  color: var(--quik-navy-light);
}

.quik-destination__label {
  font-family: var(--scalar-font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--scalar-color-1);
}

.quik-destination__hint {
  font-family: var(--scalar-font);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.35;
  color: #656364;
}

.dark-mode .quik-destination__hint {
  color: var(--scalar-color-3, #a5a4a5);
}

/* Hero enter motion — once on load, staggered */
@keyframes quik-hero-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quik-hero__enter {
  opacity: 0;
  animation: quik-hero-enter 400ms ease-out both;
}

.quik-hero__enter--1 { animation-delay: 0ms; }
.quik-hero__enter--2 { animation-delay: 80ms; }
.quik-hero__enter--3 { animation-delay: 160ms; }

@media (max-width: 640px) {
  .quik-destinations {
    grid-template-columns: 1fr;
  }

  html:has(.quik-hero) .markdown,
  html:has(.quik-hero) .prose,
  html:has(.quik-hero) main {
    min-height: auto;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quik-hero__enter {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .quik-destination:hover {
    transform: none;
  }
}

/* ============================================================================
 * Header brand + top tabs (Home / Docs / API)
 * ============================================================================ */

/* "Developer Docs" wordmark beside the logo */
.quik-header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.75rem;
  flex-shrink: 0;
  min-width: 0;
}

.quik-header-brand__divider {
  display: block;
  width: 1px;
  height: 1.125rem;
  flex-shrink: 0;
  background: rgba(41, 39, 40, 0.28);
}

.dark-mode .quik-header-brand__divider {
  background: rgba(242, 241, 238, 0.35);
}

.quik-header-brand__label {
  font-family: var(--scalar-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: #13357f !important;
  white-space: nowrap;
}

.dark-mode .quik-header-brand__label {
  color: #8faad9 !important;
}

@media (max-width: 480px) {
  .quik-header-brand__label {
    display: none;
  }
  .quik-header-brand__divider {
    display: none;
  }
}

/*
 * Top tabs — ink at rest, navy hover/active, 2px underline.
 * Scalar paints inactive tabs with --scalar-color-3 (#656364) and
 * -webkit-font-smoothing: antialiased, which washes ink into "disabled gray."
 * Remap the token + restore subpixel smoothing so the body ink reads clearly.
 */
.tabs.tabs-header {
  --scalar-color-3: #2b2926;
  --scalar-color-2: #13357f;
  --scalar-color-1: #13357f;
}

.dark-mode .tabs.tabs-header {
  --scalar-color-3: #e2e9f9;
  --scalar-color-2: #8faad9;
  --scalar-color-1: #8faad9;
}

.tabs.tabs-header a.link,
.tabs.tabs-header a.link .link__icon,
.tabs.tabs-header a.link svg {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #2b2926 !important;
  fill: currentColor !important;
  border-bottom: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  opacity: 1 !important;
  -webkit-font-smoothing: auto !important;
  -moz-osx-font-smoothing: auto !important;
}

.tabs.tabs-header a.link {
  position: relative;
  gap: 0.4rem;
}

/* Underline the label only — not the icon */
.tabs.tabs-header a.link .quik-tab-label {
  display: inline-block;
  line-height: 1.2;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.tabs.tabs-header a.link:hover,
.tabs.tabs-header a.link:hover .link__icon,
.tabs.tabs-header a.link:hover svg {
  color: #13357f !important;
  fill: currentColor !important;
}

.tabs.tabs-header a.link.link-active,
.tabs.tabs-header a.link[aria-current="page"],
.tabs.tabs-header a.link.router-link-active,
.tabs.tabs-header a.link.link-active .link__icon,
.tabs.tabs-header a.link[aria-current="page"] .link__icon,
.tabs.tabs-header a.link.router-link-active .link__icon,
.tabs.tabs-header a.link.link-active svg,
.tabs.tabs-header a.link[aria-current="page"] svg,
.tabs.tabs-header a.link.router-link-active svg {
  color: #13357f !important;
  fill: currentColor !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

.tabs.tabs-header a.link.link-active .quik-tab-label,
.tabs.tabs-header a.link[aria-current="page"] .quik-tab-label,
.tabs.tabs-header a.link.router-link-active .quik-tab-label {
  border-bottom-color: #13357f;
}

.dark-mode .tabs.tabs-header a.link,
.dark-mode .tabs.tabs-header a.link .link__icon,
.dark-mode .tabs.tabs-header a.link svg {
  color: #e2e9f9 !important;
  fill: currentColor !important;
}

.dark-mode .tabs.tabs-header a.link:hover,
.dark-mode .tabs.tabs-header a.link:hover .link__icon,
.dark-mode .tabs.tabs-header a.link:hover svg,
.dark-mode .tabs.tabs-header a.link.link-active,
.dark-mode .tabs.tabs-header a.link[aria-current="page"],
.dark-mode .tabs.tabs-header a.link.router-link-active,
.dark-mode .tabs.tabs-header a.link.link-active .link__icon,
.dark-mode .tabs.tabs-header a.link[aria-current="page"] .link__icon,
.dark-mode .tabs.tabs-header a.link.router-link-active .link__icon,
.dark-mode .tabs.tabs-header a.link.link-active svg,
.dark-mode .tabs.tabs-header a.link[aria-current="page"] svg,
.dark-mode .tabs.tabs-header a.link.router-link-active svg {
  color: #8faad9 !important;
  fill: currentColor !important;
}

.dark-mode .tabs.tabs-header a.link.link-active,
.dark-mode .tabs.tabs-header a.link[aria-current="page"],
.dark-mode .tabs.tabs-header a.link.router-link-active {
  border-bottom: none !important;
  box-shadow: none !important;
}

.dark-mode .tabs.tabs-header a.link.link-active .quik-tab-label,
.dark-mode .tabs.tabs-header a.link[aria-current="page"] .quik-tab-label,
.dark-mode .tabs.tabs-header a.link.router-link-active .quik-tab-label {
  border-bottom-color: #8faad9;
}

/* --------------------------------------------------------------------------
 * Core flow diagram
 * Legend strip → numbered nodes on a rail → edge labels in gaps → icon/title/desc
 * Light: env #EAF4F7, Quik #EAEEF7, navy #13357F
 * Dark:  page #070D1D, env #132652, Quik #0C1D45, accent #8FAAD9
 */
.quik-flow {
  --quik-flow-env: #eaf4f7;
  --quik-flow-quik: #eaeef7;
  --quik-flow-muted: #656364;
  --quik-flow-line: #13357f;
  --quik-flow-title: #2B2926;
  --quik-flow-desc: #3d3b3c;
  --quik-flow-accent: #13357f;
  --quik-flow-node-fg: #ffffff;
  --quik-flow-surface: #ffffff;
  --quik-flow-node: 28px;
  --quik-flow-edge-h: 1.85rem;
  margin: 1.75rem 0 3.5rem;
  padding: 0;
  border: 1px solid var(--scalar-border-color, #c5cbd0);
  border-radius: 12px;
  background: var(--quik-flow-surface);
  overflow: hidden;
  position: relative;
  z-index: 0;
  isolation: isolate;
}

.dark-mode .quik-flow,
html.dark-mode .quik-flow,
body.dark-mode .quik-flow {
  --quik-flow-env: #132652;
  --quik-flow-quik: #0c1d45;
  --quik-flow-muted: #8faad9;
  --quik-flow-line: #8faad9;
  --quik-flow-title: #e2e9f9;
  --quik-flow-desc: #c2d0f0;
  --quik-flow-accent: #8faad9;
  --quik-flow-node-fg: #070d1d;
  --quik-flow-surface: #0c1d45;
  border-color: var(--scalar-border-color, #656364);
}

.quik-flow__legend {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  margin: 0;
  padding: 0;
}

.quik-flow__legend-item {
  display: block;
  padding: 0.55rem 0.5rem;
  text-align: center;
  font-family: var(--scalar-font);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--quik-flow-muted);
}

.quik-flow__legend-item--env {
  background: var(--quik-flow-env);
}

.quik-flow__legend-item--quik {
  background: var(--quik-flow-quik);
  color: var(--quik-flow-accent);
}

.quik-flow__track {
  position: relative;
  /* Room above the rail for transition labels */
  padding: calc(0.85rem + var(--quik-flow-edge-h)) 0.75rem 1.5rem;
  background:
    linear-gradient(
      to right,
      var(--quik-flow-env) 0%,
      var(--quik-flow-env) 25%,
      var(--quik-flow-quik) 25%,
      var(--quik-flow-quik) 50%,
      var(--quik-flow-env) 50%,
      var(--quik-flow-env) 100%
    );
}

.quik-flow__rail {
  position: absolute;
  top: calc(0.85rem + var(--quik-flow-edge-h) + (var(--quik-flow-node) / 2) - 1px);
  left: calc(12.5% + 0.75rem);
  right: calc(12.5% + 0.75rem);
  height: 2px;
  background: var(--quik-flow-line);
  opacity: 0.35;
  z-index: 0;
  transform-origin: left center;
  animation: quik-flow-line-x 780ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quik-flow__steps {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  position: relative;
  z-index: 1;
}

.quik-flow__step {
  --quik-flow-delay: 0ms;
  display: grid;
  /* node → spacer under rail → icon → title → desc */
  grid-template-rows: var(--quik-flow-node) 0.85rem auto auto auto;
  justify-items: center;
  text-align: center;
  min-width: 0;
  margin: 0 !important;
  padding: 0 0.55rem !important;
  position: relative;
  opacity: 0;
  transform: translateY(6px);
  animation: quik-flow-step 640ms cubic-bezier(0.22, 1, 0.36, 1) var(--quik-flow-delay) both;
}

.quik-flow__step:nth-child(1) { --quik-flow-delay: 40ms; }
.quik-flow__step:nth-child(2) { --quik-flow-delay: 120ms; }
.quik-flow__step:nth-child(3) { --quik-flow-delay: 200ms; }
.quik-flow__step:nth-child(4) { --quik-flow-delay: 280ms; }

.quik-flow__node {
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--quik-flow-node);
  height: var(--quik-flow-node);
  border-radius: 999px;
  background: var(--quik-flow-accent);
  color: var(--quik-flow-node-fg);
  font-family: var(--scalar-font);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 4px var(--quik-flow-env);
  position: relative;
  z-index: 1;
}

.quik-flow__step--quik .quik-flow__node {
  box-shadow: 0 0 0 4px var(--quik-flow-quik);
}

/* Transition labels sit above the rail, centered in the gap to the next step */
.quik-flow__edge {
  position: absolute;
  top: calc(-1 * var(--quik-flow-edge-h) + 0.1rem);
  left: 50%;
  width: 100%;
  max-width: 10rem;
  margin: 0;
  padding: 0 0.2rem;
  font-family: var(--scalar-font);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--quik-flow-muted);
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.quik-flow__icon {
  grid-row: 3;
  display: inline-flex;
  color: var(--quik-flow-accent);
}

.quik-flow__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.quik-flow__title {
  grid-row: 4;
  display: block;
  margin-top: 0.4rem;
  font-family: var(--quik-font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--quik-flow-title);
  line-height: 1.3;
}

.quik-flow__step--quik .quik-flow__title {
  color: var(--quik-flow-accent);
}

.quik-flow__desc {
  grid-row: 5;
  display: block;
  margin-top: 0.25rem;
  font-family: var(--scalar-font);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--quik-flow-desc);
  max-width: 11rem;
}

@keyframes quik-flow-line-x {
  from { transform: scaleX(0); opacity: 0.15; }
  to { transform: scaleX(1); opacity: 0.35; }
}

@keyframes quik-flow-line-y {
  from { transform: scaleY(0); opacity: 0.15; }
  to { transform: scaleY(1); opacity: 0.35; }
}

@keyframes quik-flow-step {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 800px) {
  .quik-flow {
    margin: 1.5rem 0 3rem;
  }

  .quik-flow__legend {
    display: none;
  }

  .quik-flow__track {
    padding: 0.75rem;
    background: transparent;
  }

  .quik-flow__rail {
    top: 1.35rem;
    bottom: 1.35rem;
    left: calc(0.75rem + 13px);
    right: auto;
    width: 2px;
    height: auto;
    transform-origin: top center;
    animation-name: quik-flow-line-y;
  }

  .quik-flow__steps {
    display: flex !important;
    flex-direction: column;
    gap: 0.55rem;
  }

  .quik-flow__step {
    display: grid;
    grid-template-columns: var(--quik-flow-node) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "node title"
      "node desc"
      "edge edge";
    column-gap: 0.85rem;
    row-gap: 0.15rem;
    justify-items: start;
    text-align: left;
    padding: 0.85rem 0.9rem !important;
    border-radius: 10px;
    background: var(--quik-flow-env);
  }

  .quik-flow__step--quik {
    background: var(--quik-flow-quik);
  }

  .quik-flow__node {
    grid-area: node;
    box-shadow: none;
  }

  .quik-flow__icon {
    display: none;
  }

  .quik-flow__title {
    grid-area: title;
    margin-top: 0.15rem;
  }

  .quik-flow__desc {
    grid-area: desc;
    margin-top: 0;
    max-width: none;
  }

  .quik-flow__edge {
    grid-area: edge;
    position: static;
    left: auto;
    top: auto;
    width: auto;
    max-width: none;
    margin: 0.5rem 0 0;
    padding-left: calc(var(--quik-flow-node) + 0.85rem);
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quik-flow__rail,
  .quik-flow__step {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* ============================================================================
 * API reference intro panels (Server / Auth / Client Libraries)
 * Scalar paints inner rows with page bg (#F4F6F0) while inputs stay white —
 * that reads as tan/white stripes on Name / Value / Authorization.
 * Flatten the whole card (including inputs) to one surface.
 */
.light-mode .introduction-card,
.light-mode .introduction-card-item,
.light-mode .sticky-cards .introduction-card-item,
.light-mode .card-footer,
.light-mode .selected-client.card-footer,
.light-mode .introduction-card-item.scalar-reference-intro-server,
.light-mode .introduction-card-item.scalar-reference-intro-auth,
.light-mode .introduction-card-item.scalar-reference-intro-clients {
  background-color: #ffffff !important;
  border-color: var(--scalar-border-color, #c5cbd0);
}

.light-mode .introduction-card .bg-b-1,
.light-mode .introduction-card-item .bg-b-1,
.light-mode .introduction-card .bg-b-2,
.light-mode .introduction-card-item .bg-b-2,
.light-mode .introduction-card .auth-description,
.light-mode .introduction-card .scalar-data-table,
.light-mode .introduction-card .client-libraries-content,
.light-mode .client-libraries-heading,
.light-mode .scalar-reference-intro-auth .auth-description,
.light-mode .scalar-reference-intro-auth .scalar-data-table,
.light-mode .scalar-reference-intro-clients .client-libraries-content,
.light-mode .scalar-reference-intro-server > .bg-b-2,
.light-mode .scalar-reference-intro-auth > .bg-b-2,
.light-mode .scalar-reference-intro-server [class*="bg-b-1"],
.light-mode .scalar-reference-intro-auth [class*="bg-b-1"],
.light-mode .scalar-reference-intro-clients [class*="bg-b-1"],
.light-mode .scalar-reference-intro-server [class*="bg-b-2"],
.light-mode .scalar-reference-intro-auth [class*="bg-b-2"],
.light-mode .scalar-reference-intro-clients [class*="bg-b-2"],
.light-mode .introduction-card table,
.light-mode .introduction-card tr,
.light-mode .introduction-card td,
.light-mode .introduction-card th,
.light-mode .scalar-reference-intro-auth table,
.light-mode .scalar-reference-intro-auth tr,
.light-mode .scalar-reference-intro-auth td,
.light-mode .scalar-reference-intro-server table,
.light-mode .scalar-reference-intro-server tr,
.light-mode .scalar-reference-intro-server td {
  background-color: #ffffff !important;
}

/* Same white as the card — border alone defines the field */
.light-mode .introduction-card .code-input-lite,
.light-mode .introduction-card .code-input-lite__editor,
.light-mode .introduction-card .scalar-password-input,
.light-mode .introduction-card input.scalar-password-input,
.light-mode .scalar-reference-intro-server input,
.light-mode .scalar-reference-intro-auth input,
.light-mode .scalar-reference-intro-server [class*="code-input"],
.light-mode .scalar-reference-intro-auth [class*="code-input"],
.light-mode .scalar-reference-intro-auth .code-input-lite,
.light-mode .scalar-reference-intro-auth .code-input-lite__editor,
.light-mode .scalar-reference-intro-server .code-input-lite,
.light-mode .scalar-reference-intro-server .code-input-lite__editor {
  background-color: #ffffff !important;
  border-color: var(--scalar-border-color, #c5cbd0) !important;
}

.dark-mode .introduction-card,
.dark-mode .introduction-card-item,
.dark-mode .card-footer,
.dark-mode .selected-client.card-footer,
.dark-mode .introduction-card-item.scalar-reference-intro-server,
.dark-mode .introduction-card-item.scalar-reference-intro-auth,
.dark-mode .introduction-card-item.scalar-reference-intro-clients {
  background-color: var(--quik-card-dark, #0c1d45) !important;
  border-color: var(--scalar-border-color, #656364);
}

.dark-mode .introduction-card .bg-b-1,
.dark-mode .introduction-card-item .bg-b-1,
.dark-mode .introduction-card .bg-b-2,
.dark-mode .introduction-card-item .bg-b-2,
.dark-mode .introduction-card .auth-description,
.dark-mode .introduction-card .scalar-data-table,
.dark-mode .introduction-card .client-libraries-content,
.dark-mode .client-libraries-heading,
.dark-mode .scalar-reference-intro-auth .auth-description,
.dark-mode .scalar-reference-intro-auth .scalar-data-table,
.dark-mode .scalar-reference-intro-clients .client-libraries-content,
.dark-mode .scalar-reference-intro-server [class*="bg-b-1"],
.dark-mode .scalar-reference-intro-auth [class*="bg-b-1"],
.dark-mode .scalar-reference-intro-clients [class*="bg-b-1"],
.dark-mode .introduction-card table,
.dark-mode .introduction-card tr,
.dark-mode .introduction-card td,
.dark-mode .scalar-reference-intro-auth table,
.dark-mode .scalar-reference-intro-auth tr,
.dark-mode .scalar-reference-intro-auth td {
  background-color: var(--quik-card-dark, #0c1d45) !important;
}

.dark-mode .introduction-card .code-input-lite,
.dark-mode .introduction-card .code-input-lite__editor,
.dark-mode .introduction-card .scalar-password-input,
.dark-mode .introduction-card input.scalar-password-input,
.dark-mode .code-input-lite,
.dark-mode .code-input-lite__editor,
.dark-mode .scalar-password-input,
.dark-mode input.scalar-password-input {
  background-color: var(--quik-card-dark, #0c1d45) !important;
}

/*
 * Schema names (formIds) and status codes (200) sit next to prose labels.
 * Keep them in the body face at 600 so they stay readable and don't pick up
 * the code face's tighter spacing.
 */
.property-name,
.property-name span,
.parameter-item-name {
  font-family: var(--scalar-font) !important;
  font-style: normal !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  font-synthesis: none !important;
  -webkit-font-smoothing: auto !important;
  -moz-osx-font-smoothing: auto !important;
}

/*
 * The corner widget host is appended in normal flow, which puts it below the
 * fold. Pin it to the viewport so the panel opens on the bubble.
 */
#quik-chat-host {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  pointer-events: none !important;
  background: transparent !important;
  z-index: 10040 !important;
  transform: none !important;
}

/*
 * Desktop header already links Home / Docs / API. The tab row repeats them.
 * Keep the tab row below 1000px, where the header links are not on screen
 * and that row is the section switcher.
 */
@media (min-width: 1000px) {
  .t-header__tabs,
  nav.tabs.tabs-header {
    display: none !important;
  }

  /*
   * The tab row is hidden, but the shell still offsets the page by two header
   * heights. Use one so the sidebar and article sit against the header.
   */
  main.content-tabs-header {
    padding-top: calc(var(--scalar-banner-height, 0px) + var(--scalar-header-height)) !important;
  }

  aside.sidebar.sidebar-tabs-header {
    top: calc(var(--scalar-banner-height, 0px) + var(--scalar-header-height)) !important;
    height: calc(100dvh - var(--scalar-banner-height, 0px) - var(--scalar-header-height)) !important;
  }

  aside.toc.sidebar-tabs-header {
    top: calc(var(--scalar-banner-height, 0px) + var(--scalar-header-height)) !important;
  }
}

/*
 * Mobile drawers / open menus must paint above page diagrams (e.g. .quik-flow).
 */
@media (max-width: 999px) {
  .sidebar,
  aside.sidebar,
  [data-state="open"][role="dialog"],
  [role="dialog"],
  .scalar-modal,
  .scalar-drawer {
    z-index: 10050 !important;
  }
}
