/* Anleitung im Design der Startseite: Inhaltsverzeichnis und Kapitel als Karten auf hellem Grund,
   Schritte mit roten Ziffern, Knöpfe und Code wie dort. Grundlage kommt aus site.css. */
body { background: var(--soft); }
.toc { max-width: 72.5rem; margin: 0 auto; padding: clamp(2rem, 5vw, 3rem) max(1rem, env(safe-area-inset-left)) 0; }
.toc .toc-inner { padding: 1.5rem; border-radius: 1rem; background: #ffffff; border: 1px solid var(--line); }
.toc .toc-title { margin: 0 0 0.75rem; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: 0 1.5rem; }
.toc li { counter-increment: toc; }
.toc a { display: flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; color: var(--ink); font-weight: 600; text-decoration: none; }
.toc a::before { content: counter(toc); flex: none; width: 1.75rem; font-weight: 800; color: var(--red); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--red); text-decoration: underline; }

main { display: block; max-width: 72.5rem; margin: 0 auto; padding: 1.5rem max(1rem, env(safe-area-inset-left)) clamp(3rem, 7vw, 4.5rem); }
.section { margin-top: 1.5rem; scroll-margin-top: 1rem; }
.section .card { padding: clamp(1.25rem, 3vw, 2rem); border-radius: 1rem; background: #ffffff; border: 1px solid var(--line); }
.section h2 { margin: 0 0 0.875rem; padding-top: 1rem; border-top: 4px solid var(--navy); font-size: clamp(1.375rem, 2.8vw, 1.75rem); line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.section h3 { margin: 1.5rem 0 0.375rem; font-size: 1.125rem; font-weight: 800; color: var(--ink); }
.section p { margin: 0.75rem 0; max-width: 46rem; color: var(--ink-2); }
.section p:first-of-type { margin-top: 0; }
.section strong { color: var(--ink); font-weight: 700; }
.section em { color: var(--ink-2); }
.section code { padding: 0.1em 0.375em; border-radius: 0.3rem; background: var(--soft); border: 1px solid var(--line); color: var(--ink); }
.section ul:not(.grid-cards), .section ol:not(.steps) { margin: 0.625rem 0; padding-left: 1.375rem; max-width: 46rem; color: var(--ink-2); }
.section ul:not(.grid-cards) > li, .section ol:not(.steps) > li { margin: 0.4rem 0; }

/* Karten-Raster (z. B. die vier Bereiche der App) */
.section ul.grid-cards { list-style: none; margin: 1rem 0 0.25rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 0.875rem; }
.section ul.grid-cards > li { padding: 1rem 1.125rem; border-radius: 0.875rem; background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); }
.section ul.grid-cards > li strong:first-child { color: var(--ink); }

/* Nummerierte Schritte: rote Ziffern wie auf der Startseite */
.section ol.steps { list-style: none; margin: 1.125rem 0 0.25rem; padding: 0; counter-reset: step; max-width: 46rem; }
.section ol.steps > li { counter-increment: step; position: relative; margin: 0 0 0.875rem; padding: 0.25rem 0 0.25rem 3rem; min-height: 2.25rem; color: var(--ink-2); }
.section ol.steps > li:last-child { margin-bottom: 0.125rem; }
.section ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.25rem; font-size: 1.75rem; font-weight: 800; line-height: 1.15; color: var(--red); font-variant-numeric: tabular-nums; }
.section ol.steps > li strong:first-child { color: var(--ink); }
.section ol.steps.cards { max-width: none; display: grid; gap: 0.875rem; margin: 1rem 0 0.25rem; grid-template-columns: repeat(auto-fit, minmax(min(13.75rem, 100%), 1fr)); }
.section ol.steps.cards > li { margin: 0; min-height: 0; padding: 3.25rem 1.125rem 1.125rem; border-radius: 0.875rem; background: var(--soft); border: 1px solid var(--line); border-top: 4px solid var(--navy); font-size: 0.9375rem; }
.section ol.steps.cards > li::before { top: 0.875rem; left: 1.125rem; }

/* Firmware laden: Knopf wie auf der Startseite */
.section .download-row { margin: 1rem 0 0.375rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.section a.btn-download { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.875rem; padding: 0 1.125rem; border-radius: 0.75rem; background: var(--red); color: #ffffff; font-weight: 700; text-decoration: none; }
.section a.btn-download:hover { background: #a93020; color: #ffffff; }
.section .download-hint { font-size: 0.875rem; color: var(--muted); }

/* Code-Blöcke: wie der getippte Text auf der Startseite */
.section pre { margin: 0.875rem 0; padding: 0.875rem 1rem; max-width: 46rem; overflow-x: auto; border-radius: 0.75rem; background: #0f1a36; border: 1px solid var(--navy-line); color: #f4f6fb; font-family: var(--mono); font-size: 0.875rem; line-height: 1.6; }
.section pre code { padding: 0; border: 0; background: transparent; color: inherit; }

@media (max-width: 35.99rem) {
  .toc .toc-inner { padding: 1.125rem; }
  .section ol.steps > li { padding-left: 2.5rem; }
}
