.anl {
  --bg: var(--bg-dark);
  --surface: var(--bg-surface);
  --surface-2: var(--bg-surface-elevated);
  --border: var(--bg-surface-border);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --green: var(--primary-green);
  --orange: var(--master-orange);
  --red: var(--danger-red);
  --mono: var(--font-mono);
  --sans: var(--font-sans);
  --green-dim: rgba(0, 230, 118, 0.12);
  --orange-dim: rgba(249, 115, 22, 0.12);
  --blue: #4da3ff;
  --blue-dim: rgba(77, 163, 255, 0.12);
  --shot-border: var(--bg-surface-border);
}
.anl, .anl * { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--anl-head) + 20px); }
.anl { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--sans); -webkit-text-size-adjust: 100%; }
.anl a:not(.btn) { color: var(--green); text-decoration: none; }
.anl a:not(.btn):hover { text-decoration: underline; }
.anl code, .anl kbd, .anl .mono { font-family: var(--mono); font-size: 0.9em; }
.anl code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.anl kbd { background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; }
.anl pre { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font: 14px/1.55 var(--mono); }
.anl pre code { background: none; border: 0; padding: 0; }
.anl .ui { font-weight: 600; white-space: nowrap; }
.anl .ui::before { content: "„"; font-weight: 400; color: var(--muted); }
.anl .ui::after { content: "“"; font-weight: 400; color: var(--muted); }

/* Layout */
.anl .layout { display: grid; grid-template-columns: 1fr; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 1100px) {
  .anl .layout { grid-template-columns: 270px minmax(0, 1fr); gap: 56px; padding: 0 32px; }
}
.anl .toc { display: none; }
@media (min-width: 1100px) {
  .anl .toc { display: block; position: sticky; top: var(--anl-head); align-self: start; max-height: calc(100vh - var(--anl-head)); overflow-y: auto; padding: 32px 0 40px; font-size: 14.5px; }
}
.anl .toc .toc-title { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.anl .toc ol { list-style: none; margin: 0; padding: 0; }
.anl .toc li { margin: 1px 0; }
.anl .toc a { display: block; padding: 4px 10px; border-left: 2px solid transparent; color: var(--muted); border-radius: 0 6px 6px 0; }
.anl .toc a:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.anl .toc a.current { color: var(--green); border-left-color: var(--green); background: var(--green-dim); }
.anl .toc .part { margin-top: 14px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-left: 12px; }
.anl main { min-width: 0; padding-bottom: 80px; }

/* Kopf */
.anl .anl-hero { padding: 48px 0 28px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.anl .eyebrow { display: inline-block; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); background: var(--green-dim); border: 1px solid rgba(0,230,118,.3); padding: 3px 10px; border-radius: 999px; }
.anl h1 { font-size: clamp(32px, 6vw, 48px); line-height: 1.1; margin: 16px 0 12px; letter-spacing: -0.02em; }
.anl .lede { font-size: 19px; color: var(--muted); max-width: 46em; margin: 0 0 22px; }
.anl .anl-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.anl .meta { color: var(--muted); font-size: 14px; margin-top: 16px; }

/* Inhalt (mobil) */
.anl .toc-mobile { margin: 20px 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.anl .toc-mobile summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.anl .toc-mobile ol { margin: 0; padding: 0 16px 14px 36px; columns: 1; }
@media (min-width: 700px) { .anl .toc-mobile ol { columns: 2; } }
@media (min-width: 1100px) { .anl .toc-mobile { display: none; } }

/* Abschnitte */
.anl section.chapter { padding-top: 36px; }
.anl h2 { font-size: clamp(25px, 4vw, 31px); line-height: 1.2; margin: 18px 0 10px; letter-spacing: -0.01em; }
.anl h2 .num { color: var(--green); font-variant-numeric: tabular-nums; margin-right: 10px; }
.anl h3 { font-size: 20px; margin: 30px 0 6px; }
.anl h4 { font-size: 17px; margin: 22px 0 4px; }
.anl p, .anl ul, .anl ol, .anl table, .anl figure, .anl .note, .anl pre { max-width: 52em; }
.anl li { margin: 3px 0; }
.anl .part-title { margin: 56px 0 0; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* Bilder */
.anl figure { margin: 22px 0 26px; }
.anl figure img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--shot-border); background: #0b0d10; }
.anl figure.narrow img { max-width: 440px; }
.anl figure.medium img { max-width: 640px; }
.anl figcaption { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.anl figcaption b { color: var(--text); font-weight: 600; }

/* Hinweise */
.anl .note { border: 1px solid var(--border); border-left: 4px solid var(--blue); background: var(--blue-dim); border-radius: 10px; padding: 12px 16px; margin: 18px 0; }
.anl .note.tip { border-left-color: var(--green); background: var(--green-dim); }
.anl .note.warn { border-left-color: var(--orange); background: var(--orange-dim); }
.anl .note > :first-child { margin-top: 0; }
.anl .note > :last-child { margin-bottom: 0; }
.anl .note .label { display: block; font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2px; }
.anl .note.tip .label { color: var(--green); }
.anl .note.warn .label { color: var(--orange); }
.anl .note .label { color: var(--blue); }

/* Schritte */
.anl ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 16px 0 22px; }
.anl ol.steps > li { counter-increment: step; position: relative; padding: 2px 0 12px 46px; margin: 0; }
.anl ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--green-dim); border: 1px solid rgba(0,230,118,.45); color: var(--green); font-weight: 700; font-size: 15px; display: grid; place-items: center; }
.anl ol.steps > li::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 1px; background: var(--border); }
.anl ol.steps > li:last-child::after { display: none; }

/* Tabellen */
.anl .table-wrap { overflow-x: auto; max-width: 52em; margin: 16px 0 22px; border: 1px solid var(--border); border-radius: 10px; }
.anl table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
.anl th, .anl td { text-align: left; vertical-align: top; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.anl th { background: var(--surface); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.anl tr:last-child td { border-bottom: 0; }
.anl td:first-child { white-space: nowrap; }
.anl .anl-badge { display: inline-block; font-size: 13px; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.anl .anl-badge.ok { color: var(--green); background: var(--green-dim); border-color: rgba(0,230,118,.35); }
.anl .anl-badge.stby { color: var(--blue); background: var(--blue-dim); border-color: rgba(77,163,255,.35); }
.anl .anl-badge.warn { color: var(--orange); background: var(--orange-dim); border-color: rgba(249,115,22,.35); }
.anl .anl-badge.err { color: var(--red); background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); }

/* Tutorial-Karten */
.anl .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; max-width: 52em; margin: 18px 0; }
.anl .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.anl .card h4 { margin: 0 0 4px; }
.anl .card p { margin: 0; color: var(--muted); font-size: 15px; }
.anl .card a { display: block; }
.anl .card a:hover { text-decoration: none; }

.anl .doc-foot { border-top: 1px solid var(--border); margin-top: 60px; padding-top: 18px; color: var(--muted); font-size: 14px; }
.anl .print-only { display: none; }

/* ------------------------------------------------------------------ Druck / PDF */
@page { size: A4; margin: 18mm 17mm 20mm; @bottom-center { content: counter(page); font: 9pt -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #6b7280; } @bottom-left { content: "StageDHCP – Anleitung"; font: 9pt -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #6b7280; } }
@page :first { @bottom-center { content: none; } @bottom-left { content: none; } }
@media print {
  .anl { --bg: #fff; --surface: #f4f6f8; --surface-2: #eef1f4; --border: #d6dbe1; --text: #111827; --muted: #4b5563; --green: #00873f; --green-dim: #e7f6ee; --orange: #c2410c; --orange-dim: #fff1e6; --blue: #1d64c4; --blue-dim: #eaf2fd; --shot-border: #c8ced6; }
  html { scroll-behavior: auto; }
  .anl { font-size: 10.5pt; line-height: 1.5; background: #fff; }
  .anl .layout { display: block; max-width: none; padding: 0; }
  .anl .toc, .anl .toc-mobile, .anl .anl-actions, .anl .screen-only { display: none !important; }
  .anl .print-only { display: block; }
  .anl p, .anl ul, .anl ol, .anl table, .anl figure, .anl .note, .anl pre, .anl .table-wrap, .anl .cards { max-width: none; }
  .anl a { color: inherit; }
  .anl .anl-hero { min-height: 245mm; display: flex; flex-direction: column; justify-content: center; border: 0; padding: 0; break-after: page; }
  .anl .anl-hero h1 { font-size: 40pt; }
  .anl .anl-hero .lede { font-size: 14pt; }
  .anl .anl-hero .cover-shot { margin-top: 12mm; }
  .anl .print-toc { break-after: page; }
  .anl .print-toc ol { columns: 2; column-gap: 10mm; padding-left: 6mm; font-size: 10.5pt; }
  .anl .print-toc li { break-inside: avoid; }
  .anl section.chapter { padding-top: 0; }
  .anl .part-title { break-before: page; border: 0; margin-top: 0; padding-top: 0; }
  .anl section.chapter.newpage { break-before: page; }
  .anl .part-title + section.chapter.newpage { break-before: auto; }
  .anl h2 { font-size: 19pt; break-after: avoid; }
  .anl h3 { font-size: 13pt; break-after: avoid; margin-top: 18px; }
  .anl h4 { break-after: avoid; }
  .anl figure { break-inside: avoid; margin: 12px 0 16px; }
  .anl figure img { max-height: 125mm; width: auto; max-width: 100%; }
  .anl figure.narrow img { max-height: 95mm; }
  .anl .note, .anl pre, .anl .card, .anl tr, .anl ol.steps > li { break-inside: avoid; }
  .anl pre { white-space: pre-wrap; font-size: 9pt; }
  .anl table { font-size: 9.5pt; }
  .anl .table-wrap { overflow: visible; break-inside: avoid; }
  .anl table.paths td:first-child { white-space: normal; width: 30%; }
  .anl table.paths code { overflow-wrap: normal; word-break: normal; white-space: nowrap; font-size: 8.5pt; }
  .anl .doc-foot { break-before: avoid; }
}

/* Einbettung in stagedisplay.net */
:root { --anl-head: 78px; }
.anl { background: transparent; }
.anl .anl-hero { padding-top: 40px; }
.anl .anl-actions .btn { padding: 0.7rem 1.2rem; }
/* Lange Beschriftungen in „…“ dürfen auf schmalen Bildschirmen umbrechen. */
@media (max-width: 700px) { .anl .ui { white-space: normal; } }
@media print {
  body > header, body > footer, .skip-link { display: none !important; }
  body { background: #fff !important; color: #111827 !important; }
}
