.doc-page {
  --doc-rule:var(--line);
  min-height:90vh;
  padding:clamp(112px,9vw,148px) var(--gutter) clamp(72px,7vw,112px);
}
.doc-layout {
  max-width:1310px;
  margin:auto;
  display:grid;
  grid-template-columns:216px minmax(0,740px);
  justify-content:center;
  gap:clamp(30px,4vw,72px);
  align-items:start;
}
.doc-sidebar,.doc-toc {
  position:sticky;
  top:24px;
  align-self:start;
  min-width:0;
}
.doc-index-head {
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 0 21px;
}
.doc-index-head .icon {
  width:22px;
  height:22px;
}
.doc-index-head > span {
  font-family:var(--heading);
  line-height:1;
  font-size:1.38rem;
  letter-spacing:-.037em;
  font-weight:600;
}
.doc-search {
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 10px;
  border:1px solid var(--line);
  background:var(--surface);
  border-radius:8px;
  min-height:44px;
}
.doc-search:focus-within {
  outline:2px solid var(--ink);
  outline-offset:1px;
}
.doc-search .icon {
  width:16px;
  height:16px;
  color:var(--subtle);
}
.doc-search input {
  appearance:none;
  background:transparent;
  color:var(--white);
  border:0;
  width:100%;
  min-width:0;
  outline:none;
  box-shadow:none;
  font-size:.85rem;
  padding:10px 0;
}
.doc-page kbd {
  font:400 .78rem var(--mono);
  color:var(--subtle);
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:4px;
  padding:1px 5px;
}
.doc-index-list {
  margin-top:24px;
  max-height:calc(100dvh - 190px);
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#b2b2c1 transparent;
  padding:0 6px 12px 0;
}
.doc-index-group + .doc-index-group { margin-top:20px; }
.doc-index-group h3,.doc-toc h2 {
  text-transform:uppercase;
  color:var(--subtle);
  letter-spacing:.09em;
  font:500 .78rem/1.3 var(--mono);
  margin:0 0 8px;
}
.doc-index-group h3 { padding:0 10px; }
.doc-index-item > a {
  display:block;
  border-radius:6px;
  padding:.38rem .65rem;
  font-size:.91rem;
  color:var(--subtle);
}
.doc-index-item > a:hover,.doc-heading-matches a:hover {
  background:var(--lift);
  color:var(--white);
  text-decoration:none;
}
.doc-index-item > a[aria-current] {
  font-weight:650;
  color:var(--white);
  background:var(--lift);
  box-shadow:inset 3px 0 var(--ink);
}
.doc-heading-matches {
  padding:3px 0 3px 12px;
  margin:2px 0 8px 10px;
  border-left:1px solid var(--doc-rule);
}
.doc-heading-matches a {
  display:block;
  padding:5px;
  border-radius:4px;
  font-size:.84rem;
  line-height:1.4;
}
#doc-no-match { font-size:.9rem; color:var(--subtle); }
.doc-reading { min-width:0; }
.doc-crumb {
  display:flex;
  gap:10px;
  align-items:center;
  color:var(--subtle);
  font-size:.84rem;
  margin:0 0 clamp(20px,2vw,32px);
}
.doc-crumb > span:first-of-type { color:var(--muted); }
.doc-articles section {
  scroll-margin:28px;
}
.doc-articles section > h2 {
  font-size:clamp(3.2rem,5.2vw,5.4rem);
  line-height:.98;
  margin-bottom:22px;
  overflow-wrap:anywhere;
}
.doc-articles section > h3 {
  font-size:clamp(1.65rem,2.15vw,2.1rem);
  margin:clamp(30px,3vw,44px) 0 14px;
}
.doc-articles p,.doc-articles li,.doc-articles dd {
  font-size:1rem;
  line-height:1.7;
}
.doc-articles p + p { margin-top:12px; }
.doc-articles .doc-lead,.doc-articles h2 + p {
  color:var(--muted);
  font-size:clamp(1.05rem,1.35vw,1.24rem);
  line-height:1.5;
  text-wrap:pretty;
}
.doc-articles p a,.doc-articles li a,.doc-articles td a {
  font-weight:600;
  text-decoration:underline;
  text-decoration-color:#8d8d9f;
  text-underline-offset:.19em;
}
.doc-articles p a:hover,.doc-articles td a:hover { text-decoration-color:var(--ink); }
.doc-articles dl,.doc-articles ol,.doc-articles ul { margin:14px 0; }
.doc-articles ol,.doc-articles ul { padding-left:1.5em; }
.doc-articles li { margin:8px 0; padding-left:4px; }
.doc-articles li::marker { color:var(--subtle); }
.doc-articles dt { margin:14px 0 2px; font-weight:650; }
.doc-articles dd { color:var(--subtle); }
.doc-articles code,.doc-matrix,.doc-matcell { font-family:var(--mono); }
.doc-articles :not(pre) > code {
  background:var(--lift);
  font-size:.87em;
  padding:2px 4px;
  border-radius:4px;
  overflow-wrap:anywhere;
}
.doc-plate {
  background:var(--surface);
  color:var(--white);
  border-radius:16px;
  margin-top:28px;
  overflow:hidden;
}
.doc-plate figcaption {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border-bottom:1px solid var(--line);
  padding:12px clamp(15px,2vw,24px);
  font-size:.92rem;
  font-weight:550;
}
.doc-plate figcaption span { display:flex; align-items:center; gap:9px; }
.doc-plate figcaption .icon { width:16px; height:16px; color:var(--accent); }
.doc-plate figcaption small { font:400 .78rem var(--mono); color:var(--muted); }
.doc-plate > svg { display:block; width:100%; max-height:208px; padding:17px 10px; font-family:var(--mono); }
.doc-articles .callout {
  background:var(--lift);
  border-left:3px solid #474983;
  padding:15px 18px;
  margin:18px 0;
  font-size:1rem;
}
.doc-table-frame {
  margin:18px 0;
  overflow:auto;
  overscroll-behavior-x:contain;
  border:1px solid var(--doc-rule);
  border-radius:10px;
}
.doc-articles table { border-collapse:collapse; width:100%; text-align:left; }
.doc-articles td,.doc-articles th {
  padding:11px 13px;
  vertical-align:top;
  border-bottom:1px solid var(--doc-rule);
  font:400 .9rem/1.5 var(--body);
}
.doc-articles thead th {
  background:var(--lift);
  font-weight:650;
  color:var(--muted);
}
.doc-articles tbody th { font-weight:650; }
.doc-articles tr:last-child > td,.doc-articles tbody tr:last-child > th { border-bottom:0; }
.doc-articles td { background:var(--surface); }
.doc-articles .gate-reference td,.doc-articles .gate-reference th { vertical-align:middle; }
.doc-matcell { display:inline-flex; align-items:center; gap:.3em; white-space:nowrap; }
.doc-matrix {
  display:inline-grid;
  grid-template-columns:repeat(var(--dim),auto);
  gap:3px 9px;
  text-align:center;
  position:relative;
  padding:3px 6px;
  line-height:1.12;
}
.doc-matrix::before,.doc-matrix::after {
  content:"";
  width:4px;
  position:absolute;
  inset-block:0;
  border-block:1px solid currentColor;
}
.doc-matrix::before { left:0; border-left:1px solid currentColor; }
.doc-matrix::after { right:0; border-right:1px solid currentColor; }
.doc-code-frame {
  position:relative;
  border-radius:12px;
  margin:16px 0;
  color:var(--white);
  background:var(--surface);
  overflow:hidden;
  padding-top:45px;
}
.doc-code-frame button {
  position:absolute;
  right:7px;
  top:3px;
  display:flex;
  align-items:center;
  gap:6px;
  padding:0 10px;
  min-height:40px;
  color:var(--muted);
  font-size:.8rem;
  border-radius:6px;
}
.doc-code-frame button:hover { color:var(--white); background:var(--lift); }
.doc-code-frame .icon { width:14px; height:14px; }
.doc-code-frame pre {
  overflow-x:auto;
  margin:0;
  padding:0 18px 18px;
  font:400 .86rem/1.65 var(--mono);
}
.doc-articles details { border-bottom:1px solid var(--doc-rule); }
.doc-articles details p { padding:0 1rem 1rem 0; color:var(--subtle); }
.doc-articles summary { font-size:1rem; }
.doc-pager {
  display:flex;
  justify-content:space-between;
  gap:16px;
  border-top:1px solid var(--doc-rule);
  margin-top:48px;
  padding-top:20px;
}
.doc-pager a {
  flex:0 1 48%;
  border:1px solid var(--doc-rule);
  padding:12px 16px;
  border-radius:10px;
  color:var(--white);
}
.doc-pager a:hover { background:var(--lift); text-decoration:none; border-color:#8a8b9f; }
.doc-pager a[rel=next] { margin-left:auto; text-align:right; }
.doc-pager small { display:block; color:var(--subtle); margin-bottom:2px; }
.doc-pager strong { font-weight:600; }
.doc-toc { display:none; }
.doc-toc nav {
  border-left:1px solid var(--doc-rule);
  max-height:calc(100dvh - 90px);
  overflow:auto;
  scrollbar-width:thin;
  scrollbar-color:#b2b2c1 transparent;
}
.doc-toc nav a {
  color:var(--subtle);
  display:block;
  border-left:2px solid transparent;
  margin-left:-1px;
  padding:6px 10px;
  font-size:.85rem;
  line-height:1.4;
}
.doc-toc nav a[aria-current] { color:var(--white); border-left-color:var(--ink); }
.doc-mobile-open { display:none; }
.doc-brand-art {
  background:var(--surface);
  color:var(--white);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding:40px 16px;
  border-radius:12px;
  margin-top:22px;
  font:700 clamp(2.75rem,6vw,5rem)/1 var(--heading);
  letter-spacing:-.062em;
}
.doc-downloads { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 20px; }
.doc-downloads > * {
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:8px 15px;
  border-radius:100px;
  border:1px solid var(--doc-rule);
  font-size:.87rem;
}
.doc-downloads > *:hover { background:var(--card); text-decoration:none; }
.doc-downloads .icon { width:16px; height:16px; }
.doc-swatches {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin:16px 0 20px;
}
.doc-swatches i { display:block; height:42px; border-radius:6px; border:1px solid var(--doc-rule); }
.doc-swatches strong { display:block; font-size:.85rem; margin:5px 0 1px; }
.doc-swatches div > code { background:transparent; padding:0; color:var(--subtle); }
#doc-menu {
  background:var(--paper);
  color:var(--white);
  border:1px solid var(--line);
  border-radius:20px 20px 0 0;
  width:100%;
  max-width:100%;
  max-height:88dvh;
  margin:auto 0 0;
  padding:24px 20px max(24px,env(safe-area-inset-bottom));
}
#doc-menu::backdrop { background:#101012b3; }
#doc-menu form { position:absolute; top:12px; right:15px; }
#doc-menu form button:hover { background:var(--card); }
#doc-menu .doc-index-head { min-height:33px; }
#doc-menu .doc-index-list { margin-top:16px; max-height:calc(88dvh - 166px); }
#doc-menu .doc-index-item a { display:flex; align-items:center; min-height:44px; }
@media(min-width:1280px) {
  .doc-layout { grid-template-columns:208px minmax(0,740px) 165px; gap:clamp(38px,4vw,70px); }
  .doc-toc { display:block; padding-top:4px; }
  .doc-toc h2 { margin:0 0 16px; }
}
@media(max-width:820px) {
  .doc-page { padding-top:104px; }
  .doc-layout { display:block; max-width:680px; }
  .doc-sidebar { display:none; }
  .doc-mobile-open {
    width:100%;
    display:flex;
    align-items:center;
    gap:9px;
    min-height:46px;
    border-block:1px solid var(--doc-rule);
    text-align:left;
    padding:0 2px;
    color:var(--subtle);
    font-size:.9rem;
    margin:0 0 25px;
  }
  .doc-mobile-open:hover { color:var(--white); background:var(--card); }
  .doc-mobile-open .icon { width:16px; height:16px; }
  .doc-mobile-open .icon:last-child { margin-left:auto; }
  .doc-crumb { font-size:.8rem; margin-bottom:17px; }
  .doc-plate { margin-top:22px; }
  .doc-articles section > h2 { margin-bottom:15px; }
}
@media(max-width:460px) {
  .doc-page { padding:95px 19px 58px; }
  .doc-articles section > h2 { font-size:clamp(2.6rem,12vw,3.5rem); }
  .doc-plate > svg { padding:10px 3px; }
  .doc-plate figcaption { font-size:.8rem; }
  .doc-plate figcaption small { font-size:.72rem; }
  .doc-articles td,.doc-articles th { padding:9px; }
}

.doc-search {padding-right:0}
.doc-search kbd {margin-right:10px}
.doc-search:focus-within {outline:3px solid var(--accent);box-shadow:0 0 0 3px var(--ink)}
.doc-search-clear {min-height:44px;min-width:44px;display:grid;place-items:center;color:var(--subtle)}
.doc-search-clear:hover {color:var(--white);background:var(--card)}
.doc-search input {height:44px}
.doc-index-item>a,.doc-heading-matches a,.doc-toc nav a,.doc-crumb a,.doc-articles td a {display:flex;align-items:center;min-height:44px;min-width:44px}
.doc-code-frame button {min-height:44px}
.doc-articles :is(p,li,dd)>a {display:inline-flex;align-items:center;min-width:44px;min-height:44px;vertical-align:middle}

.doc-articles .experiment-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:0 1rem}
.doc-articles .experiment-grid h3 {margin:0}
.doc-independence {font-size:.86rem;color:var(--subtle)}
.doc-articles .econ-block th[scope=row] {white-space:nowrap}
@media(max-width:560px){.doc-articles .experiment-grid{grid-template-columns:1fr}}

.doc-articles .econ-block h3 {font-size:clamp(1.65rem,2.15vw,2.1rem);margin:clamp(28px,3vw,42px) 0 12px}
.doc-articles .econ-block table {text-align:right}
.doc-articles .econ-block table th:first-child {text-align:left}
.doc-articles .econ-block:last-child tbody tr:last-child>* {background:var(--lift);font-weight:600}
@media(max-width:560px){.doc-articles .econ-block table th[scope=row]{white-space:normal}}

#where-runs-execute tbody th a {display:inline-flex;align-items:center;min-height:44px;text-decoration:underline;text-decoration-color:#acacbc;text-underline-offset:3px;white-space:nowrap}
@media(max-width:560px) {
  #where-runs-execute thead {position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
  #where-runs-execute table,#where-runs-execute tbody {display:block}
  #where-runs-execute tbody tr {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:1px 12px;padding:8px 14px 14px;background:var(--surface)}
  #where-runs-execute tbody tr+tr {border-top:1px solid var(--doc-rule)}
  #where-runs-execute tbody tr>* {display:block;background:none;border:0;padding:0}
  #where-runs-execute tbody th {font-size:1rem}
  #where-runs-execute tbody td:nth-child(2) {grid-column:1;grid-row:2;font-size:.82rem;color:var(--subtle)}
  #where-runs-execute tbody td:nth-child(3) {grid-column:1/-1;grid-row:3;margin-top:8px}
  #where-runs-execute tbody td:last-child {grid-column:2;grid-row:1/3;text-align:right;font-family:var(--mono);font-size:.82rem}
  #where-runs-execute tbody td:last-child::before {display:block;content:"Typical queue";font:400 .72rem var(--body);color:var(--subtle)}
}
