:root {
  --bg: #f6faf9; --card: #fff; --text: #1b241f; --muted: #5d6b63;
  --accent: #00695c; --accent-soft: #e0f2f0; --line: #dfe5e1; --warn-bg: #fff4e0; --warn-line: #e6a23c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121714; --card: #1a211d; --text: #e6ece8; --muted: #9aa8a0;
    --accent: #4db6ac; --accent-soft: #1b3330; --line: #2c3731; --warn-bg: #3a2e16; --warn-line: #c58b2f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.menu-toggle { display: none; cursor: pointer; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; }
.menu-check { display: none; }
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1100px; margin: 0 auto; gap: 24px; padding: 24px 16px 64px; }
.side ol { list-style: none; margin: 0; padding: 0; position: sticky; top: 72px; }
.side li a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.side li a:hover { background: var(--accent-soft); }
.side li.current a { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { min-width: 0; }
article { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px; }
h1 { margin-top: 0; font-size: 1.9rem; line-height: 1.25; }
h2 { margin-top: 2rem; font-size: 1.35rem; }
h3 { margin-top: 1.5rem; font-size: 1.1rem; }
.lead { color: var(--muted); font-size: 1.1rem; }
img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
code { background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
kbd, .btn { background: var(--accent-soft); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: .92em; white-space: nowrap; }
table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--accent-soft); }
blockquote { margin: 1rem 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
blockquote.warn, .warn { border-left-color: var(--warn-line); background: var(--warn-bg); }
.toc { margin: 1rem 0; padding: 8px 14px; background: var(--accent-soft); border-radius: 10px; }
.toc nav ul { margin: 6px 0; padding-left: 20px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.chapters li { margin: 6px 0; }
.chapters span { color: var(--muted); }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; padding-top: 12px; }
  .menu-toggle { display: inline-block; }
  .side { display: none; }
  .menu-check:checked ~ .layout .side { display: block; }
  .side ol { position: static; }
  article { padding: 18px 16px; border-radius: 12px; }
  h1 { font-size: 1.6rem; }
}

/* Ablaufdiagramme (Shortcode "diagram", Quelle: diagrams/generate.py) */
.diagram { margin: 1.5rem auto; max-width: 520px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram figcaption { margin-top: 8px; text-align: center; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.diagram figcaption strong { display: block; color: var(--text); margin-bottom: 2px; }
.dg-box { fill: var(--card); stroke: var(--line); stroke-width: 1.5; }
.dg-neutral { stroke: var(--muted); }
.dg-sys { fill: var(--accent-soft); stroke: var(--accent); }
.dg-you { fill: var(--warn-bg); stroke: var(--warn-line); stroke-dasharray: 6 4; stroke-width: 1.8; }
.dg-text { fill: var(--text); font: 600 15px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-anchor: middle; }
.dg-sub { fill: var(--muted); font: 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-anchor: middle; }
.dg-line { fill: none; stroke: var(--muted); stroke-width: 1.8; }
.dg-head { fill: var(--muted); stroke: none; }
.dg-legend { display: inline-block; white-space: nowrap; }
.dg-key { display: inline-block; width: 14px; height: 10px; margin: 0 5px 0 12px; border-radius: 3px; border: 1.5px solid var(--line); vertical-align: -1px; }
.dg-key:first-child { margin-left: 0; }
.dg-key-sys { background: var(--accent-soft); border-color: var(--accent); }
.dg-key-you { background: var(--warn-bg); border: 1.5px dashed var(--warn-line); }
.dg-key-neutral { background: var(--card); border-color: var(--muted); }
@media (max-width: 800px) { .dg-legend { white-space: normal; } }
/* Screenshots der App (Hochformat): schmal und mittig, damit sie nicht die ganze Seite füllen. */
figure.shot { margin: 1.2rem auto; text-align: center; }
figure.shot img { max-width: min(100%, 300px); }
figure.shot figcaption { margin-top: 6px; color: var(--muted); font-size: .9rem; }

/* Zwei Screenshots nebeneinander (Shortcode "shots") */
.shots { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin: 1.2rem 0; }
.shots figure.shot { margin: 0; flex: 1 1 220px; max-width: 280px; }
.shots figure.shot img { max-width: 100%; }
