/* Schriften lokal (OFL, Kopie aus server/web/static/fonts), ersetzt Google Fonts */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Recursive";
  src: url("fonts/recursive-mono.woff2") format("woff2");
  font-weight: 300 1000;
  font-style: normal;
  font-display: swap;
}

/* Layout: Handbuch mit fester Inhaltsleiste links, Laufwerksschilder als Kapitelnummern, Bilder aus dem echten Test. */
:root {
  --paper: #f2f4f3;
  --surface: #ffffff;
  --sunken: #e7ecea;
  --ink: #16202a;
  --ink-2: #33414d;
  --muted: #5a6772;
  --rule: #d6dcdf;
  --rule-strong: #b6c0c5;
  --accent: #0a6375;
  --accent-ink: #084f5e;
  --accent-wash: #dfedef;
  --on-accent: #ffffff;
  --ok: #2b7a47;
  --ok-wash: #e2f1e6;
  --warn: #8a5800;
  --warn-wash: #f7ecd5;
  --err: #b3261e;
  --err-wash: #f9e3e1;
  --lane-lan: #0a6375;
  --lane-it: #4b5bb0;
  --lane-ma: #2b7a47;
  --lane-ms: #5a6772;
  --shadow: 0 1px 2px rgba(14, 26, 34, .08), 0 8px 24px rgba(14, 26, 34, .08);
  --backdrop: rgba(12, 22, 28, .78);
  --f-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --f-body: "Archivo", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Recursive", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --r-s: 4px;
  --r-m: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111518;
    --surface: #182024;
    --sunken: #1f292e;
    --ink: #e2e7ea;
    --ink-2: #c3ccd1;
    --muted: #97a3ab;
    --rule: #2a353b;
    --rule-strong: #3c4a51;
    --accent: #5cb6c5;
    --accent-ink: #7fcad6;
    --accent-wash: #15343a;
    --on-accent: #06242a;
    --ok: #6cca8c;
    --ok-wash: #16301f;
    --warn: #e2aa4c;
    --warn-wash: #33280f;
    --err: #f28a7f;
    --err-wash: #3b1b18;
    --lane-lan: #5cb6c5;
    --lane-it: #9aa8f0;
    --lane-ma: #6cca8c;
    --lane-ms: #97a3ab;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --backdrop: rgba(0, 0, 0, .82);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111518;
  --surface: #182024;
  --sunken: #1f292e;
  --ink: #e2e7ea;
  --ink-2: #c3ccd1;
  --muted: #97a3ab;
  --rule: #2a353b;
  --rule-strong: #3c4a51;
  --accent: #5cb6c5;
  --accent-ink: #7fcad6;
  --accent-wash: #15343a;
  --on-accent: #06242a;
  --ok: #6cca8c;
  --ok-wash: #16301f;
  --warn: #e2aa4c;
  --warn-wash: #33280f;
  --err: #f28a7f;
  --err-wash: #3b1b18;
  --lane-lan: #5cb6c5;
  --lane-it: #9aa8f0;
  --lane-ma: #6cca8c;
  --lane-ms: #97a3ab;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --backdrop: rgba(0, 0, 0, .82);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--f-body);
  font-variation-settings: "wdth" 100;
  -webkit-text-size-adjust: 100%;
}
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding-block: 28px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.page { grid-template-areas: "head" "toc" "main"; }
.masthead { grid-area: head; min-width: 0; }
.toc { grid-area: toc; }
main { grid-area: main; min-width: 0; }
@media (min-width: 1100px) {
  .page { grid-template-columns: 240px minmax(0, 1fr); grid-template-areas: "toc head" "toc main"; column-gap: 56px; row-gap: 8px; padding-block: 40px 96px; }
}
main > *, .masthead > * { max-width: 820px; }

/* Typografie */
h1, h2, h3, h4 { font-family: var(--f-display); color: var(--ink); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.02; font-weight: 800; font-variation-settings: "wdth" 118; letter-spacing: -.01em; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2rem); line-height: 1.15; font-weight: 750; font-variation-settings: "wdth" 112; }
h3 { font-size: 1.2rem; line-height: 1.3; font-weight: 700; font-variation-settings: "wdth" 106; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
code, kbd, .mono { font-family: var(--f-mono); font-size: .88em; font-variation-settings: "MONO" 1; }
code { background: var(--sunken); padding: .08em .35em; border-radius: var(--r-s); overflow-wrap: anywhere; }
.ui { font-weight: 650; color: var(--ink); }
.eyebrow { font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 1.15rem; line-height: 1.55; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.flow { display: grid; gap: 14px; }
.flow > p, .flow > ul, .flow > ol { max-width: 68ch; }
ul, ol { margin: 0; padding-left: 1.3em; }
li + li { margin-top: .3em; }

/* Kopf */
.masthead { display: grid; gap: 18px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 44px; height: 44px; flex: none; }
.brand .who { font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: .8rem; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-m); overflow: hidden; margin-top: 6px; }
.facts div { background: var(--surface); padding: 10px 14px; min-width: 0; }
.facts dt { font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* Inhaltsverzeichnis */
.toc { min-width: 0; }
.toc-inner { border: 1px solid var(--rule); background: var(--surface); border-radius: var(--r-m); padding: 14px 16px; }
@media (min-width: 1100px) {
  .toc-inner { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 24px); max-height: calc(100vh - 48px); overflow: auto; border: 0; background: none; padding: 0; }
}
.toc h2 { font-size: .78rem; font-family: var(--f-mono); font-variation-settings: "MONO" 1; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.toc li + li { margin-top: 0; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 5px 6px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; font-size: .95rem; line-height: 1.3; }
.toc a:hover { background: var(--sunken); color: var(--ink); }
.toc a[aria-current="true"] { background: var(--accent-wash); color: var(--ink); }
.toc .sub a { padding-left: 38px; font-size: .86rem; color: var(--muted); }
.toc .sub a:hover { color: var(--ink); }
@media (max-width: 1099px) { .toc .sub { display: none; } .toc ol { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } }

/* Laufwerksschild als Kapitelnummer */
.plate { display: inline-grid; place-items: center; min-width: 1.9em; height: 1.9em; padding: 0 .3em; border: 2px solid currentColor; border-radius: 5px; font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-weight: 700; font-size: .8em; line-height: 1; position: relative; flex: none; }
.plate::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 3px; height: 2px; background: currentColor; opacity: .35; border-radius: 1px; }
.toc .plate { font-size: .72rem; color: var(--accent); }

/* Kapitel */
section.chapter { display: grid; gap: 22px; padding-top: 56px; margin-top: 8px; border-top: 1px solid var(--rule); scroll-margin-top: 16px; }
section.chapter:first-of-type { border-top: 0; padding-top: 28px; }
.chapter-head { display: flex; gap: 16px; align-items: flex-start; }
.chapter-head .plate { font-size: 1.25rem; color: var(--accent); margin-top: .1em; }
.chapter-head .eyebrow { display: block; margin-bottom: 4px; }
.sub-block { display: grid; gap: 14px; padding-top: 18px; scroll-margin-top: 16px; }
.when { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .86rem; color: var(--muted); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.pill.time { background: var(--accent-wash); color: var(--accent-ink); }

/* Schritte */
ol.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 18px; }
ol.steps > li { counter-increment: s; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 14px; margin: 0; }
ol.steps > li::before { content: counter(s); grid-row: 1 / span 9; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--accent); color: var(--on-accent); margin-top: 1px; }
ol.steps > li > * { grid-column: 2; min-width: 0; }
ol.steps > li > * + * { margin-top: 6px; }

/* Hinweise */
.note { border: 1px solid var(--rule); background: var(--surface); border-radius: var(--r-m); padding: 12px 16px; display: grid; gap: 6px; max-width: 68ch; }
.note.warn { background: var(--warn-wash); border-color: transparent; }
.note.ok { background: var(--ok-wash); border-color: transparent; }
.note strong:first-child { font-family: var(--f-display); }

/* Bilder */
figure { margin: 0; }
.shot { display: grid; gap: 8px; justify-items: start; }
.shot .zoom { all: unset; cursor: zoom-in; display: block; max-width: 100%; border-radius: var(--r-m); box-shadow: var(--shadow); line-height: 0; background: var(--surface); }
.shot .zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shot img { max-width: 100%; height: auto; border-radius: var(--r-m); border: 1px solid var(--rule); display: block; }
.shot figcaption { font-size: .88rem; line-height: 1.45; color: var(--muted); max-width: 68ch; }
.shot figcaption b { color: var(--ink-2); font-weight: 650; }
.pair { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 720px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pair.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pair .shot .zoom, .pair .shot img { width: 100%; }
.wide, main .wide { max-width: 1000px; }

/* Code */
.code { position: relative; background: var(--sunken); border-radius: var(--r-m); border: 1px solid var(--rule); max-width: 820px; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: .84rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.code .label { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px 0 16px; font-size: .78rem; color: var(--muted); font-family: var(--f-mono); font-variation-settings: "MONO" 1; letter-spacing: .04em; }
.copy { font: 600 .78rem var(--f-body); border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-s); padding: 3px 10px; cursor: pointer; }
.copy:hover { border-color: var(--accent); }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-m); background: var(--surface); max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
tr:last-child > td { border-bottom: 0; }
thead th { font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--sunken); }
tbody th { font-weight: 650; color: var(--ink); }
td.yes { color: var(--ink); }
.cmp td:nth-child(2) { background: var(--accent-wash); }
.modes th:nth-child(2), .modes td:nth-child(2) { background: var(--accent-wash); }
.modes { min-width: 600px; }
.cmp { min-width: 640px; }
.msg { min-width: 620px; }

/* Wer macht was wo */
.lanes { display: grid; gap: 10px; max-width: 1000px; }
.lane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; background: var(--surface); border: 1px solid var(--rule); border-left: 6px solid var(--c); border-radius: var(--r-m); padding: 14px 16px; }
@media (min-width: 760px) { .lane { grid-template-columns: 190px minmax(0, 1fr); gap: 18px; } }
.lane.lan { --c: var(--lane-lan); } .lane.it { --c: var(--lane-it); } .lane.ma { --c: var(--lane-ma); } .lane.ms { --c: var(--lane-ms); }
.lane-who h3 { font-size: 1.05rem; color: var(--c); }
.lane-who p { font-size: .84rem; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.lane-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 6px; align-items: center; }
.lane-steps li { margin: 0; display: flex; align-items: center; gap: 6px; }
.lane-steps li + li::before { content: ""; width: 14px; height: 2px; background: var(--rule-strong); display: block; }
.step { border: 1px solid var(--rule); background: var(--paper); border-radius: 6px; padding: 5px 10px; font-size: .88rem; line-height: 1.3; }
.step b { font-weight: 650; }
.lane-after { grid-column: 1 / -1; font-size: .84rem; color: var(--muted); }
@media (min-width: 760px) { .lane-after { grid-column: 2; } }

/* Datenfluss */
.diagram { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-m); max-width: 1000px; }
.diagram svg { display: block; min-width: 660px; width: 100%; height: auto; }
.d-box { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 1.5; }
.d-box.ms { fill: var(--sunken); }
.d-box.srv { fill: var(--accent-wash); stroke: var(--accent); }
.d-title { fill: var(--ink); font: 700 15px var(--f-display); }
.d-text { fill: var(--muted); font: 400 12.5px var(--f-body); }
.d-file { stroke: var(--lane-ma); stroke-width: 5; fill: none; }
.d-cfg { stroke: var(--accent); stroke-width: 2; fill: none; }
.d-dir { stroke: var(--lane-ms); stroke-width: 2; fill: none; stroke-dasharray: 6 5; }
.d-lab { fill: var(--ink-2); font: 600 12.5px var(--f-body); }
.d-lab.file { fill: var(--lane-ma); }
.d-head-file { fill: var(--lane-ma); }
.d-head-cfg { fill: var(--accent); }
.d-head-dir { fill: var(--lane-ms); }

/* Entscheidungshilfe */
.choose { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); max-width: 820px; }
@media (min-width: 720px) { .choose { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.choose div { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 12px 14px; font-size: .92rem; min-width: 0; }
.choose b { display: block; margin-bottom: 4px; font-family: var(--f-display); }
.choose .arrow { color: var(--accent); font-weight: 700; }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq article { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 14px 16px; display: grid; gap: 6px; }
.faq h4 { font-family: var(--f-display); font-size: 1.02rem; }
.faq .fix { border-left: 3px solid var(--ok); padding-left: 10px; }
.faq-group { font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }

/* Lupe */
.lupe { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
.lupe::backdrop { background: var(--backdrop); }
.lupe-inner { width: 100%; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); box-sizing: border-box; cursor: zoom-out; }
.lupe img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-m); background: #fff; }
.lupe p { color: #e8eef0; font-size: .92rem; max-width: 90ch; text-align: center; }
.lupe .close { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: calc(env(safe-area-inset-right, 0px) + 12px); font: 600 .9rem var(--f-body); background: rgba(255, 255, 255, .92); color: #16202a; border: 0; border-radius: 999px; padding: 8px 16px; cursor: pointer; }

footer.colophon { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: .86rem; color: var(--muted); display: grid; gap: 6px; }

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .toc, .lupe, .copy { display: none !important; }
  .page { display: block; padding: 0; }
  main > *, .masthead > * { max-width: none; }
  section.chapter { break-before: page; border: 0; padding-top: 0; }
  section.chapter:first-of-type { break-before: auto; }
  figure, .lane, .faq article, .note, tr { break-inside: avoid; }
  .shot .zoom { box-shadow: none; }
  .table-wrap, .diagram { overflow: visible; }
  .modes, .cmp, .msg { min-width: 0; }
  a { color: inherit; }
}

/* Ergänzungen für cloudmount.de/hilfe/ (deploy/hilfe_bauen.py) */
body { margin: 0; }
.brand { flex-wrap: wrap; }
.brand .who { min-width: 0; }
.brand .zum-portal { margin-left: auto; font: 600 .86rem/1.3 var(--f-body); color: var(--ink-2); text-decoration: none; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 5px 13px; white-space: nowrap; }
.brand .zum-portal:hover { color: var(--accent-ink); border-color: var(--accent); }
.brand .zum-portal-2 { margin-left: 8px; }
@media print { .brand .zum-portal { display: none; } }

/* Einwilligung und Fusszeile (deploy/hilfe_bauen.py, Regeln wie site.css .consent) */
.cm-consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px; margin-left: auto; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 16px; padding: 20px 22px; box-shadow: 0 24px 60px -20px rgba(11, 43, 51, .4); font: 400 .95rem/1.5 var(--f-body); color: var(--ink); }
.cm-consent[hidden] { display: none; }
.cm-consent p { margin: 0 0 14px; }
.cm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cm-actions button, .cm-fuss button { font: 600 .92rem/1.2 var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 10px 18px; cursor: pointer; flex: 1 1 140px; }
.cm-actions button:hover, .cm-fuss button:hover { border-color: var(--accent); color: var(--accent-ink); }
.cm-fuss { max-width: 1100px; margin: 0 auto; padding: 18px 20px 40px; font: 400 .86rem/1.5 var(--f-body); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.cm-fuss a { color: var(--ink-2); }
.cm-fuss button { flex: 0 0 auto; padding: 4px 12px; font-size: .86rem; }
@media print { .cm-consent, .cm-fuss { display: none; } }
