/*
 * Lab-owned pdoc presentation. Load after pdoc's styles and family/open.css.
 * The DOM, search, anchors, source toggles and original copy belong to pdoc.
 * For the caller's template-directory option (December 4), retain pdoc's base
 * template and load this same asset last; keep the family bar outside main.pdoc
 * because search replaces that element. Do not fork generated HTML or docstrings.
 *
 * Layout: existing family document sidebar + fluid main; document scroll owns
 * the reading area, the bounded sidebar owns navigation scroll, and code/tables
 * own horizontal scroll. At <=769px pdoc's native toggle remains in flow.
 * Sizes below map to lab-web-design sections 2/3/4 and the family document shell.
 */
body:has(.rfx-pdoc-shell) {
  --rfx-body:16px; --rfx-small:15px; --rfx-h1:40px; --rfx-h2:28px; --rfx-h3:20px;
  --rfx-space:16px; --rfx-rail:240px; --rfx-control:44px; --rfx-radius:6px;
  height:auto; min-height:100vh; background:var(--paper);
  color:var(--ink); font:var(--rfx-body)/1.6 var(--sans);
}
.rfx-pdoc-shell {
  display:grid; grid-template-columns:var(--rfx-rail) minmax(0,1fr);
  gap:var(--cg); max-width:var(--wrap); margin-inline:auto;
  padding:var(--gut); min-width:0; overflow-wrap:anywhere;
}
.rfx-pdoc-shell .pdoc {
  --text:var(--ink); --muted:var(--ink-2); --link:var(--go); --link-hover:var(--go-2);
  --code:var(--wash); --active:var(--go-t); --accent:var(--wash); --accent2:var(--line);
  --nav-hover:var(--go-t); --name:var(--ink); --def:var(--ink); --annotation:var(--ink-2);
  color:var(--ink); font-family:var(--sans); line-height:1.6;
}
.rfx-pdoc-shell > nav.pdoc {
  grid-column:1; grid-row:1 / span 2; position:sticky; align-self:start;
  top:calc(var(--remi-bar-h) + var(--rfx-space)); width:auto;
  height:auto; max-height:calc(100dvh - var(--remi-bar-h) - 2 * var(--rfx-space));
  padding:0 var(--rfx-space) 0 0; border-right:1px solid var(--line);
  background:var(--paper); box-shadow:none; font-size:var(--rfx-small);
  --pad:var(--rfx-space); --indent:var(--rfx-space);
}
.rfx-pdoc-shell > nav.pdoc > div {padding:0}
.rfx-pdoc-shell > main.pdoc {
  grid-column:2; min-width:0; width:100%; max-width:100%; margin:0; padding:0;
  font-size:var(--rfx-body);
}
.rfx-pdoc-shell main.pdoc > aside[aria-label="Documentation version"] {
  padding:var(--rfx-space)!important; border:1px solid var(--line)!important;
  margin-bottom:var(--cg)!important; background:var(--wash); font-size:var(--rfx-small);
}
/* pdoc ships global nav/header rules: contain them away from the family bar. */
body:has(.rfx-pdoc-shell) .remi-bar {width:100%; max-width:none; padding:0}
body:has(.rfx-pdoc-shell) :is(.remi-bar,.remi-drawer,.foot) nav {
  position:static; height:auto; width:auto; overflow:visible; max-width:100%;
}
body:has(.rfx-pdoc-shell) .foot {margin-top:var(--gut)}
.rfx-pdoc-shell .pdoc :is(h1,h2,h3,h4,h5,h6) {
  font-family:var(--disp); font-stretch:112%; color:var(--ink);
  font-weight:620; line-height:1.35; letter-spacing:-.02em; padding:0;
  margin:calc(2 * var(--rfx-space)) 0 var(--rfx-space);
}
.rfx-pdoc-shell main.pdoc .modulename {font-size:var(--rfx-h1); font-weight:640; margin-top:0}
.rfx-pdoc-shell main.pdoc h2 {font-size:var(--rfx-h2)}
.rfx-pdoc-shell main.pdoc :is(h3,h4,h5,h6) {font-size:var(--rfx-h3)}
.rfx-pdoc-shell nav.pdoc h2 {font-size:var(--rfx-h3)}
.rfx-pdoc-shell .pdoc :is(pre,code,kbd,samp,.attr,.signature) {
  font-family:var(--mono); font-variant-ligatures:none!important;
  font-feature-settings:"liga" 0,"calt" 0!important;
}
.rfx-pdoc-shell .pdoc code {font-size:.9em; border-radius:var(--rfx-radius)}
.rfx-pdoc-shell .pdoc :is(pre,.attr) {
  max-width:100%; font-size:var(--rfx-small); line-height:1.75;
  background:var(--wash); padding:var(--rfx-space);
}
.rfx-pdoc-shell .pdoc pre {white-space:pre; overflow:auto}
.rfx-pdoc-shell .pdoc pre code {font-size:inherit}
.rfx-pdoc-shell .pdoc-code span {color:var(--ink); background:transparent}
.rfx-pdoc-shell .pdoc :is(.docstring,.classattr,.inherited) {margin-inline:0; min-width:0}
.rfx-pdoc-shell .pdoc .docstring .pdoc-code {margin-inline:0}
.rfx-pdoc-shell .pdoc table {
  width:100%; max-width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums;
}
.rfx-pdoc-shell .pdoc :is(th,td) {
  border:0; border-bottom:1px solid var(--line); padding:var(--rfx-space);
  vertical-align:top; font-size:var(--rfx-body); line-height:1.6;
}
.rfx-pdoc-shell .pdoc th {font-size:var(--rfx-small); font-weight:600; color:var(--ink-2); background:var(--wash)}
.rfx-pdoc-shell .pdoc :is(.pdoc-button,.view-source-button,.view-value-button) {
  font-size:var(--rfx-small); min-height:var(--rfx-control); line-height:1.6;
  border-color:var(--ink-2); color:var(--ink); background:var(--paper);
}
.rfx-pdoc-shell .pdoc :is(input,button) {font:inherit; caret-color:var(--go)}
.rfx-pdoc-shell nav.pdoc input[type=search] {
  width:100%; max-width:100%; min-height:var(--rfx-control); margin:0;
  border:1px solid var(--ink-2); border-radius:var(--wa-form-control-border-radius);
  padding:calc(var(--rfx-space) / 2); background:var(--paper); color:var(--ink);
}
.rfx-pdoc-shell input::placeholder {color:var(--ink-2); opacity:1}
.rfx-pdoc-shell .pdoc :is(a,button,input,label):focus-visible {outline:3px solid var(--go); outline-offset:4px}
.rfx-pdoc-shell .pdoc a {text-underline-offset:.2em}
.rfx-pdoc-shell .pdoc a:hover {text-decoration:underline}
.rfx-pdoc-shell nav.pdoc li a {min-height:var(--rfx-control); align-content:center}
.rfx-pdoc-shell .pdoc .headerlink {left:0; position:relative; display:inline-block}
.rfx-pdoc-shell .pdoc :is(h1,h2,h3,h4,h5,h6):target {box-shadow:none}
.rfx-pdoc-shell .pdoc * {scroll-margin-top:calc(var(--remi-bar-h) + var(--rfx-space))}
.rfx-pdoc-shell ::selection {background:var(--go-t); color:var(--ink)}
.rfx-pdoc-shell :is(nav,pre,table,.attr) {scrollbar-width:thin; scrollbar-color:var(--ink-2) var(--wash)}
.rfx-pdoc-shell .pdoc footer {font-size:var(--rfx-small)}
@media (max-width:769px) {
  body:has(.rfx-pdoc-shell) {--rfx-h1:32px}
  .rfx-pdoc-shell {display:flex; flex-direction:column; padding:var(--rfx-space)}
  .rfx-pdoc-shell > nav.pdoc {position:relative; top:auto; border:0; padding:0; width:100%; max-height:none}
  .rfx-pdoc-shell > nav.pdoc {order:1}
  .rfx-pdoc-shell > main.pdoc {order:2}
  .rfx-pdoc-shell #navtoggle {
    position:static; display:flex; width:var(--rfx-control); height:var(--rfx-control);
    margin:0 0 var(--rfx-space); opacity:1; padding:calc(var(--rfx-space) / 2);
  }
  .rfx-pdoc-shell #togglestate:checked + div {max-height:50dvh; overflow:auto; padding:var(--rfx-space)}
  /* The closed phone page has the family bar and one API-navigation row.
     Its release context stays reachable with that same native navigation toggle. */
  .rfx-pdoc-shell main.pdoc > aside[aria-label="Documentation version"] {display:none}
  .rfx-pdoc-shell:has(#togglestate:checked) main.pdoc > aside[aria-label="Documentation version"] {display:block}
  .rfx-pdoc-shell .pdoc :is(.param,.return-annotation) {white-space:pre-wrap}
  .rfx-pdoc-shell .pdoc .signature.condensed .param {display:inline}
}
@media (prefers-reduced-motion:reduce) {
  .rfx-pdoc-shell,.rfx-pdoc-shell * {scroll-behavior:auto; transition:none}
}
