/* smell docs (/docs, /docs/:page). One sheet for every page: the Glow look of the app (navy ground, the dialog's faces),
   a left rail of every page (docs.js NAV), the article, and an "On this page" rail. Dark only, like the product. */
@font-face { font-family: 'Inter Tight'; src: url('/static/term/InterTight-500.ttf?v=1') format('truetype'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('/static/term/InterTight-600.ttf?v=1') format('truetype'); font-weight: 600 800; font-display: swap; }
@font-face { font-family: 'Clash Display'; src: url('/static/term/ClashDisplay-Semibold.ttf?v=1') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --ground: #080b1c;
  --edge: #1a2154;
  --panel: #0b0f24;
  --panel-2: #0e1330;
  --line: rgba(126, 136, 230, .16);
  --line-2: rgba(255, 255, 255, .09);
  --word: #cfdcf2;
  --text: #c3c8da;
  --sub: #a3a5b9;
  --muted: #7d8094;
  --accent: #8fb4ff;
  --sky: #66b0f5;
  --up: #3ddc97;
  --warn: #f5c451;
  --down: #ff8a8a;
  --btn: #f4f4f6;
  --btn-fg: #0b0b0d;
  --text-face: 'Inter Tight', 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-face: 'Clash Display', 'Inter Tight', system-ui, sans-serif;
  --header-h: 60px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 18px); }
body {
  margin: 0; background: var(--ground); color: var(--text); font: 400 15.5px/1.7 var(--text-face);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
/* the Glow ground: one navy field, lit from the edges */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, rgba(26, 33, 84, .55), transparent 60%),
              radial-gradient(90% 60% at 100% 100%, rgba(26, 33, 84, .35), transparent 60%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: rgba(143, 180, 255, .28); }

/* ── header ── */
.dh {
  position: sticky; top: 0; z-index: 30; height: var(--header-h); display: flex; align-items: center; gap: 18px;
  padding: 0 20px; background: rgba(8, 11, 28, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.dh .brand { display: flex; align-items: center; gap: 9px; color: var(--word); text-decoration: none; flex: none; }
.dh .brand img { width: 30px; height: 30px; border-radius: 8px; }
.dh .brand .wm { font: 600 23px/1 var(--display-face); letter-spacing: -.025em; color: #fff; margin-top: -2px; }
.dh .brand .tag { font: 600 12px/1 var(--text-face); color: var(--sub); padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; letter-spacing: .02em; }
.dh .menu { display: none; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--word); cursor: pointer; }
.dh .menu svg { width: 18px; height: 18px; }
.dh .find {
  flex: 1; max-width: 420px; margin: 0 auto; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .03); color: var(--muted);
  font: 500 14px var(--text-face); cursor: pointer; text-align: left;
}
.dh .find:hover { border-color: rgba(143, 180, 255, .45); color: var(--sub); }
.dh .find svg { width: 16px; height: 16px; flex: none; }
.dh .find span { flex: 1; }
.dh .find kbd { font: 600 11px var(--text-face); color: var(--sub); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
.dh .open {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px;
  background: var(--btn); color: var(--btn-fg); font: 600 14px var(--text-face); text-decoration: none;
}
.dh .open:hover { background: #fff; text-decoration: none; }
.dh .open svg { width: 15px; height: 15px; }

/* ── layout ── */
.dl { display: grid; grid-template-columns: 272px minmax(0, 1fr) 220px; max-width: 1360px; margin: 0 auto; }
.rail {
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 26px 14px 40px 22px;
  border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #232a55 transparent;
}
.rail .grp { margin-bottom: 22px; }
.rail .gh { font: 600 11.5px/1 var(--text-face); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 9px 10px; }
.rail a {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--sub);
  font: 500 14.5px/1.35 var(--text-face); text-decoration: none; position: relative;
}
.rail a:hover { color: var(--word); background: rgba(255, 255, 255, .035); }
.rail a.on { color: #fff; background: rgba(143, 180, 255, .1); }
.rail a.on::before { content: ''; position: absolute; left: -1px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent); }
.rail a.soon { color: var(--muted); pointer-events: none; }
.rail a .pill { margin-left: auto; font: 600 10px/1 var(--text-face); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; }

.main { min-width: 0; padding: 40px 56px 80px; }
.doc { max-width: 760px; margin: 0 auto; }
.crumb { font: 600 12.5px/1 var(--text-face); color: var(--sky); letter-spacing: .03em; margin-bottom: 14px; }
.doc h1 { font: 600 40px/1.12 var(--display-face); letter-spacing: -.022em; word-spacing: .1em; color: #fff; margin: 0 0 14px; }
.doc .lead { font-size: 18px; line-height: 1.6; color: var(--sub); margin: 0 0 34px; }
.doc h2 { font: 600 25px/1.25 var(--display-face); letter-spacing: -.012em; word-spacing: .12em; color: #fff; margin: 52px 0 12px; padding-top: 4px; }
.doc h3 { font: 600 17.5px/1.35 var(--text-face); color: var(--word); margin: 30px 0 8px; }
.doc h2 .anchor, .doc h3 .anchor { margin-left: 8px; color: var(--muted); opacity: 0; font-weight: 500; text-decoration: none; }
.doc h2:hover .anchor, .doc h3:hover .anchor { opacity: 1; }
.doc p { margin: 0 0 16px; }
.doc strong { color: var(--word); font-weight: 600; }
.doc ul, .doc ol { margin: 0 0 18px; padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--muted); }
.doc ol.steps { list-style: none; padding: 0; counter-reset: st; }
.doc ol.steps > li { counter-increment: st; position: relative; padding: 0 0 6px 44px; margin: 0 0 16px; }
.doc ol.steps > li::before {
  content: counter(st); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 600 13px/1 var(--text-face); color: var(--word);
  background: var(--panel-2); border: 1px solid var(--line);
}
.doc code, .doc kbd {
  font: 500 .88em var(--text-face); color: var(--word); background: rgba(255, 255, 255, .055); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 1px 6px;
}
.doc .ui { font-weight: 600; color: var(--word); } /* a control's label, as the app writes it */

/* a figure: the screenshot on its own navy card */
.doc figure { margin: 26px 0 30px; }
.doc figure .shot {
  border-radius: 14px; border: 1px solid var(--line); background: var(--panel); padding: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 0 60px rgba(26, 33, 84, .45);
}
.doc figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 9px; }
.doc figure.narrow img { max-width: 340px; }
.doc figure.pair .shot { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.doc figure.pair img { max-width: 100%; }
.doc figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; text-align: center; }

/* callouts */
.doc .note {
  display: flex; gap: 12px; margin: 22px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(143, 180, 255, .06); font-size: 14.5px; line-height: 1.6;
}
.doc .note svg { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }
.doc .note p:last-child { margin: 0; }
.doc .note.warn { background: rgba(245, 196, 81, .07); border-color: rgba(245, 196, 81, .28); }
.doc .note.warn svg { color: var(--warn); }
.doc .note.tip { background: rgba(61, 220, 151, .06); border-color: rgba(61, 220, 151, .26); }
.doc .note.tip svg { color: var(--up); }

/* a table of controls */
.doc table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 18px 0 26px; font-size: 14.5px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.doc th { text-align: left; font: 600 12px var(--text-face); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: 11px 14px; background: rgba(255, 255, 255, .025); border-bottom: 1px solid var(--line); }
.doc td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.doc tr:last-child td { border-bottom: 0; }
.doc td:first-child { color: var(--word); font-weight: 600; white-space: nowrap; }

/* prev / next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 60px; padding-top: 26px; border-top: 1px solid var(--line); }
.pn a { display: block; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; background: rgba(255, 255, 255, .015); }
.pn a:hover { border-color: rgba(143, 180, 255, .45); background: rgba(143, 180, 255, .05); text-decoration: none; }
.pn a small { display: block; font: 600 12px var(--text-face); color: var(--muted); margin-bottom: 4px; }
.pn a b { font: 600 15.5px var(--text-face); color: var(--word); }
.pn .next { text-align: right; grid-column: 2; }
.foot { margin-top: 34px; font-size: 13px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--sub); }

/* ── "On this page" ── */
.toc { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 40px 18px 40px 6px; }
.toc .th { font: 600 11.5px/1 var(--text-face); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.toc a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--line); color: var(--muted); font: 500 13.5px/1.4 var(--text-face); text-decoration: none; }
.toc a.h3 { padding-left: 24px; font-size: 13px; }
.toc a:hover { color: var(--word); }
.toc a.on { color: #fff; border-left-color: var(--accent); }

/* ── search ── */
.sk { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
  background: rgba(3, 5, 14, .66); backdrop-filter: blur(3px); }
.sk.on { display: flex; }
.sk .box { width: min(600px, 100%); border-radius: 16px; border: 1px solid rgba(126, 136, 230, .26); background: #0b0f24;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 0 60px rgba(26, 33, 84, .5); overflow: hidden; }
.sk .in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.sk .in svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.sk input { flex: 1; height: 56px; border: 0; outline: 0; background: transparent; color: #fff; font: 500 17px var(--text-face); }
.sk .res { max-height: 52vh; overflow-y: auto; padding: 8px; }
.sk .res a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.sk .res a b { display: block; font: 600 15px var(--text-face); color: var(--word); }
.sk .res a small { font: 500 12.5px var(--text-face); color: var(--muted); }
.sk .res a.sel, .sk .res a:hover { background: rgba(143, 180, 255, .1); }
.sk .empty { padding: 22px 14px; color: var(--muted); font-size: 14px; text-align: center; }

/* ── narrower screens ── */
@media (max-width: 1180px) {
  .dl { grid-template-columns: 252px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .dl { display: block; }
  .dh { padding: 0 14px; gap: 10px; }
  .dh .menu { display: grid; place-items: center; }
  .dh .brand .tag { display: none; }
  .dh .find { max-width: none; }
  .dh .find kbd, .dh .find span { display: none; }
  .dh .find { flex: none; width: 38px; padding: 0; justify-content: center; margin: 0 0 0 auto; }
  .dh .open { padding: 0 12px; }
  .rail { position: fixed; z-index: 40; top: var(--header-h); left: 0; bottom: 0; width: min(300px, 86vw); height: auto;
    background: #0a0e22; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  body.rail-on .rail { transform: none; }
  body.rail-on::after { content: ''; position: fixed; inset: var(--header-h) 0 0 0; z-index: 35; background: rgba(3, 5, 14, .5); }
  .main { padding: 28px 16px 64px; }
  .doc h1 { font-size: 32px; }
  .doc .lead { font-size: 16.5px; }
  .doc h2 { font-size: 22px; margin-top: 42px; }
  .doc figure.pair .shot { grid-template-columns: 1fr; }
  .doc td:first-child { white-space: normal; }
  .doc td, .doc th { padding-left: 10px; padding-right: 10px; }
  .pn { grid-template-columns: 1fr; }
  .pn .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { .rail { transition: none; } }

/* ── photo-led explanation: a screenshot with numbered markers (baked into the image) and its legend ── */
.doc ol.legend { list-style: none; padding: 0; margin: -10px 0 30px; counter-reset: lg; display: grid; gap: 10px; }
.doc ol.legend > li { counter-increment: lg; position: relative; margin: 0; padding: 2px 0 2px 40px; min-height: 28px; }
.doc ol.legend > li::before {
  content: counter(lg); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font: 600 13px/1 var(--text-face); color: #080b1c; background: var(--accent);
  box-shadow: 0 0 0 3px var(--ground);
}
.doc ol.legend > li strong:first-child { color: #fff; }
.doc figure.side { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 26px; align-items: start; }
.doc figure.side .shot img { max-width: 100%; }
.doc figure.side ol.legend { margin: 4px 0 0; }
.doc figure.side figcaption { grid-column: 1; }
/* any screenshot opens full size */
.doc figure img { cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 24px;
  background: rgba(3, 5, 14, .86); backdrop-filter: blur(4px); cursor: zoom-out; }
.zoom.on { display: flex; }
.zoom img { max-width: min(1600px, 100%); max-height: 100%; object-fit: contain; border-radius: 12px;
  border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
@media (max-width: 860px) {
  .doc figure.side { grid-template-columns: 1fr; }
  .doc figure.side .shot { max-width: 360px; margin: 0 auto; }
}

/* ── the header's links (docs.js LINKS) ── */
.dlinks { display: flex; align-items: center; gap: 4px; flex: none; }
@media (min-width: 1081px) { .dh .find { margin: 0 14px 0 auto; } }
.dlinks .dl-a { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px; border-radius: 9px; border: 0;
  background: transparent; color: var(--sub); font: 500 14.5px var(--text-face); text-decoration: none; cursor: pointer; }
.dlinks .dl-a:hover, .dlinks .dl-a[aria-expanded="true"] { color: var(--word); background: rgba(255, 255, 255, .04); text-decoration: none; }
.dlinks .dl-a[aria-expanded="true"] { color: var(--accent); }
.dlinks .dl-a svg { width: 14px; height: 14px; transition: transform .15s; }
.dlinks .dl-a[aria-expanded="true"] svg { transform: rotate(180deg); }
.dlinks .dl-m { position: relative; }
.dlinks .dl-pop { position: absolute; top: calc(100% + 8px); left: 0; min-width: 190px; padding: 6px; border-radius: 12px;
  border: 1px solid rgba(126, 136, 230, .24); background: #0b0f24; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); z-index: 40; }
.dlinks .dl-pop[hidden] { display: none; }
.dlinks .dl-i { display: block; padding: 9px 12px; border-radius: 8px; color: var(--word); font: 500 14.5px var(--text-face); text-decoration: none; }
.dlinks .dl-i:hover { background: rgba(143, 180, 255, .1); text-decoration: none; }
.dlinks .dl-i small, .rail a small { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.rail .rail-links { display: none; }
@media (max-width: 1080px) { .dlinks { display: none; } .rail .rail-links { display: block; } }
