/**
 * tb-todo API-Doku (Swagger-artig). Nutzt die Theme-Tokens (--tb-*),
 * eigene Bausteine, dark-mode-faehig ueber die vererbten Tokens.
 */
.tbtodocs {
	--d-card: var(--tb-bg-card, #fff);
	--d-line: var(--tb-line, #e7e7f2);
	--d-ink: var(--tb-ink-900, #0e0e2a);
	--d-ink2: var(--tb-ink-500, #5c5c7a);
	--d-brand: var(--tb-primary-700, #1919c8);
	--d-get: #10b981; --d-post: #4f8cff; --d-patch: #f2994a; --d-delete: #f43f5e;
	color: var(--d-ink); font-family: inherit;
}
.tbtodocs__boot { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 60px 0; color: var(--d-ink2); }
.tbtodocs__spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid color-mix( in srgb, var(--d-brand) 30%, transparent ); border-top-color: var(--d-brand); animation: tbtd-spin .8s linear infinite; }
@keyframes tbtd-spin { to { transform: rotate( 360deg ); } }
.tbtodocs__err { padding: 24px; border: 1px solid var(--d-line); border-radius: 14px; background: var(--d-card); }
.tbtodocs__err a { color: var(--d-brand); }

/* ── Layout ────────────────────────────────────────────────────────── */
.tbtodocs__wrap { display: grid; grid-template-columns: 250px minmax( 0, 1fr ); gap: 26px; align-items: start; }
.tbtodocs__side { position: sticky; top: 16px; align-self: start; max-height: calc( 100vh - 32px ); overflow: auto; border-right: 1px solid var(--d-line); padding-right: 14px; }
.tbtodocs__brand { font-weight: 800; font-size: 1.05rem; margin-bottom: 12px; }
.tbtodocs__ver { font-size: .72em; font-weight: 700; color: #fff; background: var(--d-brand); padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
.tbtodocs__nav { display: flex; flex-direction: column; gap: 2px; }
.tbtodocs__nav-tag { margin-top: 12px; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--d-ink2); text-decoration: none; padding: 4px 0; }
.tbtodocs__nav-op { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; text-decoration: none; color: var(--d-ink); font-size: .84rem; }
.tbtodocs__nav-op:hover { background: color-mix( in srgb, var(--d-brand) 9%, transparent ); }
.tbtodocs__nav-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; }

/* ── Methoden-Badge ────────────────────────────────────────────────── */
.tbtodocs-m { flex: none; font-size: .68rem; font-weight: 800; letter-spacing: .03em; color: #fff; padding: 3px 7px; border-radius: 6px; min-width: 50px; text-align: center; }
.tbtodocs-m--get { background: var(--d-get); }
.tbtodocs-m--post { background: var(--d-post); }
.tbtodocs-m--patch { background: var(--d-patch); }
.tbtodocs-m--put { background: var(--d-patch); }
.tbtodocs-m--delete { background: var(--d-delete); }

/* ── Kopf ──────────────────────────────────────────────────────────── */
.tbtodocs__head { margin-bottom: 22px; }
.tbtodocs__title { margin: 0 0 12px; font-size: 1.9rem; }
.tbtodocs__base { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--d-card); border: 1px solid var(--d-line); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.tbtodocs__base-lbl { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--d-ink2); }
.tbtodocs__base-url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; color: var(--d-brand); word-break: break-all; flex: 1 1 auto; }
.tbtodocs__desc { color: var(--d-ink2); line-height: 1.6; margin-bottom: 14px; }
.tbtodocs__desc p { margin: 0 0 10px; }
.tbtodocs__desc code, .tbtodocs-op__desc code { background: var(--tb-bg, #f1f1f8); padding: 1px 6px; border-radius: 5px; font-size: .88em; }
.tbtodocs__desc strong { color: var(--d-ink); }
.tbtodocs__bar { display: flex; flex-wrap: wrap; gap: 8px; }

.tbtodocs-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: .86rem; padding: 8px 13px; border-radius: 10px; border: 1px solid var(--d-line); background: var(--d-card); color: var(--d-ink); cursor: pointer; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.tbtodocs-btn:hover { border-color: var(--d-brand); color: var(--d-brand); }

/* ── Gruppen + Operationen ─────────────────────────────────────────── */
.tbtodocs__group { margin-bottom: 30px; }
.tbtodocs__group-title { font-size: 1.3rem; margin: 0 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--d-line); }
.tbtodocs__group-desc { color: var(--d-ink2); margin: 6px 0 14px; }

.tbtodocs-op { border: 1px solid var(--d-line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; background: var(--d-card); scroll-margin-top: 16px; }
.tbtodocs-op--get { border-left: 4px solid var(--d-get); }
.tbtodocs-op--post { border-left: 4px solid var(--d-post); }
.tbtodocs-op--patch, .tbtodocs-op--put { border-left: 4px solid var(--d-patch); }
.tbtodocs-op--delete { border-left: 4px solid var(--d-delete); }
.tbtodocs-op__head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; background: transparent; border: none; cursor: pointer; padding: 12px 14px; color: inherit; }
.tbtodocs-op__head:hover { background: color-mix( in srgb, var(--d-brand) 5%, transparent ); }
.tbtodocs-op__path { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: .92rem; }
.tbtodocs-op__sum { color: var(--d-ink2); flex: 1 1 auto; font-size: .9rem; }
.tbtodocs-op__chev { transition: transform .2s ease; color: var(--d-ink2); }
.tbtodocs-op.is-open .tbtodocs-op__chev { transform: rotate( 180deg ); }
.tbtodocs-op__body { display: none; padding: 4px 16px 18px; border-top: 1px solid var(--d-line); }
.tbtodocs-op.is-open .tbtodocs-op__body { display: block; }
.tbtodocs-op__desc { line-height: 1.6; margin: 12px 0; }
.tbtodocs-op__desc p { margin: 0 0 8px; }
.tbtodocs-op__auth { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--d-ink2); background: var(--tb-bg, #f1f1f8); border: 1px solid var(--d-line); border-radius: 999px; padding: 3px 10px; margin: 2px 0 8px; }
.tbtodocs-op__h { margin: 16px 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--d-ink2); }
.tbtodocs-op__exlbl { font-size: .78rem; color: var(--d-ink2); margin: 6px 0 4px; }

/* ── Tabellen ──────────────────────────────────────────────────────── */
.tbtodocs-tbl { width: 100%; border-collapse: collapse; font-size: .88rem; margin-bottom: 6px; }
.tbtodocs-tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--d-ink2); border-bottom: 1px solid var(--d-line); padding: 6px 8px; }
.tbtodocs-tbl td { border-bottom: 1px solid var(--d-line); padding: 7px 8px; vertical-align: top; }
.tbtodocs-tbl code { background: var(--tb-bg, #f1f1f8); padding: 1px 5px; border-radius: 5px; }

/* ── Code-Bloecke ──────────────────────────────────────────────────── */
.tbtodocs-pre { background: var(--tb-ink-900, #0e0e2a); color: #d7e3ff; border-radius: 10px; padding: 13px 15px; overflow: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.5; white-space: pre; margin: 0 0 8px; }
.tbtodocs-pre--curl { background: #0b1020; }
.tbtodocs-curl { position: relative; }
.tbtodocs-curl__cp { position: absolute; top: 8px; right: 8px; padding: 5px 10px; font-size: .78rem; }

/* ── Responses ─────────────────────────────────────────────────────── */
.tbtodocs-rsp { margin-bottom: 10px; }
.tbtodocs-rsp__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: .9rem; color: var(--d-ink2); }
.tbtodocs-code { font-weight: 800; color: #fff; padding: 2px 9px; border-radius: 6px; font-size: .8rem; }
.tbtodocs-code--ok { background: var(--d-get); }
.tbtodocs-code--warn { background: var(--d-patch); }
.tbtodocs-code--err { background: var(--d-delete); }

/* ── Responsive ────────────────────────────────────────────────────── */
@media ( max-width: 820px ) {
	.tbtodocs__wrap { grid-template-columns: 1fr; }
	.tbtodocs__side { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--d-line); padding: 0 0 12px; margin-bottom: 8px; }
	.tbtodocs__nav { flex-flow: row wrap; }
	.tbtodocs__nav-op .tbtodocs__nav-path { max-width: 150px; }
}
@media ( prefers-reduced-motion: reduce ) { .tbtodocs__spin { animation: none; } .tbtodocs-op__chev { transition: none; } }
