/* =========================================================================
   FJX Studios Docs — Design-System
   Akzent: Verlauf #c2b9f9 -> #918be5
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --grad-from: #c2b9f9;
  --grad-to: #918be5;
  --grad: linear-gradient(135deg, var(--grad-from) 0%, var(--grad-to) 100%);
  --grad-soft: linear-gradient(135deg, rgba(194, 185, 249, .16) 0%, rgba(145, 139, 229, .16) 100%);

  --accent: #a9a1f2;
  --accent-strong: #918be5;
  --accent-ink: #12111a;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --topbar-h: 64px;
  --sidebar-w: 288px;
  --toc-w: 236px;
  --content-max: 860px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .18);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .6);

  --dur: 160ms;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* -------------------------------------------------------------- Themes -- */

html[data-theme='dark'] {
  --bg: #0b0a12;
  --bg-alt: #100e18;
  --surface: #15131f;
  --surface-2: #1b1928;
  --surface-3: #221f31;
  --border: #272438;
  --border-soft: #1f1c2d;
  --text: #ecebf5;
  --text-2: #bdb9d0;
  --muted: #8f8ba6;
  --code-bg: #100e19;
  --sel: rgba(145, 139, 229, .32);
  color-scheme: dark;
}

html[data-theme='light'] {
  --bg: #ffffff;
  --bg-alt: #faf9fe;
  --surface: #ffffff;
  --surface-2: #f6f4fd;
  --surface-3: #efecfb;
  --border: #e5e1f4;
  --border-soft: #eeebf8;
  --text: #15131f;
  --text-2: #413d55;
  --muted: #6d6885;
  --code-bg: #f7f5fe;
  --sel: rgba(145, 139, 229, .22);
  color-scheme: light;
}

/* ---------------------------------------------------------------- Base -- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 24px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--sel); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

svg.ico, .brand__mark, .nav-link__icon svg, .nav-group__icon svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
svg.ico--sm { width: 14px; height: 14px; }
.ico-emoji { font-size: 15px; line-height: 1; font-style: normal; }

kbd {
  font-family: var(--font-sans);
  font-size: 10.5px; font-weight: 600;
  padding: 2px 5px; border-radius: 5px;
  background: var(--surface-3); color: var(--muted);
  border: 1px solid var(--border);
  line-height: 1.4;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------- Buttons -- */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  text-decoration: none;
}
.btn:hover { background: var(--surface-3); border-color: var(--accent-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--grad); color: var(--accent-ink);
  border-color: transparent; font-weight: 700;
  box-shadow: 0 6px 20px -8px rgba(145, 139, 229, .8);
}
.btn--primary:hover { filter: brightness(1.06); border-color: transparent; }

.btn--ghost { background: transparent; }
.btn--danger { color: #ff8a8a; border-color: rgba(255, 138, 138, .3); background: rgba(255, 90, 90, .08); }
.btn--danger:hover { background: rgba(255, 90, 90, .16); border-color: rgba(255, 138, 138, .55); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn--discord { background: rgba(88, 101, 242, .14); border-color: rgba(88, 101, 242, .34); color: #b7bdfb; }
.btn--discord:hover { background: rgba(88, 101, 242, .24); border-color: rgba(88, 101, 242, .6); }

.iconbtn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text-2);
  cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }

/* -------------------------------------------------------------- Topbar -- */

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--grad); opacity: .35;
}
.topbar__inner {
  height: 100%; margin: 0 auto; max-width: 1560px;
  padding: 0 20px; display: flex; align-items: center; gap: 14px;
}
.topbar__burger { display: none; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 34px; height: 34px; stroke: none; filter: drop-shadow(0 4px 14px rgba(145, 139, 229, .45)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong {
  font-size: 15px; font-weight: 800; letter-spacing: -.2px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__text span { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .3px; }

.searchbtn {
  display: flex; align-items: center; gap: 9px;
  margin-left: 22px; height: 38px; width: min(360px, 34vw); padding: 0 10px 0 12px;
  border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  font: inherit; font-size: 13.5px; cursor: pointer; text-align: left;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.searchbtn:hover { border-color: var(--accent-strong); background: var(--surface-2); }
.searchbtn > span { flex: 1; }
.searchbtn kbd { margin-left: 0; }

/* ------------------------------------------------------------ Usermenu -- */

.usermenu { position: relative; }
.usermenu__btn {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 9px 0 5px;
  border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.usermenu__btn:hover { border-color: var(--accent-strong); }
.usermenu__btn img { border-radius: 50%; }
.usermenu__name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.usermenu__panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 70;
  min-width: 232px; padding: 8px;
  border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
.usermenu.is-open .usermenu__panel { opacity: 1; visibility: visible; transform: none; }
.usermenu__head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border-soft);
}
.usermenu__head img { border-radius: 50%; }
.usermenu__head strong { display: block; font-size: 13.5px; }
.usermenu__head span { font-size: 11.5px; color: var(--muted); }
.usermenu__item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: 9px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
}
.usermenu__item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.usermenu__item--danger { color: #ff9b9b; }
.usermenu__item--danger:hover { background: rgba(255, 90, 90, .12); color: #ffb0b0; }

/* --------------------------------------------------------------- Shell -- */

.shell {
  margin: 0 auto; max-width: 1560px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 0;
  align-items: start;
}

/* ------------------------------------------------------------- Sidebar -- */

.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column;
  padding: 22px 12px 18px 20px;
  border-right: 1px solid var(--border-soft);
  overflow: hidden;
}
.sidebar__nav { flex: 1; overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
.sidebar__nav::-webkit-scrollbar { width: 8px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
.sidebar__nav:hover::-webkit-scrollbar-thumb { background: var(--surface-3); background-clip: content-box; }

.nav-home {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; margin-bottom: 14px;
  border-radius: 10px; color: var(--text-2);
  font-size: 13.5px; font-weight: 600;
}
.nav-home:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-home.is-active { background: var(--grad-soft); color: var(--text); }
.nav-home.is-active .nav-link__icon { color: var(--accent); }

.nav-group { margin-bottom: 20px; }
.nav-group__head {
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px 8px;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.nav-group__icon { display: inline-flex; color: var(--accent); }
.nav-group__icon svg { width: 15px; height: 15px; }
.nav-group.is-current .nav-group__name {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav-list, .nav-children { list-style: none; margin: 0; padding: 0; }
.nav-children {
  margin-left: 15px; padding-left: 11px;
  border-left: 1px solid var(--border);
  display: none;
}
.nav-item.is-open > .nav-children { display: block; }

.nav-row { display: flex; align-items: stretch; gap: 2px; border-radius: 9px; }
.nav-row.is-active { background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(145, 139, 229, .22); }
.nav-row:not(.is-active):hover { background: var(--surface-2); }

.nav-toggle {
  display: grid; place-items: center;
  width: 20px; flex: none;
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--muted);
}
.nav-toggle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur) var(--ease); }
.nav-item.is-open > .nav-row > .nav-toggle svg { transform: rotate(90deg); }
.nav-toggle--empty { cursor: default; }

.nav-link {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px 7px 4px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  border-radius: 9px;
}
.nav-link:hover { text-decoration: none; color: var(--text); }
.nav-row.is-active .nav-link { color: var(--text); font-weight: 650; }
.nav-link__icon { display: inline-flex; color: var(--muted); }
.nav-row.is-active .nav-link__icon { color: var(--accent); }
.nav-link__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  margin-left: auto; flex: none;
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px;
  background: rgba(255, 193, 94, .16); color: #ffc15e;
}
.nav-empty { color: var(--muted); font-size: 13px; padding: 10px; }

.sidebar__admin {
  display: flex; align-items: center; gap: 9px;
  margin-top: 12px; padding: 10px 12px;
  border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 600;
}
.sidebar__admin:hover { border-color: var(--accent-strong); color: var(--text); text-decoration: none; background: var(--surface-2); }

.sidebar-backdrop { display: none; }

/* ------------------------------------------------------------- Content -- */

.content {
  min-width: 0;
  padding: 40px 48px 96px;
}
.content__inner { max-width: var(--content-max); margin: 0 auto; }

.breadcrumbs {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted); margin-bottom: 14px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; opacity: .55; }

.page-head { margin-bottom: 34px; }
.page-head__icon {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; margin-bottom: 14px;
  border-radius: 14px;
  background: var(--grad-soft);
  border: 1px solid rgba(145, 139, 229, .28);
  color: var(--accent);
}
.page-head__icon svg { width: 23px; height: 23px; }
.page-head__icon .ico-emoji { font-size: 24px; }
.page-head h1 {
  margin: 0; font-size: 38px; line-height: 1.15; letter-spacing: -.03em; font-weight: 800;
}
.page-head__desc { margin: 12px 0 0; color: var(--muted); font-size: 16.5px; line-height: 1.6; }
.page-head__meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft);
  font-size: 12.5px; color: var(--muted);
}
.page-head__meta .btn { margin-left: auto; }

/* -------------------------------------------------------------- Prose --- */

.prose { font-size: 15.5px; }
.prose > *:first-child { margin-top: 0; }

.prose h1, .prose h2, .prose h3, .prose h4 {
  scroll-margin-top: calc(var(--topbar-h) + 24px);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.3;
  color: var(--text);
}
.prose h1 { font-size: 30px; margin: 44px 0 16px; }
.prose h2 {
  font-size: 23px; margin: 46px 0 16px; padding-top: 22px;
  border-top: 1px solid var(--border-soft);
}
.prose h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.prose h3 { font-size: 18px; margin: 32px 0 12px; }
.prose h4 { font-size: 15.5px; margin: 24px 0 10px; color: var(--text-2); }

.heading-anchor {
  margin-left: 8px; color: var(--border);
  opacity: 0; font-weight: 400; text-decoration: none;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .prose h4:hover .heading-anchor { opacity: 1; }
.heading-anchor:hover { color: var(--accent); text-decoration: none; }

.prose p { margin: 14px 0; color: var(--text-2); }
.prose strong { color: var(--text); font-weight: 650; }
.prose em { color: var(--text-2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }

.prose ul, .prose ol { margin: 14px 0; padding-left: 22px; color: var(--text-2); }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--accent); }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin: 6px 0; }
.prose li > p { margin: 6px 0; }
.prose input[type='checkbox'] { accent-color: var(--accent-strong); margin-right: 6px; }

.prose blockquote {
  margin: 20px 0; padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent-strong);
  color: var(--muted); font-style: italic;
}

.prose img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }

.prose code {
  font-family: var(--font-mono); font-size: .875em;
  padding: .16em .42em; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  color: var(--accent); white-space: nowrap;
}

/* ---------------------------------------------------------- Code-Block -- */

.code-block {
  margin: 20px 0;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--code-bg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-block__bar {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px 7px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border-soft);
}
.code-block__lang {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.code-block__copy {
  margin-left: auto;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 7px; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.code-block__copy:hover { color: var(--text); border-color: var(--accent-strong); }
.code-block__copy.is-done { color: #6ee7a8; border-color: rgba(110, 231, 168, .5); }
.code-block pre { margin: 0; padding: 15px 16px; overflow-x: auto; }
.code-block code {
  background: none; border: 0; padding: 0; color: var(--text);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.65;
  white-space: pre;
}

.cb-code { margin: 20px 0; }
.cb-code__title {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; margin-bottom: -1px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border); border-bottom: 0;
  border-radius: 9px 9px 0 0;
  position: relative; z-index: 1;
}
.cb-code > .code-block { margin-top: 0; border-top-left-radius: 0; }
.cb-code--numbered .code-block pre { counter-reset: ln; }

/* Highlight.js — an das Theme angepasst */
.hljs-comment, .hljs-quote { color: #6b6885; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type { color: #c2b9f9; }
.hljs-string, .hljs-doctag, .hljs-regexp { color: #8fe3c0; }
.hljs-number, .hljs-symbol, .hljs-bullet { color: #ffc98a; }
.hljs-title, .hljs-section, .hljs-name, .hljs-title.function_ { color: #93c9ff; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable { color: #f5a8d0; }
.hljs-built_in, .hljs-class .hljs-title { color: #ffd79a; }
.hljs-meta { color: #8f8ba6; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
html[data-theme='light'] .hljs-comment { color: #8a86a3; }
html[data-theme='light'] .hljs-keyword, html[data-theme='light'] .hljs-type { color: #7b6fd6; }
html[data-theme='light'] .hljs-string { color: #1f8a63; }
html[data-theme='light'] .hljs-number { color: #b06a1a; }
html[data-theme='light'] .hljs-title, html[data-theme='light'] .hljs-name { color: #1f6fbf; }
html[data-theme='light'] .hljs-attr, html[data-theme='light'] .hljs-variable { color: #b33f86; }

/* ------------------------------------------------------------- Tabellen -- */

.table-wrap {
  margin: 22px 0; overflow-x: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap th {
  text-align: left; font-weight: 700; font-size: 12px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  padding: 11px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table-wrap td {
  padding: 12px 16px; color: var(--text-2);
  border-bottom: 1px solid var(--border-soft); vertical-align: top;
}
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table-wrap code { white-space: nowrap; }

/* ---------------------------------------------------------------- Hints -- */

.cb-hint {
  display: flex; gap: 13px;
  margin: 22px 0; padding: 15px 17px;
  border-radius: var(--radius);
  border: 1px solid var(--hint-border);
  background: var(--hint-bg);
  position: relative; overflow: hidden;
}
.cb-hint::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--hint-accent);
}
.cb-hint__icon { flex: none; color: var(--hint-accent); margin-top: 1px; }
.cb-hint__icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cb-hint__body { min-width: 0; flex: 1; }
.cb-hint__body > *:first-child { margin-top: 0; }
.cb-hint__body > *:last-child { margin-bottom: 0; }
.cb-hint__body p { color: var(--text-2); margin: 8px 0; }
.cb-hint__body h3, .cb-hint__body h4 {
  margin: 0 0 6px; font-size: 14.5px; color: var(--text); border: 0; padding: 0;
}
.cb-hint__body ul, .cb-hint__body ol { margin: 8px 0; }
.cb-hint__body .code-block { margin: 12px 0; }

.cb-hint--info    { --hint-accent: #7dd3fc; --hint-bg: rgba(125, 211, 252, .07); --hint-border: rgba(125, 211, 252, .22); }
.cb-hint--success { --hint-accent: #6ee7a8; --hint-bg: rgba(110, 231, 168, .07); --hint-border: rgba(110, 231, 168, .22); }
.cb-hint--warning { --hint-accent: #fbbf5c; --hint-bg: rgba(251, 191, 92, .08);  --hint-border: rgba(251, 191, 92, .24); }
.cb-hint--danger  { --hint-accent: #fb7185; --hint-bg: rgba(251, 113, 133, .08); --hint-border: rgba(251, 113, 133, .24); }

/* -------------------------------------------------------------- Stepper -- */

.cb-stepper { margin: 26px 0; counter-reset: fjxstep; }
.cb-step { display: flex; gap: 16px; position: relative; padding-bottom: 8px; }
.cb-step:not(:last-child)::before {
  content: ''; position: absolute; left: 15px; top: 34px; bottom: -6px; width: 2px;
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--border) 100%);
  opacity: .55; border-radius: 2px;
}
.cb-step__marker {
  counter-increment: fjxstep;
  flex: none; width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad); color: var(--accent-ink);
  font-size: 13.5px; font-weight: 800;
  box-shadow: 0 4px 14px -4px rgba(145, 139, 229, .7);
}
.cb-step__marker::before { content: counter(fjxstep); }
.cb-step__body { min-width: 0; flex: 1; padding-bottom: 22px; }
.cb-step__body > *:first-child { margin-top: 0; }
.cb-step__body > *:last-child { margin-bottom: 0; }
.cb-step__body h3, .cb-step__body h4 {
  margin: 4px 0 8px; font-size: 16.5px; font-weight: 700; border: 0; padding: 0;
}

/* ----------------------------------------------------------------- Tabs -- */

.cb-tabs {
  margin: 22px 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.cb-tabs__bar {
  display: flex; gap: 2px; padding: 6px 6px 0;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.cb-tabs__bar::-webkit-scrollbar { display: none; }
.cb-tabs__btn {
  border: 0; background: none; cursor: pointer;
  padding: 8px 14px; border-radius: 8px 8px 0 0;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  white-space: nowrap; position: relative;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.cb-tabs__btn:hover { color: var(--text-2); }
.cb-tabs__btn.is-active { color: var(--text); background: var(--surface); }
.cb-tabs__btn.is-active::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--grad); border-radius: 2px 2px 0 0;
}
.cb-tab { display: none; padding: 4px 18px 18px; }
.cb-tab.is-active { display: block; }
.cb-tab > *:first-child { margin-top: 16px; }
.cb-tab > *:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ Expandable -- */

.cb-expand {
  margin: 18px 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.cb-expand__summary {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; cursor: pointer;
  font-size: 14.5px; font-weight: 600; color: var(--text);
  list-style: none; user-select: none;
  transition: background var(--dur) var(--ease);
}
.cb-expand__summary::-webkit-details-marker { display: none; }
.cb-expand__summary::before {
  content: ''; flex: none; width: 8px; height: 8px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg); margin-left: 3px;
  transition: transform var(--dur) var(--ease);
}
.cb-expand[open] > .cb-expand__summary::before { transform: rotate(45deg); }
.cb-expand__summary:hover { background: var(--surface-2); }
.cb-expand__body { padding: 2px 18px 16px 36px; border-top: 1px solid var(--border-soft); }
.cb-expand__body > *:first-child { margin-top: 14px; }
.cb-expand__body > *:last-child { margin-bottom: 0; }

/* -------------------------------------------------------- Parameter-Feld -- */

.cb-param {
  margin: 14px 0; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease);
}
.cb-param:hover { border-color: rgba(145, 139, 229, .45); }
.cb-param__head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 4px; }
.cb-param__name {
  font-family: var(--font-mono); font-size: 13.5px; font-weight: 600;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); padding: 2px 8px; border-radius: 7px;
}
.cb-param__type {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  color: var(--accent); background: var(--grad-soft);
  padding: 2px 8px; border-radius: 20px; border: 1px solid rgba(145, 139, 229, .28);
}
.cb-param__default { font-size: 12px; color: var(--muted); }
.cb-param__default code { font-size: 11.5px; padding: 1px 5px; }
.cb-param__req {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fb7185; background: rgba(251, 113, 133, .12);
  padding: 2px 7px; border-radius: 20px; border: 1px solid rgba(251, 113, 133, .28);
}
.cb-param__body { color: var(--text-2); font-size: 14px; }
.cb-param__body > *:first-child { margin-top: 0; }
.cb-param__body > *:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- Cards -- */

.cb-cards {
  display: grid; gap: 14px; margin: 24px 0;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}
.cb-card {
  display: block; padding: 18px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text);
  text-decoration: none; position: relative; overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.cb-card--link { cursor: pointer; }
.cb-card--link:hover {
  transform: translateY(-2px); border-color: rgba(145, 139, 229, .5);
  box-shadow: var(--shadow);
}
.cb-card__hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.cb-card__hit:hover { text-decoration: none; }
.cb-card > *:not(.cb-card__hit) { position: relative; z-index: 2; pointer-events: none; }
.cb-card__body a { pointer-events: auto; }
.cb-card::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--grad); opacity: 0; transition: opacity var(--dur) var(--ease);
}
.cb-card--link:hover::after { opacity: 1; }
.cb-card__icon {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; margin-bottom: 12px;
  border-radius: 11px; background: var(--grad-soft);
  border: 1px solid rgba(145, 139, 229, .26); color: var(--accent);
}
.cb-card__icon svg { width: 19px; height: 19px; }
.cb-card__title { font-size: 15.5px; font-weight: 700; margin-bottom: 5px; }
.cb-card__body { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.cb-card__body > *:first-child { margin-top: 0; }
.cb-card__body > *:last-child { margin-bottom: 0; }
.cb-card__body p { color: var(--muted); margin: 0; }

/* ----------------------------------------------------- Ref / Embed / File -- */

.cb-refwrap, .cb-filewrap, .cb-embedwrap { display: block; }
.cb-ref {
  display: flex; align-items: center; gap: 11px;
  margin: 16px 0; padding: 13px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font-size: 14.5px; font-weight: 600; text-decoration: none;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.cb-ref:hover { border-color: var(--accent-strong); background: var(--surface-2); text-decoration: none; }
.cb-ref__icon { color: var(--accent); display: inline-flex; }
.cb-ref__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-ref__arrow { color: var(--muted); transition: transform var(--dur) var(--ease); }
.cb-ref:hover .cb-ref__arrow { transform: translateX(3px); color: var(--accent); }

.cb-embed { display: block; margin: 22px 0; }
.cb-embed--video {
  position: relative; padding-top: 56.25%;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
}
.cb-embed--video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.cb-embed--link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  color: var(--text-2); font-size: 13.5px; word-break: break-all;
}
.cb-embed--link:hover { border-color: var(--accent-strong); text-decoration: none; }

.cb-file {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 14px 0; padding: 10px 15px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600;
}
.cb-file:hover { border-color: var(--accent-strong); text-decoration: none; background: var(--surface-2); }
.cb-file__icon { color: var(--accent); display: inline-flex; }

.cb-columns { display: grid; gap: 18px; margin: 22px 0; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cb-column > *:first-child { margin-top: 0; }

.cb-badge {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; vertical-align: middle;
  background: var(--grad-soft); color: var(--accent);
  border: 1px solid rgba(145, 139, 229, .3);
}
.cb-badge--success { background: rgba(110, 231, 168, .12); color: #6ee7a8; border-color: rgba(110, 231, 168, .3); }
.cb-badge--warning { background: rgba(251, 191, 92, .12); color: #fbbf5c; border-color: rgba(251, 191, 92, .3); }
.cb-badge--danger  { background: rgba(251, 113, 133, .12); color: #fb7185; border-color: rgba(251, 113, 133, .3); }

/* ----------------------------------------------------------------- TOC -- */

.toc {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  padding: 42px 20px 40px 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.toc__title {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px; padding-left: 12px;
}
.toc__title svg { width: 14px; height: 14px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a {
  display: block; padding: 5px 12px;
  font-size: 12.8px; line-height: 1.5; color: var(--muted);
  border-left: 2px solid transparent; margin-left: -1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.toc li a:hover { color: var(--text-2); text-decoration: none; }
.toc li a.is-active { color: var(--accent); border-left-color: var(--accent-strong); font-weight: 600; }
.toc li.toc--3 a { padding-left: 24px; font-size: 12.3px; }

/* --------------------------------------------------------------- Pager -- */

.pager {
  display: grid; gap: 14px; grid-template-columns: 1fr 1fr;
  margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border-soft);
}
.pager__link {
  display: flex; flex-direction: column; gap: 3px;
  padding: 15px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.pager__link:hover { border-color: var(--accent-strong); text-decoration: none; transform: translateY(-1px); }
.pager__link--next { text-align: right; grid-column: 2; }
.pager__label { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pager__title { font-size: 14.5px; font-weight: 650; }

.page-foot {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
}

/* -------------------------------------------------------------- Search -- */

.searchmodal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: start center; padding-top: 10vh; }
.searchmodal[hidden] { display: none; }
.searchmodal__backdrop { position: absolute; inset: 0; background: rgba(6, 5, 12, .68); backdrop-filter: blur(4px); }
.searchmodal__box {
  position: relative; width: min(640px, calc(100vw - 32px));
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: pop 140ms var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.99); } }
.searchmodal__input { display: flex; align-items: center; gap: 11px; padding: 15px 16px; border-bottom: 1px solid var(--border); }
.searchmodal__input svg { color: var(--muted); width: 19px; height: 19px; }
.searchmodal__input input {
  flex: 1; border: 0; background: none; outline: none;
  font: inherit; font-size: 16px; color: var(--text);
}
.searchmodal__input input::placeholder { color: var(--muted); }
.searchmodal__results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.searchmodal__empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.sr-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none;
}
.sr-item:hover, .sr-item.is-active { background: var(--grad-soft); text-decoration: none; }
.sr-item__icon { color: var(--accent); margin-top: 2px; display: inline-flex; }
.sr-item__main { min-width: 0; flex: 1; }
.sr-item__title { font-size: 14px; font-weight: 650; }
.sr-item__crumb { font-size: 11.5px; color: var(--muted); }
.sr-item__snippet { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sr-item mark { background: rgba(145, 139, 229, .3); color: var(--text); border-radius: 3px; padding: 0 2px; }

/* ----------------------------------------------------------- Startseite -- */

.hero {
  position: relative; overflow: hidden;
  margin: -40px -48px 44px; padding: 72px 48px 60px;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(900px 340px at 18% -10%, rgba(194, 185, 249, .16), transparent 65%),
    radial-gradient(700px 300px at 88% 8%, rgba(145, 139, 229, .14), transparent 60%);
}
.hero__inner { max-width: var(--content-max); margin: 0 auto; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px; margin-bottom: 20px;
  border-radius: 30px; border: 1px solid rgba(145, 139, 229, .3);
  background: var(--grad-soft);
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent);
}
.hero h1 { margin: 0; font-size: clamp(34px, 5vw, 52px); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 18px 0 0; max-width: 620px; font-size: 17px; line-height: 1.65; color: var(--muted); }
.hero__actions { display: flex; gap: 11px; flex-wrap: wrap; margin-top: 28px; }

.home-section { max-width: var(--content-max); margin: 0 auto 44px; }
.home-section__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.home-section__head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.home-section__head span { font-size: 13px; color: var(--muted); }

.space-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.space-card {
  display: flex; flex-direction: column;
  padding: 20px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface);
  position: relative; overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.space-card:hover { transform: translateY(-3px); border-color: rgba(145, 139, 229, .5); box-shadow: var(--shadow); }
.space-card__top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.space-card__icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; background: var(--grad); color: var(--accent-ink);
  box-shadow: 0 6px 18px -6px rgba(145, 139, 229, .7);
}
.space-card__icon svg { width: 20px; height: 20px; stroke-width: 2; }
.space-card__icon .ico-emoji { font-size: 20px; }
.space-card h3 { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.space-card__desc { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.space-card__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; margin-top: auto; }
.space-card__links a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; margin: 0 -9px; border-radius: 8px;
  font-size: 13.5px; color: var(--text-2);
}
.space-card__links a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.space-card__links svg { width: 15px; height: 15px; color: var(--muted); }
.space-card__more { font-size: 12.5px; color: var(--muted); padding: 6px 0 0; }

.empty-state {
  max-width: 520px; margin: 60px auto; padding: 40px 32px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius-xl); background: var(--surface);
}
.empty-state svg { width: 40px; height: 40px; color: var(--accent); margin-bottom: 14px; }
.empty-state h2 { margin: 0 0 8px; font-size: 20px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

/* ----------------------------------------------------------------- Auth -- */

.authpage { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.authpage::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(700px 420px at 30% 10%, rgba(194, 185, 249, .2), transparent 60%),
    radial-gradient(600px 400px at 75% 85%, rgba(145, 139, 229, .16), transparent 60%);
}
.authcard {
  position: relative; width: min(420px, 100%); padding: 38px 34px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.authcard .brand__mark { width: 52px; height: 52px; margin-bottom: 18px; }
.authcard h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.02em; }
.authcard p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.authcard .btn { width: 100%; justify-content: center; height: 44px; font-size: 14.5px; }
.authcard__foot { margin-top: 20px; font-size: 12.5px; color: var(--muted); }
.authcard__error {
  margin-bottom: 20px; padding: 11px 14px; border-radius: 10px; text-align: left;
  background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .28);
  color: #fda4af; font-size: 13px;
}

/* ------------------------------------------------------------ Responsive -- */

@media (max-width: 1240px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
  .content { padding: 36px 40px 90px; }
  .hero { margin: -36px -40px 40px; padding: 60px 40px 52px; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar__burger { display: inline-grid; }
  .searchbtn { margin-left: 6px; width: auto; }
  .searchbtn > span, .searchbtn kbd { display: none; }
  .searchbtn { width: 38px; justify-content: center; padding: 0; }
  .brand__text span { display: none; }
  .usermenu__name { display: none; }
  .btn--discord span { display: none; }
  .btn--discord { padding: 0 10px; }

  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; z-index: 90;
    width: min(320px, 86vw); height: calc(100vh - var(--topbar-h));
    background: var(--bg-alt); padding: 20px 14px;
    transform: translateX(-102%);
    transition: transform 220ms var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 80;
    background: rgba(6, 5, 12, .6);
    opacity: 0; visibility: hidden; transition: opacity 200ms var(--ease), visibility 200ms;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
  body.sidebar-open { overflow: hidden; }

  .content { padding: 28px 20px 80px; }
  .hero { margin: -28px -20px 32px; padding: 46px 20px 40px; }
  .page-head h1 { font-size: 30px; }
  .pager { grid-template-columns: 1fr; }
  .pager__link--next { grid-column: 1; }
}

@media print {
  .topbar, .sidebar, .toc, .pager, .searchmodal, .sidebar-backdrop { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; color: #000; }
}

/* Eigenes Logo (public/img/logo.svg|png|webp) */
.brand__mark--custom { object-fit: contain; border-radius: 9px; }
.authcard .brand__mark--custom { width: 52px; height: 52px; }
