/* Tankstellen-Ampel – Textseiten: API-Dokumentation, Impressum, Datenschutz, 404 */
.c-low  { --c: var(--g); --c-ink: var(--g-ink); --c-tint: var(--g-tint); }
.c-mid  { --c: var(--y); --c-ink: var(--y-ink); --c-tint: var(--y-tint); }
.c-high { --c: var(--r); --c-ink: var(--r-ink); --c-tint: var(--r-tint); }

.page-head { padding: clamp(32px, 5vw, 64px) 0 clamp(20px, 3vw, 36px); position: relative; }
.page-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: repeating-linear-gradient(90deg, var(--line-2) 0 22px, transparent 22px 40px); opacity: .8; }
.crumbs { margin-bottom: 14px; font-size: .88rem; color: var(--muted); }
.crumbs a { color: var(--ink-2); }
.page-head h1 { font-size: clamp(2rem, 1.1rem + 3vw, 3.2rem); letter-spacing: -.025em; line-height: 1.04; }
.page-head .lead { margin-top: 14px; font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; }

.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding-top: 40px; align-items: start; }
.toc { position: sticky; top: 20px; font-size: .92rem; }
.toc h2 { font-family: var(--font-text); font-size: .84rem; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--ink-2); }
.toc a:hover { color: var(--ink); border-left-color: var(--ink); }

.prose { min-width: 0; max-width: 820px; }
.prose > section { margin-bottom: 52px; }
.prose h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem); margin-bottom: 14px; scroll-margin-top: 20px; }
.prose h3 { font-size: 1.12rem; margin: 26px 0 10px; }
.prose p { margin-bottom: 12px; max-width: 70ch; color: var(--ink-2); }
.prose p b, .prose li b { color: var(--ink); }
.prose ul { padding-left: 20px; color: var(--ink-2); max-width: 70ch; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .88em; background: var(--sunken); padding: .12em .4em; border-radius: 6px; color: var(--ink); }

.endpoint { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 14px 0 18px; }
.method { font: 800 .85rem var(--font-display); background: var(--btn-bg); color: var(--btn-fg); padding: 5px 10px; border-radius: 8px; }
.endpoint code { background: transparent; padding: 0; font-size: .98rem; word-break: break-all; }

.table-wrap { overflow-x: auto; margin: 10px 0 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
table.t th, table.t td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t thead th { font-weight: 600; color: var(--muted); font-size: .84rem; background: var(--sunken); }
table.t tr:last-child td { border-bottom: 0; }
table.t td:first-child { white-space: nowrap; }
table.t td { color: var(--ink-2); }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }

.code { position: relative; margin: 10px 0 20px; }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; background: var(--code-bg); color: var(--code-fg); border-radius: 12px; font: .86rem/1.6 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; tab-size: 2; }
.code pre:focus-visible { outline-offset: 2px; }
.code .copy { position: absolute; top: 8px; right: 8px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #ece8e1; font-size: .8rem; font-weight: 600; }
.code .copy:hover { background: rgba(255, 255, 255, .16); }
.code .copy:focus-visible { outline-color: #8db1ff; }
.code-label { font-size: .84rem; font-weight: 600; color: var(--muted); margin: 18px 0 0; }

.note { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 10px; margin: 14px 0; max-width: 70ch; }
.note p:last-child { margin-bottom: 0; }

.rule { list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.rule li { display: flex; align-items: center; gap: 10px; margin: 0; }
.rule .badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 8px; border-radius: 999px; background: var(--c-tint); color: var(--c-ink); font-size: .78rem; font-weight: 700; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.rule .sym { color: var(--c); }

.mtsk-box { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; max-width: 70ch; margin: 10px 0; }
.mtsk-box .mtsk-l, .mtsk-box .mtsk-w { height: 32px; }
.mtsk-box p { margin: 0; color: var(--ink); font-weight: 500; }

/* Platzhalter für Rechtstexte */
.placeholder { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 36px 28px; text-align: center; background: var(--surface); max-width: 760px; margin: 40px auto 0; }
.placeholder strong { font-family: var(--font-display); font-size: 1.5rem; display: block; margin-bottom: 8px; }
.placeholder p { color: var(--ink-2); margin: 0 auto; }

.err-page { padding: clamp(48px, 9vw, 110px) 0; display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 6vw, 72px); align-items: center; max-width: 900px; }
.err-page h1 { font-size: clamp(2.2rem, 1.2rem + 4vw, 4rem); letter-spacing: -.03em; }
.err-page p { margin: 14px 0 22px; color: var(--ink-2); font-size: 1.1rem; max-width: 46ch; }
.err-page .housing { gap: 14px; }
.err-page .lamp { width: 54px; height: 54px; border-radius: 50%; display: block; }
.err-page .lamp-r { background: #e0483a; box-shadow: 0 0 26px 2px rgba(224, 72, 58, .5); }
.err-page .lamp-y, .err-page .lamp-g { background: #3a4047; box-shadow: none; }
.housing { display: grid; gap: 14px; padding: 16px; border-radius: 34px; background: var(--housing); box-shadow: inset 0 0 0 1.5px #3b434b, 0 18px 40px -22px rgba(0, 0, 0, .55); }

@media (max-width: 899px) {
  .doc { grid-template-columns: 1fr; gap: 20px; }
  .toc { position: static; }
  .toc ol { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-left: 0; gap: 0 12px; }
  .toc a { border-left: 0; margin: 0; padding: 6px 0; }
}
@media (max-width: 560px) {
  .err-page { grid-template-columns: 1fr; }
  .mtsk-box { flex-direction: column; align-items: flex-start; }
}

/* Rechtstexte (Impressum, Datenschutz): legal, legal-card, legal-toc, platzhalter */
.legal { max-width: 820px; padding: 32px 0 72px; overflow-wrap: anywhere; }
.legal .legal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 32px); margin-bottom: 16px; scroll-margin-top: 16px; box-shadow: var(--shadow); }
.legal .legal-card h2 { font-size: clamp(1rem, .9rem + .6vw, 1.3rem); overflow-wrap: break-word; hyphens: manual; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.legal .legal-card h3 { font-size: 1.02rem; margin: 20px 0 8px; }
.legal .legal-card p { margin-bottom: 12px; max-width: 70ch; color: var(--ink-2); }
.legal .legal-card p:last-child, .legal .legal-card ul:last-child { margin-bottom: 0; }
.legal .legal-card ul { padding-left: 20px; margin: 0 0 12px; max-width: 70ch; color: var(--ink-2); }
.legal .legal-card li { margin-bottom: 6px; }
.legal .legal-card strong { color: var(--ink); }
.legal code { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .88em; background: var(--sunken); padding: .12em .4em; border-radius: 6px; color: var(--ink); }
.legal .toc.legal-toc { position: static; margin-bottom: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: .95rem; }
.legal .toc.legal-toc p { margin: 0 0 8px; font-size: .84rem; font-weight: 600; color: var(--muted); }
.legal .toc.legal-toc ol { display: block; list-style: decimal; margin: 0; padding: 0 0 0 22px; border-left: 0; color: var(--ink-2); }
.legal .toc.legal-toc li { margin: 0; padding: 3px 0; }
.legal .toc.legal-toc a { display: inline; margin: 0; padding: 0; border-left: 0; }
.legal .toc.legal-toc a:hover { border-left: 0; text-decoration-thickness: 2px; }
mark.platzhalter { background: #fff3b0; color: #5a3b00; border-radius: 4px; padding: 0 4px; font-weight: 600; }
:root[data-theme="dark"] mark.platzhalter { background: rgba(242, 194, 48, .22); color: #f6d25f; }
