/* Developer docs: a three-column reading frame, code in Learnya ink and paper, amber only for what the
   reader changes, and the request-path figure. Built on the site tokens of styles.css. */

:root {
  --dx-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --dx-hdr: 68px;
  /* The code ground stays ink in both themes. Dark lifts it a step off the page. */
  --dx-code-bg: #15120e;
  --dx-code-bar: #1c1813;
  --dx-code-out: #110f0b;
  --dx-code-line: rgba(244, 239, 230, .09);
  --dx-code-ink: #ece6da;
  --dx-code-muted: #8a8170;
  --dx-tok-k: #fbf6ec;
  --dx-tok-s: #d6c49b;
  --dx-tok-p: #a9bdd2;
  --dx-tok-n: #e0b39b;
  --dx-tok-f: #b6d1c4;
  --dx-mark: #ffc27a;
  --dx-mark-bg: rgba(243, 167, 82, .17);
  --dx-swiss-tint: rgba(201, 122, 35, .055);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --dx-code-bg: #17140f;
    --dx-code-bar: #1d1a14;
    --dx-code-out: #120f0b;
    --dx-swiss-tint: rgba(243, 167, 82, .06);
  }
}
:root[data-theme="dark"] {
  --dx-code-bg: #17140f;
  --dx-code-bar: #1d1a14;
  --dx-code-out: #120f0b;
  --dx-swiss-tint: rgba(243, 167, 82, .06);
}

/* Frame. It keeps the container of every learnya.ai header and footer, so the three columns share its edges. */
.dx { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
.dx:has(> .dx-toc) { grid-template-columns: 200px minmax(0, 1fr) 180px; }
.dx-side { position: sticky; top: var(--dx-hdr); align-self: start; max-height: calc(100dvh - var(--dx-hdr)); overflow-y: auto; padding: 32px 4px 40px 0; overscroll-behavior: contain; }
.dx-main { min-width: 0; padding: 40px 0 96px; max-width: 800px; }
.dx-main.is-wide { max-width: 1000px; }

/* Side navigation */
.dx-nav { display: grid; gap: 22px; margin-top: 22px; }
.dx-nav-h { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px 10px; }
.dx-nav-g { display: grid; gap: 1px; }
.dx-nav-a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--ink-soft); font-size: .9rem; line-height: 1.35; text-decoration: none; }
.dx-nav-a:hover { color: var(--ink); background: var(--surface); }
.dx-nav-a[aria-current="page"] { color: var(--ink); font-weight: 600; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

.dx-search-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; }
.dx-search-btn:hover { border-color: var(--line-2); color: var(--ink-soft); }
.dx-search-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.dx-search-btn span { flex: 1; text-align: left; }
.dx kbd { font-family: var(--dx-mono); font-size: .72rem; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 5px; color: var(--muted); background: var(--surface-2); }

/* Phone navigation, folded at the top of the page */
.dx-mnav { display: none; margin: 0 0 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.dx-mnav > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.dx-mnav > summary::-webkit-details-marker { display: none; }
.dx-mnav > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.dx-mnav[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.dx-mnav-k { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dx-mnav-t { font-weight: 600; font-size: .92rem; }
.dx-mnav[open] { padding-bottom: 14px; }
.dx-mnav .dx-search-btn { margin: 4px 14px 0; width: calc(100% - 28px); }
.dx-mnav .dx-nav { padding: 0 8px; }

/* Page head */
.dx-eyebrow { margin: 0 0 12px; font-size: .74rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-text); }
.dx-head h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 3.2vw, 2.5rem); line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
.dx-main.is-wide .dx-head h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); max-width: 19ch; }
.dx-lead { margin: 16px 0 0; font-size: 1.1rem; line-height: 1.6; color: var(--ink-soft); max-width: 62ch; }
.dx-hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; }
.dx-hero-code { margin-top: 32px; }

/* On this page */
.dx-toc { position: sticky; top: var(--dx-hdr); align-self: start; padding: 44px 0 40px; max-height: calc(100dvh - var(--dx-hdr)); overflow-y: auto; }
.dx-toc-h { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.dx-toc ol, .dx-mtoc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dx-toc a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: .84rem; line-height: 1.4; text-decoration: none; }
.dx-toc a:hover { color: var(--ink); }
.dx-toc a[aria-current="location"] { color: var(--ink); border-left-color: var(--ink); }
.dx-mtoc { display: none; margin: 26px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dx-mtoc > summary { cursor: pointer; padding: 11px 0; font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.dx-mtoc ol { padding: 0 0 12px; }
.dx-mtoc a { color: var(--ink-soft); font-size: .9rem; text-decoration: none; padding: 4px 0; display: block; }

/* Sections and prose */
.dx-sec { scroll-margin-top: calc(var(--dx-hdr) + 20px); margin-top: 56px; }
.dx-sec > h2 { margin: 0 0 16px; font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; letter-spacing: -.01em; line-height: 1.25; text-wrap: balance; }
.dx-anchor { color: inherit; text-decoration: none; }
.dx-anchor:hover::after { content: " #"; color: var(--muted); font-weight: 400; }
.dx-sec p { margin: 0 0 14px; line-height: 1.7; color: var(--ink-soft); max-width: 68ch; }
.dx-sec p a:not(.btn), .dx-sec li a, .dx-table a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.dx-sec p a:not(.btn):hover, .dx-table a:hover { text-decoration-color: var(--ink); }
.dx-list { margin: 0 0 16px; padding-left: 1.15rem; display: grid; gap: 8px; color: var(--ink-soft); line-height: 1.6; max-width: 66ch; }
.dx-list li::marker { color: var(--muted); }
.dx-sec > * + .dx-code, .dx-sec > .dx-code + * { margin-top: 18px; }
.dx-main :not(pre) > code { font-family: var(--dx-mono); font-size: .86em; padding: 1px 5px; border-radius: 5px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; }

/* Code */
.dx-code { margin: 0; border-radius: 12px; overflow: hidden; background: var(--dx-code-bg); color: var(--dx-code-ink); box-shadow: 0 0 0 1px var(--dx-code-line), var(--shadow); }
.dx-code-bar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 8px 0 14px; background: var(--dx-code-bar); border-bottom: 1px solid var(--dx-code-line); }
.dx-tabs { display: flex; gap: 2px; align-self: stretch; overflow-x: auto; scrollbar-width: none; }
.dx-tabs [role="tab"] { position: relative; padding: 0 10px; border: 0; background: none; color: var(--dx-code-muted); font: 500 .8rem var(--font-body); cursor: pointer; white-space: nowrap; }
.dx-tabs [role="tab"]:hover { color: var(--dx-code-ink); }
.dx-tabs [role="tab"][aria-selected="true"] { color: var(--dx-tok-k); }
.dx-tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px; background: var(--dx-tok-k); }
.dx-tabs [role="tab"]:focus-visible, .dx-copy:focus-visible { outline: 2px solid var(--dx-mark); outline-offset: -2px; border-radius: 6px; }
.dx-code-lang { font-size: .8rem; font-weight: 500; color: var(--dx-code-muted); }
.dx-code-cap { font-size: .8rem; color: var(--dx-code-muted); }
.dx-copy { margin-left: auto; flex: none; padding: 5px 10px; border: 1px solid var(--dx-code-line); border-radius: 7px; background: transparent; color: var(--dx-code-muted); font: 500 .76rem var(--font-body); cursor: pointer; }
.dx-copy:hover { color: var(--dx-code-ink); border-color: rgba(244, 239, 230, .2); }
.dx-pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; font-family: var(--dx-mono); font-size: .81rem; line-height: 1.7; tab-size: 2; }
.dx-pre code { font: inherit; white-space: pre; color: inherit; background: none; border: 0; padding: 0; }
.dx-out { background: var(--dx-code-out); border-top: 1px solid var(--dx-code-line); }
.dx-out-h { padding: 10px 18px 0; font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--dx-code-muted); }
.dx-pre-out { max-height: 340px; overflow-y: auto; padding-top: 8px; }
.dx-pre-out code { white-space: pre-wrap; overflow-wrap: anywhere; }
.dx-hero-code .dx-pre-out { max-height: none; }
.dx-c { color: var(--dx-code-muted); font-style: italic; }
.dx-s { color: var(--dx-tok-s); }
.dx-p { color: var(--dx-tok-p); }
.dx-n { color: var(--dx-tok-n); }
.dx-k { color: var(--dx-tok-k); font-weight: 600; }
.dx-f { color: var(--dx-tok-f); }
.dx-v { color: var(--dx-mark); background: var(--dx-mark-bg); border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -1px 0 rgba(243, 167, 82, .55); }
.dx-v .dx-s, .dx-s .dx-v { color: var(--dx-mark); }

/* Tables */
.dx-table { overflow-x: auto; margin: 4px 0 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.dx-table table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.dx-table th, .dx-table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); line-height: 1.5; }
.dx-table tbody tr:last-child > * { border-bottom: 0; }
.dx-table thead th { font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.dx-table tbody th { font-weight: 600; color: var(--ink); }
.dx-table td { color: var(--ink-soft); }
.dx-table code { white-space: nowrap; }

/* Notes */
.dx-note { margin: 18px 0; padding: 13px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); line-height: 1.6; color: var(--ink-soft); font-size: .94rem; max-width: 70ch; }
.dx-note strong { color: var(--ink); }
.dx-note-warn { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }

/* Parameters */
.dx-params { margin: 0; display: grid; border-top: 1px solid var(--line); }
.dx-param { padding: 14px 0; border-bottom: 1px solid var(--line); }
.dx-param dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.dx-type { font-family: var(--dx-mono); font-size: .76rem; color: var(--muted); }
.dx-req { font-size: .72rem; font-weight: 600; color: var(--accent-text); }
.dx-param dd { margin: 6px 0 0; color: var(--ink-soft); line-height: 1.6; }
.dx-ep { font-family: var(--dx-mono); }
.dx-m { font-weight: 700; color: var(--accent-text); margin-right: 2px; }

/* Steps: a real sequence, so they are numbered */
.dx-steps { list-style: none; margin: 0; padding: 0; counter-reset: dx-step; display: grid; gap: 0; }
.dx-steps > li { position: relative; min-width: 0; padding: 0 0 28px 46px; counter-increment: dx-step; }
.dx-steps > li::before { content: counter(dx-step); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 .82rem var(--font-display); color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.dx-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 6px; width: 1px; background: var(--line); }
.dx-steps h3 { margin: 0 0 8px; font-size: 1.02rem; font-weight: 600; }
.dx-steps .dx-code { margin-top: 12px; }

/* Doors */
.dx-doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.dx-door { position: relative; display: grid; align-content: start; gap: 8px; padding: 20px 20px 44px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.dx-door:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.dx-door-k { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.dx-door-t { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.3; }
.dx-door-d { color: var(--ink-soft); font-size: .92rem; line-height: 1.55; }
.dx-door-more { position: absolute; left: 20px; bottom: 16px; color: var(--muted); transition: transform .15s, color .15s; }
.dx-door:hover .dx-door-more { transform: translateX(3px); color: var(--ink); }

/* Models */
.dx-models { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.dx-model { display: grid; gap: 10px; padding: 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
a.dx-model:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.dx-model-n { font-family: var(--font-display); font-weight: 600; font-size: 2rem; letter-spacing: -.03em; line-height: 1; }
.dx-model-d { color: var(--ink-soft); line-height: 1.55; font-size: .95rem; }

/* Request path */
.dx-path { margin: 8px 0 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.dx-path-req { display: inline-flex; gap: 8px; padding: 6px 12px; border-radius: 8px; background: var(--dx-code-bg); color: var(--dx-code-ink); font: .78rem var(--dx-mono); margin-bottom: 26px; max-width: 100%; overflow-x: auto; white-space: nowrap; }
.dx-path-req .dx-m { color: var(--dx-mark); }
.dx-path-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.dx-path-track::before { content: ""; position: absolute; left: 22px; right: 22px; top: 37px; height: 1px; background: var(--line-2); }
.dx-stop { position: relative; display: grid; align-content: start; gap: 7px; padding: 30px 18px 20px; }
.dx-stop-node { position: relative; z-index: 1; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1.5px var(--ink); margin-bottom: 6px; }
.dx-stop.is-swiss .dx-stop-node { background: var(--accent); box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 5px var(--surface); }
.dx-stop-where { font: .74rem var(--dx-mono); color: var(--muted); }
.dx-stop-t { font-family: var(--font-display); font-weight: 600; font-size: 1.06rem; }
.dx-stop-d { color: var(--ink-soft); font-size: .88rem; line-height: 1.55; }
.dx-stop-keep { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .84rem; line-height: 1.5; color: var(--ink); }
.dx-stop-kh { display: block; font-size: .68rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
/* The Swiss boundary: one dashed frame around the contiguous stops that run in Switzerland. */
.dx-stop.is-swiss { background: var(--dx-swiss-tint); border-top: 1px dashed var(--accent); border-bottom: 1px dashed var(--accent); }
.dx-stop:not(.is-swiss) + .dx-stop.is-swiss { border-left: 1px dashed var(--accent); border-radius: 12px 0 0 12px; }
.dx-stop.is-swiss:has(+ .dx-stop:not(.is-swiss)) { border-right: 1px dashed var(--accent); border-radius: 0 12px 12px 0; }
.dx-path-flag { position: absolute; top: -10px; left: 14px; padding: 0 8px; background: var(--surface); font-size: .7rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-text); line-height: 20px; }
.dx-path figcaption { margin-top: 16px; font-size: .84rem; color: var(--muted); }

/* Search */
.dx-search { width: min(640px, calc(100% - 32px)); max-height: 72vh; margin: 12vh auto 0; padding: 0; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.dx-search::backdrop { background: rgba(12, 11, 9, .38); backdrop-filter: blur(3px); }
.dx-search-in { display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: 72vh; }
.dx-search-q { width: 100%; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 1.05rem; outline: none; }
.dx-search-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.dx-hit { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; }
.dx-hit:hover, .dx-hit:focus-visible, .dx-hit.is-first { background: var(--surface-2); outline: none; box-shadow: inset 0 0 0 1px var(--line); }
.dx-hit-p { color: var(--muted); font-size: .84rem; white-space: nowrap; }
.dx-search-empty { margin: 0; padding: 20px; color: var(--muted); }

/* Previous and next */
.dx-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); }
.dx-pager-a { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; background: var(--surface); }
.dx-pager-a:hover { border-color: var(--line-2); }
.dx-pager-a.is-next { text-align: right; grid-column: 2; }
.dx-pager-k { font-size: .76rem; color: var(--muted); }
.dx-pager-t { font-weight: 600; }

@media (max-width: 1220px) {
  .dx:has(> .dx-toc) { grid-template-columns: 200px minmax(0, 1fr); }
  .dx-toc { display: none; }
  .dx-mtoc { display: block; }
}
@media (max-width: 960px) {
  .dx, .dx:has(> .dx-toc) { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dx-side { display: none; }
  .dx-mnav { display: block; }
  .dx-main { padding-top: 20px; }
  .dx-path-track { grid-template-columns: minmax(0, 1fr); }
  .dx-path-track::before { left: 23px; right: auto; top: 22px; bottom: 22px; width: 1px; height: auto; }
  .dx-stop { padding: 18px 16px 18px 44px; }
  .dx-stop-node { position: absolute; left: 18px; top: 22px; margin: 0; }
  .dx-stop.is-swiss { border-top: 0; border-bottom: 0; border-left: 1px dashed var(--accent); border-right: 1px dashed var(--accent); border-radius: 0; }
  .dx-stop:not(.is-swiss) + .dx-stop.is-swiss { border-top: 1px dashed var(--accent); border-radius: 12px 12px 0 0; }
  .dx-stop.is-swiss:has(+ .dx-stop:not(.is-swiss)) { border-bottom: 1px dashed var(--accent); border-radius: 0 0 12px 12px; }
}
@media (max-width: 560px) {
  .dx-path { padding: 16px 12px; }
  /* A phone cannot show 64 columns: lines wrap rather than scroll sideways. */
  .dx-pre { font-size: .74rem; padding: 14px; }
  .dx-pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .dx-pager { grid-template-columns: minmax(0, 1fr); }
  .dx-pager-a.is-next { grid-column: 1; }
  /* A row becomes a small card: its first cell as the title, the others under it. */
  .dx-table { overflow: visible; }
  .dx-table thead { display: none; }
  .dx-table table, .dx-table tbody, .dx-table tr, .dx-table th, .dx-table td { display: block; }
  .dx-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .dx-table tbody tr:last-child { border-bottom: 0; }
  .dx-table th, .dx-table td { padding: 0; border: 0; }
  .dx-table td { margin-top: 4px; }
  .dx-main .dx-table code { white-space: normal; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  .dx-door, .dx-door-more, .dx-mnav > summary::after { transition: none; }
}

/* Docs header extras: the shared header and footer come from styles.css. The search button wears the burger's shape. */
.dx-hdr .nav { gap: 1rem; }
.dx-hdr-search { display: none; width: 42px; height: 42px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; place-items: center; }
.dx-hdr-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.dx-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.dx-endpoint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.dx-sec { margin-top: 56px; }
@media (max-width: 760px) {
  .dx-hdr .nav-links { display: none; }
  .dx-hdr-search { display: grid; }
}
/* A phone keeps the lockup and the search; the key request stays in the page's own calls to action. */
@media (max-width: 620px) {
  .dx-hdr .nav .btn-accent { display: none; }
}
/* The site gives every section a band's padding; a docs section is a block of reading, not a band. */
section.dx-sec { padding: 0; }
