/* October 2026 redesign: the documentation layout (site/docs/**, also docs.fibric.io).
   Written into pages by tools/gen-docs-nav.mjs. Kit classes live in r26.css; the
   type and colour follow the editorial system in r26-editorial.css.

   Shape:  .docs-sub (search bar)  ·  .docs__bar (crumbs + maturity)
           .docs__shell = [ rail | main | toc ]                                   */

/* Docs pages keep their per-page component styles, which read the shared tokens.
   The redesign is light-only, so the light token set is pinned here whatever an
   older appearance preference stored. */
body.docs-body{
  color-scheme:light;
  --paper:#fff;--paper-2:#f4f5f8;--paper-3:#e7eaf0;--card:#fff;
  --ink:#131417;--ink-2:#40454d;--mid:#5d636d;--faint:#5d636d;
  --line:#dfe3ec;--line-2:#c9cfdb;
  --accent:#2450e8;--accent-text:#1d43d0;--link:#1d43d0;
  --green:#1e7a46;--coral:#b42318;
  --shadow-float:0 2px 6px rgba(19,20,23,.06),0 24px 48px -20px rgba(19,20,23,.28);
  background:#f4f5f8;color:#131417;
}

/* ---- docs bar: label, search, section links ---- */
.docs-sub{position:sticky;top:72px;z-index:40;background:#fff;border-bottom:1px solid #dfe3ec}
.docs-sub__in{max-width:1344px;margin:0 auto;padding:0 48px;height:60px;display:flex;align-items:center;gap:24px}
.docs-sub__label{font-size:17px;font-weight:700;letter-spacing:-0.02em;display:inline-flex;align-items:center;gap:8px}
.docs-sub__label::before{content:"";width:8px;height:8px;border-radius:50%;background:#2450e8}
.docs-sub__links{display:flex;gap:24px;margin-left:auto;font-size:14px;font-weight:600}
.docs-sub__links a{color:#4a4f58;transition:color 160ms ease}

/* search (wired by /docs/docs-nav.js) */
.docs-search{position:relative;flex:0 1 380px;min-width:0}
.docs-search__input{width:100%;box-sizing:border-box;height:40px;border:1px solid #dfe3ec;border-radius:999px;padding:0 16px 0 40px;font-size:14.5px;font-weight:500;background:#f4f5f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235d636d' stroke-width='1.8'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l3.5 3.5'/%3E%3C/svg%3E") no-repeat 16px 50%;color:#131417;-webkit-appearance:none;appearance:none;transition:border-color 160ms ease,background-color 160ms ease}
.docs-search__input::placeholder{color:#5d636d}
.docs-search__input:focus{outline:2px solid #2450e8;outline-offset:1px;background-color:#fff;border-color:#2450e8}
.docs-search__panel{position:absolute;top:calc(100% + 8px);left:0;right:0;min-width:300px;z-index:70;background:#fff;border:1px solid #dfe3ec;border-radius:12px;box-shadow:0 2px 6px rgba(19,20,23,.06),0 24px 48px -20px rgba(19,20,23,.28);padding:6px;max-height:70vh;overflow:auto}
.docs-search:not(.no-motion) .docs-search__panel{animation:docs-search-in 140ms cubic-bezier(.23,1,.32,1)}
@keyframes docs-search-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.docs-search__item{display:flex;align-items:baseline;justify-content:space-between;gap:16px;padding:10px 12px;border-radius:8px;font-size:14.5px;line-height:1.35}
.docs-search__item.is-active{background:#eef1fb}
.docs-search__item.is-active .docs-search__title{color:#1d43d0}
.docs-search__title{font-weight:700}
.docs-search__sec{font-size:12.5px;font-weight:650;color:#5d636d;white-space:nowrap}
.docs-search__empty{margin:0;padding:10px 12px;font-size:14px;color:#4a4f58}

/* ---- crumbs + maturity row ---- */
.docs__bar{max-width:1344px;margin:0 auto;padding:28px 48px 0;display:flex;align-items:center;gap:12px 20px;flex-wrap:wrap}
.docs__bar-spacer{flex:1 1 auto}
.crumb{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:14px;font-weight:600;color:#4a4f58}
.crumb a{color:#1d43d0;transition:color 160ms ease}
.crumb .sep{color:#737983}
.crumb [aria-current]{color:#131417}
.ver-pill{display:inline-flex;align-items:center;gap:8px;height:30px;padding:0 12px;border-radius:999px;background:#fff;border:1px solid #dfe3ec;font-size:12.5px;font-weight:650;color:#131417;white-space:nowrap}
.ver-pill .dot{width:8px;height:8px;border-radius:50%;background:#fff252;box-shadow:0 0 0 1.5px #131417}

/* ---- the grid ---- */
.docs__shell{max-width:1344px;margin:0 auto;padding:32px 48px 120px;display:grid;grid-template-columns:232px minmax(0,1fr) 200px;gap:56px;align-items:start}

/* left rail */
.docs__rail{position:sticky;top:156px;max-height:calc(100vh - 176px);overflow-y:auto;overscroll-behavior:contain;padding:0 4px 24px 0;font-size:14.5px;scrollbar-width:thin;scrollbar-color:#dfe3ec transparent}
.rail-sec{margin-bottom:26px}
.rail-sec > .rail-h{margin:0 0 8px 12px;font-size:13px;font-weight:700;color:#5d636d}
.docs__rail a{display:block;padding:7px 12px;border-radius:8px;border:1px solid transparent;color:#40454d;line-height:1.35;transition:background-color 160ms ease,border-color 160ms ease,color 160ms ease}
.docs__rail a[aria-current]{background:#fff;border-color:#dfe3ec;color:#131417;font-weight:700}
.docs-mobile-toggle{display:none}

/* right "On this page" */
.docs__toc{position:sticky;top:156px;max-height:calc(100vh - 176px);overflow-y:auto;font-size:13.5px}
.docs__toc-h{margin:0 0 12px;font-size:13px;font-weight:700;color:#5d636d}
.docs__toc a{display:block;padding:6px 0 6px 14px;border-left:2px solid #dfe3ec;color:#4a4f58;line-height:1.4;transition:color 160ms ease,border-color 160ms ease}
.docs__toc a.lvl-3{padding-left:26px;font-size:13px}
.docs__toc a[aria-current]{color:#131417;font-weight:700;border-left-color:#2450e8}

/* ---- the content column ---- */
.docs__main{min-width:0;max-width:780px;overflow-wrap:anywhere;font-size:17px;line-height:1.65;color:#2b2f36}
.docs__main > .callout:first-child{margin-top:0}
.docs-hero{margin:0}
.docs__main .eyebrow{display:inline-flex;align-items:center;gap:8px;margin-top:36px;font-size:13.5px;font-weight:650;color:#4a4f58}
.docs__main .eyebrow .chip{display:inline-block;width:8px;height:8px;min-height:0;padding:0;border:0;border-radius:50%;background:#2450e8}
.docs__main h1{margin:16px 0 0;font-size:clamp(40px,4.6vw,64px);line-height:.98;font-weight:700;letter-spacing:-0.05em;text-wrap:balance;color:#131417}
.docs__main .callout + h1,.docs__main .callout + .docs-hero h1,.docs__main .callout + .docs-hero > h1{margin-top:40px}
.docs__lede{margin:20px 0 40px;font-size:21px;line-height:1.45;font-weight:600;letter-spacing:-0.015em;color:#131417;max-width:40ch;text-wrap:pretty}
.docs__main h2{position:relative;margin:56px 0 16px;font-size:32px;line-height:1.08;font-weight:700;letter-spacing:-0.035em;color:#131417;scroll-margin-top:156px;text-wrap:balance}
.docs__main h3{position:relative;margin:36px 0 12px;font-size:21px;line-height:1.2;font-weight:700;letter-spacing:-0.025em;color:#131417;scroll-margin-top:156px}
.docs__main h4{margin:24px 0 8px;font-size:17px;font-weight:700;letter-spacing:-0.015em;color:#131417}
.docs__main h2 + h3{margin-top:16px}
.docs__main [id]{scroll-margin-top:156px}
.docs__main p{margin:0 0 18px;max-width:68ch;font-size:17px;line-height:1.65;color:#2b2f36;text-wrap:pretty}
.docs__main ul,.docs__main ol{margin:0 0 22px;padding-left:22px;max-width:66ch;color:#2b2f36}
.docs__main li{margin-bottom:8px;line-height:1.6}
.docs__main li::marker{color:#737983}
.docs__main strong,.docs__main b{color:#131417}
.docs__main a:not(.pill):not(.anchor):not(.more){color:#1d43d0;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px;text-decoration-color:rgba(29,67,208,.4);transition:text-decoration-color 160ms ease}
.docs__main hr{border:0;border-top:1px solid #dfe3ec;margin:40px 0}

/* heading anchors: shown on hover and on focus */
.docs__main .anchor{position:absolute;left:-26px;top:50%;transform:translateY(-50%);width:20px;text-align:center;color:#737983;opacity:0;font-weight:600;font-size:.8em;transition:opacity 160ms ease}
.docs__main h2:hover .anchor,.docs__main h3:hover .anchor,.docs__main .anchor:focus-visible{opacity:1}

/* inline code */
.docs__main :not(pre) > code,.docs__main code.inl{font-family:var(--mono);font-size:.84em;font-weight:500;background:#eef1fb;color:#131417;border-radius:5px;padding:.12em .38em;white-space:normal;overflow-wrap:anywhere}
.docs__main kbd{font-family:var(--mono);font-size:.82em;background:#fff;border:1px solid #c9cfdb;border-bottom-width:2px;border-radius:5px;padding:.05em .4em}

/* ---- code blocks: ink panels, Spline Sans Mono, scroll inside themselves ---- */
.code{--syntax-key:#cdb6f5;--syntax-string:#a6dcb4;--syntax-number:#f0c48c;--syntax-function:#a9c1ff;position:relative;margin:24px 0 32px;background:#131417;color:#eceef2;border-radius:12px;overflow:hidden;font-family:var(--mono);max-width:100%}
.code__head{display:flex;align-items:center;gap:10px;min-height:46px;padding:6px 8px 6px 18px;border-bottom:1px solid #2b2f36;background:#1b1d22}
.code__lang{font-family:var(--mono);font-size:12.5px;font-weight:500;color:#b9bfca}
.code__head-spacer{flex:1}
.code__copy{font-family:"Hanken Grotesk",-apple-system,"Segoe UI",sans-serif;font-size:13px;font-weight:650;color:#eceef2;background:transparent;border:1px solid #45484f;border-radius:999px;height:32px;padding:0 14px;cursor:pointer;transition:background-color 160ms ease,border-color 160ms ease,color 160ms ease}
.code__copy.is-copied{background:#fff252;border-color:#fff252;color:#131417}
.code__copy:focus-visible{outline:2px solid #fff252;outline-offset:2px;box-shadow:none}
.code pre{margin:0;padding:18px 22px 20px;overflow-x:auto;overscroll-behavior-inline:contain;font-family:var(--mono);font-size:13.5px;line-height:1.7;color:#eceef2;tab-size:2;scrollbar-width:thin;scrollbar-color:#45484f transparent}
.code pre:focus-visible{outline:2px solid #fff252;outline-offset:-2px;box-shadow:none;border-radius:0 0 12px 12px}
.code pre code{font:inherit;color:inherit;background:none;border:0;padding:0;white-space:pre}
.code .tok-key{color:var(--syntax-key)}
.code .tok-str{color:var(--syntax-string)}
.code .tok-num{color:var(--syntax-number)}
.code .tok-com{color:#a2a8b3;font-style:italic}
.code .tok-fn{color:var(--syntax-function)}
.code .tok-punc{color:#b9bfca}
.docs__main > pre,.docs__main pre:not(.code pre){font-family:var(--mono);font-size:13.5px;line-height:1.7;background:#131417;color:#eceef2;border-radius:12px;padding:18px 22px;overflow-x:auto;max-width:100%}

/* ---- callouts ---- */
.callout{display:flex;gap:14px;align-items:flex-start;margin:24px 0;padding:18px 22px;background:#fff;border:1px solid #dfe3ec;border-left:4px solid #2450e8;border-radius:10px;color:#40454d;font-size:15.5px;line-height:1.55}
.callout p{margin:0;max-width:none;font-size:15.5px;line-height:1.55;color:inherit}
.callout p + p{margin-top:8px}
.callout__icon{flex:none;width:22px;height:22px;margin-top:1px;border-radius:50%;background:#131417;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800}
.callout__body{min-width:0}
.callout__label{display:block;margin-bottom:4px;font-size:14px;font-weight:700;color:#131417}
.callout.note{border-left-color:#2450e8}
.callout.note .callout__icon{background:#2450e8}
.callout.tip{border-left-color:#1e7a46}
.callout.tip .callout__icon{background:#1e7a46}
.callout.warn{border-left-color:#131417}
.callout.warn .callout__icon{background:#fff252;color:#131417;box-shadow:inset 0 0 0 1.5px #131417}

/* ---- tables: white cards that scroll inside themselves ---- */
.docs__main table,.tbl{display:block;width:100%;max-width:100%;box-sizing:border-box;overflow-x:auto;overscroll-behavior-inline:contain;border-collapse:separate;border-spacing:0;margin:24px 0 32px;background:#fff;border:1px solid #dfe3ec;border-radius:10px;font-size:14.5px}
.docs__main thead th,.tbl thead th{text-align:left;padding:12px 16px;background:#f7f8fb;border-bottom:1px solid #dfe3ec;font-size:13px;font-weight:700;color:#131417;white-space:nowrap}
.docs__main tbody td,.tbl tbody td,.docs__main tbody th{padding:14px 16px;border-bottom:1px solid #eef0f4;color:#40454d;vertical-align:top;line-height:1.55;text-align:left}
.docs__main tbody tr:last-child td,.docs__main tbody tr:last-child th{border-bottom:0}
.docs__main td code{white-space:nowrap;overflow-wrap:normal}

/* ---- API parameters, methods, endpoints ---- */
.params{margin:20px 0 28px;border-top:2px solid #131417}
.param{display:grid;grid-template-columns:minmax(140px,1fr) minmax(0,3fr);gap:10px 24px;padding:18px 0;border-bottom:1px solid #dfe3ec;align-items:start}
.param__name{font-family:var(--mono);font-size:14px;font-weight:500;color:#131417;overflow-wrap:anywhere}
.param__name .req{margin-left:6px;font-family:"Hanken Grotesk",sans-serif;font-size:12px;font-weight:700;color:#b42318}
.param__type{display:block;margin-top:4px;font-family:var(--mono);font-size:12.5px;color:#5d636d}
.param__desc{font-size:15.5px;line-height:1.55;color:#40454d}
.param__desc p{margin:0 0 6px;font-size:15.5px;max-width:none}
.method{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:6px;font-family:var(--mono);font-size:11.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;line-height:1;background:#eef0f4;color:#131417}
.method.get{background:#e6f3ec;color:#17603a}
.method.post{background:#eef1fb;color:#1d43d0}
.method.put{background:#eef0f4;color:#131417}
.method.del{background:#fff1ef;color:#b42318}
.method.patch{background:#fff8c2;color:#5c4d00}
.endpoint,.ep__route{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-family:var(--mono);font-size:14px;color:#131417;background:#fff;border:1px solid #dfe3ec;border-radius:10px;padding:10px 14px;margin:14px 0 20px}
.endpoint .path,.ep__route .path{color:#40454d;overflow-wrap:anywhere}
/* endpoint blocks on pages that never shipped their own component styles */
.ep{margin:28px 0 40px}
.ep__head{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.ep__head h3{margin:0}
.scopes,.respbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13.5px;color:#40454d;margin:8px 0}
.status{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:6px;font-family:var(--mono);font-size:12px;font-weight:600;background:#eef0f4;color:#131417}
.status.s2{background:#e6f3ec;color:#17603a}
.status.s4{background:#fff1ef;color:#b42318}
/* status tags some pages colour with the old token palette: keep them legible */
.docs__main .status.s2,.docs__main .status.s2.created,.docs__main .rel__badge.available,.docs__main .chg__tag.available{background:#e6f3ec;color:#17603a}
.docs__main .status.s4{background:#fff1ef;color:#b42318}

/* ---- docs home ---- */
.docs-concepts{margin:20px 0 28px;border-top:2px solid #131417}
.docs-concepts > div{display:grid;grid-template-columns:minmax(0,200px) minmax(0,1fr);gap:8px 24px;padding:16px 0;border-bottom:1px solid #dfe3ec}
.docs-concepts dt{font-size:16px;font-weight:700}
.docs-concepts dd{margin:0;font-size:15.5px;line-height:1.55;color:#40454d}
.docs-start{margin:20px 0 28px;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:12px}
.docs__main .docs-start > a{display:flex;flex-direction:column;gap:6px;padding:20px;background:#fff;border:1px solid #dfe3ec;border-radius:10px;color:#131417;text-decoration:none;transition:border-color 160ms ease}
.docs-start strong{font-size:17px;letter-spacing:-0.015em}
.docs-start span{font-size:14.5px;line-height:1.5;color:#4a4f58}

/* ---- prev / next ---- */
.docs__pager{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:72px;padding-top:28px;border-top:1px solid #dfe3ec}
.docs__main .docs__pager a{display:flex;flex-direction:column;gap:6px;padding:20px 22px;background:#fff;border:1px solid #dfe3ec;border-radius:10px;color:#131417;text-decoration:none;transition:border-color 160ms ease}
.docs__pager .dir{font-size:13px;font-weight:650;color:#5d636d}
.docs__pager .ttl{font-size:17px;font-weight:700;letter-spacing:-0.015em}
.docs__pager .next{text-align:right;align-items:flex-end}

/* ---- hover (fine pointers only) ---- */
@media (hover:hover) and (pointer:fine){
  .docs-sub__links a:hover{color:#2450e8}
  .docs-search__item:hover{background:#f4f5f8}
  .crumb a:hover{color:#131417}
  .docs__rail a:not([aria-current]):hover{background:rgba(255,255,255,.7);color:#131417}
  .docs__toc a:hover{color:#131417}
  .docs__main a:not(.pill):not(.anchor):not(.more):hover{text-decoration-color:currentColor}
  .code__copy:hover{background:#2b2f36;border-color:#6a7280}
  .docs__main .docs-start > a:hover,.docs__main .docs__pager a:hover{border-color:#b9c1d1}
}

/* ---- narrow screens ---- */
@media (max-width:1180px){
  .docs__shell{grid-template-columns:220px minmax(0,1fr);gap:48px}
  .docs__toc{display:none}
}
@media (max-width:1000px){
  .docs__shell{grid-template-columns:minmax(0,1fr);gap:0}
  .docs__rail{display:none;position:static;max-height:none;overflow:visible;margin:0 0 24px;padding:16px 8px 0;background:#fff;border:1px solid #dfe3ec;border-radius:10px}
  .docs__rail.is-mobile-open{display:block}
  .docs-mobile-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;height:48px;margin-bottom:12px;padding:0 16px;background:#fff;border:1px solid #dfe3ec;border-radius:10px;font-size:15px;font-weight:700;color:#131417;text-align:left}
  .docs-mobile-toggle::after{content:"";width:8px;height:8px;border-right:1.8px solid #131417;border-bottom:1.8px solid #131417;transform:translateY(-2px) rotate(45deg);transition:transform 160ms ease}
  .docs-mobile-toggle[aria-expanded="true"]::after{transform:translateY(2px) rotate(-135deg)}
  .docs__main .anchor{display:none}
}
@media (max-width:900px){
  .docs-sub{position:static}
  .docs-sub__in{padding:0 20px;gap:16px}
  .docs-sub__links{display:none}
  .docs-search{flex:1 1 auto}
  .docs__bar{padding:20px 20px 0}
  .docs__shell{padding:20px 20px 88px}
  .docs__rail,.docs__toc,.docs__main [id],.docs__main h2,.docs__main h3{scroll-margin-top:88px}
}
@media (max-width:700px){
  .docs__main h1{font-size:40px}
  .docs__lede{font-size:19px;margin-bottom:32px}
  .docs__main h2{font-size:27px;margin-top:44px}
  .docs__main p,.docs__main{font-size:16.5px}
  .code{border-radius:10px}
  .code pre{padding:16px;font-size:12.5px}
  .param{grid-template-columns:1fr;gap:6px}
  .docs-concepts > div{grid-template-columns:1fr}
  .docs__pager{grid-template-columns:1fr}
  .docs__pager .next{text-align:left;align-items:flex-start}
}
@media (prefers-reduced-motion:reduce){.docs-search__panel{animation:none!important}}
/* connectors: the "before" card is tinted rather than faded, so its text keeps contrast */
.docs__main .swap__c.old{opacity:1;background:#f7f8fb;border-style:dashed}
