:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1d2125;
  --muted: #5b636b;
  --line: #dfe2e5;
  --accent: #1f4e79;
  --accent-soft: #e6eef6;
  --good: #2f6b3a;
  --good-soft: #e8f2ea;
  --care: #8a5a00;
  --care-soft: #fbf1dc;
  --code-bg: #f0f1f2;
  --radius: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181b;
    --surface: #1d2125;
    --text: #e6e8ea;
    --muted: #a0a8b0;
    --line: #333a41;
    --accent: #8fb8e0;
    --accent-soft: #22303d;
    --good: #8fcf9b;
    --good-soft: #1f2e23;
    --care: #e5bd6b;
    --care-soft: #332a17;
    --code-bg: #262b30;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

header.site .inner, main, footer.site .inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

header.site .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.brand span { color: var(--muted); font-weight: 400; }

nav.site { display: flex; flex-wrap: wrap; gap: 4px; }
nav.site a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
nav.site a:hover { background: var(--accent-soft); color: var(--text); }
nav.site a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

main { padding-top: 28px; padding-bottom: 48px; }

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.35rem; margin: 40px 0 12px; padding-top: 8px; border-top: 1px solid var(--line); }
h3 { font-size: 1.1rem; margin: 28px 0 8px; }
.lede { color: var(--muted); font-size: 1.08rem; margin: 0 0 24px; max-width: 70ch; }
p, li { max-width: 75ch; }

a { color: var(--accent); }

code {
  font: 0.88em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

pre {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.45;
}
pre code { background: none; padding: 0; overflow-wrap: normal; }

.table-wrap { overflow-x: auto; margin: 12px 0 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--accent-soft); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card h3 { margin-top: 0; }
.card p { margin: 6px 0; }
.card a.more { font-weight: 600; text-decoration: none; }

.note { border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; border: 1px solid var(--line); }
.note.care { background: var(--care-soft); border-color: transparent; }
.note.good { background: var(--good-soft); border-color: transparent; }
.note.info { background: var(--accent-soft); border-color: transparent; }
.note p { margin: 4px 0; }

.tag {
  display: inline-block;
  font-size: 0.78rem;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.tag.neu { background: var(--care-soft); color: var(--care); }
.tag.ueb { background: var(--good-soft); color: var(--good); }

ol.etappen { list-style: none; padding: 0; counter-reset: etappe; }
ol.etappen > li {
  counter-increment: etappe;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 16px 60px;
  margin: 0 0 14px;
  max-width: none;
}
ol.etappen > li::before {
  content: counter(etappe, decimal);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
ol.etappen > li.start::before { content: "0"; }
ol.etappen h3 { margin: 2px 0 6px; }
ol.etappen ul { padding-left: 20px; }
.meta { color: var(--muted); font-size: 0.9rem; }

figure { margin: 20px 0; }
figure svg { width: 100%; height: auto; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }

svg .box { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
svg .box.kern { fill: var(--accent-soft); stroke: var(--accent); }
svg .box.dienst { fill: var(--code-bg); }
svg .box.mvp { fill: var(--good-soft); stroke: var(--good); }
svg .t { fill: var(--text); font: 600 13px system-ui, sans-serif; }
svg .s { fill: var(--muted); font: 11.5px system-ui, sans-serif; }
svg .edge { stroke: var(--muted); stroke-width: 1.4; fill: none; }
svg .edge.dash { stroke-dasharray: 5 4; }
svg .arrow { fill: var(--muted); }

footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
footer.site .inner { padding-top: 16px; padding-bottom: 24px; }

@media (max-width: 600px) {
  h1 { font-size: 1.55rem; }
  ol.etappen > li { padding-left: 18px; padding-top: 54px; }
}

kbd {
  font: 0.85em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
  background: var(--surface);
}
