/* Help docs (/docs) — generated pages, see gen-docs.mjs.
   Like faq.css this borrows only the :root tokens and @font-face rules from
   styles.css; the page is an ordinary scrolling document.
   Square corners everywhere — the app's brutalist rule. */

.dx-page { background: var(--bg); color: var(--text); }
.dx-page a { color: inherit; }

.dx-skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-fg) !important; padding: 8px 12px;
  font-weight: 700; text-decoration: none;
}
.dx-skip:focus { left: 8px; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.dx-top {
  position: sticky; top: 0; z-index: 30;
  height: 60px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.dx-top-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dx-logo { display: block; text-decoration: none; }
.dx-wordmark { display: flex; align-items: center; gap: 5px; }
.dx-wordmark svg { display: block; }
.dx-docs-label {
  font-family: var(--head); font-size: 22px; letter-spacing: 0.04em; line-height: 1;
  color: var(--muted) !important; text-decoration: none;
  padding-left: 14px; border-left: 1px solid var(--border);
}
.dx-docs-label:hover { color: var(--text) !important; }

.dx-burger { display: none; width: 36px; height: 36px; position: relative; flex: none; }
.dx-burger span { position: absolute; left: 8px; right: 8px; height: 2px; background: var(--text); transition: transform .2s, opacity .2s; }
.dx-burger span:nth-child(1) { top: 11px; }
.dx-burger span:nth-child(2) { top: 17px; }
.dx-burger span:nth-child(3) { top: 23px; }
.dx-nav-open .dx-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.dx-nav-open .dx-burger span:nth-child(2) { opacity: 0; }
.dx-nav-open .dx-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.dx-search-btn {
  display: flex; align-items: center; gap: 10px;
  width: min(420px, 38vw); height: 38px; padding: 0 12px;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  font-size: 14px; text-align: left;
}
.dx-search-btn:hover { border-color: var(--muted); color: var(--text); }
.dx-search-btn-text { flex: 1; }
.dx-search-btn-kbd { font-size: 11px; letter-spacing: 0.06em; padding: 2px 6px; border: 1px solid var(--border); }

.dx-top-right { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.dx-top-link {
  font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted) !important; text-decoration: none; padding: 8px 10px;
}
.dx-top-link:hover { color: var(--text) !important; }
.dx-top-cta {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-fg) !important; text-decoration: none;
  padding: 9px 14px; margin-left: 6px;
}
.dx-top-cta:hover { filter: brightness(0.92); }

/* ── Layout ──────────────────────────────────────────────────────────── */
.dx-body { display: grid; grid-template-columns: 264px minmax(0, 1fr); }

.dx-side {
  position: sticky; top: 60px; align-self: start;
  height: calc(100vh - 60px); height: calc(100dvh - 60px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 16px 48px 20px;
  border-right: 1px solid var(--border);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.dx-side-group { margin-bottom: 26px; }
.dx-side-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px 10px;
}
.dx-side-link {
  display: block; padding: 6px 10px; margin: 1px 0;
  font-size: 14.5px; line-height: 1.35; color: #bdbdbd !important; text-decoration: none;
  border-left: 2px solid transparent;
}
.dx-side-link:hover { color: var(--text) !important; background: var(--panel); }
.dx-side-active, .dx-side-active:hover {
  color: var(--text) !important; background: var(--panel); border-left-color: var(--accent); font-weight: 600;
}
.dx-side-scrim { display: none; }

.dx-main {
  display: grid; grid-template-columns: minmax(0, 760px) 220px; gap: 56px;
  justify-content: center;
  padding: 48px 40px 96px;
}

/* ── Article ─────────────────────────────────────────────────────────── */
.dc-article { min-width: 0; font-size: 16.5px; line-height: 1.7; color: #cfcfcf; }
.dc-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.dc-title {
  font-family: var(--head); font-weight: 400;
  font-size: clamp(44px, 7vw, 72px); line-height: 0.95; letter-spacing: 0.01em;
  color: var(--text); margin: 0 0 16px;
}
.dc-lede { font-size: 19px; line-height: 1.55; color: #bdbdbd; margin: 0 0 36px; max-width: 60ch; }

.dc-article h2 {
  position: relative;
  font-family: var(--head); font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: 0.01em;
  color: var(--text); margin: 52px 0 14px; padding-top: 18px; border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.dc-article h3 {
  position: relative;
  font-family: var(--body); font-weight: 700; font-size: 18px; line-height: 1.3;
  color: var(--text); margin: 32px 0 8px;
  scroll-margin-top: 80px;
}
.dc-anchor {
  position: absolute; left: -22px; opacity: 0; text-decoration: none;
  color: var(--muted) !important; font-family: var(--body); font-weight: 400;
}
.dc-article h2 .dc-anchor { top: 18px; }
.dc-article h2:hover .dc-anchor, .dc-article h3:hover .dc-anchor { opacity: 1; }

.dc-article p { margin: 0 0 16px; }
.dc-article ul, .dc-article ol { margin: 0 0 18px; padding-left: 22px; }
.dc-article li { margin: 6px 0; }
.dc-article li::marker { color: var(--muted); }
.dc-article strong, .dc-article b { color: var(--text); font-weight: 700; }
.dc-article em { color: #e4e4e4; }
.dc-article a:not(.dc-card):not(.dc-pager-link):not(.dc-anchor) {
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
.dc-article a:not(.dc-card):not(.dc-pager-link):hover { text-decoration-thickness: 2px; }
.dc-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em;
  background: var(--panel); border: 1px solid var(--border); padding: 1px 5px; color: var(--text);
}
.dc-article hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

/* UI label in the app's own voice (BEBAS, caps) — e.g. a button name. */
.dc-article .ui {
  font-family: var(--head); font-size: 1.12em; letter-spacing: 0.04em; color: var(--text);
  white-space: nowrap;
}
.dc-article .path {
  display: inline-block; font-size: 0.86em; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text); background: var(--panel2); border: 1px solid var(--border);
  padding: 0 7px; line-height: 1.7;
}
.dc-article .badge {
  display: inline-block; vertical-align: 2px; margin-left: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-fg); background: var(--accent); padding: 2px 6px; line-height: 1.4;
}
.dc-article .badge.grey { background: var(--panel2); color: #bdbdbd; border: 1px solid var(--border); }

/* Callouts */
.dc-callout {
  margin: 22px 0; padding: 14px 18px;
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--muted);
}
.dc-callout-tip  { border-left-color: var(--accent); }
.dc-callout-warn { border-left-color: var(--danger); }
.dc-callout-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.dc-callout-tip .dc-callout-label  { color: var(--accent); }
.dc-callout-warn .dc-callout-label { color: var(--danger); }
.dc-callout p:last-child, .dc-callout ul:last-child { margin-bottom: 0; }

/* Numbered steps */
.dc-article ol.steps { list-style: none; padding: 0; counter-reset: step; margin: 22px 0 26px; }
.dc-article ol.steps > li {
  counter-increment: step; position: relative;
  padding: 0 0 22px 52px; margin: 0;
  border-left: 1px solid var(--border); margin-left: 15px; padding-left: 36px;
}
.dc-article ol.steps > li:last-child { border-left-color: transparent; padding-bottom: 4px; }
.dc-article ol.steps > li::before {
  content: counter(step);
  position: absolute; left: -16px; top: -2px;
  width: 31px; height: 31px; display: grid; place-items: center;
  font-family: var(--head); font-size: 19px; line-height: 1;
  background: var(--accent); color: var(--accent-fg);
}
.dc-article ol.steps > li > b:first-child { display: block; font-size: 17px; margin-bottom: 4px; }

/* Tables */
.dc-table-wrap { overflow-x: auto; margin: 18px 0 24px; border: 1px solid var(--border); }
.dc-article table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.dc-article th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); background: var(--panel); padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.dc-article td { padding: 10px 14px; border-bottom: 1px solid #1c1c1c; vertical-align: top; }
.dc-article tr:last-child td { border-bottom: 0; }
.dc-article td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }

/* Cards */
.dc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 20px 0 28px; }
.dc-card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 40px 16px 16px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--border);
  transition: border-color .15s, transform .15s;
}
.dc-card:hover { border-color: var(--accent); }
.dc-card-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.dc-card-title { font-family: var(--head); font-size: 24px; line-height: 1.05; letter-spacing: 0.02em; color: var(--text); }
.dc-card-body { font-size: 14px; line-height: 1.45; color: #a9a9a9; }
.dc-card-arrow { position: absolute; right: 14px; top: 14px; color: var(--muted); }
.dc-card:hover .dc-card-arrow { color: var(--accent); }

/* Hero (intro page) */
.dc-hero {
  margin: -8px 0 8px; padding: 22px 24px;
  background: var(--accent); color: var(--accent-fg);
}
.dc-hero p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--accent-fg); }
.dc-hero strong { color: var(--accent-fg) !important; }

/* Pager + foot */
.dc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 56px 0 0; }
.dc-pager-link {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  border: 1px solid var(--border); text-decoration: none;
}
.dc-pager-link:hover { border-color: var(--accent); }
.dc-pager-next { text-align: right; }
.dc-pager-dir { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.dc-pager-title { font-family: var(--head); font-size: 22px; letter-spacing: 0.02em; color: var(--text); }
.dc-foot { margin-top: 28px; font-size: 14.5px; color: var(--muted); }

/* ── On this page ────────────────────────────────────────────────────── */
.dx-toc {
  position: sticky; top: 92px; align-self: start;
  max-height: calc(100vh - 120px); overflow-y: auto;
  padding-left: 14px; border-left: 1px solid var(--border);
}
.dx-toc-label { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.dx-toc-link { display: block; font-size: 13.5px; line-height: 1.4; padding: 4px 0; color: #8f8f8f !important; text-decoration: none; }
.dx-toc-link:hover { color: var(--text) !important; }
.dx-toc-l3 { padding-left: 12px; font-size: 13px; }
.dx-toc-active { color: var(--accent) !important; }

/* ── Search ──────────────────────────────────────────────────────────── */
.dx-search-scrim {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.72);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
}
.dx-search-scrim.dx-open { display: flex; }
.dx-search { width: min(620px, 100%); background: var(--panel); border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.dx-search-row { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); color: var(--muted); }
.dx-search-input {
  flex: 1; height: 54px; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 17px;
}
.dx-search-esc { font-size: 11px; letter-spacing: 0.06em; padding: 3px 7px; border: 1px solid var(--border); color: var(--muted); }
.dx-search-results { max-height: min(60vh, 480px); overflow-y: auto; padding: 8px; }
.dx-search-hint { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 6px; }
.dx-search-empty { padding: 18px 10px; color: #a9a9a9; font-size: 14.5px; }
.dx-search-empty a { color: var(--accent); }
.dx-result { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-decoration: none; border-left: 2px solid transparent; }
.dx-result-sel { background: var(--panel2); border-left-color: var(--accent); }
.dx-result-group { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.dx-result-title { font-size: 15.5px; font-weight: 600; color: var(--text); }
.dx-result-sub { font-size: 13px; color: var(--accent); }
.dx-result-desc { font-size: 13.5px; color: #9a9a9a; line-height: 1.4; }

/* ── Shared modal (contact / legal), viewport-anchored as on /faq ──────── */
.dx-page .modal { position: fixed; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .dx-main { grid-template-columns: minmax(0, 760px); }
  .dx-toc { display: none; }
}
@media (max-width: 900px) {
  .dx-top { grid-template-columns: 1fr auto; padding: 0 12px; }
  .dx-top-right { display: none; }
  .dx-burger { display: block; }
  .dx-search-btn { width: 40px; padding: 0; justify-content: center; }
  .dx-search-btn-text, .dx-search-btn-kbd { display: none; }
  .dx-body { grid-template-columns: minmax(0, 1fr); }
  .dx-side {
    position: fixed; top: 60px; left: 0; bottom: 0; z-index: 25; width: min(300px, 86vw);
    /* align-self: auto undoes the desktop rule's `start`. Chrome now applies
       align-self to fixed/absolute boxes, and `start` sizes the drawer to its
       content (≈1500px) instead of stretching it between top and bottom — so
       it was taller than the screen and had nothing to scroll. */
    align-self: auto;
    height: auto; background: var(--bg); transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
  }
  .dx-nav-open .dx-side { transform: none; }
  .dx-side-scrim { display: block; position: fixed; inset: 60px 0 0; z-index: 24; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .dx-nav-open .dx-side-scrim { opacity: 1; pointer-events: auto; }
  .dx-nav-open { overflow: hidden; }
  .dx-main { padding: 32px 20px 72px; }
  .dc-anchor { display: none; }
}
@media (max-width: 520px) {
  .dx-docs-label { font-size: 19px; padding-left: 10px; }
  .dx-wordmark svg { height: 18px; width: auto; }
  .dc-article { font-size: 16px; }
  .dc-lede { font-size: 17px; }
  .dc-article h2 { font-size: 30px; }
  .dc-pager { grid-template-columns: 1fr; }
  .dc-pager-next { text-align: left; }
}
