/* Doku (108): drei Spalten wie eine Produkt-Doku. Baut auf style.css auf (Schrift, Tokens, Fuss) und gilt nur unter body.docs.
   Entwurf: specs/108-doku/entwurf.html. Dunkel nach Systemeinstellung; die Tokens der Website werden dafür auf body umdefiniert. */
body.docs {
  --seitenleiste: oklch(0.985 0.003 265);
  --code-grund: oklch(0.2 0.02 265);
  --code-text: oklch(0.93 0.01 265);
  --code-leise: oklch(0.68 0.02 265);
  --code-linie: oklch(0.32 0.02 265);
  --hinweis: oklch(0.96 0.025 240); --hinweis-rand: oklch(0.6 0.12 240);
  --wichtig: oklch(0.97 0.04 85); --wichtig-rand: oklch(0.68 0.14 70);
  --erfolg: oklch(0.48 0.13 155);
  --docs-kopf: 60px;
  background: var(--flaeche);
  font-size: 16px;
  line-height: 1.65;
}
@media (prefers-color-scheme: dark) {
  body.docs {
    --grund: oklch(0.17 0.012 265); --flaeche: oklch(0.17 0.012 265); --sanft: oklch(0.23 0.014 265); --linie: oklch(0.3 0.014 265);
    --text: oklch(0.94 0.006 265); --gedaempft: oklch(0.75 0.01 265); --leise: oklch(0.64 0.01 265);
    --akzent: oklch(0.76 0.12 265); --akzentSanft: oklch(0.28 0.05 265);
    --seitenleiste: oklch(0.19 0.012 265);
    --code-grund: oklch(0.13 0.012 265); --code-linie: oklch(0.28 0.014 265);
    --hinweis: oklch(0.24 0.04 240); --hinweis-rand: oklch(0.66 0.12 240);
    --wichtig: oklch(0.26 0.05 75); --wichtig-rand: oklch(0.74 0.13 75);
    --erfolg: oklch(0.74 0.13 155);
    color-scheme: dark;
  }
  body.docs .fuss, body.docs .vertrauen { background: var(--grund); color: var(--text); }
}
.docs :is(.docs-artikel, .docs-band) a { color: var(--akzent); }
.docs :is(.docs-artikel, .docs-band) a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Links im Fliesstext unterstrichen, nicht nur farbig (axe link-in-text-block). */
.docs-artikel :is(p, li, td, .p-text) a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in oklch, currentColor 45%, transparent); }
.docs-artikel :is(p, li, td, .p-text) a:hover { text-decoration-color: currentColor; }
.docs :focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 4px; box-shadow: none; }
.docs code { font-family: var(--mono); font-size: 0.86em; }
.docs :not(pre) > code { background: var(--sanft); border: 1px solid var(--linie); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.docs .unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Band „Für deinen Chat“ */
.docs-band { background: var(--akzentSanft); border-bottom: 1px solid var(--linie); padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
.docs-band-innen { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 16px; }
.docs-band-icon { color: var(--akzent); flex: none; }
.docs-band-text { margin: 0; font-size: 14.5px; line-height: 1.45; max-width: 64ch; min-width: 0; }
.docs-band-text strong { font-weight: 600; }
.docs-band-aktionen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.docs-band-link { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 7px; padding: 4px 9px; font-size: 13px; color: var(--gedaempft); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.docs-band-knopf { height: 32px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--text); background: transparent; color: var(--text); font: 600 13.5px var(--schrift); cursor: pointer; white-space: nowrap; }
.docs-band-knopf.haupt { background: var(--text); color: var(--flaeche); }
.docs-band-knopf:hover { opacity: 0.88; }

/* Kopf */
.docs-kopf { position: sticky; top: 0; z-index: 20; height: var(--docs-kopf); display: flex; align-items: center; gap: 16px; background: var(--flaeche); border-bottom: 1px solid var(--linie); padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.docs-marke { display: inline-flex; align-items: center; gap: 10px; color: var(--text) !important; font-weight: 600; font-size: 17px; text-decoration: none !important; }
.docs-marke svg { flex: none; }
.docs-name { color: var(--leise) !important; font-weight: 500; font-size: 17px; text-decoration: none !important; margin-left: -6px; }
.docs-suche { flex: 1; max-width: 420px; position: relative; }
.docs-suche input { width: 100%; height: 36px; border: 1px solid var(--linie); border-radius: 8px; background: var(--seitenleiste); color: var(--text); font: 400 14.5px var(--schrift); padding: 0 12px 0 34px; }
.docs-suche input::placeholder { color: var(--leise); }
.docs-suche svg { position: absolute; left: 11px; top: 10.5px; color: var(--leise); }
.docs-kopf-links { margin-left: auto; display: flex; gap: 22px; font-size: 14.5px; white-space: nowrap; }
.docs-kopf-links a { color: var(--gedaempft); }
.docs-kopf-links a:hover { color: var(--text); text-decoration: none; }
.docs-menue { border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); border-radius: 8px; height: 36px; padding: 0 12px; font: 500 14px var(--schrift); }

/* Gerüst */
.docs-geruest { display: grid; grid-template-columns: 268px minmax(0, 1fr); }
.docs-nav { position: sticky; top: var(--docs-kopf); align-self: start; height: calc(100vh - var(--docs-kopf)); overflow-y: auto; background: var(--seitenleiste); border-right: 1px solid var(--linie); padding: 24px 16px 40px max(20px, env(safe-area-inset-left, 0px)); }
.docs-gruppe + .docs-gruppe { margin-top: 22px; }
.docs-gruppe-titel { font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--leise); margin: 0 0 6px 10px; }
.docs-nav ul { display: flex; flex-direction: column; gap: 1px; }
.docs-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 10px; border-radius: 7px; color: var(--gedaempft); font-size: 14.5px; line-height: 1.4; }
.docs-nav a:hover { background: var(--sanft); color: var(--text); text-decoration: none; }
.docs-nav a[aria-current="page"] { background: var(--akzentSanft); color: var(--akzent); font-weight: 600; }
.docs-nav-code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.docs-etikett { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--erfolg); border: 1px solid currentColor; border-radius: 999px; padding: 0 7px; flex: none; }
.docs-leer { font-size: 14px; color: var(--leise); padding: 6px 10px; }

.docs-rahmen { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 48px; padding: 40px max(24px, env(safe-area-inset-right, 0px)) 80px 56px; max-width: 1180px; }
.docs-rahmen.breit { grid-template-columns: minmax(0, 1fr); }
/* Referenzseiten brauchen die Breite für die Code-Spalte; dort gibt es kein „Auf dieser Seite“. */
.docs-rahmen.breit .docs-toc { display: none; }
.docs-artikel { min-width: 0; max-width: 720px; }
.docs-rahmen.breit .docs-artikel { max-width: none; }
.docs-artikel .brotkrume { font-size: 13.5px; color: var(--leise); margin-bottom: 10px; }
.docs-artikel .brotkrume a { color: var(--leise); }
.docs-artikel h1 { font-size: 34px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance; }
.docs-lead { font-size: 18.5px; line-height: 1.6; color: var(--gedaempft); margin: 0 0 28px; max-width: 64ch; }
.docs-artikel h2 { font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin: 44px 0 12px; scroll-margin-top: calc(var(--docs-kopf) + 24px); text-wrap: balance; }
.docs-artikel h3 { font-size: 17px; font-weight: 600; margin: 28px 0 8px; scroll-margin-top: calc(var(--docs-kopf) + 24px); }
.docs-artikel p { margin: 0 0 14px; max-width: 68ch; }
.docs-artikel ul, .docs-artikel ol { margin: 0 0 16px; padding-left: 22px; max-width: 66ch; }
.docs-artikel ul { list-style: disc; }
.docs-artikel ol { list-style: decimal; }
.docs-artikel li { margin-bottom: 6px; }
.docs-anker { color: var(--leise) !important; opacity: 0; margin-left: 8px; font-weight: 400; text-decoration: none !important; }
.docs-artikel h2:hover .docs-anker, .docs-artikel h3:hover .docs-anker, .docs-anker:focus-visible { opacity: 1; }

/* Kästen */
.doc-kasten { border-left: 3px solid var(--hinweis-rand); background: var(--hinweis); border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 18px 0 22px; font-size: 15px; }
.doc-kasten-wichtig { border-color: var(--wichtig-rand); background: var(--wichtig); }
.doc-kasten .kasten-titel { font-weight: 600; margin: 0 0 2px; }
.doc-kasten p:last-child { margin-bottom: 0; }

/* Code */
.docs .code-block { position: relative; margin: 14px 0 22px; border-radius: 10px; background: var(--code-grund); overflow: hidden; border: 1px solid var(--linie); }
.docs .code-kopf { display: flex; align-items: center; min-height: 38px; padding: 0 110px 0 14px; border-bottom: 1px solid var(--code-linie); font-size: 12.5px; color: var(--code-leise); }
.docs .code { margin: 0; padding: 14px 16px; overflow-x: auto; color: var(--code-text); font: 400 13.2px/1.65 var(--mono); white-space: pre; background: none; border-radius: 0; }
.docs .code-block:not(.mit-kopf) .code { padding-top: 46px; }
/* Prompts sind Text, kein Code: umbrechen statt waagrecht scrollen. */
.docs .code-block pre.code:not(:has(code)) { white-space: pre-wrap; overflow-wrap: anywhere; }
.docs .code code { font-size: inherit; background: none; border: 0; padding: 0; }
.docs .code-kopieren { position: absolute; top: 4px; right: 6px; min-height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--code-leise); font: 500 12.5px var(--schrift); cursor: pointer; }
.docs .code-kopieren:hover, .docs .code-kopieren.ist-kopiert { background: var(--code-linie); color: var(--code-text); }
.t-k { color: oklch(0.78 0.12 300); }
.t-s { color: oklch(0.8 0.12 150); }
.t-n { color: oklch(0.8 0.12 60); }
.t-c { color: var(--code-leise); font-style: italic; }
.t-g { color: oklch(0.78 0.1 230); }
.t-a { color: oklch(0.84 0.09 80); }
.t-f { color: oklch(0.82 0.1 200); }

/* Tabellen */
.docs .tabelle { overflow-x: auto; margin: 14px 0 24px; border: 1px solid var(--linie); border-radius: 10px; }
.docs table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.docs th { text-align: left; font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--leise); background: var(--seitenleiste); padding: 9px 14px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.docs td { padding: 11px 14px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.docs tr:last-child td { border-bottom: 0; }
.docs td:first-child { white-space: nowrap; }
.docs th.rechts, .docs td.rechts { text-align: right; font-variant-numeric: tabular-nums; }

/* Parameter */
.docs .parameter { list-style: none; padding: 0; margin: 10px 0 24px; border-top: 1px solid var(--linie); max-width: none; }
.docs .parameter li { padding: 12px 0; border-bottom: 1px solid var(--linie); margin: 0; }
.p-name { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--text); }
.p-typ { font-size: 13px; color: var(--leise); margin-left: 8px; }
.p-pflicht { font-size: 11.5px; font-weight: 600; color: var(--wichtig-rand); margin-left: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.p-text { display: block; margin-top: 4px; font-size: 14.5px; color: var(--gedaempft); }
.signatur { font-family: var(--mono); font-size: 14px; background: var(--sanft); border: 1px solid var(--linie); border-radius: 8px; padding: 8px 12px; margin: 0 0 16px; overflow-x: auto; white-space: nowrap; max-width: none !important; }
.signatur code { background: none !important; border: 0 !important; padding: 0 !important; font-size: inherit; }
.signatur .m { color: var(--erfolg); font-weight: 600; margin-right: 8px; }

/* Referenz: Text links, Code rechts */
.ref { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 8px 0 36px; border-bottom: 1px solid var(--linie); margin-bottom: 8px; }
.ref + .ref { padding-top: 28px; }
.ref > div { min-width: 0; }
.ref h2 { margin-top: 0 !important; }
.ref-code { position: sticky; top: calc(var(--docs-kopf) + 24px); align-self: start; }
.ref-code .code-block:first-child { margin-top: 0; }

/* Schritte */
.docs .schritte { list-style: none; padding: 0; margin: 14px 0 24px; counter-reset: s; }
.docs .schritte li { counter-increment: s; position: relative; padding: 0 0 18px 44px; margin: 0; }
.docs .schritte li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--linie); display: grid; place-items: center; font-size: 13.5px; font-weight: 600; color: var(--gedaempft); background: var(--flaeche); }
.docs .schritte li::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 1.5px; background: var(--linie); }
.docs .schritte li:last-child::after { display: none; }
.docs .schritte strong { display: block; font-weight: 600; }
.docs .schritte span { color: var(--gedaempft); font-size: 15px; }

/* Anleitungen dazu, Blättern, Stand */
.docs-anleitungen { margin-top: 44px; border: 1px solid var(--linie); border-radius: 12px; padding: 18px 20px; background: var(--seitenleiste); }
.docs-anleitungen-titel { font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--leise); margin: 0 0 8px !important; }
.docs-anleitungen ul { list-style: none !important; padding: 0 !important; margin: 0 !important; display: grid; gap: 4px; }
.docs-anleitungen li { margin: 0; }
.docs-blaettern { display: flex; justify-content: space-between; gap: 12px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--linie); font-size: 14.5px; }
.docs-blaettern a { display: flex; flex-direction: column; border: 1px solid var(--linie); border-radius: 10px; padding: 10px 14px; min-width: 0; max-width: 48%; }
.docs-blaettern a:hover { border-color: var(--akzent); text-decoration: none; }
.docs-blaettern small { color: var(--leise); font-size: 12.5px; }
.docs-weiter { margin-left: auto; text-align: right; }
.docs-stand { margin-top: 18px !important; font-size: 13px; color: var(--leise); }

/* Auf dieser Seite */
.docs-toc { position: sticky; top: calc(var(--docs-kopf) + 40px); align-self: start; font-size: 13.5px; }
.docs-toc-titel { font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--leise); margin: 0 0 10px; }
.docs-toc ul { border-left: 1px solid var(--linie); }
.docs-toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--gedaempft); line-height: 1.4; }
.docs-toc a:hover { color: var(--text); text-decoration: none; }
.docs-toc a.aktiv { color: var(--akzent); border-left-color: var(--akzent); }

@media (max-width: 1180px) { .docs-rahmen { grid-template-columns: minmax(0, 1fr); } .docs-toc { display: none; } }
@media (max-width: 1080px) { .ref { grid-template-columns: minmax(0, 1fr); gap: 4px; } .ref-code { position: static; } }
@media (max-width: 860px) {
  .docs-geruest { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--linie); padding: 16px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px)); }
  .docs-js .docs-nav:not(.offen) { display: none; }
  .docs-kopf-links { display: none; }
  .docs-suche { max-width: none; }
  .docs-rahmen { padding: 28px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); }
  .docs-artikel h1 { font-size: 28px; }
  .docs-name { display: none; }
}
@media (min-width: 861px) { .docs-menue { display: none; } }
@media (max-width: 640px) { .docs td:first-child { white-space: normal; } .docs td, .docs th { padding: 10px; } }
@media (max-width: 640px) { .docs-band-innen { justify-content: flex-start; } .docs-band-icon, .docs-band-link { display: none; } .docs-marke span { display: none; } }
