/* KI klar verstehen – Gestaltung „Sachlich-klar“ (E19)
   Weiß, Dunkelblau als Akzent, serifenlos (Atkinson Hyperlegible, selbst gehostet, SIL OFL 1.1).
   Mobil zuerst, Kontraste nach WCAG 2.2 AA, druckfreundlich. */

@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

:root {
  --text: #1b1f24;          /* auf Weiß 16,1:1 */
  --text-leise: #4a5361;    /* auf Weiß 7,6:1 */
  --grund: #ffffff;
  --flaeche: #f3f5f8;
  --akzent: #1f3a68;        /* Dunkelblau, auf Weiß 11,4:1 */
  --akzent-hell: #e8eef7;
  --link: #1d4f91;          /* auf Weiß 8,2:1 */
  --rahmen: #8792a2;        /* Nicht-Text-Kontrast 3,3:1 */
  --fokus: #b34700;         /* auf Weiß 5,1:1 */
  --warn-grund: #fff4d6;
  --warn-text: #5c3d00;     /* auf Warngrund 9,6:1 */
  --warn-rand: #a86b00;
  --breite: 42rem;
  --abstand: 1rem;
  font-size: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.125rem;      /* 18 px */
  line-height: 1.6;
  color: var(--text);
  background: var(--grund);
  overflow-wrap: break-word;
}

/* Fokus immer sichtbar (WCAG 2.4.7, 2.4.13 angestrebt) */
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.25; color: var(--akzent); }
h1 { font-size: 1.75rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.375rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }

.springen { position: absolute; left: -999px; top: 0; background: var(--grund); color: var(--akzent); padding: 0.5rem 1rem; z-index: 10; }
.springen:focus { left: var(--abstand); }
.nur-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopf */
.kopf { background: var(--akzent); color: #fff; }
.kopf-innen { max-width: 64rem; margin: 0 auto; padding: 0.75rem var(--abstand); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.marke { color: #fff; font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.marke:hover { text-decoration: underline; }
.kopf :focus-visible { outline-color: #ffd27a; }

.menue { flex-basis: 100%; }
.menue > summary {
  list-style: none; cursor: pointer; display: inline-block;
  min-height: 44px; padding: 0.5rem 1rem; border: 2px solid #fff; border-radius: 6px; font-weight: 700;
  position: absolute; right: var(--abstand); top: 0.5rem;
}
.menue > summary::-webkit-details-marker { display: none; }
.menue > summary::after { content: " ▾"; }
.menue[open] > summary::after { content: " ▴"; }
.kopf-innen { position: relative; }
.menue nav { padding: 0.5rem 0 0.25rem; }

.nav-liste { list-style: none; margin: 0; padding: 0; }
.nav-liste a { display: block; color: #fff; padding: 0.6rem 0.25rem; text-decoration: none; border-top: 1px solid rgba(255,255,255,0.25); }
.nav-liste a:hover, .nav-liste a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

.nav-breit { display: none; }

@media (min-width: 60rem) {
  .menue { display: none; }
  .nav-breit { display: block; max-width: 64rem; margin: 0 auto; padding: 0 var(--abstand) 0.5rem; }
  .nav-breit .nav-liste { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
  .nav-breit .nav-liste a { border: 0; padding: 0.35rem 0; }
}

/* Inhalt */
.inhalt { max-width: var(--breite); margin: 0 auto; padding: 1.5rem var(--abstand) 3rem; }
.leitgedanke { color: var(--text-leise); margin: 0; }
.einleitung { font-size: 1.2rem; }

/* v0.4: Spalten passen sich der Schriftgröße an (vergrößerte Schrift ohne seitliches Scrollen, WCAG 1.4.4/1.4.10) */
.kacheln { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(max(min(100%, 9rem), calc((100% - 0.75rem) / 2)), 1fr)); gap: 0.75rem; }
.kacheln > li { min-width: 0; }
.kacheln--breit { grid-template-columns: 1fr; }
.kachel { overflow-wrap: break-word; hyphens: auto; }
.kachel {
  display: flex; flex-direction: column; justify-content: center; gap: 0.25rem;
  min-height: 4.5rem; height: 100%; padding: 0.75rem 1rem;
  border: 2px solid var(--akzent); border-radius: 6px; background: var(--grund);
  color: var(--akzent); font-weight: 700; text-decoration: none;
}
.kachel span { color: var(--text-leise); font-weight: 400; font-size: 1rem; }
.kachel:hover { background: var(--akzent-hell); }
@media (min-width: 40rem) { .kacheln--breit { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); } }

/* Bausteine und Quellen (01 Abschn. 7b) */
.baustein { margin: 0 0 1.25rem; }
.kennzeichen { display: inline-block; font-size: 0.9rem; font-weight: 700; color: var(--akzent); background: var(--akzent-hell); padding: 0 0.5rem; border-radius: 4px; margin-bottom: 0.25rem; }
.baustein--beispiel, .baustein--vergleich { border-left: 4px solid var(--akzent); padding-left: 0.85rem; }

details.quelle { font-size: 0.95rem; color: var(--text-leise); margin: -0.5rem 0 1rem; }
details.quelle > summary { cursor: pointer; min-height: 24px; padding: 0.15rem 0; width: fit-content; }
details.quelle > summary:hover { color: var(--text); }
details.quelle ul { margin: 0.25rem 0 0.5rem; padding-left: 1.25rem; }
.q-nr { font-weight: 700; }
.q-anm { font-style: italic; }
.q-naechste { margin: 0; }

.veraltet { background: var(--warn-grund); color: var(--warn-text); border-left: 4px solid var(--warn-rand); padding: 0.6rem 0.85rem; margin: 0 0 1rem; }
.veraltet ul { margin: 0.25rem 0 0; }

.platzhalter-hinweis { background: var(--flaeche); border: 1px dashed var(--rahmen); padding: 0.75rem 1rem; margin: 0 0 1.25rem; }
.platzhalter-hinweis p:last-child { margin-bottom: 0; }
.intern { color: var(--text-leise); font-size: 0.95rem; }

/* Tabellen: auf schmalen Bildschirmen innerhalb des Rahmens scrollbar, die Seite selbst nie */
.tabelle-rahmen { overflow-x: auto; margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.5rem; border-bottom: 1px solid #c9d0da; }
thead th { border-bottom: 2px solid var(--akzent); }
.quellen-tabelle td:nth-child(2) { min-width: 14rem; }

/* Selbstcheck */
.sc-frage { border: 1px solid var(--rahmen); border-radius: 6px; margin: 0 0 1rem; padding: 0.5rem 1rem 0.75rem; }
.sc-frage[hidden] { display: none; }
.sc-frage legend { font-weight: 700; padding: 0 0.25rem; color: var(--akzent); }
.sc-nr { display: inline-block; min-width: 1.6rem; height: 1.6rem; line-height: 1.6rem; text-align: center; border-radius: 50%; background: var(--akzent); color: #fff; font-size: 0.95rem; margin-right: 0.25rem; }
.sc-option { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.4rem 0; min-height: 44px; cursor: pointer; }
.sc-option input { width: 1.35rem; height: 1.35rem; margin: 0.15rem 0 0; flex-shrink: 0; accent-color: var(--akzent); }
.sc-zusatz { color: var(--text-leise); font-size: 0.95rem; }
.sc-aktionen { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 2rem; }
.knopf { font: inherit; font-weight: 700; min-height: 44px; padding: 0.5rem 1.25rem; border-radius: 6px; border: 2px solid var(--akzent); background: var(--akzent); color: #fff; cursor: pointer; }
.knopf--zweit { background: var(--grund); color: var(--akzent); }
.knopf:hover { text-decoration: underline; }

.sc-ergebnis { border-top: 3px solid var(--akzent); padding-top: 0.5rem; }
.sc-ergebnis:focus { outline: none; }
.sc-ergebnis:focus-visible { outline: 3px solid var(--fokus); }
.sc-liste { list-style: none; padding: 0; margin: 0; }
.sc-baustein { border-left: 4px solid var(--rahmen); padding: 0.5rem 0 0.25rem 0.85rem; margin: 0 0 1rem; }
.sc-baustein p { margin-bottom: 0.5rem; }
.sc-mehr { display: inline-block; margin: 0 0 0.75rem; }
/* Hinweis auf Fachleute: deutlich, aber ohne Wertungsfarbe (01 Abschn. 6 Nr. 2 und 5) */
.sc-abschnitt--fachleute .sc-baustein { border-left-color: var(--akzent); border-left-width: 6px; background: var(--akzent-hell); padding-right: 0.85rem; }
.sc-baustein[data-id="fl-sensibel"] p:first-child { font-weight: 700; } /* Pflichthinweis 01 Abschn. 6 Nr. 5 */

/* Fuß */
.fuss { background: var(--flaeche); border-top: 1px solid #c9d0da; font-size: 1rem; }
.fuss-innen { max-width: var(--breite); margin: 0 auto; padding: 1.5rem var(--abstand) 2rem; }
.fuss-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.fuss-links a { display: inline-block; padding: 0.4rem 0; }
.stand { color: var(--text-leise); }


/* Quellverweise im Text (Chat 7): klein, unaufdringlich, führen zur Quellenliste */
sup.qv { font-size: 0.72em; line-height: 0; color: var(--text-leise); white-space: normal; }
sup.qv a { color: var(--text-leise); text-decoration-thickness: 1px; }
sup.qv a:hover { color: var(--link); }
.qv-zelle { display: block; margin-top: 0.35rem; font-size: 0.85rem; color: var(--text-leise); }
.qv-zelle a, .qv-spalte a { color: var(--text-leise); }
.qv-spalte { font-size: 0.9rem; color: var(--text-leise); }
.kennzeichen span { font-weight: 400; }
.sz-erfunden { font-size: 0.9rem; color: var(--text-leise, inherit); margin-top: -0.25rem; }
a.q-nr { color: inherit; }

/* Sprungmarken und Fragen */
.sprungmarken { background: var(--flaeche); border-radius: 6px; padding: 0.6rem 1rem; margin: 0 0 1.5rem; }
.sprungmarken ol, .sprungmarken ul { margin: 0; padding-left: 1.25rem; }
.sprungmarken a { display: inline-block; padding: 0.2rem 0; }
.sprungmarken-zeile { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.frage-nr { display: inline-block; min-width: 1.8rem; height: 1.8rem; line-height: 1.8rem; text-align: center; border-radius: 50%; background: var(--akzent); color: #fff; font-size: 1rem; margin-right: 0.35rem; vertical-align: 0.1em; }
h2[id], h3[id], section[id] { scroll-margin-top: 1rem; }
.vier-kurz { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.vier-kurz > li { border-left: 4px solid var(--akzent-hell); padding-left: 0.85rem; margin-bottom: 1rem; }
.vier-kurz h3 { margin-top: 0.5rem; }
.weiter { margin-top: -0.5rem; }
.einleitung .baustein { margin-bottom: 0.5rem; }

/* „Fachlich erklärt“ eingeklappt (01 Abschn. 7: nur wo es Mehrwert hat) */
details.fachlich { border: 1px solid #c9d0da; border-radius: 6px; padding: 0.25rem 1rem; margin: 0 0 1.5rem; }
details.fachlich > summary { cursor: pointer; font-weight: 700; color: var(--akzent); min-height: 44px; display: flex; align-items: center; }
details.fachlich[open] > summary { margin-bottom: 0.5rem; }

.grundsaetze li { margin-bottom: 0.6rem; }

/* Gestapelte Tabellen auf schmalen Bildschirmen: jede Zelle mit ihrer Spaltenüberschrift */
@media (max-width: 47.99rem) {
  table.tabelle-gestapelt, .tabelle-gestapelt tbody, .tabelle-gestapelt tr, .tabelle-gestapelt td, .tabelle-gestapelt th { display: block; width: 100%; }
  .tabelle-gestapelt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabelle-gestapelt tr { border: 1px solid #c9d0da; border-radius: 6px; margin: 0 0 0.75rem; padding: 0.25rem 0.75rem; }
  .tabelle-gestapelt td { border: 0; padding: 0.35rem 0; }
  .tabelle-gestapelt td + td { border-top: 1px dashed #dde2e9; }
  .tabelle-gestapelt td:first-child { font-weight: 700; color: var(--akzent); }
  .tabelle-gestapelt td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 0.85rem; font-weight: 700; color: var(--text-leise); }
  .tabelle-gestapelt td[data-label=""]::before { content: none; }
}
@media (min-width: 48rem) {
  .inhalt--breit { max-width: 64rem; }
  .tabelle-gestapelt td:first-child { font-weight: 700; }
}

/* Fuß: Absender dezent */
.fuss-links .absender { color: var(--text-leise); padding: 0.4rem 0; }

/* Bewegung reduzieren */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Drucken (03 Abschn. 7) */
@media print {
  body { font-size: 11pt; color: #000; }
  .kopf, .menue, .nav-breit, .springen, .sc-aktionen, .fuss-links, .stand { display: none !important; }
  .inhalt, .fuss-innen { max-width: none; padding: 0; }
  .fuss { background: none; border-top: 1px solid #000; margin-top: 1.5rem; }
  h1, h2, h3 { color: #000; break-after: avoid; }
  a { color: #000; }
  .inhalt a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
  details.quelle > summary { list-style: none; }
  .sc-formular { display: none; }
  .veraltet, .platzhalter-hinweis, .sc-abschnitt--fachleute .sc-baustein { background: none; border: 1px solid #000; }
  .sc-baustein, .baustein, tr { break-inside: avoid; }
}

/* Szenarien (Chat 11, Website v0.5) */
.szenario-nr { color: var(--text-leise); margin-bottom: 0.25rem; }
.szenario-fuer { color: var(--text-leise); margin-top: -0.5rem; }
/* Deutlicher Hinweis auf fachkundige Prüfung (01 Abschn. 6 Nr. 5): wie der Fachleute-Hinweis im Selbstcheck, ohne Wertungsfarbe */
.szenario-hinweis { border-left: 6px solid var(--akzent); background: var(--akzent-hell); padding: 0.75rem 0.85rem 0.25rem; margin: 0 0 1.5rem; }
.szenario-hinweis .baustein { margin-bottom: 0.5rem; }
.szenario-link { margin-top: 0; }
@media print { .szenario-hinweis { background: none; border: 1px solid #000; } }
/* Lange Wörter bei 200 % Schrift umbrechen statt seitlich scrollen (Chat 11, Browserprüfung v0.5) */
.sprungmarken a, h1, h2, h3, summary, .kachel strong, .sc-frage legend, .sc-option span { overflow-wrap: break-word; hyphens: auto; }
.sc-frage { min-width: 0; } /* fieldset: Standard-min-width min-content verhinderte Umbruch */
