/*
  Stonewake skin for the /docs schema explorer: the "Precision desk" public
  register, token-for-token the docs-site's language (docs-site/src/app/
  globals.css is the source of truth; every token below cites its line there).
  Light paper, hairline structure, black as the one act-here colour, the dark
  "deep" surface reserved for code. Loaded AFTER the vendored swagger-ui.css,
  so plain specificity wins; zero external requests (fonts ride ./fonts/).

  Token map (docs-site/src/app/globals.css @theme):
    --paper        #fcfcfd  <- --color-paper
    --sunk         #f4f5f7  <- --color-surface-sunk
    --deep         #0e0f12  <- --color-deep (code samples, both themes)
    --ink          #16181d  <- --color-ink
    --ink-muted    #5c6270  <- --color-ink-muted
    --ink-faint    #8a909c  <- --color-ink-faint (decoration only, never text)
    --dusk         #f3f3f5  <- --color-dusk (ink on the dark surface)
    --dusk-muted   #a1a6af  <- --color-dusk-muted
    --dusk-line    #2a2c31  <- --color-dusk-line
    --line         #e6e8ec  <- --color-line
    --line-strong  #d3d6dd  <- --color-line-strong
    --accent       #000000  <- --color-accent
    --accent-hover #333333  <- --color-accent-hover
    radius 4px             <- --radius-chip/control/media (quadratic register)
  Dark scheme = the docs-site "deep" register page-wide: paper takes
  --color-deep, ink takes --color-dusk, lines take --color-dusk-line, and the
  act-here colour becomes the light ink (the globals.css [data-nav-dark]
  focus-ring rule); --color-line doubles as a fill in canon (::selection), so
  the sunk fill on deep reuses --color-dusk-line.
*/

@font-face {
  font-family: "Switzer";
  src: url("fonts/Switzer-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("fonts/fragment-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #fcfcfd;
  --sunk: #f4f5f7;
  --deep: #0e0f12;
  --ink: #16181d;
  --ink-muted: #5c6270;
  --ink-faint: #8a909c;
  --dusk: #f3f3f5;
  --dusk-muted: #a1a6af;
  --dusk-line: #2a2c31;
  --line: #e6e8ec;
  --line-strong: #d3d6dd;
  --accent: #000000;
  --accent-hover: #333333;
  --on-accent: #fcfcfd;
  --code-border: transparent;
  --radius: 4px;
  /* Fallback stacks from globals.css @theme inline */
  --font-sans: "Switzer", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, "SF Mono", monospace;
  --font-serif: "Newsreader", ui-serif, Georgia, serif;
  --font-wordmark: "Manrope", ui-sans-serif, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e0f12;      /* --color-deep */
    --sunk: #2a2c31;       /* --color-dusk-line as fill (the ::selection idiom) */
    --ink: #f3f3f5;        /* --color-dusk */
    --ink-muted: #a1a6af;  /* --color-dusk-muted */
    --ink-faint: #a1a6af;
    --line: #2a2c31;       /* --color-dusk-line */
    --line-strong: #2a2c31;
    --accent: #f3f3f5;     /* act-here on dark = the light ink ([data-nav-dark]) */
    --accent-hover: #a1a6af;
    --on-accent: #0e0f12;
    --code-border: #2a2c31;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--line); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Page shell: the docs-site frame (max-w-1200, hairline structure) ---- */

.sw-shell { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .sw-shell { padding: 0 40px; } }

.sw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
}
/* The Stonewake lockup as on docs-shell/wordmark.tsx: bar mark at 22px beside
   the name in Manrope, 15px semibold uppercase, tracking 0.115em, gap 12px. */
.sw-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  text-decoration: none;
}
.sw-wordmark svg { width: 22px; height: 22px; flex-shrink: 0; fill: currentColor; }
.sw-wordmark span {
  font-family: var(--font-wordmark);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.115em;
  text-transform: uppercase;
}
.sw-nav { display: flex; align-items: center; gap: 20px; }
.sw-nav a {
  font-size: 13px;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.sw-nav a:hover { color: var(--ink); }
/* The primary documentation link carries the accent link recipe (md.tsx LINK_CLS). */
.sw-nav a.sw-primary {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 30%, transparent);
  text-underline-offset: 2px;
}
.sw-nav a.sw-primary:hover { color: var(--accent-hover); }

.sw-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 40px 0 0;
}

.sw-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 48px; }
.sw-footer p { font-size: 13px; line-height: 1.6; color: var(--ink-muted); margin: 0; }
.sw-footer a,
.swagger-ui .info a,
.swagger-ui .markdown a,
.swagger-ui .renderedMarkdown a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 30%, transparent);
  text-underline-offset: 2px;
  transition: color 0.2s;
}
.sw-footer a:hover,
.swagger-ui .info a:hover,
.swagger-ui .markdown a:hover,
.swagger-ui .renderedMarkdown a:hover { color: var(--accent-hover); }

/* ---- Explorer chrome: neutralise swagger-ui to the register ---- */

.swagger-ui { font-family: var(--font-sans); color: var(--ink); }
.swagger-ui .wrapper { padding: 0; max-width: none; }

/* Info block: display-serif title (the globals.css display-serif recipe). */
.swagger-ui .information-container { margin: 12px 0 0; padding: 0; background: transparent; }
.swagger-ui .info { margin: 24px 0 32px; }
.swagger-ui .info .title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.swagger-ui .info .title small {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  top: -7px;
}
.swagger-ui .info .title small pre {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  padding: 2px 4px;
}
.swagger-ui .info .title small.version-stamp { background: var(--sunk); }
.swagger-ui .info .description,
.swagger-ui .info li, .swagger-ui .info p, .swagger-ui .info table {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-muted);
}
.swagger-ui .info hgroup.main { margin: 0 0 12px; }

/* Servers / authorize row: a plain hairline band, never a shadowed card. */
.swagger-ui .scheme-container {
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
  margin: 0 0 24px;
  padding: 0 0 20px;
}
.swagger-ui .servers-title,
.swagger-ui .servers > label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.swagger-ui .servers > label { margin: 0; }
.swagger-ui .servers > label select { margin-top: 6px; }

/* Section (tag) headers: hairline rule, sentence-weight sans. */
.swagger-ui .opblock-tag {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  margin: 8px 0;
}
.swagger-ui .opblock-tag small {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-muted);
  padding: 0 10px;
}
.swagger-ui .opblock-tag svg, .swagger-ui .expand-operation svg { fill: var(--ink-faint); }

/* Operation rows: flat cards, hairline border, one neutral method chip.
   Method colour-coding is taxonomy, and taxonomy renders plain (web/AGENTS.md);
   every verb wears the same micro-label chip. */
.swagger-ui .opblock,
.swagger-ui .opblock.opblock-get, .swagger-ui .opblock.opblock-post,
.swagger-ui .opblock.opblock-put, .swagger-ui .opblock.opblock-delete,
.swagger-ui .opblock.opblock-patch, .swagger-ui .opblock.opblock-head,
.swagger-ui .opblock.opblock-options, .swagger-ui .opblock.opblock-deprecated {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  margin: 0 0 10px;
}
.swagger-ui .opblock .opblock-summary,
.swagger-ui .opblock.opblock-get .opblock-summary,
.swagger-ui .opblock.opblock-post .opblock-summary,
.swagger-ui .opblock.opblock-put .opblock-summary,
.swagger-ui .opblock.opblock-delete .opblock-summary,
.swagger-ui .opblock.opblock-patch .opblock-summary,
.swagger-ui .opblock.opblock-head .opblock-summary,
.swagger-ui .opblock.opblock-options .opblock-summary {
  border-color: var(--line);
  padding: 8px 12px;
}
.swagger-ui .opblock .opblock-summary-method,
.swagger-ui .opblock.opblock-get .opblock-summary-method,
.swagger-ui .opblock.opblock-post .opblock-summary-method,
.swagger-ui .opblock.opblock-put .opblock-summary-method,
.swagger-ui .opblock.opblock-delete .opblock-summary-method,
.swagger-ui .opblock.opblock-patch .opblock-summary-method,
.swagger-ui .opblock.opblock-head .opblock-summary-method,
.swagger-ui .opblock.opblock-options .opblock-summary-method {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  min-width: 64px;
  padding: 5px 8px;
  text-shadow: none;
}
.swagger-ui .opblock .opblock-summary-path,
.swagger-ui .opblock .opblock-summary-operation-id,
.swagger-ui .opblock .opblock-summary-path__deprecated {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
}
.swagger-ui .opblock .opblock-summary-description {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-muted);
}
.swagger-ui .opblock .opblock-section-header {
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  min-height: 0;
}
.swagger-ui .opblock .opblock-section-header h4,
.swagger-ui .opblock .opblock-section-header > label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock-external-docs-wrapper p,
.swagger-ui .opblock-title_normal p {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-muted);
}
.swagger-ui .opblock-body { padding-bottom: 12px; }

/* Tables: hairline rows, mono figures (parameter names, codes). */
.swagger-ui table thead tr td, .swagger-ui table thead tr th {
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 0;
}
.swagger-ui .parameters-col_description { width: 60%; }
.swagger-ui .parameter__name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
}
.swagger-ui .parameter__name.required span, .swagger-ui .parameter__name.required:after {
  color: var(--ink-muted);
}
.swagger-ui .parameter__type, .swagger-ui .parameter__extension, .swagger-ui .parameter__in {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  font-style: normal;
}
.swagger-ui .response-col_status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}
.swagger-ui .response-col_links { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); }
.swagger-ui table.responses-table td { padding: 10px 0; }
.swagger-ui .response-col_description__inner p,
.swagger-ui .responses-inner h4, .swagger-ui .responses-inner h5 {
  font-family: var(--font-sans);
  color: var(--ink-muted);
  font-size: 13px;
}
.swagger-ui .responses-inner h4, .swagger-ui .responses-inner h5 { color: var(--ink); }

/* Code: the dark chapter surface, both themes (docs-site code-block.tsx:
   bg deep, dusk ink, mono 13px, radius-media, no highlighting). */
.swagger-ui .opblock-body pre.microlight,
.swagger-ui .highlight-code > .microlight,
.swagger-ui .highlight-code pre,
.swagger-ui .curl-command .curl,
.swagger-ui .responses-inner pre {
  background: #0e0f12 !important;   /* --color-deep */
  color: #f3f3f5 !important;        /* --color-dusk */
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  font-family: var(--font-mono) !important;
  font-size: 13px;
  line-height: 1.625;
  text-shadow: none;
}
.swagger-ui .opblock-body pre.microlight span { color: #f3f3f5 !important; }
.swagger-ui .microlight code, .swagger-ui pre code { font-family: var(--font-mono); }
/* Copy affordance: a deep chip (the dark chapter surface), so the white glyph
   in the vendored icon reads on paper and on code blocks alike, both themes. */
.swagger-ui .copy-to-clipboard {
  background: var(--deep);
  border: 1px solid var(--dusk-line);
  border-radius: var(--radius);
}
.swagger-ui .copy-to-clipboard:active { background: var(--dusk-line); }
/* The summary-row copy link collapses to width 0; without this the chip's
   border survives as a sliver on every row. Shown on hover or open. */
.swagger-ui .opblock .opblock-summary .view-line-link.copy-to-clipboard { visibility: hidden; }
.swagger-ui .opblock .opblock-summary:hover .view-line-link.copy-to-clipboard,
.swagger-ui .opblock.is-open .opblock-summary .view-line-link.copy-to-clipboard {
  visibility: visible;
}
.swagger-ui .curl-command { position: relative; }
.swagger-ui .download-contents {
  background: transparent;
  border: 1px solid var(--dusk-line);
  border-radius: var(--radius);
  color: var(--dusk-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 400;
  width: auto;
  padding: 2px 8px;
}

/* Inline code chips in markdown (md.tsx inline-code recipe). */
.swagger-ui .markdown code, .swagger-ui .renderedMarkdown code {
  background: var(--sunk);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 1px 4px;
}

/* Buttons: one accent, quadratic radius, no bold-for-emphasis. */
.swagger-ui .btn {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.swagger-ui .btn:hover { border-color: var(--ink-faint); box-shadow: none; }
.swagger-ui .btn.execute {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.swagger-ui .btn.execute:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.swagger-ui .btn.authorize {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}
.swagger-ui .btn.authorize span { padding: 4px 10px 0 0; }
.swagger-ui .btn.authorize svg { fill: var(--accent); }
.swagger-ui .btn.cancel { border-color: var(--line-strong); color: var(--ink-muted); }
.swagger-ui .authorization__btn { fill: var(--ink-faint); }
/* Ring for keyboard focus only; a mouse click must not box the row. */
.swagger-ui .model-box-control:focus, .swagger-ui .models-control:focus,
.swagger-ui .opblock-summary-control:focus { outline: none; }
.swagger-ui .model-box-control:focus-visible, .swagger-ui .models-control:focus-visible,
.swagger-ui .opblock-summary-control:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Active tab marker (Parameters / Example Value): the accent hairline, never
   the per-method greens and blues. */
.swagger-ui .opblock .tab-header .tab-item.active h4 span:after,
.swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span:after,
.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after,
.swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span:after,
.swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span:after,
.swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span:after,
.swagger-ui .opblock.opblock-head .tab-header .tab-item.active h4 span:after,
.swagger-ui .opblock.opblock-options .tab-header .tab-item.active h4 span:after {
  background: var(--accent);
  height: 2px;
  bottom: -13px;
}

/* Inputs and selects: controls on paper, hairline borders, 4px. */
.swagger-ui input[type=email], .swagger-ui input[type=file],
.swagger-ui input[type=password], .swagger-ui input[type=search],
.swagger-ui input[type=text], .swagger-ui textarea {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
}
.swagger-ui select {
  background-color: var(--sunk);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
}
.swagger-ui .parameters-col_description input[type=text] { max-width: 340px; }
.swagger-ui .parameters-col_description select { max-width: 340px; }

/* Models: same flat card language. */
.swagger-ui section.models {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.swagger-ui section.models.is-open { padding: 0 0 16px; }
.swagger-ui section.models h4 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.swagger-ui section.models .model-container,
.swagger-ui section.models .model-box {
  background: var(--sunk);
  border-radius: var(--radius);
}
.swagger-ui .model, .swagger-ui .model-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
}
.swagger-ui .model-title { font-size: 14px; }
.swagger-ui .prop-type { color: var(--ink-muted); font-family: var(--font-mono); }
.swagger-ui .prop-format { color: var(--ink-faint); }
.swagger-ui .model .property.primitive { color: var(--ink-faint); }
.swagger-ui .model-toggle:after { opacity: 0.5; }
.swagger-ui .model .brace-open, .swagger-ui .model .brace-close,
.swagger-ui .model .inner-object { color: var(--ink-muted); }

/* Response / media-type pickers, tabs. */
.swagger-ui .tab li { font-family: var(--font-sans); font-size: 12px; color: var(--ink); }
.swagger-ui .tab li button.tablinks { color: var(--ink-muted); }
.swagger-ui .tab li.active button.tablinks, .swagger-ui .tab li.tabitem.active button.tablinks { color: var(--ink); }
.swagger-ui .response-control-media-type__accept-message { color: var(--ink-muted); }
.swagger-ui .response-control-media-type--accept-controller select { border-color: var(--line-strong); }
.swagger-ui .opblock-body .opblock-loading-animation { filter: grayscale(1); }

/* Expand chevrons and misc glyphs read as decoration. */
.swagger-ui .arrow, .swagger-ui .opblock-summary-control svg { fill: var(--ink-faint); }
.swagger-ui .expand-methods svg { fill: var(--ink-faint); }
.swagger-ui .expand-methods:hover svg { fill: var(--ink-muted); }

/* Authorize dialog: paper card, hairline, the one sanctioned shadow. */
.swagger-ui .dialog-ux .backdrop-ux { background: rgba(14, 15, 18, 0.5); }
.swagger-ui .dialog-ux .modal-ux {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(14, 15, 18, 0.18);
}
.swagger-ui .dialog-ux .modal-ux-header { border-bottom: 1px solid var(--line); }
.swagger-ui .dialog-ux .modal-ux-header h3,
.swagger-ui .dialog-ux .modal-ux-content h4,
.swagger-ui .dialog-ux .modal-ux-content h6,
.swagger-ui .auth-container .wrapper,
.swagger-ui .auth-container label {
  font-family: var(--font-sans);
  color: var(--ink);
}
.swagger-ui .dialog-ux .modal-ux-content p { color: var(--ink-muted); font-family: var(--font-sans); }
.swagger-ui .auth-container { border-bottom: 1px solid var(--line); }
.swagger-ui .auth-btn-wrapper { padding: 12px 0; }
.swagger-ui .close-modal { background: transparent; }
.swagger-ui .dialog-ux .modal-ux-header .close-modal svg { fill: var(--ink-faint); }

/* Errors keep their red (true state semantics), on register surfaces. */
.swagger-ui .errors-wrapper {
  background: var(--sunk);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.swagger-ui .errors-wrapper hgroup h4, .swagger-ui .errors-wrapper .errors h4 {
  font-family: var(--font-sans);
  color: var(--ink);
}

/* Deprecation and loading states. */
.swagger-ui .opblock.opblock-deprecated { opacity: 0.65; }
.swagger-ui .loading-container .loading:before {
  border-color: rgba(92, 98, 112, 0.2);
  border-top-color: var(--ink-muted);
}

/* Filter box row, if enabled, stays on register. */
.swagger-ui .filter-container .operation-filter-input { border: 1px solid var(--line-strong); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
