/* developers.conversionloop.net – dieselben Marken-Tokens wie Backoffice und Landingpage. */
@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/geist.woff2') format('woff2-variations');
}

:root {
  --brand-900: #003d66;
  --brand-700: #0069a9;
  --brand-500: #1e9fd8;
  --brand-300: #3ad4ff;
  --brand-050: #eef4f8;
  --ink-900: #10151f;
  --ink-800: #1c2431;
  --ink-700: #333b4b;
  --ink-500: #5a6579;
  --ink-400: #7b8698;
  --line: #e3e8ef;
  --surface: #ffffff;
  --surface-sunken: #f5f7fa;
  --ok: #1f7a4d;
  --ok-bg: #eefaf3;
  --danger: #a52620;
  --danger-bg: #fdf0ef;
  --warn: #b45309;
  --font: 'Geist Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius: 10px;
  --header-h: 60px;
  --sidebar-w: 270px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.65;
  color: var(--ink-800); background: var(--surface); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-700); text-underline-offset: 2px; }
a:hover { color: var(--brand-900); }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .86em; background: var(--brand-050); color: var(--ink-900); padding: .1em .35em; border-radius: 4px; }
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.muted { color: var(--ink-500); font-weight: 400; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: .75rem; z-index: 20; background: var(--surface); padding: .4rem .8rem; }

/* --- Kopfzeile --- */
.top {
  position: sticky; top: 0; z-index: 10; height: var(--header-h);
  display: flex; align-items: center; gap: 1.5rem; padding: 0 1.5rem;
  background: var(--ink-700); color: #fff;
}
.brand { display: inline-flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__word { font-weight: 700; font-size: 1.15rem; letter-spacing: -.035em; }
.brand__tag {
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-300); border: 1px solid rgba(58,212,255,.45); border-radius: 999px; padding: .05rem .5rem;
}
.top__nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.top__nav a { color: #dfe5ee; text-decoration: none; padding: .4rem .75rem; border-radius: var(--radius-sm); font-size: .92rem; font-weight: 500; }
.top__nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.top__nav a[aria-current] { color: #fff; background: rgba(255,255,255,.12); }
.top__nav .top__cta { background: var(--brand-700); color: #fff; margin-left: .5rem; }
.top__nav .top__cta:hover { background: var(--brand-500); }
.menu-toggle { display: none; }

/* --- Rahmen --- */
.frame { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto;
  border-right: 1px solid var(--line); background: var(--surface-sunken); padding: 1.25rem 1rem 2rem;
  font-size: .9rem;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: flex; align-items: center; gap: .45rem; padding: .28rem .6rem; border-radius: var(--radius-sm); color: var(--ink-700); text-decoration: none; }
.sidebar a:hover { background: #e9eef4; color: var(--ink-900); }
.sidebar a[aria-current] { background: var(--brand-050); color: var(--brand-700); font-weight: 600; }
.sidebar__title { margin: 1.1rem .6rem .35rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400); }
.sidebar__title:first-child { margin-top: 0; }
.sidebar__ref > li > a { font-weight: 600; color: var(--ink-900); margin-top: .35rem; }
.sidebar__ref ul a { font-size: .84rem; padding-left: .6rem; }

.content { min-width: 0; padding: 2.5rem 3rem 0; }
.prose { max-width: 760px; }
.is-wide .content { padding-right: 2rem; }

/* --- Text --- */
h1, h2, h3, h4 { color: var(--ink-900); letter-spacing: -.02em; line-height: 1.25; }
h1 { font-size: 2.1rem; margin: 0 0 1rem; letter-spacing: -.03em; }
h2 { font-size: 1.45rem; margin: 2.6rem 0 .8rem; padding-top: .4rem; }
h3 { font-size: 1.12rem; margin: 2rem 0 .6rem; }
h4 { font-size: .95rem; margin: 1.6rem 0 .5rem; }
.anchor { color: inherit; text-decoration: none; }
.anchor:hover::after { content: ' #'; color: var(--ink-400); }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin: .25rem 0; }
.prose blockquote {
  margin: 1.25rem 0; padding: .8rem 1rem; background: var(--brand-050); border-left: 3px solid var(--brand-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

pre, .code {
  margin: 0 0 1.25rem; padding: 1rem 1.1rem; overflow-x: auto; position: relative;
  background: var(--ink-900); color: #d7ecff; border-radius: var(--radius);
  font-family: var(--mono); font-size: .82rem; line-height: 1.6;
}
.copy {
  position: absolute; top: .5rem; right: .5rem; padding: .2rem .55rem; font: 600 .72rem var(--font);
  color: #cfe0f2; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 5px; cursor: pointer;
  opacity: 0; transition: opacity .15s;
}
pre:hover .copy, .copy:focus-visible { opacity: 1; }

table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); }
th, td { text-align: left; vertical-align: top; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
th { background: var(--surface-sunken); font-size: .8rem; color: var(--ink-500); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.prose table:not(.conditions):not(.operators) { border: 1px solid var(--line); margin-bottom: 1.5rem; }
.conditions td:first-child { width: 1%; white-space: nowrap; }
.conditions td:nth-child(3) code { display: inline-block; margin: 0 .15rem .2rem 0; }
.cell-note { margin-top: .35rem; font-size: .84rem; color: var(--ink-500); }
.cell-note code { display: inline-block; margin: 0 .15rem .2rem 0; }
.tag-live {
  display: inline-block; margin-top: .3rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 0 .45rem;
}

/* --- Referenz --- */
.ref-intro { max-width: 760px; margin-bottom: 1rem; }
.tag { border-top: 1px solid var(--line); margin-top: 3rem; }
.tag > h2 { margin-top: 2rem; }
.tag__desc { max-width: 760px; color: var(--ink-700); }
.op {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem;
  padding: 1.5rem 0 2rem; border-bottom: 1px solid var(--line);
}
.op:last-child { border-bottom: 0; }
.op__doc h3 { margin-top: .5rem; }
.op__code { position: sticky; top: calc(var(--header-h) + 1rem); align-self: start; }
.code__label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); margin: 0 0 .4rem; }
.endpoint { margin: 0 0 .4rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.endpoint code { background: none; padding: 0; font-size: .9rem; color: var(--ink-900); overflow-wrap: anywhere; }
.scope { margin: 0 0 1rem; font-size: .85rem; color: var(--ink-500); }

.method {
  display: inline-block; min-width: 3.4rem; text-align: center; padding: .1rem .45rem; border-radius: 5px;
  font: 700 .72rem var(--mono); letter-spacing: .02em; color: #fff;
}
.method--get { background: #1f7a4d; }
.method--post { background: var(--brand-700); }
.method--patch { background: #8a5a00; }
.method--put { background: #8a5a00; }
.method--delete { background: var(--danger); }
.method--sm { min-width: 2.6rem; font-size: .62rem; padding: 0 .3rem; flex: none; }

.props { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--line); }
.prop { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.prop__head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.prop__name { background: none; padding: 0; font-weight: 700; font-size: .88rem; }
.prop__type { font-size: .82rem; color: var(--ink-500); }
.prop__req { font-size: .7rem; font-weight: 700; color: var(--warn); text-transform: uppercase; letter-spacing: .04em; }
.prop__desc { font-size: .9rem; margin-top: .2rem; }
.prop__desc p { margin: 0 0 .4rem; }
.prop__desc p:last-child { margin: 0; }
.prop__notes { font-size: .82rem; color: var(--ink-500); margin-top: .25rem; }
.prop__child { margin-top: .5rem; }
.prop__child > summary {
  cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--brand-700); width: fit-content;
  padding: .15rem .55rem; border: 1px solid var(--line); border-radius: 999px; list-style: none;
}
.prop__child > summary::-webkit-details-marker { display: none; }
.prop__child > summary::before { content: '+ '; }
.prop__child[open] > summary::before { content: '− '; }
.prop__child > .props, .prop__child > .variant { margin: .5rem 0 0 .25rem; padding-left: .9rem; border-left: 2px solid var(--line); }
.variant { margin: .75rem 0 1rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.variant__head { font-weight: 700; color: var(--ink-900); display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.variant__desc { margin: .2rem 0 .5rem; font-size: .9rem; color: var(--ink-700); }
.variant .props { border-top: 0; }

.resps { list-style: none; margin: 0; padding: 0; }
.resp { padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.resp:last-child { border-bottom: 0; }
.resp__schema { margin-top: .25rem; font-size: .85rem; color: var(--ink-500); }
.status { display: inline-block; font: 700 .78rem var(--mono); padding: 0 .4rem; border-radius: 4px; margin-right: .35rem; }
.status--ok { color: var(--ok); background: var(--ok-bg); }
.status--err { color: var(--danger); background: var(--danger-bg); }
.schema { padding: 1rem 0 1.5rem; border-bottom: 1px solid var(--line); max-width: 860px; }

.foot { display: flex; gap: 1.5rem; flex-wrap: wrap; padding: 2rem 0 2.5rem; margin-top: 4rem; border-top: 1px solid var(--line); font-size: .85rem; }
.foot a { color: var(--ink-500); text-decoration: none; }
.foot a:hover { color: var(--brand-700); text-decoration: underline; }

/* --- Schmale Bildschirme --- */
@media (max-width: 1100px) {
  .op { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .op__code { position: static; }
}
@media (max-width: 860px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 1.75rem 1.25rem 0; }
  .top { gap: .75rem; padding: 0 1rem; }
  .top__nav { display: none; }
  .brand__tag { display: none; }
  .menu-toggle {
    display: block; margin-left: auto; padding: .4rem .8rem; font: 600 .88rem var(--font);
    color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-sm);
  }
  .sidebar { display: none; position: fixed; inset: var(--header-h) 0 0 0; height: auto; z-index: 9; }
  .sidebar.is-open { display: block; }
  h1 { font-size: 1.7rem; }
}
