/* AEX developer site: AEX Command look (tokens shared with aexrts.com's styles.css),
   tuned for reading short reference pages. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/Archivo-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Rajdhani";
  src: url("/assets/fonts/Rajdhani-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Oxanium";
  src: url("/assets/fonts/Oxanium-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* AEX Command canvas, glass, text and edge colors (as aexrts.com). */
  --bg: #070f14;
  --bg-2: #0b161d;
  --panel: #101a20;
  --panel-2: #19262d;
  --text: #e4edf2;
  --silver: #d7e2e9;
  --muted: #b0bec8;
  --dim: #9aafbc;
  --line: #33444d;
  --line-2: #617680;
  --accent: #48bbff;
  --accent-soft: #48bbff18;
  --cyan: #63d9ff;
  --cyan-soft: #63d9ff1f;
  --amber: #f2c46d;
  --amber-soft: rgba(242, 196, 109, 0.12);
  --red: #ff8a7a;
  --red-soft: rgba(255, 138, 122, 0.1);
  --edge-light: #617d8b;
  --edge-dark: #02060a;
  --command-panel-fill: linear-gradient(164deg, #1a2c36, #101d26 42%, #08131b);
  --command-panel-rim: linear-gradient(165deg, #9cb4bf, #415964 38%, #263b47 76%, #597687);
  --command-rocks: url("/assets/aex-command-rocks.png");
  --control-face: linear-gradient(180deg, #242c2e, #1e2628 50%, #182022);
  --control-primary: linear-gradient(180deg, #122b3e, #0a1c2b 64%);
  --control-hover: linear-gradient(180deg, #194d69, #103349);
  --control-cut: 4px;
  --panel-cut: 8px;
  --heading: "Rajdhani", "Arial Narrow", ui-sans-serif, sans-serif;
  --action: "Oxanium", ui-sans-serif, system-ui, sans-serif;
  --body: "Archivo", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 3.5vw, 40px);
  --header-h: 72px;
  --measure: 72ch;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #070f14d9, var(--bg) 520px),
    var(--command-rocks) center top / max(100%, 1100px) auto no-repeat,
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: #245577;
  color: #fff;
}

:is(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.doc-main:focus {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -90px;
  left: 20px;
  z-index: 30;
  padding: 12px 20px;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  top: 12px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px 26px;
  min-height: var(--header-h);
  padding: 10px var(--gutter);
  background: linear-gradient(180deg, #17262ef2, #09131bf7);
  border-bottom: 1px solid #48bbff55;
  box-shadow: inset 0 1px #afcbd62b, 0 1px var(--edge-dark);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: var(--text);
}

.brand-mark {
  display: block;
  width: 100px;
  height: 44px;
  object-fit: contain;
}

.brand-tag {
  padding-left: 12px;
  border-left: 1px solid var(--line-2);
  color: var(--dim);
  font: 0.72rem var(--action);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px 20px;
  color: var(--muted);
  font: 0.9rem var(--action);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  transition: color 80ms ease;
}

.nav-links a:hover {
  color: var(--cyan);
}

.nav-links a[aria-current] {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.home-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--dim);
  font: 0.82rem var(--action);
}

.home-link:hover {
  color: var(--cyan);
}

/* Search */

.site-search {
  position: relative;
  margin-left: auto;
  flex: 0 1 340px;
  min-width: 0;
}

.search-fallback {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--edge-light);
  background: #0b141d;
  color: var(--muted);
  font: 0.86rem var(--action);
}

.search-fallback:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.search-form {
  position: relative;
  margin: 0;
}

.search-input {
  width: 100%;
  min-height: 44px;
  padding: 9px 40px 9px 12px;
  border: 1px solid var(--edge-light);
  border-radius: 2px;
  background: #0b141d;
  color: var(--text);
  font: 0.9rem var(--body);
}

.search-input::placeholder {
  color: var(--dim);
  opacity: 1;
}

.search-input:hover {
  border-color: var(--cyan);
}

.search-input:focus-visible {
  outline-offset: 0;
  border-color: var(--cyan);
}

.search-input::-webkit-search-cancel-button {
  filter: grayscale(1) brightness(1.6);
}

.search-key {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  color: var(--dim);
  font: 0.72rem var(--mono);
  pointer-events: none;
}

.search-input:focus ~ .search-key,
.search-input:not(:placeholder-shown) ~ .search-key {
  display: none;
}

.search-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(520px, calc(100vw - 2 * var(--gutter)));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  border: 1px solid var(--edge-light);
  background: #0d1820;
  box-shadow: 0 22px 60px #000a, inset 0 1px #afcbd62b;
}

.search-panel[hidden] {
  display: none;
}

.search-status {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font: 0.75rem var(--action);
  letter-spacing: 0.04em;
}

.search-status:empty {
  display: none;
}

.search-results {
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.search-results:empty {
  display: none;
}

.search-results a {
  display: block;
  padding: 10px 14px;
  border-left: 2px solid transparent;
  color: var(--text);
}

.search-results [aria-selected="true"] a,
.search-results a:hover {
  border-left-color: var(--cyan);
  background: #173649;
}

.search-result-title {
  display: block;
  font-weight: 600;
}

.search-result-path {
  display: block;
  color: var(--dim);
  font: 0.72rem var(--mono);
}

.search-result-snippet {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.search-results mark {
  background: transparent;
  color: var(--cyan);
  font-weight: 600;
}

/* Page shell: sidebar, on-page headings, reading column */

.doc-shell {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 220px;
  grid-template-areas: "nav main aside";
  gap: 40px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px var(--gutter) 72px;
  align-items: start;
}

.doc-nav {
  grid-area: nav;
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.doc-nav-toggle {
  display: none;
}

.doc-aside {
  grid-area: aside;
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
}

.doc-aside:not(:has(*)) {
  display: none;
}

.doc-main {
  grid-area: main;
  min-width: 0;
}

/* Sidebar tree: <ul class="nav-tree"> from the generator */

.nav-tree,
.nav-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-section + .nav-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.nav-section-title {
  display: block;
  margin-bottom: 6px;
  color: var(--silver);
  font: 0.74rem var(--action);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

a.nav-section-title:hover {
  color: var(--cyan);
}

.nav-tree li li a {
  display: block;
  padding: 6px 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.nav-tree li li li a {
  padding-left: 22px;
  font-size: 0.84rem;
}

.nav-tree li li a:hover {
  border-left-color: var(--line-2);
  color: var(--text);
}

.nav-tree a[aria-current="page"] {
  border-left: 2px solid var(--cyan);
  background: var(--cyan-soft);
  color: var(--text);
}

.nav-group-title {
  display: block;
  padding: 10px 10px 4px;
  color: var(--dim);
  font-size: 0.78rem;
}

/* On this page: <nav class="doc-toc"> from the generator */

.doc-toc {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 0.84rem;
}

.toc-title {
  margin: 0 0 8px;
  color: var(--dim);
  font: 0.72rem var(--action);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.doc-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-toc ul ul {
  padding-left: 12px;
}

.doc-toc a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  line-height: 1.35;
}

.doc-toc a:hover,
.doc-toc a[aria-current="true"] {
  color: var(--cyan);
}

/* Reading column */

.doc-article {
  max-width: var(--measure);
  container: doc / inline-size;
}

/* Wide components (the settings catalog, card grids marked .wide) take the full column. */
.doc-shell:has(.catalog-results, .doc-content > .wide) .doc-article {
  max-width: none;
}

.doc-head {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.doc-title {
  margin: 0;
  color: var(--silver);
  font: 700 clamp(2.2rem, 4.4vw, 3.2rem) / 1.02 var(--heading);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.doc-summary {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.5;
}

.doc-summary:empty {
  display: none;
}

.doc-content {
  font-size: 1.02rem;
}

.doc-content > :first-child {
  margin-top: 0;
}

.doc-content :is(h2, h3, h4) {
  position: relative;
  color: var(--silver);
  font-family: var(--heading);
  font-weight: 700;
  line-height: 1.1;
  text-wrap: balance;
}

.doc-content h2 {
  margin: 2.2em 0 0.6em;
  font-size: 1.9rem;
}

.doc-content h3 {
  margin: 1.8em 0 0.5em;
  font-size: 1.4rem;
}

.doc-content h4 {
  margin: 1.5em 0 0.4em;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}

.doc-content :is(h2, h3, h4) .anchor {
  margin-left: 8px;
  color: var(--line-2);
  font-family: var(--mono);
  font-size: 0.7em;
  opacity: 0;
}

.doc-content :is(h2, h3, h4):hover .anchor,
.doc-content :is(h2, h3, h4) .anchor:focus-visible {
  opacity: 1;
}

.doc-content :is(p, ul, ol, dl, blockquote, pre, table, figure, details) {
  margin: 0 0 1.1em;
}

.doc-content :is(ul, ol) {
  padding-left: 1.4em;
}

.doc-content li + li {
  margin-top: 0.3em;
}

.doc-content li > :is(ul, ol) {
  margin: 0.3em 0 0;
}

.doc-content li::marker {
  color: var(--line-2);
}

.doc-content strong {
  color: var(--text);
  font-weight: 650;
}

.doc-content a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: #63d9ff66;
  text-underline-offset: 0.18em;
}

.doc-content a:hover {
  color: #fff;
  text-decoration-color: currentColor;
}

.doc-content hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.doc-content blockquote {
  padding: 12px 18px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--muted);
}

.doc-content blockquote > :last-child {
  margin-bottom: 0;
}

.doc-content dt {
  color: var(--text);
  font-weight: 650;
}

.doc-content dd {
  margin: 0 0 0.6em 1.2em;
  color: var(--muted);
}

/* Inline code and code blocks */

code,
kbd,
samp {
  font-family: var(--mono);
  font-size: 0.88em;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  border: 1px solid #33444d99;
  background: #0b161d;
  color: var(--cyan);
  overflow-wrap: anywhere;
}

kbd:not(.search-key) {
  padding: 0.05em 0.45em;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  background: var(--panel-2);
  color: var(--text);
  white-space: nowrap;
}

.code-block {
  position: relative;
  margin: 0 0 1.1em;
}

.doc-content pre,
.code-block pre {
  margin: 0 0 1.1em;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan);
  background: #08121a;
  color: #c7e5ee;
  font: 0.86rem / 1.65 var(--mono);
  tab-size: 4;
  -webkit-overflow-scrolling: touch;
}

.code-block pre {
  margin: 0;
  padding-right: 76px;
}

pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  background: #101d26;
  color: var(--muted);
  cursor: pointer;
  font: 0.72rem var(--action);
  letter-spacing: 0.04em;
}

.copy-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.copy-button[data-state="done"] {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Tables: wrapped by JS in .table-scroll; plain tables still scroll via display:block. */

.doc-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92rem;
  -webkit-overflow-scrolling: touch;
}

.table-scroll {
  max-width: 100%;
  margin: 0 0 1.1em;
  overflow-x: auto;
  border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.table-scroll > table {
  display: table;
  width: 100%;
  margin: 0;
  overflow: visible;
}

.doc-content :is(th, td) {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc-content th {
  background: #0e1a22;
  color: var(--dim);
  font: 600 0.72rem var(--action);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.doc-content td {
  color: var(--muted);
}

.doc-content td:first-child {
  color: var(--text);
}

.doc-content tr:last-child td {
  border-bottom: 0;
}

.doc-content td code {
  white-space: nowrap;
}

/* Callouts: <div class="note">, .note.warning, .note.planned */

.note {
  margin: 0 0 1.1em;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: #0c1820;
  color: var(--muted);
}

.note > :last-child {
  margin-bottom: 0;
}

.note strong:first-child {
  color: var(--text);
}

.note.warning {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.note.planned {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

/* Log lines and messages a player sees */
.log-line {
  display: block;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #08121a;
  color: var(--amber);
  font: 0.84rem / 1.5 var(--mono);
  overflow-x: auto;
  white-space: pre;
}

/* Shared building blocks for hand-written pages (home, Studio, guide indexes) */

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font: 0.76rem var(--action);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede {
  color: var(--muted);
  font-size: 1.12rem;
}

.card-label {
  color: var(--cyan);
  font: 0.69rem var(--action);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.text-link,
.doc-content a.text-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  color: var(--cyan);
  font: 0.86rem var(--action);
  text-decoration: none;
}

.text-link:hover,
.doc-content a.text-link:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.availability {
  display: inline-block;
  padding-left: 9px;
  border-left: 2px solid var(--cyan);
  color: var(--cyan);
  font: 0.69rem var(--action);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.availability.planned {
  border-color: var(--amber);
  color: var(--amber);
}

.small-copy {
  color: var(--dim);
  font-size: 0.82rem;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  margin-bottom: 4px;
}

.section-summary {
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
  margin: 0 0 1.4em;
  padding: 0;
  list-style: none;
}

.card-grid > li + li {
  margin-top: 0;
}

.card,
.command-tile {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 22px;
}

.card > :is(h2, h3) {
  margin: 0;
  font-size: 1.45rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card > .text-link:last-child,
.card > .button:last-child {
  margin-top: auto;
}

/* A whole card that is a link */
a.card {
  color: var(--text);
  text-decoration: none;
}

a.card:hover {
  --rim: var(--cyan);
}

/* Chamfered frames for buttons and panels (as aexrts.com): clip only the material layers. */
:is(.button)::before,
:is(.button)::after,
:is(.card, .command-tile)::before,
:is(.card, .command-tile)::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  clip-path: polygon(
    var(--cut) 0, calc(100% - var(--cut)) 0,
    100% var(--cut), 100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%, var(--cut) 100%,
    0 calc(100% - var(--cut)), 0 var(--cut)
  );
}

:is(.card, .command-tile)::before {
  --cut: var(--panel-cut);
  inset: 0;
  background: var(--rim, var(--command-panel-rim));
}

:is(.card, .command-tile)::after {
  --cut: calc(var(--panel-cut) - 1px);
  inset: 1px;
  background: var(--command-panel-fill);
  box-shadow: inset 0 1px #afcbd62b, inset 0 -1px var(--edge-dark);
}

.button,
.doc-content a.button {
  --button-fill: var(--control-face);
  --button-edge: var(--line-2);
  --button-light: #afcbd63d;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 22px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: 0.9rem / 1.4 var(--action);
  text-align: center;
  text-decoration: none;
}

.button::before {
  --cut: var(--control-cut);
  inset: 0;
  background: var(--button-edge);
}

.button::after {
  --cut: calc(var(--control-cut) - 1px);
  inset: 1px;
  background: var(--button-fill);
  box-shadow: inset 0 1px var(--button-light), inset 0 -1px var(--edge-dark);
}

.button.primary {
  --button-edge: #3c97c5;
  --button-fill: var(--control-primary);
  --button-light: #63d9ff7a;
  color: #f7fbff;
}

.button:hover,
.doc-content a.button:hover {
  --button-edge: var(--cyan);
  --button-fill: var(--control-hover);
  color: #f7fbff;
}

.button:active {
  --button-fill: #071b29;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 1.2em;
}

/* Previous / next: <nav class="prevnext"> from the generator */

.prevnext {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: var(--measure);
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.doc-shell:has(.catalog-results, .doc-content > .wide) .prevnext {
  max-width: none;
}

.prevnext a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 64px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: #0c1820;
  color: var(--text);
}

.prevnext a:hover {
  border-color: var(--cyan);
  background: #12283a;
}

.prevnext .next {
  grid-column: 2;
  align-items: flex-end;
  text-align: right;
}

.prevnext-label {
  color: var(--dim);
  font: 0.72rem var(--action);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.prevnext .prev .prevnext-label::before {
  content: "← ";
}

.prevnext .next .prevnext-label::after {
  content: " →";
}

.prevnext-title {
  font-weight: 600;
  line-height: 1.35;
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 26px var(--gutter);
  background: linear-gradient(180deg, #101d26, #08131b);
  box-shadow: inset 0 1px #afcbd629;
  color: var(--dim);
  font: 0.8rem var(--mono);
}

.site-footer a {
  color: inherit;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer .rights-notice {
  flex-basis: 100%;
  margin: 0;
}

.site-footer .rights-notice a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Medium: on-page headings move above the article */

@media (max-width: 1200px) {
  .doc-shell {
    grid-template-columns: 230px minmax(0, 1fr);
    grid-template-areas:
      "nav aside"
      "nav main";
    gap: 0 36px;
  }

  .doc-nav {
    grid-row: 1 / span 2;
  }

  .doc-aside {
    position: static;
    max-height: none;
    margin-bottom: 28px;
  }

  .doc-toc {
    max-width: var(--measure);
    padding: 12px 16px;
    border: 1px solid var(--line);
    background: #0b161dcc;
  }

  .doc-toc > ul {
    columns: 2 220px;
    column-gap: 24px;
  }

  .doc-toc li {
    break-inside: avoid;
  }
}

@media (max-width: 1040px) {
  .brand-tag {
    display: none;
  }

  .site-header {
    gap: 12px 18px;
  }
}

/* Narrow: sidebar collapses into a <details> menu */

@media (max-width: 900px) {
  :root {
    --header-h: 0px;
  }

  html {
    scroll-padding-top: 16px;
  }

  .site-header {
    position: relative;
    flex-wrap: wrap;
    gap: 4px 18px;
  }

  .brand-mark {
    width: 88px;
    height: 38px;
  }

  .site-search {
    flex: 1 1 100%;
    order: 3;
    margin: 2px 0 4px;
  }

  .search-fallback {
    width: 100%;
  }

  .search-panel {
    left: 0;
    right: auto;
    width: 100%;
  }

  .brand-tag {
    display: inline;
  }

  .home-link {
    margin-left: auto;
  }

  .doc-shell {
    display: block;
    padding-top: 20px;
  }

  .doc-nav,
  .doc-aside {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .doc-nav {
    margin-bottom: 20px;
    border: 1px solid var(--edge-light);
    background: #0d1820;
  }

  .doc-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text);
    font: 0.86rem var(--action);
    letter-spacing: 0.06em;
    list-style: none;
  }

  .doc-nav-toggle::-webkit-details-marker {
    display: none;
  }

  .doc-nav-toggle::after {
    content: "+";
    color: var(--cyan);
    font: 1.1rem var(--mono);
  }

  .doc-nav[open] > .doc-nav-toggle::after {
    content: "−";
  }

  .doc-nav[open] > .doc-nav-toggle {
    border-bottom: 1px solid var(--line);
  }

  .doc-nav-tree {
    padding: 14px 16px 16px;
  }

  .nav-tree li li a {
    padding-block: 9px;
  }

  .doc-toc > ul {
    columns: auto;
  }
}

@media (max-width: 560px) {
  .brand-tag {
    display: none;
  }

  .nav-links {
    gap: 0 16px;
    font-size: 0.86rem;
  }

  .doc-content {
    font-size: 1rem;
  }

  .doc-content pre,
  .code-block pre {
    padding: 14px 14px;
    font-size: 0.8rem;
  }

  .code-block pre {
    padding-top: 46px;
  }

  .prevnext {
    grid-template-columns: 1fr;
  }

  .prevnext .next {
    grid-column: 1;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .button,
  .card,
  .command-tile,
  .prevnext a,
  .search-panel,
  .note {
    border: 1px solid ButtonText;
  }

  :is(.button, .card, .command-tile)::before,
  :is(.button, .card, .command-tile)::after {
    display: none;
  }

  .nav-tree a[aria-current="page"],
  .search-results [aria-selected="true"] a {
    outline: 2px solid Highlight;
  }
}

@media print {
  .site-header,
  .doc-nav,
  .doc-aside,
  .prevnext,
  .copy-button,
  .site-footer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .doc-shell {
    display: block;
  }
}
