/* Stingray documentation site: page chrome only. Components come from stingray.css; nothing in this file is part of the distributed system.
 * Pages are numbered like a standards document. The canvas is gray, the bar, demo trays and tables are single raised surfaces, and none is nested. */

/* ---------- Frame ---------- */
html { scroll-padding-block-start: calc(var(--sg-size-48) + var(--sg-space-4)); }
.docs-bar { position: sticky; inset-block-start: 0; z-index: calc(var(--sg-layer-sticky) + 1); display: flex; align-items: center; gap: var(--sg-space-4); block-size: var(--sg-size-48); padding-inline: var(--sg-space-4); border-block-end: 1px solid var(--sg-color-border-subtle); background: var(--sg-color-surface-raised); box-shadow: var(--sg-elevation-raised); }
.docs-brand { display: inline-flex; align-items: center; gap: var(--sg-space-3); color: var(--sg-color-text-primary); text-decoration: none; }
.docs-brand__mark { display: inline-flex; flex: none; inline-size: calc(var(--sg-space-8) + var(--sg-space-2)); }
.docs-brand__rel { color: var(--sg-color-text-secondary); font-size: var(--sg-type-heading-4-size); line-height: var(--sg-type-heading-4-line); font-weight: var(--sg-font-weight-regular); }
/* the logo is always the brand blue, on light and on dark surfaces alike */
.docs-logo { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 1337 / 1042; }
.docs-brand__name { font-size: var(--sg-type-heading-4-size); line-height: var(--sg-type-heading-4-line); font-weight: var(--sg-font-weight-semibold); }
.docs-tools { display: flex; align-items: center; gap: var(--sg-space-3); margin-inline-start: auto; }
.docs-menu-button { display: none; }
.docs-shell { display: grid; grid-template-columns: 16.5rem minmax(0, 60rem) 14rem; justify-content: center; align-items: start; }
.docs-nav { position: sticky; inset-block-start: var(--sg-size-48); block-size: calc(100vh - var(--sg-size-48)); overflow-y: auto; padding: var(--sg-space-4) var(--sg-space-2) var(--sg-space-12); }
.docs-nav .sg-input-group { margin: 0 var(--sg-space-2) var(--sg-space-2); }
.docs-nav__empty { padding: var(--sg-space-2) var(--sg-space-3); color: var(--sg-color-text-tertiary); }
.docs-nav .sg-nav__heading:first-of-type { margin-block-start: var(--sg-space-2); }
.docs-toc { position: sticky; inset-block-start: var(--sg-size-48); max-block-size: calc(100vh - var(--sg-size-48)); overflow-y: auto; padding: var(--sg-space-12) var(--sg-space-4) var(--sg-space-8); }
.docs-toc__title { margin-block-end: var(--sg-space-2); color: var(--sg-color-text-tertiary); font-size: var(--sg-type-label-size); line-height: var(--sg-type-label-line); font-weight: var(--sg-font-weight-semibold); }
.docs-toc ol { margin: 0; padding: 0; list-style: none; border-inline-start: 1px solid var(--sg-color-border-subtle); }
.docs-toc a { display: block; margin-inline-start: calc(-1 * var(--sg-stroke-rule)); padding: var(--sg-space-1) var(--sg-space-3); border-inline-start: var(--sg-stroke-rule) solid transparent; color: var(--sg-color-text-secondary); font-size: var(--sg-type-caption-size); line-height: var(--sg-type-caption-line); text-decoration: none; }
.docs-toc a:hover { color: var(--sg-color-text-primary); text-decoration: underline; }
.docs-toc a[aria-current="location"] { border-inline-start-color: var(--sg-color-border-strong); color: var(--sg-color-text-primary); font-weight: var(--sg-font-weight-semibold); }
.docs-drawer { background: var(--sg-page-background); }
.docs-drawer .sg-drawer__header { align-items: center; border-block-end-color: var(--sg-color-border-subtle); }
.docs-drawer .docs-nav { position: static; flex: 1 1 auto; min-block-size: 0; block-size: auto; overflow-y: auto; border: 0; }
/* slow motion (the header toggle): every motion duration four times longer; reduced motion still wins */
@media (prefers-reduced-motion: no-preference) {
  html.docs-slow { --sg-motion-duration-state: calc(var(--sg-motion-duration-fast) * 4); --sg-motion-duration-reveal: calc(var(--sg-motion-duration-base) * 4); --sg-motion-duration-overlay: calc(var(--sg-motion-duration-slow) * 4); --sg-motion-duration-panel: calc(var(--sg-motion-duration-slower) * 4); --sg-motion-duration-stagger: calc(var(--sg-motion-duration-step) * 4); }
}
.docs-drawer__foot { justify-content: flex-start; border-block-start-color: var(--sg-color-border-subtle); }

/* ---------- Page ---------- */
/* docs.js builds the frame (top bar, navigation, contents) after the first paint would happen, so the page stays hidden until it adds docs-ready.
 * The body background still fills the window meanwhile, in the right theme. If the script never runs, the page appears after eight seconds. */
body:not(.docs-ready) { visibility: hidden; animation: docs-reveal 0s 8s forwards; }
@keyframes docs-reveal { to { visibility: visible; } }
/* The manta is the Stingray site's own loader; products use the ring, sg-loader. Its three wing poses: */
:root {
  --docs-manta-up: polygon(35% 20%, 42% 3%, 46% 15%, 50% 13%, 54% 15%, 58% 3%, 65% 20%, 84% 21%, 100% 24%, 72% 56%, 57% 68%, 53% 76%, 51% 100%, 49% 100%, 47% 76%, 43% 68%, 28% 56%, 0% 24%, 16% 21%);
  --docs-manta-level: polygon(35% 20%, 42% 3%, 46% 15%, 50% 13%, 54% 15%, 58% 3%, 65% 20%, 84% 30%, 100% 46%, 72% 62%, 57% 70%, 53% 77%, 51% 100%, 49% 100%, 47% 77%, 43% 70%, 28% 62%, 0% 46%, 16% 30%);
  --docs-manta-down: polygon(35% 20%, 42% 3%, 46% 15%, 50% 13%, 54% 15%, 58% 3%, 65% 20%, 84% 39%, 100% 64%, 72% 68%, 57% 72%, 53% 78%, 51% 100%, 49% 100%, 47% 78%, 43% 72%, 28% 68%, 0% 64%, 16% 39%);
}
@keyframes docs-swim {
  0%, 100% { clip-path: var(--docs-manta-up); translate: 0 4%; }
  50% { clip-path: var(--docs-manta-down); translate: 0 -4%; }
}
/* While the page is hidden, the manta swims at the center of the window, in the brand blue of the mark.
 * It waits a quarter second before showing, so a fast load never flashes it. On the first visit to the Overview (html.docs-intro)
 * it shows at once, and docs.js holds the page until one second has passed. It leaves with the safety net above. */
body:not(.docs-ready)::before { content: ""; position: fixed; inset: 0; margin: auto; inline-size: 4rem; block-size: 4rem; background: var(--sg-color-action-primary); clip-path: var(--docs-manta-level); visibility: visible; opacity: 0; animation: docs-swim var(--sg-motion-duration-loop) ease-in-out infinite, docs-loader-in 0.2s 0.25s forwards, docs-loader-out 0s 8s forwards; }
.docs-intro body:not(.docs-ready)::before { animation-delay: 0s, 0s, 8s; }
@keyframes docs-loader-in { to { opacity: 1; } }
@keyframes docs-loader-out { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { body:not(.docs-ready)::before { animation: docs-loader-in 0s 0.25s forwards, docs-loader-out 0s 8s forwards; } .docs-intro body:not(.docs-ready)::before { animation-delay: 0s, 8s; } }
@media (forced-colors: active) { body:not(.docs-ready)::before { forced-color-adjust: none; background: CanvasText; } }
@media print { body:not(.docs-ready)::before { display: none; } }
/* the column is the container for the section grids (why, component tiles) */
.docs-main { container-type: inline-size; min-inline-size: 0; padding: var(--sg-space-12) var(--sg-space-8) var(--sg-space-16); }
.docs-head { margin-block-end: var(--sg-space-12); }
.docs-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-2) var(--sg-space-6); margin-block: var(--sg-space-2) var(--sg-space-4); }
.docs-head .docs-head__title > h1 { margin-block: 0; }
.docs-eyebrow { display: flex; align-items: center; gap: var(--sg-space-2); color: var(--sg-color-text-secondary); font-size: var(--sg-type-label-size); line-height: var(--sg-type-label-line); font-weight: var(--sg-font-weight-semibold); }
.docs-eyebrow .sg-icon { --sg-icon-size: var(--sg-size-icon-small); }
.docs-head h1 { margin-block: var(--sg-space-2) var(--sg-space-4); font-size: var(--sg-type-display-size); line-height: var(--sg-type-display-line); font-weight: var(--sg-type-display-weight); letter-spacing: var(--sg-type-display-tracking); }
.docs-lead { max-inline-size: 46rem; color: var(--sg-color-text-secondary); font-size: var(--sg-type-heading-3-size); line-height: var(--sg-type-heading-3-line); }
/* page facts under the lead: a small label over its value, so the facts read at a glance; the rule above stays */
.docs-meta { display: flex; flex-wrap: wrap; gap: var(--sg-space-4) var(--sg-space-8); margin-block-start: var(--sg-space-6); padding-block-start: var(--sg-space-4); border-block-start: 1px solid var(--sg-color-border-subtle); }
.docs-meta div { display: flex; flex-direction: column; gap: var(--sg-space-1); min-inline-size: 0; }
.docs-meta dt { color: var(--sg-color-text-tertiary); font-size: var(--sg-type-label-size); line-height: var(--sg-type-label-line); font-weight: var(--sg-type-label-weight); }
.docs-meta dd { color: var(--sg-color-text-primary); font-size: var(--sg-type-body-size); line-height: var(--sg-type-body-line); }
.docs-main > section { margin-block-start: var(--sg-space-12); scroll-margin-block-start: calc(var(--sg-size-48) + var(--sg-space-6)); }
.docs-main > section > * + * { margin-block-start: var(--sg-space-4); }
.docs-main > section > h2 { display: flex; align-items: baseline; gap: var(--sg-space-3); font-size: var(--sg-type-heading-2-size); line-height: var(--sg-type-heading-2-line); font-weight: var(--sg-type-heading-2-weight); letter-spacing: var(--sg-type-heading-2-tracking); }
.docs-main > section > h2::before { content: attr(data-n); min-inline-size: 1.75rem; color: var(--sg-color-text-tertiary); font-size: var(--sg-type-body-size); font-weight: var(--sg-font-weight-regular); font-variant-numeric: tabular-nums; }
.docs-main h3:where(:not([class*="sg-"])) { margin-block-start: var(--sg-space-8); font-size: var(--sg-type-heading-3-size); line-height: var(--sg-type-heading-3-line); font-weight: var(--sg-type-heading-3-weight); scroll-margin-block-start: calc(var(--sg-size-48) + var(--sg-space-6)); }
.docs-main h3.docs-sub { margin-block-start: var(--sg-space-2); font-size: var(--sg-type-heading-4-size); line-height: var(--sg-type-heading-4-line); font-weight: var(--sg-type-heading-4-weight); }
.docs-main h4:where(:not([class*="sg-"])) { margin-block-start: var(--sg-space-6); font-size: var(--sg-type-heading-4-size); line-height: var(--sg-type-heading-4-line); font-weight: var(--sg-type-heading-4-weight); }
.docs-main section > :is(p, ul, ol):where(:not([class*="sg-"])), .docs-block > :is(p, ul, ol) { max-inline-size: 70ch; font-size: var(--sg-type-body-large-size); line-height: var(--sg-type-body-large-line); }
.docs-main section > :is(ul, ol):where(:not([class*="sg-"])) { padding-inline-start: var(--sg-space-6); }
.docs-main section li:where(:not([class*="sg-"])) + li:where(:not([class*="sg-"])) { margin-block-start: var(--sg-space-1); }
.docs-main strong { font-weight: var(--sg-font-weight-semibold); }
.docs-main :not(pre) > code { padding: 0 var(--sg-space-1); border-radius: var(--sg-radius-mark); background: var(--sg-code-background); font-size: 0.92em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.docs-anchor { margin-inline-start: var(--sg-space-2); color: var(--sg-color-text-tertiary); text-decoration: none; opacity: 0; }
:is(h2, h3):hover > .docs-anchor, .docs-anchor:focus-visible { opacity: 1; }
.docs-note { color: var(--sg-color-text-secondary); font-size: var(--sg-type-caption-size); line-height: var(--sg-type-caption-line); }
.docs-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sg-space-4); margin-block-start: var(--sg-space-16); }
.docs-pager a { display: grid; gap: var(--sg-space-1); min-inline-size: min(12rem, 100%); padding: var(--sg-space-3) var(--sg-space-4); border: 1px solid var(--sg-color-border-subtle); border-radius: var(--sg-radius-container); background: var(--sg-color-surface-raised); box-shadow: var(--sg-elevation-raised); color: var(--sg-color-text-primary); text-decoration: none; }
.docs-pager a:last-child { text-align: end; margin-inline-start: auto; }
.docs-pager small { color: var(--sg-color-text-tertiary); font-size: var(--sg-type-caption-size); }
.docs-pager strong { font-size: var(--sg-type-heading-4-size); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: var(--sg-space-1); }
.docs-pager a:hover { border-color: var(--sg-color-border-control); }
.docs-pager a:hover strong { text-decoration-thickness: 2px; }

/* ---------- Live demos ---------- */
.docs-demo { overflow: hidden; border: 1px solid var(--sg-color-border-subtle); border-radius: var(--sg-radius-container); background: var(--sg-color-surface-sunken); }
.docs-demo__preview { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-4); padding: var(--sg-space-6); overflow-wrap: anywhere; background: var(--sg-color-surface-sunken); color: var(--sg-page-text); }
:where(.docs-demo__preview) > * { min-inline-size: 0; } /* zero specificity, so components keep their own minimum width */
.docs-demo--stack .docs-demo__preview { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
.docs-demo--flush .docs-demo__preview { padding: 0; }
.docs-demo--top .docs-demo__preview { align-items: flex-start; }
/* a whole-window frame, drawn at three quarters so its desktop layout fits the docs column */
.docs-demo--zoom .docs-demo__preview { zoom: 0.75; }
.docs-demo--subtle .docs-demo__preview { background: var(--sg-color-surface-inset); }
.docs-demo__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-1); padding: var(--sg-space-1) var(--sg-space-2); border-block-start: 1px solid var(--sg-color-border-subtle); background: var(--sg-color-surface-raised); }
.docs-demo__bar .docs-note { margin-inline-end: auto; padding-inline-start: var(--sg-space-2); }
.docs-demo__code { border: 0; border-radius: 0; border-block-start: 1px solid var(--sg-color-border-subtle); max-block-size: 28rem; }
.docs-demo__code[hidden] { display: none; }
.docs-code { position: relative; }
.docs-source-bar { margin-block-end: var(--sg-space-3); }
.docs-code > .sg-code-block { padding-block-start: var(--sg-space-6); }
.docs-code__label { position: absolute; inset-block-start: var(--sg-space-1); inset-inline-start: var(--sg-space-3); color: var(--sg-color-text-tertiary); font-size: var(--sg-type-label-size); line-height: var(--sg-type-label-line); font-weight: var(--sg-font-weight-semibold); }
.docs-code__copy { position: absolute; inset-block-start: var(--sg-space-1); inset-inline-end: var(--sg-space-1); }
.docs-code .sg-code-block { max-block-size: 32rem; }

/* ---------- Ledger tables, do and don't, swatches ---------- */
.docs-ledger { inline-size: 100%; }
.docs-ledger :where(th, td) { block-size: auto; padding: var(--sg-space-3); vertical-align: top; white-space: normal; }
.docs-ledger :where(th, td):first-child { padding-inline-start: var(--sg-space-4); }
.docs-ledger :where(th, td):last-child { padding-inline-end: var(--sg-space-4); }
.docs-ledger th[scope="row"] { min-inline-size: 9rem; }
.docs-ledger td:first-child, .docs-ledger th[scope="row"] { font-weight: var(--sg-font-weight-semibold); }
.docs-ledger .sg-num, .docs-ledger .sg-num-end { white-space: nowrap; }
.docs-ledger td:first-child > code { white-space: nowrap; overflow-wrap: normal; }
.docs-ledger thead th { position: static; }
.docs-ledger--tight :where(th, td) { padding-block: var(--sg-space-2); }
.docs-fit .sg-table :where(th, td) { white-space: normal; block-size: auto; padding-block: var(--sg-space-2); vertical-align: top; }
.docs-dodont { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--sg-space-6); }
.docs-do, .docs-dont { --_c: var(--sg-color-feedback-success-icon); display: flex; flex-direction: column; gap: var(--sg-space-3); margin: 0; }
.docs-dont { --_c: var(--sg-color-feedback-error-icon); }
.docs-do__frame { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-3); min-block-size: 6rem; padding: var(--sg-space-4); border: 1px solid var(--sg-color-border-subtle); border-radius: var(--sg-radius-container); background: var(--sg-color-surface-sunken); }
.docs-do figcaption, .docs-dont figcaption { display: flex; gap: var(--sg-space-2); align-items: flex-start; font-size: var(--sg-type-body-size); }
.docs-do figcaption .sg-icon, .docs-dont figcaption .sg-icon { --sg-icon-size: var(--sg-size-icon-medium); margin-block-start: 0; color: var(--_c); }
.docs-do figcaption strong, .docs-dont figcaption strong { display: block; }
.docs-swatch { display: inline-block; inline-size: var(--sg-size-24); block-size: var(--sg-size-24); border: 1px solid var(--sg-color-border-default); border-radius: var(--sg-radius-mark); vertical-align: middle; }
.docs-swatch--pair { display: inline-flex; inline-size: auto; border: 0; gap: 0; }
.docs-swatch--pair > i { display: block; inline-size: var(--sg-size-24); block-size: var(--sg-size-24); border: 1px solid var(--sg-color-border-default); }
.docs-swatch--pair > i:first-child { border-start-start-radius: var(--sg-radius-mark); border-end-start-radius: var(--sg-radius-mark); }
.docs-swatch--pair > i:last-child { margin-inline-start: -1px; border-start-end-radius: var(--sg-radius-mark); border-end-end-radius: var(--sg-radius-mark); }
.docs-ramp { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr)); overflow: hidden; border: 1px solid var(--sg-color-border-default); border-radius: var(--sg-radius-control); }
.docs-ramp > i { display: block; block-size: var(--sg-space-8); }
.docs-chip { display: flex; flex-direction: column; gap: var(--sg-space-1); padding: 0 0 var(--sg-space-2); font-size: var(--sg-type-caption-size); line-height: var(--sg-type-caption-line); font-variant-numeric: tabular-nums; color: var(--sg-color-text-secondary); }
.docs-chip i { display: block; block-size: var(--sg-space-8); margin-block-end: var(--sg-space-1); border: 1px solid var(--sg-color-border-subtle); border-radius: var(--sg-radius-control); }
.docs-chip b { padding-inline: var(--sg-space-2); font-weight: var(--sg-font-weight-semibold); color: var(--sg-color-text-primary); }
.docs-chip span { padding-inline: var(--sg-space-2); }
.docs-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: var(--sg-space-8) var(--sg-space-6); align-items: start; }
.docs-cols > * { min-inline-size: 0; }
.docs-cols--3 { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.docs-cols > .sg-panel { align-self: stretch; }
.docs-main .sg-panel__title { margin-block-start: 0; }
.docs-list-plain { padding: 0; list-style: none; }
.docs-list-plain li + li { margin-block-start: var(--sg-space-2); }
.docs-list-forbid { padding: 0; list-style: none; }
.docs-list-forbid li { display: grid; grid-template-columns: var(--sg-size-icon-medium) 1fr; gap: var(--sg-space-3); padding-block: var(--sg-space-3); border-block-end: 1px solid var(--sg-color-border-subtle); }
.docs-list-forbid li > .sg-icon { color: var(--sg-color-feedback-error-icon); margin-block-start: var(--sg-space-1); }
.docs-list-forbid li + li { margin-block-start: 0; }
.docs-list-forbid strong { display: block; }
.docs-list-forbid span { color: var(--sg-color-text-secondary); }
.docs-principles { counter-reset: pr; padding: 0; list-style: none; }
.docs-principles > li { counter-increment: pr; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: var(--sg-space-2) var(--sg-space-4); padding-block: var(--sg-space-4); border-block-start: 1px solid var(--sg-color-border-subtle); }
.docs-principles > li::before { content: counter(pr, decimal-leading-zero); color: var(--sg-color-text-tertiary); font-variant-numeric: tabular-nums; }
.docs-principles h3 { margin: 0; font-size: var(--sg-type-heading-4-size); line-height: var(--sg-type-heading-4-line); }
.docs-principles dl { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--sg-space-1) var(--sg-space-3); margin-block-start: var(--sg-space-2); font-size: var(--sg-type-body-size); }
.docs-principles dt { color: var(--sg-color-text-tertiary); font-weight: var(--sg-font-weight-semibold); }
.docs-principles dd { margin: 0; color: var(--sg-color-text-secondary); }
.docs-principles dd b { color: var(--sg-color-text-primary); font-weight: var(--sg-font-weight-semibold); }
.docs-manifesto { max-inline-size: 46rem; padding: var(--sg-space-8); border: 1px solid var(--sg-color-border-subtle); border-radius: var(--sg-radius-container); background: var(--sg-color-surface-raised); box-shadow: var(--sg-elevation-raised); font-size: var(--sg-type-heading-3-size); line-height: var(--sg-type-heading-3-line); }
.docs-manifesto p + p { margin-block-start: 0; }
.docs-manifesto sup { line-height: 0; color: var(--sg-color-text-tertiary); font-size: var(--sg-type-caption-size); font-variant-numeric: tabular-nums; }
.docs-token { font-variant-numeric: tabular-nums; white-space: nowrap; }
.docs-token--wrap { white-space: normal; }
.docs-mono { font-variant-numeric: tabular-nums; }
.docs-scale-bar { display: block; block-size: var(--sg-space-3); background: var(--sg-color-text-primary); }


/* ---------- 4pt grid overlay (a documentation tool) ---------- */
.docs-show-grid::after { content: ""; position: fixed; inset: 0; z-index: 900; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M0 .5H16M0 4.5H16M0 8.5H16M0 12.5H16' stroke='%23d63330' stroke-opacity='.22'/%3E%3Cpath d='M0 .5H16' stroke='%23d63330' stroke-opacity='.5'/%3E%3C/svg%3E"); }

/* ---------- Details, nav helpers ---------- */
.docs-details { border-block-start: 1px solid var(--sg-color-border-default); }
.docs-details > summary { display: flex; align-items: center; gap: var(--sg-space-2); min-block-size: var(--sg-size-control-small); cursor: pointer; font-weight: var(--sg-font-weight-semibold); list-style: none; }
.docs-details > summary::-webkit-details-marker { display: none; }
.docs-details > summary::before { content: ""; inline-size: var(--sg-size-icon-small); block-size: var(--sg-size-icon-small); background-color: currentColor; -webkit-mask: var(--sg-i-right-line) center / contain no-repeat; mask: var(--sg-i-right-line) center / contain no-repeat; transition: rotate var(--sg-motion-duration-reveal) var(--sg-motion-easing-enter); forced-color-adjust: none; }
.docs-details[open] > summary::before { rotate: 90deg; }
[dir="rtl"] .docs-details > summary::before { rotate: 180deg; }
[dir="rtl"] .docs-details[open] > summary::before { rotate: 90deg; }
.docs-details > :not(summary) { margin-block-start: var(--sg-space-3); }

/* ---------- Responsive and print ---------- */
@media (max-width: 80rem) { .docs-shell { grid-template-columns: 16.5rem minmax(0, 60rem); } .docs-toc { display: none; } }
@media (max-width: 60rem) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .docs-shell > .docs-nav { display: none; }
  .docs-menu-button { display: inline-flex; }
  .docs-main { padding: var(--sg-space-8) var(--sg-space-4) var(--sg-space-12); }
  .docs-tools .docs-density, .docs-tools .docs-gridtoggle, .docs-tools .docs-slowtoggle { display: none; }
  .docs-head h1 { font-size: var(--sg-type-heading-1-size); line-height: var(--sg-type-heading-1-line); }
}
@media (max-width: 40rem) { .docs-tools .docs-theme .sg-segmented__item { padding-inline: var(--sg-space-2); } }
@media (max-width: 24rem) { .docs-brand__name, .docs-brand__rel { display: none; } }
@media print {
  .docs-bar, .docs-nav, .docs-toc, .docs-pager, .docs-footer, .docs-demo__bar, .docs-code__copy, .docs-anchor { display: none !important; }
  .docs-shell { display: block; }
  .docs-main { padding: 0; }
  .docs-demo__code[hidden] { display: none; }
}

/* ---------- Overview page: hero, live sample, tiles ---------- */
body[data-page="index"] .docs-toc { display: none; }
@media (min-width: 60.0625rem) { body[data-page="index"] .docs-shell { grid-template-columns: 16.5rem minmax(0, 74rem); } }
.docs-hero { max-inline-size: 32rem; padding-block: var(--sg-space-12) var(--sg-space-16); margin-block-end: var(--sg-space-8); }
.docs-hero__brand { margin: 0; font-size: var(--sg-type-heading-2-size); line-height: var(--sg-type-heading-2-line); letter-spacing: var(--sg-type-heading-2-tracking); }
.docs-hero__name { font-weight: var(--sg-type-heading-2-weight); letter-spacing: var(--sg-type-heading-2-tracking); }
.docs-hero__rel { color: var(--sg-color-text-secondary); font-weight: var(--sg-font-weight-regular); }
.docs-hero h1 { margin-block: var(--sg-space-4); font-size: var(--sg-type-hero-size); line-height: var(--sg-type-hero-line); font-weight: var(--sg-type-hero-weight); letter-spacing: var(--sg-type-hero-tracking); }
.docs-hero .docs-lead { max-inline-size: 32rem; }
.docs-hero__cta { margin-block-start: var(--sg-space-8); }
/* The Stingray mark, outlined in brand blue, behind the Overview. It belongs to the page, so it scrolls with it.
 * Wide screens: it starts just past the hero copy, so its lines never cross text, and the panels below cover it.
 * Narrower screens: it sits above the headline, and the hero makes room for it. */
body[data-page="index"] { position: relative; }
.docs-backdrop { --_start: calc(max(0px, (100% - 90.5rem) / 2) + 16.5rem + var(--sg-space-8)); --_left: calc(var(--_start) + 34rem); position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.docs-backdrop img { position: absolute; inset-block-start: 6rem; inset-inline-start: var(--_left); inline-size: clamp(48rem, calc((100% - var(--_left)) / 0.88), 72rem); max-inline-size: none; block-size: auto; }
@media (max-width: 85rem) {
  .docs-backdrop img { --_w: min(40rem, 90vw); inset-block-start: 5rem; inset-inline-start: calc(100% - 0.85 * var(--_w)); inline-size: var(--_w); }
  body[data-page="index"] .docs-hero { padding-block-start: calc(0.5 * min(40rem, 90vw)); }
}
/* Getting started: the manta, outlined in brand blue, upside down, straight, gliding in from the right edge.
 * It sits behind everything and scrolls with the page; raised panels cover it where they meet. */
body[data-page="developers"] { position: relative; }
.docs-backdrop--manta img { inset-block-start: 3rem; inset-inline-start: auto; inset-inline-end: -14rem; inline-size: clamp(32rem, 44vw, 56rem); rotate: 180deg; }
@media (max-width: 60rem) { .docs-backdrop--manta img { inset-block-start: 3rem; inset-inline-end: -40vw; inline-size: 95vw; } }
@media print, (forced-colors: active) { .docs-backdrop { display: none; } }

/* Why Stingray: one raised strip; each cell draws its hairline on the leading and top edges, and the strip clips the outer ones */
.docs-main section > .docs-why { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-inline-size: none; margin-block-start: var(--sg-space-4); padding: 0; overflow: hidden; list-style: none; border: 1px solid var(--sg-color-border-subtle); border-radius: var(--sg-radius-container); background: var(--sg-color-surface-raised); box-shadow: var(--sg-elevation-raised); font-size: var(--sg-type-body-size); line-height: var(--sg-type-body-line); }
.docs-main .docs-why > li { display: grid; align-content: start; gap: var(--sg-space-2); margin: 0; padding: var(--sg-space-6); box-shadow: -1px 0 0 0 var(--sg-color-border-subtle), 0 -1px 0 0 var(--sg-color-border-subtle); }
.docs-why .sg-icon { --sg-icon-size: var(--sg-size-icon-large); margin-block-end: var(--sg-space-2); }
.docs-main .docs-why h3 { margin: 0; font-size: var(--sg-type-heading-4-size); line-height: var(--sg-type-heading-4-line); font-weight: var(--sg-type-heading-4-weight); }
.docs-why p { margin: 0; color: var(--sg-color-text-secondary); }
/* columns follow the width of the section, not the window: four, then two, then one */
@container (max-width: 56rem) { .docs-main section > .docs-why { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 30rem) { .docs-main section > .docs-why { grid-template-columns: minmax(0, 1fr); } }

/* start panels */
.docs-start .sg-panel { display: flex; flex-direction: column; gap: var(--sg-space-3); }
.docs-start .sg-panel > * { margin: 0; }
.docs-start__icon { --sg-icon-size: var(--sg-size-icon-large); }
.docs-start .sg-panel p:not(.docs-note) { color: var(--sg-color-text-secondary); font-size: var(--sg-type-body-size); line-height: var(--sg-type-body-line); }
.docs-start .docs-list-plain { padding: 0; }
.docs-start__go { display: inline-flex; align-items: center; gap: var(--sg-space-1); margin-block-start: auto; padding-block-start: var(--sg-space-2); font-weight: var(--sg-font-weight-semibold); }
.docs-main section > .docs-start p { max-inline-size: none; }

/* tiles: a single raised surface each, with a specimen on an inset stage above the words */
.docs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: var(--sg-space-4); }
.docs-tiles--3 { grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); }
.docs-tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (max-width: 48rem) { .docs-tiles--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 26rem) { .docs-tiles--4 { grid-template-columns: minmax(0, 1fr); } }
.docs-tile { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--sg-color-border-subtle); border-radius: var(--sg-radius-container); background: var(--sg-color-surface-raised); box-shadow: var(--sg-elevation-raised); color: var(--sg-color-text-primary); text-decoration: none; }
.docs-tile:hover { border-color: var(--sg-color-border-control); }
.docs-tile__spec { display: grid; place-items: center; block-size: 7.5rem; padding: var(--sg-space-3); border-block-end: 1px solid var(--sg-color-border-subtle); background: var(--sg-color-surface-inset); }
/* the component tiles show a render: cropped to 16:9, which trims only empty backdrop */
.docs-tile__img { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 16 / 9; object-fit: cover; border-block-end: 1px solid var(--sg-color-border-subtle); background: var(--sg-color-surface-inverse); }
.docs-tile__text { padding: var(--sg-space-4); }
.docs-main .docs-tile h3 { margin: 0; font-size: var(--sg-type-heading-4-size); line-height: var(--sg-type-heading-4-line); font-weight: var(--sg-type-heading-4-weight); }
.docs-tile p { margin: var(--sg-space-1) 0 0; color: var(--sg-color-text-secondary); font-size: var(--sg-type-body-size); line-height: var(--sg-type-body-line); }
.docs-main section > .docs-tiles { max-inline-size: none; }
.docs-strips { display: grid; gap: var(--sg-space-1); inline-size: 100%; }
.docs-strip { display: flex; gap: 2px; }
.docs-strip > i { flex: 1; block-size: var(--sg-space-4); border-radius: var(--sg-radius-mark); }
.docs-spec-type { display: flex; align-items: baseline; gap: var(--sg-space-3); }
.docs-spec-type__aa { font-size: var(--sg-type-hero-size); line-height: var(--sg-type-hero-line); font-weight: var(--sg-type-hero-weight); letter-spacing: var(--sg-type-hero-tracking); }
.docs-spec-type__chars { font-size: var(--sg-type-heading-3-size); line-height: var(--sg-type-heading-3-line); letter-spacing: 0.04em; }
.docs-spec-space { display: flex; align-items: flex-end; gap: var(--sg-space-1); }
.docs-spec-space > i { display: block; background: var(--sg-color-text-primary); border-radius: var(--sg-radius-mark); }
.docs-spec-icons { display: grid; grid-template-columns: repeat(4, auto); gap: var(--sg-space-3) var(--sg-space-4); }
.docs-spec-levels { position: relative; inline-size: 9rem; block-size: 5rem; }
.docs-spec-levels > i { position: absolute; display: block; }
.docs-spec-levels__raised { inset-block: 0 var(--sg-space-2); inset-inline: 0 var(--sg-space-6); border: 1px solid var(--sg-panel-border); border-radius: var(--sg-radius-container); background: var(--sg-panel-background); box-shadow: var(--sg-panel-shadow); }
.docs-spec-levels__overlay { inset-block: var(--sg-space-6) 0; inset-inline: var(--sg-space-6) 0; border: 1px solid var(--sg-menu-border); border-radius: var(--sg-radius-float); background: var(--sg-menu-background); box-shadow: var(--sg-menu-shadow); }
.docs-spec-status { display: grid; gap: var(--sg-space-1); }

/* side-by-side demo: the result on the left, the exact markup on the right */
.docs-demo--split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.docs-demo--split .docs-demo__preview { grid-column: 1; grid-row: 1; align-items: flex-start; }
.docs-demo--split .docs-demo__bar { grid-column: 1; grid-row: 2; }
.docs-demo--split .docs-demo__code { grid-column: 2; grid-row: 1 / 3; max-block-size: none; border-block-start: 0; border-inline-start: 1px solid var(--sg-color-border-subtle); }
.docs-demo--split .docs-demo__preview > * { inline-size: 100%; }

/* principles and refusals read in two columns on wide screens */
.docs-main section > :is(.docs-principles, .docs-list-forbid) { max-inline-size: none; font-size: var(--sg-type-body-size); line-height: var(--sg-type-body-line); }
@media (min-width: 64rem) {
  .docs-principles, .docs-list-forbid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sg-space-12); }
  .docs-principles > li { border-block-start: 1px solid var(--sg-color-border-subtle); }
  .docs-list-forbid li { align-content: start; }
}
@media (max-width: 60rem) { .docs-demo--split { grid-template-columns: minmax(0, 1fr); } .docs-demo--split .docs-demo__code { grid-column: 1; grid-row: 3; border-inline-start: 0; border-block-start: 1px solid var(--sg-color-border-subtle); } .docs-hero h1 { font-size: var(--sg-type-display-size); line-height: var(--sg-type-display-line); } }

/* ---------- Footer ---------- */
.docs-footer { display: grid; gap: var(--sg-space-4); margin-block-start: var(--sg-space-8); padding: var(--sg-space-8) var(--sg-space-6); border-block-start: 1px solid var(--sg-color-border-subtle); background: var(--sg-color-surface-raised); }
.docs-footer > * { inline-size: 100%; max-inline-size: 90rem; margin-inline: auto; }
.docs-footer__grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sg-space-4) var(--sg-space-8); }
.docs-footer__brand { display: flex; align-items: center; gap: var(--sg-space-3); }
.docs-footer__name { margin: 0; font-weight: var(--sg-font-weight-semibold); }
.docs-footer__brand p { margin: 0; }
.docs-footer__nav { display: flex; flex-wrap: wrap; gap: var(--sg-space-1) var(--sg-space-6); }
.docs-footer__nav a { color: var(--sg-color-text-primary); }
.docs-footer__legal { display: flex; flex-wrap: wrap; gap: var(--sg-space-1) var(--sg-space-6); margin-block: 0; padding-block-start: var(--sg-space-4); border-block-start: 1px solid var(--sg-color-border-subtle); color: var(--sg-color-text-secondary); font-size: var(--sg-type-caption-size); line-height: var(--sg-type-caption-line); }
.docs-footer__by { display: flex; align-items: center; gap: var(--sg-space-2); color: var(--sg-color-text-secondary); font-size: var(--sg-type-caption-size); line-height: var(--sg-type-caption-line); }
.docs-footer__by a { display: inline-flex; text-decoration: none; }
.docs-footer__by img { display: block; block-size: var(--sg-size-20); inline-size: auto; }

.docs-gray { filter: grayscale(1); }
.docs-glyphs { display: flex; flex-wrap: wrap; gap: var(--sg-space-6); font-size: var(--sg-type-display-size); line-height: var(--sg-type-display-line); font-weight: var(--sg-font-weight-semibold); }
.docs-glyphs span small { display: block; color: var(--sg-color-text-tertiary); font-size: var(--sg-type-caption-size); line-height: var(--sg-type-caption-line); font-weight: var(--sg-font-weight-regular); }

.docs-chain { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid var(--sg-color-border-default); }
.docs-chain li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-2); padding-block: var(--sg-space-3); border-block-end: 1px solid var(--sg-color-border-subtle); }
.docs-chain b { min-inline-size: 3rem; font-weight: var(--sg-font-weight-semibold); }
.docs-chain code { padding: 0 var(--sg-space-1); border: 1px solid var(--sg-color-border-default); border-radius: var(--sg-radius-mark); background: var(--sg-color-surface-raised); font-variant-numeric: tabular-nums; white-space: nowrap; }
.docs-orb { display: grid; justify-items: center; gap: var(--sg-space-2); margin: 0; color: var(--sg-color-text-secondary); font-size: var(--sg-type-caption-size); line-height: var(--sg-type-caption-line); }
