/* Overrides for the static export, copied into out/ and linked from every page
   by .source/scripts/build-static.mjs.

   The docs wear the family design system shared with meghaos.ai,
   nicrronninoo.ai and ninoo.ai (website/DESIGN.md, website/src/styles/global.css):
   Google Sans Flex and Google Sans Code, white paper in light and deep navy in
   dark (never black), structure drawn in 1px hairlines, no shadows or
   gradients, 6px controls and 12px cards, and blue only for things you can
   click. docs.json sets the accent and the background; everything Mintlify
   does not expose is set here. Mintlify's chrome is Tailwind with class-based
   dark mode (`dark` on <html>). */

/* ── Faces ────────────────────────────────────────────────────────────────
   Self-hosted from /fonts, the same files as the main site. Declared with the
   full variable weight range: docs.json's `fonts.source` makes Mintlify emit a
   face too, but with a single weight. */
@font-face {
  font-family: "Google Sans Flex";
  src: url("/fonts/google-sans-flex.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Google Sans Code";
  src: url("/fonts/google-sans-code.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ───────────────────────────────────────────────────────────────── */
html:root {
  --mos-paper: #ffffff;
  --mos-paper-2: #f3f6fc;
  --mos-paper-3: #e7edf8;
  --mos-ink: #0b1b3a;
  --mos-ink-2: #3d4d6b;
  --mos-ink-3: #5b6a86;
  --mos-line: #dde5f2;
  --mos-line-2: #c6d2e6;
  --mos-accent: #1a66f0;
  --mos-accent-hover: #1150c8;
  --mos-accent-soft: #e6eefe;
  --mos-on-accent: #ffffff;

  --font-family-headings-custom: "Google Sans Flex", "Google Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-family-body-custom: "Google Sans Flex", "Google Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;

  /* Mintlify's grey ramp (rgb triplets), re-pointed at the family's ink and
     line tones so every text-gray-* / border-gray-* lands on a token. */
  --gray-50: 243 246 252;
  --gray-100: 231 237 248;
  --gray-200: 221 229 242;
  --gray-300: 198 210 230;
  --gray-400: 138 156 188;
  --gray-500: 91 106 134;
  --gray-600: 61 77 107;
  --gray-700: 61 77 107;
  --gray-800: 35 52 85;
  --gray-900: 11 27 58;
  --gray-950: 11 27 58;
}

html.dark:root {
  --mos-paper: #0a1630;
  --mos-paper-2: #0f1f40;
  --mos-paper-3: #172b52;
  --mos-ink: #e9eef8;
  --mos-ink-2: #b1bfda;
  --mos-ink-3: #8a9cbc;
  --mos-line: #223762;
  --mos-line-2: #2f4a7c;
  --mos-accent: #7fa9ff;
  --mos-accent-hover: #a3c1ff;
  --mos-accent-soft: #172b52;
  --mos-on-accent: #0a1630;

  /* Dark mode reads the light end of the ramp as text and the dark end as
     surfaces: fog for text, night and seam for fills and rules. */
  --gray-50: 243 246 252;
  --gray-100: 233 238 248;
  --gray-200: 233 238 248;
  --gray-300: 177 191 218;
  --gray-400: 177 191 218;
  --gray-500: 138 156 188;
  --gray-600: 90 116 166;
  --gray-700: 47 74 124;
  --gray-800: 34 55 98;
  --gray-900: 23 43 82;
  --gray-950: 15 31 64;
}

body {
  font-feature-settings: "calt", "kern";
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in oklab, var(--mos-accent) 30%, transparent);
  color: var(--mos-ink);
}

/* Prose colours: ink for headings and emphasis, ink-2 for body copy. */
.prose,
.prose-gray {
  --tw-prose-body: var(--mos-ink-2);
  --tw-prose-headings: var(--mos-ink);
  --tw-prose-lead: var(--mos-ink-2);
  --tw-prose-links: var(--mos-accent);
  --tw-prose-bold: var(--mos-ink);
  --tw-prose-counters: var(--mos-ink-3);
  --tw-prose-bullets: var(--mos-line-2);
  --tw-prose-hr: var(--mos-line);
  --tw-prose-quotes: var(--mos-ink);
  --tw-prose-quote-borders: var(--mos-line);
  --tw-prose-captions: var(--mos-ink-3);
  --tw-prose-code: var(--mos-ink);
  --tw-prose-th-borders: var(--mos-line);
  --tw-prose-td-borders: var(--mos-line);
  --tw-prose-invert-body: var(--mos-ink-2);
  --tw-prose-invert-headings: var(--mos-ink);
  --tw-prose-invert-lead: var(--mos-ink-2);
  --tw-prose-invert-links: var(--mos-accent);
  --tw-prose-invert-bold: var(--mos-ink);
  --tw-prose-invert-counters: var(--mos-ink-3);
  --tw-prose-invert-bullets: var(--mos-line-2);
  --tw-prose-invert-hr: var(--mos-line);
  --tw-prose-invert-quotes: var(--mos-ink);
  --tw-prose-invert-quote-borders: var(--mos-line);
  --tw-prose-invert-captions: var(--mos-ink-3);
  --tw-prose-invert-code: var(--mos-ink);
  --tw-prose-invert-th-borders: var(--mos-line);
  --tw-prose-invert-td-borders: var(--mos-line);
}

/* Every hairline is the line token. Mintlify draws them as translucent
   ink/white, which reads warmer and heavier than the family's rules. */
.border-gray-950\/10,
.border-gray-950\/5,
.border-gray-100,
.border-gray-200,
.border-gray-200\/70,
.dark\:border-white\/10:is(.dark *),
.dark\:border-white\/5:is(.dark *),
.dark\:border-gray-300\/10:is(.dark *),
.dark\:border-gray-800:is(.dark *),
.dark\:border-gray-800\/50:is(.dark *),
.dark\:border-neutral-700:is(.dark *),
.border-neutral-200 {
  border-color: var(--mos-line) !important;
}
#navbar-transition,
#navbar .border-b,
#sidebar,
#sidebar-content {
  border-color: var(--mos-line) !important;
}

/* ── Type ─────────────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
#page-title {
  font-family: var(--font-family-headings-custom);
  text-wrap-style: balance;
}
#page-title {
  font-weight: 500 !important;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--mos-ink) !important;
}
.prose :where(h1, h2, h3, h4):not(:where(.not-prose, .not-prose *)) {
  font-weight: 500;
  color: var(--mos-ink);
}
.prose :where(h2):not(:where(.not-prose, .not-prose *)) {
  letter-spacing: -0.02em;
}
.prose :where(h3, h4):not(:where(.not-prose, .not-prose *)) {
  letter-spacing: -0.015em;
}
.prose :where(strong, b) {
  font-weight: 600;
}

/* The lede under the page title. */
#header .prose,
#header .text-lg {
  color: var(--mos-ink-2);
}

/* Eyebrow above the page title: grey, 13px, medium. Blue is for links. */
.eyebrow {
  color: var(--mos-ink-2) !important;
  font-size: 13px !important;
  line-height: 18px !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em;
}

/* List markers: quiet ink-3, not ink. */
.prose :where(ul, ol) > li::marker {
  color: var(--mos-ink-3);
}

/* Links in copy: accent, quiet underline on hover only. */
.prose a:not(.card):not([data-component-part]),
.prose a.link {
  color: var(--mos-accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 0 !important;
  transition: color 160ms;
}
.prose a:not(.card):not([data-component-part]):hover,
.prose a.link:hover {
  color: var(--mos-accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* ── Code ─────────────────────────────────────────────────────────────────
   Google Sans Code for code, versions and hashes. docs.json only configures
   the body and heading family, so the code face is set here. */
code,
pre,
pre *,
kbd,
samp,
.font-mono {
  font-family: "Google Sans Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace !important;
  font-variant-ligatures: none;
}

/* Code blocks: a 12px hairline frame on paper-2, no shadow. */
.code-block,
.code-group {
  border: 1px solid var(--mos-line) !important;
  border-radius: 12px !important;
  background: var(--mos-paper-2) !important;
  box-shadow: none !important;
}
/* Mintlify paints the dark background from an inline --shiki-dark-bg with
   `html.dark .code-block-background {…!important}`, so both the variable and
   a more specific selector are needed. */
html .code-block-background,
html .code-block pre,
html .code-block .dark\:bg-codeblock,
html .code-group .code-block-background,
html .code-group pre {
  --shiki-dark-bg: var(--mos-paper-2) !important;
  --shiki-light-bg: var(--mos-paper-2) !important;
  border-radius: 0 0 12px 12px !important;
  background-color: var(--mos-paper-2) !important;
}
/* The fade that keeps long lines from running under the copy button: match
   it to the paper-2 fill. */
html [data-fade-overlay] {
  --fade-color-light: #f3f6fc !important;
  --fade-color-dark: #0f1f40 !important;
}
html .code-block > .code-block-background {
  border-radius: 12px !important;
}
.code-block [data-component-part="code-block-header"],
.code-group [data-component-part="code-group-tab-bar"] {
  border-color: var(--mos-line) !important;
  background: transparent !important;
}
.code-block-copy-button button,
[data-component-part="code-block-copy-button"] {
  border-radius: 6px !important;
}

/* Inline code: a small hairline chip. */
.prose :not(pre) > code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--mos-line);
  border-radius: 4px;
  background: var(--mos-paper-2);
  color: var(--mos-ink);
  font-size: 0.875em;
  font-weight: 450;
}
.prose :not(pre) > code::before,
.prose :not(pre) > code::after {
  content: none;
}

/* ── Cards ────────────────────────────────────────────────────────────────
   12px hairline, paper fill, no shadow, no ring. Linked cards fill with
   paper-2 and firm the frame on hover rather than turning blue. */
.card {
  border: 1px solid var(--mos-line) !important;
  border-radius: 12px !important;
  background: var(--mos-paper) !important;
  box-shadow: none !important;
  --tw-ring-color: transparent !important;
  transition: background-color 160ms, border-color 160ms;
}
.card:hover {
  border-color: var(--mos-line-2) !important;
  background: var(--mos-paper-2) !important;
}
.card [data-component-part="card-title"] {
  color: var(--mos-ink) !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em;
}
.card [data-component-part="card-content"],
.card [data-component-part="card-content"] * {
  color: var(--mos-ink-2);
}
/* Card icons are labels, not actions: ink-2, not accent. */
.card [data-component-part="card-icon"] svg.bg-primary,
.card [data-component-part="card-icon"] svg {
  background-color: var(--mos-ink-2) !important;
}
.card .group-hover\:text-primary {
  color: var(--mos-ink-3) !important;
}

/* Callouts, accordions, tabs, tables, frames: the same hairline at 12px. */
.callout {
  border: 1px solid var(--mos-line) !important;
  border-radius: 12px !important;
  background: var(--mos-paper-2) !important;
  color: var(--mos-ink-2);
}
.callout svg {
  color: var(--mos-ink-3);
}
.accordion,
details,
[data-component-part="accordion"],
.frame,
[data-component-part="frame"],
.table-container,
.prose table {
  border-color: var(--mos-line) !important;
  border-radius: 12px;
  box-shadow: none !important;
}
.rounded-2xl:not(.card):not(.code-block):not(.callout) {
  border-radius: 12px;
}

.callout [data-component-part="callout-content"] {
  color: var(--mos-ink-2) !important;
}
.callout [data-component-part="callout-content"] strong {
  color: var(--mos-ink) !important;
}
.callout [data-component-part="callout-content"] a {
  color: var(--mos-accent) !important;
  border-bottom: 0 !important;
}

/* Content tabs: the selected tab is ink with an ink rule; the others ink-2. */
[data-component-part="tab-button"] {
  font-weight: 500 !important;
  color: var(--mos-ink-2) !important;
}
[data-component-part="tab-button"]:hover {
  color: var(--mos-ink) !important;
}
[data-component-part="tab-button"][data-active="true"] {
  color: var(--mos-ink) !important;
  border-color: var(--mos-ink) !important;
}

/* Steps: numbered markers in ink, not accent. */
[data-component-part="step-number"],
.steps [data-component-part="step-number"] {
  border-radius: 999px;
  background: var(--mos-paper-2) !important;
  color: var(--mos-ink) !important;
  font-family: "Google Sans Code", ui-monospace, monospace;
}
[data-component-part="step-line"] {
  background: var(--mos-line) !important;
}

/* ── Chrome ─────────────────────────────────────────────────────────────── */

/* Navbar: opaque paper with a hairline, no blur or tint. */
#navbar-transition {
  background: var(--mos-paper) !important;
  box-shadow: none !important;
}
#navbar img.nav-logo,
#navbar a[href="https://meghaos.ai"] img {
  height: 26px;
  width: auto;
}

/* The one primary action in the bar: 6px blue button. */
#topbar-cta-button a > span:first-child {
  border-radius: 6px !important;
  background: var(--mos-accent) !important;
  transition: background-color 160ms;
}
#topbar-cta-button a:hover > span:first-child {
  opacity: 1 !important;
  background: var(--mos-accent-hover) !important;
}
#topbar-cta-button a .text-white,
#topbar-cta-button a .text-white\/90 {
  color: var(--mos-on-accent) !important;
}
/* A label, not a label and a chevron. Mintlify draws a "›" in every navbar
   primary button and docs.json has no switch for it; the padding evens out
   once it is gone. */
#topbar-cta-button a svg {
  display: none;
}
#topbar-cta-button a {
  padding-right: 0.75rem !important;
}
.navbar-link a {
  color: var(--mos-ink-2) !important;
}
.navbar-link a:hover {
  color: var(--mos-ink) !important;
}

/* Search entry: 6px hairline control on paper. */
#search-bar-entry {
  border-radius: 6px !important;
  border: 1px solid var(--mos-line) !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  box-shadow: none !important;
  background: var(--mos-paper) !important;
  color: var(--mos-ink-3) !important;
  filter: none !important;
  transition: border-color 160ms;
}
#search-bar-entry:hover {
  border-color: var(--mos-line-2) !important;
}

/* Tabs under the bar: the active tab is ink with an ink rule. */
.nav-tabs-item[data-active="true"] {
  color: var(--mos-ink) !important;
  text-shadow: none !important;
}
.nav-tabs-item[data-active="true"] > div.bg-primary {
  background: var(--mos-ink) !important;
  height: 1px;
}
.nav-tabs-item:not([data-active="true"]) {
  color: var(--mos-ink-2) !important;
}
.nav-tabs-item:not([data-active="true"]):hover {
  color: var(--mos-ink) !important;
}

/* Sidebar: group headers as grey 13px eyebrows; items ink-2; the active
   item is ink on paper-2 with a 6px radius, not a blue fill. */
#sidebar .sidebar-group-header,
#sidebar .sidebar-group-header * {
  color: var(--mos-ink-3) !important;
  font-size: 13px;
  font-weight: 500 !important;
  letter-spacing: 0.01em;
}
#sidebar li > a {
  border-radius: 6px !important;
  color: var(--mos-ink-2);
  text-shadow: none !important;
  transition: background-color 160ms, color 160ms;
}
#sidebar li > a:hover {
  background: var(--mos-paper-2) !important;
  color: var(--mos-ink) !important;
}
#sidebar li[data-active="true"] > a,
#sidebar a[aria-current="page"] {
  background: var(--mos-paper-2) !important;
  color: var(--mos-ink) !important;
  font-weight: 500;
  box-shadow: inset 2px 0 0 var(--mos-ink);
}
html.dark #sidebar li[data-active="true"] > a,
html.dark #sidebar a[aria-current="page"] {
  background: var(--mos-paper-3) !important;
}

/* Table of contents: grey, the current entry ink. */
#table-of-contents a,
#content-side-layout a {
  color: var(--mos-ink-3);
}
#table-of-contents a:hover,
#content-side-layout a:hover {
  color: var(--mos-ink);
}
#table-of-contents a[data-active="true"],
#table-of-contents .text-primary,
#content-side-layout .text-primary,
#content-side-layout .dark\:text-primary-light:is(.dark *) {
  color: var(--mos-ink) !important;
  font-weight: 500;
}
#content-side-layout .border-primary,
#content-side-layout .dark\:border-primary-light:is(.dark *) {
  border-color: var(--mos-ink) !important;
}

/* Page context menu ("Copy page"): hairline 6px control. */
#page-context-menu button,
#page-context-menu-button {
  border-radius: 6px !important;
  border-color: var(--mos-line) !important;
  box-shadow: none !important;
}

/* Previous / next pager: hairline 12px cards. */
#pagination a {
  border-color: var(--mos-line) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
#pagination a:hover {
  border-color: var(--mos-line-2) !important;
  background: var(--mos-paper-2);
}

/* "Powered by Mintlify" in the footer: Mintlify's grey-400 measures 2.8:1 on
   paper; ink-3 is 5.3:1 in light and 6.9:1 in dark (WCAG 1.4.3). */
#footer a[href*="mintlify.com"] {
  color: var(--mos-ink-3) !important;
}

/* ── Diagrams ─────────────────────────────────────────────────────────────
   Every ```mermaid block starts with the family theme directive (Mermaid's
   base theme: paper nodes, line-2 borders, paper-2 groups, ink text, Google
   Sans Flex at 14px). Mintlify gives Mermaid no per-mode setting, so the
   directive draws the light version and the dark one is painted here, over
   the same SVG. Corners follow the family radii: 6px boxes, 12px groups. */
svg[id^="mermaid-"] .node rect {
  rx: 6px;
  ry: 6px;
}
svg[id^="mermaid-"] .cluster rect {
  rx: 12px;
  ry: 12px;
}
html.dark svg[id^="mermaid-"] .node rect,
html.dark svg[id^="mermaid-"] .node polygon,
html.dark svg[id^="mermaid-"] .node circle,
html.dark svg[id^="mermaid-"] .node ellipse,
html.dark svg[id^="mermaid-"] .node path,
html.dark svg[id^="mermaid-"] rect.actor {
  fill: var(--mos-paper) !important;
  stroke: var(--mos-line-2) !important;
}
/* Sequence diagrams put the `actor` class on the participant's label as well
   as its box, so the label is named explicitly. */
html.dark svg[id^="mermaid-"] text.actor,
html.dark svg[id^="mermaid-"] text.actor > tspan {
  fill: var(--mos-ink) !important;
}
html.dark svg[id^="mermaid-"] .cluster rect,
html.dark svg[id^="mermaid-"] .note,
html.dark svg[id^="mermaid-"] .labelBox {
  fill: var(--mos-paper-2) !important;
  stroke: var(--mos-line-2) !important;
}
html.dark svg[id^="mermaid-"] .nodeLabel,
html.dark svg[id^="mermaid-"] .cluster-label,
html.dark svg[id^="mermaid-"] .label,
html.dark svg[id^="mermaid-"] .edgeLabel,
html.dark svg[id^="mermaid-"] text,
html.dark svg[id^="mermaid-"] tspan,
html.dark svg[id^="mermaid-"] span,
html.dark svg[id^="mermaid-"] p {
  color: var(--mos-ink) !important;
  fill: var(--mos-ink) !important;
}
html.dark svg[id^="mermaid-"] .flowchart-link,
html.dark svg[id^="mermaid-"] .edgePath .path,
html.dark svg[id^="mermaid-"] .messageLine0,
html.dark svg[id^="mermaid-"] .messageLine1,
html.dark svg[id^="mermaid-"] .actor-line {
  stroke: var(--mos-ink-3) !important;
}
/* The frame of an alt/loop block is a hairline, as in light mode. */
html.dark svg[id^="mermaid-"] .loopLine {
  stroke: var(--mos-line-2) !important;
}
html.dark svg[id^="mermaid-"] marker path,
html.dark svg[id^="mermaid-"] .arrowheadPath,
html.dark svg[id^="mermaid-"] .arrowMarkerPath {
  fill: var(--mos-ink-3) !important;
  stroke: var(--mos-ink-3) !important;
}
html.dark svg[id^="mermaid-"] .edgeLabel,
html.dark svg[id^="mermaid-"] .edgeLabel p,
html.dark svg[id^="mermaid-"] .edgeLabel span {
  background-color: var(--mos-paper) !important;
}
html.dark svg[id^="mermaid-"] .edgeLabel rect,
html.dark svg[id^="mermaid-"] .labelBkg {
  fill: var(--mos-paper) !important;
  background-color: var(--mos-paper) !important;
}

/* No shadows anywhere in the content column. */
#content-container .shadow,
#content-container .shadow-sm,
#content-container .shadow-md,
#content-container .shadow-lg {
  box-shadow: none !important;
}

/* ── Overrides of Tailwind `!` utilities ────────────────────────────────
   Mintlify marks a few utilities important (`hover:border-primary!` on cards,
   `[&_a]:text-current!` in callouts). Those live in @layer utilities, and an
   important declaration in a layer beats an important one outside any layer,
   so nothing above can override them. For important declarations the
   earliest layer wins, and `properties` is the first layer Mintlify's
   stylesheet declares; these go there. */
@layer properties {
  .card:hover {
    border-color: var(--mos-line-2) !important;
  }
  .callout [data-component-part="callout-content"] a {
    color: var(--mos-accent) !important;
    border-bottom: 0 !important;
  }
}

/* ── Disabled Mintlify widgets ──────────────────────────────────────────── */

/* Mintlify's floating status pill (the draggable dark circle in the bottom-left
   corner). build-static.mjs marks the server-rendered copy `hidden`; this
   catches a client-side re-render. */
div[data-mos-disabled],
div[role="status"].cursor-grab {
  display: none !important;
}

/* Mintlify's AI assistant ("Ask a question..."). It answers from Mintlify's
   hosted backend, which a static export on Firebase does not have, so every
   question would fail. Search (Pagefind, search.js) is the replacement. */
.chat-assistant-floating-input,
#chat-assistant-textarea,
#chat-assistant-sheet,
[data-chat-assistant],
[aria-label="Toggle assistant panel"],
[aria-label="Ask AI"] {
  display: none !important;
}
