/* Stile des Handbuchs – aus marke.css herausgelöst (P7.12), damit Seiten ohne Handbuch sie nicht laden.
   Eingebunden von vorlagen/handbuch.html, nach marke.css. */
/* ==========================================================================
   Handbuch (/handbuch)
   Zwei Spalten: links Suche und Inhaltsverzeichnis (angeheftet), rechts der Text in Lesebreite.
   Kapitel tragen ihre Nummer wie eine Achse im Bauplan – Kreis und Strichpunktlinie –, die Kapitel der
   drei Werkzeuge in deren Ebenenfarbe. Bausteine wie im Rest der Oberfläche: Schriftfeld, Hinweis,
   Plakette, Tabellenrahmen. handbuch.js: Suche, Inhaltsverzeichnis, Bild groß.
   ========================================================================== */

.hdb-seite { width: min(100% - 2.5rem, var(--breite)); }
/* Sprungziele: html hat schon scroll-padding-top in Höhe des Kopfs (stil.css) */
.hdb-seite :is(.hdb-kapitel, .hdb-abschnitt) { scroll-margin-top: 0.4rem; }

/* --- Seitenkopf -------------------------------------------------------------------------------------------- */

.hdb-kopf { margin-bottom: 0.4rem; }
.hdb-kopf .seitenkopf { align-items: flex-end; margin-bottom: 1rem; }
.hdb-kopf .schriftfeld { flex: 0 1 26rem; margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hdb-legende {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0 0 2rem; padding: 0 0 1.2rem;
  list-style: none; font-size: var(--t-neben); color: var(--neben); border-bottom: 1px solid var(--linie);
}
.hdb-legende li { display: inline-flex; align-items: center; gap: 0.45rem; }
.hdb-legende .zeichen { color: var(--plan); }

/* --- Zwei Spalten ------------------------------------------------------------------------------------------- */

.hdb { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 3rem; align-items: start; }
.hdb-nav {
  position: sticky; top: calc(var(--kopf-h) + 1rem);
  max-height: calc(100vh - var(--kopf-h) - 2rem); overflow-y: auto; overscroll-behavior: contain;
  padding: 0 0.4rem 1rem 0; scrollbar-width: thin;
}
.hdb-text { min-width: 0; max-width: 48rem; }

/* --- Suche -------------------------------------------------------------------------------------------------- */

.hdb-suche { margin-bottom: 0.8rem; }
.hdb-suche__feld { position: relative; display: block; }
.hdb-suche__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hdb-suche__lupe { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--neben); pointer-events: none; }
.hdb-suche input {
  width: 100%; min-height: var(--feld-h); padding: 0.4rem 2.2rem 0.4rem 2.2rem;
  border: 1px solid var(--feld-rand); border-radius: var(--rundung-klein); background: #fff;
  font: inherit; font-size: 0.93rem; color: var(--tinte);
}
.hdb-suche input::placeholder { color: #667789; }
.hdb-suche input:focus { outline: none; border-color: var(--plan); box-shadow: var(--ring); }
.hdb-suche__taste {
  position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); pointer-events: none;
  min-width: 1.4rem; padding: 0 0.3rem; border: 1px solid var(--stahl); border-bottom-width: 2px; border-radius: var(--rundung-fein);
  font: 600 0.75rem/1.35 var(--schrift); color: var(--neben); text-align: center; background: var(--grund);
}
.hdb-suche input:focus ~ .hdb-suche__taste, .hdb-suche input:not(:placeholder-shown) ~ .hdb-suche__taste { display: none; }
@media (hover: none) { .hdb-suche__taste { display: none; } }          /* ohne Tastatur kein „/“ */
.hdb-suche__treffer { margin: 0.45rem 0.2rem 0; font-size: var(--t-klein); color: var(--neben); }
.hdb-suche__treffer:empty { display: none; }

/* --- Inhaltsverzeichnis -------------------------------------------------------------------------------------- */

.hdb-inhalt__knopf { display: none; }
.hdb-inhalt__liste, .hdb-inhalt__abschnitte { list-style: none; margin: 0; padding: 0; }
.hdb-inhalt a { display: block; text-decoration: none; border-radius: var(--rundung-klein); line-height: 1.3; }
.hdb-inhalt__kapitel > a {
  display: flex; gap: 0.6rem; align-items: center; padding: 0.4rem 0.5rem;
  font-weight: 700; font-size: 0.92rem; color: var(--tinte);
}
.hdb-inhalt__nr {
  flex: none; display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  border: 1.5px solid var(--ebene, var(--stahl)); font: 700 0.72rem/1 var(--anzeige); color: var(--neben);
}
.hdb-inhalt__abschnitte { margin: 0.05rem 0 0.4rem 1.25rem; padding-left: 0.85rem; border-left: 1px solid var(--linie); }
.hdb-inhalt__abschnitte a { padding: 0.28rem 0.5rem; font-size: 0.87rem; color: var(--neben); }
.hdb-inhalt a:hover { background: var(--nebel); color: var(--tinte); }
.hdb-inhalt__abschnitte a[aria-current="true"] { color: var(--plan-tief); background: var(--plan-hell); font-weight: 700; }
.hdb-inhalt__kapitel.ist-aktiv > a .hdb-inhalt__nr { border-color: var(--ebene, var(--nacht)); background: var(--ebene, var(--nacht)); color: #fff; }
/* Mit Skript: nur die Abschnitte des Kapitels, in dem man gerade liest – beim Suchen alle Treffer */
.hdb--js .hdb-inhalt__kapitel:not(.ist-aktiv) > .hdb-inhalt__abschnitte { display: none; }
.hdb--js.hdb--sucht .hdb-inhalt__kapitel:not(.ist-weg) > .hdb-inhalt__abschnitte { display: block; }
.hdb--sucht [data-ziel].ist-weg { display: none !important; }

/* --- Kapitel: Nummer wie eine Achse im Plan -------------------------------------------------------------------- */

.hdb-kapitel { margin-bottom: 3.5rem; }
.hdb-kapitel__kopf { margin-bottom: 1.4rem; }
.hdb-kapitel__titel {
  display: flex; align-items: center; gap: 0.8rem; margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 1.8rem); line-height: 1.15; color: var(--tinte);
}
.hdb-kapitel__titel::after {
  content: ""; flex: 1 1 2rem; min-width: 1.5rem; height: 1.5px; margin-left: 0.3rem;
  background: repeating-linear-gradient(90deg, var(--ebene, var(--stahl)) 0 18px, transparent 18px 23px, var(--ebene, var(--stahl)) 23px 26px, transparent 26px 31px);
  opacity: 0.7;
}
.hdb-kapitel__nr {
  flex: none; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 2px solid var(--ebene, var(--nacht)); background: #fff; color: var(--ebene, var(--nacht)); font-size: 1.1rem; letter-spacing: 0;
}
.hdb-kapitel__einleitung { margin: 0.7rem 0 0; max-width: var(--lesebreite); font-size: 1.04rem; line-height: 1.55; color: var(--neben); }

/* --- Abschnitte und Fließtext ------------------------------------------------------------------------------------- */

.hdb-abschnitt { margin-top: 2.3rem; }
.hdb-abschnitt:first-of-type { margin-top: 0; }
.hdb-abschnitt__titel { margin: 0 0 0.7rem; font-size: 1.2rem; line-height: 1.3; }
.hdb-anker { color: var(--tinte); text-decoration: none; }
.hdb-anker:hover { color: var(--plan); text-decoration: none; }
.hdb-anker::after { content: "#"; margin-left: 0.4rem; color: var(--stahl); font-weight: 400; opacity: 0; transition: opacity 0.15s; }
.hdb-anker:hover::after, .hdb-anker:focus-visible::after { opacity: 1; }

.hdb-text p, .hdb-text li, .hdb-text dd { line-height: 1.62; }
.hdb-text p { margin: 0 0 0.85rem; }
.hdb-text ul, .hdb-text ol { margin: 0 0 1rem; padding-left: 1.25rem; }
.hdb-text li + li { margin-top: 0.35rem; }
.hdb-text li::marker { color: var(--neben); }
.hdb-text code { font-size: 0.88em; padding: 0.05rem 0.3rem; border-radius: 4px; background: var(--nebel); }
.hdb-siehe { font-weight: 500; }
.hdb-leise { color: var(--neben); font-size: 0.86em; }
.hdb-ende { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--linie); color: var(--neben); font-size: var(--t-neben); }

/* Schritte: eine echte Reihenfolge */
.hdb-text ol.hdb-schritte { list-style: none; padding: 0; counter-reset: schritt; display: grid; gap: 0.6rem; }
.hdb-schritte > li { position: relative; margin: 0; padding-left: 2.4rem; counter-increment: schritt; }
.hdb-schritte > li::before {
  content: counter(schritt); position: absolute; left: 0; top: 0.05rem;
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--nacht); color: #fff; font: 700 0.8rem/1 var(--anzeige);
}

/* Begriffe */
/* Formel im Handbuch: eigene Zeile, bei wenig Platz waagerecht rollbar */
.hdb-formel { margin: 0.5rem 0 0.9rem; padding: 0.55rem 0.85rem; border-left: 3px solid var(--linie); background: var(--nebel); font-variant-numeric: tabular-nums; white-space: nowrap; overflow-x: auto; }
.hdb-begriffe dd > ul { margin: 0; padding-left: 1.1rem; }
.hdb-begriffe dd > ul > li + li { margin-top: 0.3rem; }
.hdb-begriffe { margin: 0.4rem 0 1.2rem; border-top: 1px solid var(--linie); }
.hdb-begriffe > div { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); gap: 0.2rem 1.2rem; padding: 0.6rem 0; border-bottom: 1px solid var(--linie); }
.hdb-begriffe dt { font-weight: 700; color: var(--tinte); }
.hdb-begriffe dd { margin: 0; }

/* Kästen wie .hinweis */
.hdb-hinweis {
  margin: 1.2rem 0; padding: 0.75rem 1rem 0.1rem 0.95rem;
  border: 1px solid #CDDFF3; border-left: 3px solid var(--plan); border-radius: var(--rundung-klein); background: var(--plan-hell);
}
.hdb-hinweis__titel { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.25rem !important; font-weight: 700; font-size: 0.9rem; color: var(--plan-tief); }
.hdb-hinweis--achtung { background: var(--warn-hell); border-color: var(--warn-rand); border-left-color: #C98A00; }
.hdb-hinweis--achtung .hdb-hinweis__titel { color: var(--warn); }
.hdb-hinweis--abo { background: #fff; border-color: var(--linie); border-left-color: var(--nacht); }
.hdb-hinweis--abo .hdb-hinweis__titel { color: var(--tinte); }

/* Plakette „Abo“ hinter Funktionen, die ein Abo brauchen */
.hdb-abo {
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.05rem 0.45rem 0.05rem 0.35rem; border-radius: var(--rundung-fein);
  background: var(--plan-hell); color: var(--plan-tief); font-size: 0.75rem; font-weight: 700; line-height: 1.45;
  vertical-align: 0.1em; white-space: nowrap;
}

/* Tastenkappen */
.hdb-tasten { white-space: nowrap; }
.hdb-tasten kbd {
  display: inline-block; min-width: 1.7em; padding: 0.04rem 0.42rem 0.08rem; margin: 0.08rem 0;
  border: 1px solid var(--stahl); border-bottom-width: 2px; border-radius: var(--rundung-fein);
  background: linear-gradient(#fff, var(--grund)); color: var(--tinte);
  font: 600 0.8rem/1.35 var(--schrift); text-align: center; vertical-align: 0.05em;
}
.hdb-tasten__plus { margin: 0 0.18rem; color: var(--neben); font-size: 0.78rem; }

/* Tabellen wie .tabellenrahmen und .tabelle */
.hdb-tabellenrahmen { margin: 1.1rem 0 1.3rem; overflow-x: auto; background: #fff; border: 1px solid var(--linie); border-radius: var(--rundung); }
.hdb-tabelle { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.92rem; background: #fff; }
.hdb-abschnitt > .hdb-tabelle { margin: 1.1rem 0 1.3rem; border: 1px solid var(--linie); border-radius: var(--rundung); overflow: hidden; }
/* Tabelle, die auf schmalen Bildschirmen zeilenweise stapelt: jede Zelle nennt ihre Spalte (data-kopf) */
@media (max-width: 640px) {
  .hdb-tabelle--stapel thead { display: none; }
  .hdb-tabelle--stapel, .hdb-tabelle--stapel tbody, .hdb-tabelle--stapel tr, .hdb-tabelle--stapel td { display: block; width: auto; }
  .hdb-tabelle--stapel tr { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--linie); }
  .hdb-tabelle--stapel tr:last-child { border-bottom: 0; }
  .hdb-tabelle--stapel td { padding: 0.15rem 0; border: 0; }
  .hdb-tabelle--stapel td[data-kopf]::before { content: attr(data-kopf) ": "; font-weight: 700; color: var(--neben); }
}
.hdb-tabelle caption { caption-side: top; padding: 0 0 0.5rem; text-align: left; font-weight: 700; color: var(--tinte); }
.hdb-tabellenrahmen .hdb-tabelle caption { padding: 0.75rem 0.9rem 0.5rem; }
.hdb-tabelle th, .hdb-tabelle td { padding: 0.6rem 0.9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--nebel); line-height: 1.5; }
.hdb-tabelle tbody tr:last-child > * { border-bottom: 0; }
.hdb-tabelle thead th { background: #FAFBFC; font-weight: 700; font-size: var(--t-klein); color: var(--neben); border-bottom-color: var(--linie); }
.hdb-tabelle tbody th { font-weight: 700; color: var(--tinte); }
.hdb-tabelle--tasten td:first-child { width: 42%; }
.hdb-tabelle--tasten .hdb-tasten { white-space: normal; }
.hdb-tabelle--tasten .hdb-tasten kbd { white-space: nowrap; }
.hdb-tabelle--matrix { min-width: 40rem; }
.hdb-tabelle--matrix tbody th { white-space: nowrap; width: 1%; }
.hdb-tabelle--matrix tbody th .hdb-tasten { display: block; white-space: nowrap; }
.hdb-tabelle--matrix tbody th .hdb-tasten + .hdb-tasten { margin-top: 0.3rem; }
.hdb-alle { background: var(--grund); }
.hdb-nicht { color: var(--neben); text-align: center !important; }
.hdb-tabelle--vergleich tbody th { width: 11rem; }

/* Bilder */
.hdb-bild { margin: 1.2rem 0 1.4rem; }
.hdb-bild__link {
  position: relative; display: block; overflow: hidden; cursor: zoom-in;
  border: 1px solid var(--linie); border-radius: var(--rundung-klein); background: #fff; box-shadow: var(--schatten);
}
.hdb-bild__link img { display: block; width: 100%; height: auto; max-height: 40rem; object-fit: cover; object-position: top; }
.hdb-bild__link:hover { border-color: var(--stahl); }
/* sehr flache Bilder (eine Zeitleiste) am Handy: Das Tippziel bleibt mindestens 24 px hoch, das Bild steht mittig */
.hdb-bild__link { min-height: 1.5rem; align-content: center; }
.hdb-bild__link:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
/* Hohe Bilder sind oben angeschnitten: unten ausblenden und sagen, dass es mehr gibt */
.hdb-bild--gekappt .hdb-bild__link::after {
  content: "Ganzes Bild ansehen"; position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3.2rem 1rem 0.75rem; text-align: center; font-size: var(--t-neben); font-weight: 700; color: var(--plan-tief);
  background: linear-gradient(rgba(255, 255, 255, 0), #fff 70%);
}
.hdb-bild figcaption { margin-top: 0.55rem; font-size: var(--t-neben); line-height: 1.5; color: var(--neben); }
.hdb-bild--schmal { max-width: 22rem; }
.hdb-bild--dialog { max-width: 30rem; }

.hdb-zwei { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem); gap: 0.5rem 2rem; align-items: start; margin: 0.4rem 0 1rem; }
.hdb-zwei > .hdb-bild { margin-top: 0.2rem; }
.hdb-bilder { display: grid; gap: 1rem 1.2rem; margin: 1.2rem 0 1.4rem; }
.hdb-bilder--zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hdb-bilder > .hdb-bild { margin: 0; }
.hdb-bilder--handy { grid-template-columns: repeat(auto-fill, minmax(11rem, 14rem)); }
.hdb-bilder--handy .hdb-bild__link img { max-height: none; }

/* Messpunkte im Bild */
.hdb-marken { position: relative; }
.hdb-marke {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none;
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--nacht); color: #fff; font: 700 0.78rem/1 var(--anzeige);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--signal), 0 4px 10px rgba(14, 35, 64, 0.35);
}
.hdb-marke--still { position: static; transform: none; display: inline-grid; width: 1.3rem; height: 1.3rem; font-size: 0.68rem; box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px var(--signal); }
.hdb-text ol.hdb-marken__liste { list-style: none; padding: 0; margin: 0.9rem 0 0; counter-reset: marke; columns: 2 17rem; column-gap: 2rem; }
.hdb-marken__liste > li { position: relative; padding-left: 2.1rem; margin: 0 0 0.5rem; break-inside: avoid; counter-increment: marke; font-size: 0.93rem; }
.hdb-marken__liste > li::before {
  content: counter(marke); position: absolute; left: 0; top: 0.12rem;
  display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--nacht); color: #fff; font: 700 0.72rem/1 var(--anzeige);
}

/* Projekt – Standort – Werkzeug */
.hdb-baum { margin: 1rem 0 1.4rem; padding: 1.1rem 1.2rem 1.2rem; border-radius: var(--rundung); background: var(--grund); border: 1px solid var(--linie); }
.hdb-baum__art { display: block; font-size: var(--t-klein); color: var(--neben); }
.hdb-baum__projekt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.8rem; padding: 0.7rem 0.9rem; border-radius: var(--rundung-klein); background: #fff; border: 1px solid var(--linie); border-left: 4px solid var(--nacht); }
.hdb-baum__projekt .hdb-baum__art { flex-basis: 100%; }
.hdb-text .hdb-baum__standorte { list-style: none; margin: 0 0 0 1.1rem; padding: 0.4rem 0 0 0; border-left: 2px solid var(--stahl); }
.hdb-baum__standorte > li { position: relative; margin: 0.55rem 0 0 1.2rem; padding: 0.55rem 0.8rem; border-radius: var(--rundung-klein); background: #fff; border: 1px solid var(--linie); }
.hdb-baum__standorte > li::before { content: ""; position: absolute; left: calc(-1.2rem - 1px); top: 1.2rem; width: 1.2rem; border-top: 2px solid var(--stahl); }
.hdb-baum__standorte > li:last-child::after { content: ""; position: absolute; left: calc(-1.2rem - 3px); top: calc(1.2rem + 2px); bottom: -2px; width: 4px; background: var(--grund); }
.hdb-baum__werkzeuge { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; margin-top: 0.35rem; font-size: var(--t-neben); }
.hdb-baum__werkzeuge > span { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--tinte); }
.hdb-baum__werkzeuge > .hdb-wz--leer { color: var(--neben); }

/* Flächenarten */
.hdb-arten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 2rem; margin: 0.8rem 0 1rem; }
.hdb-arten__titel { margin: 0 0 0.4rem !important; font-weight: 700; font-size: var(--t-neben); color: var(--neben); }
.hdb-text .hdb-arten__liste { list-style: none; padding: 0; margin: 0 0 0.9rem; }
.hdb-arten__liste li { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.3rem; font-size: 0.93rem; }
.hdb-farbe { flex: none; width: 1.05rem; height: 1.05rem; border-radius: 3px; border: 1px solid rgba(14, 35, 64, 0.18); }
.hdb-farbe--linie { height: 0.32rem; width: 1.3rem; border: 0; border-radius: 2px; }
.hdb-farbe--kreis { border-radius: 50%; }

/* Aufklappbares */
.hdb-mehr { margin: 0.6rem 0 1.2rem; border: 1px solid var(--linie); border-radius: var(--rundung-klein); background: #fff; }
.hdb-mehr > summary { padding: 0.65rem 0.9rem; cursor: pointer; font-weight: 700; color: var(--plan); }
.hdb-mehr[open] > summary { border-bottom: 1px solid var(--linie); }
.hdb-mehr > :not(summary) { margin-left: 0.9rem; margin-right: 0.9rem; }
.hdb-mehr > :last-child { margin-bottom: 0.9rem; }
.hdb-text .hdb-spalten { columns: 3 11rem; column-gap: 1.5rem; list-style: none; padding: 0.7rem 0 0; }
.hdb-spalten li { margin: 0 0 0.3rem; break-inside: avoid; font-size: 0.9rem; }

/* Stufen der Prüfung nach DIN 4124 – wie die Plaketten */
.hdb-stufe { display: inline-block; padding: 0.02rem 0.5rem; border-radius: var(--rundung-fein); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.hdb-stufe--gut { background: var(--gut-hell); color: var(--gut); }
.hdb-stufe--info { background: var(--plan-hell); color: var(--plan-tief); }
.hdb-stufe--warn { background: var(--warn-hell); color: var(--warn); }
.hdb-stufe--fehler { background: var(--fehler-hell); color: #8F2A2A; }
.hdb-marken-beispiel .pj-lizenz, .hdb-marken-beispiel .plakette { margin: 0.1rem 0; }

/* Häufige Fragen */
.hdb-fragen { margin: 0.3rem 0 1rem; border-top: 1px solid var(--linie); }
.hdb-frage { border-bottom: 1px solid var(--linie); }
.hdb-frage > summary {
  position: relative; padding: 0.75rem 2.4rem 0.75rem 0; cursor: pointer; list-style: none;
  font-weight: 700; line-height: 1.45; color: var(--tinte);
}
.hdb-frage > summary::-webkit-details-marker { display: none; }
.hdb-frage > summary::after {
  content: ""; position: absolute; right: 0.6rem; top: 1.05rem; width: 0.5rem; height: 0.5rem;
  border-right: 2px solid var(--neben); border-bottom: 2px solid var(--neben); transform: rotate(45deg); transition: transform 0.15s;
}
.hdb-frage[open] > summary::after { transform: translateY(0.2rem) rotate(-135deg); }
.hdb-frage > summary:hover { color: var(--plan); }
.hdb-frage > p { margin: -0.1rem 0 0.9rem; }

/* Treffer der Suche */
.hdb-text mark.hdb-treffer { background: #FFE58A; color: inherit; border-radius: 2px; padding: 0 0.05em; }
.hdb-leer { padding: 1.4rem 1.2rem; border: 1px dashed var(--stahl); border-radius: var(--rundung); background: #fff; }
.hdb-leer[hidden] { display: none; }

/* Bild groß */
.hdb-gross {
  width: min(96vw, 110rem); max-width: none; max-height: 94vh; padding: 0; border: 0; border-radius: var(--rundung);
  background: #fff; box-shadow: var(--schatten-hoch); overflow: hidden;
}
.hdb-gross[open] { display: flex; flex-direction: column; }
.hdb-gross::backdrop { background: rgba(16, 33, 58, 0.72); }
.hdb-gross__kopf { display: flex; align-items: center; gap: 1rem; padding: 0.55rem 0.6rem 0.55rem 1.1rem; border-bottom: 1px solid var(--linie); margin: 0; }
.hdb-gross__text { flex: 1; margin: 0; font-size: var(--t-neben); color: var(--neben); line-height: 1.4; }
.hdb-gross__bild { display: block; min-height: 0; max-width: 100%; max-height: calc(94vh - 3.6rem); margin: 0 auto; object-fit: contain; }
.hdb-gross--hoch { overflow-y: auto; }
.hdb-gross--hoch .hdb-gross__bild { max-height: none; }

/* Knopf zum Inhalt (schmale Bildschirme) */
.hdb-hoch { display: none; }


/* --- Schmalere Bildschirme ------------------------------------------------------------------------------------- */

@media (max-width: 62rem) {
  .hdb { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .hdb-nav { position: static; max-height: none; overflow: visible; padding: 0; }
  .hdb-inhalt { border: 1px solid var(--linie); border-radius: var(--rundung); background: #fff; }
  .hdb-inhalt__knopf {
    display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; cursor: pointer; list-style: none;
    font-family: var(--anzeige); font-weight: 700; color: var(--tinte);
  }
  .hdb-inhalt__knopf::-webkit-details-marker { display: none; }
  .hdb-inhalt__knopf::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--neben); border-bottom: 2px solid var(--neben); transform: rotate(45deg); transition: transform 0.15s; }
  .hdb-inhalt[open] > .hdb-inhalt__knopf { border-bottom: 1px solid var(--linie); }
  .hdb-inhalt[open] > .hdb-inhalt__knopf::after { transform: translateY(0.2rem) rotate(-135deg); }
  .hdb-inhalt__liste { padding: 0.5rem 0.5rem 0.7rem; }
  .hdb--js .hdb-inhalt__kapitel:not(.ist-aktiv) > .hdb-inhalt__abschnitte { display: block; }
  .hdb-text { max-width: none; }
  .hdb-hoch:not([hidden]) {
    display: inline-flex; align-items: center; gap: 0.45rem; position: fixed; z-index: 25;
    right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
    min-height: var(--feld-h); padding: 0 1rem; border-radius: 999px; background: var(--nacht); color: #fff;
    font-weight: 700; font-size: 0.9rem; text-decoration: none; box-shadow: var(--schatten-hoch);
  }
  .hdb-hoch:hover { text-decoration: none; background: var(--nacht-tief); color: #fff; }
}

@media (max-width: 44rem) {
  .hdb-kopf .schriftfeld { flex-basis: 100%; }
  .hdb-zwei { grid-template-columns: minmax(0, 1fr); }
  .hdb-zwei > .hdb-bild--schmal { max-width: 20rem; }
  .hdb-bilder--zwei { grid-template-columns: minmax(0, 1fr); }
  .hdb-arten { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hdb-begriffe > div { grid-template-columns: minmax(0, 1fr); }
  .hdb-bild__link img { max-height: 32rem; }
  .hdb-tabelle th, .hdb-tabelle td { padding: 0.5rem 0.65rem; }
  .hdb-tabelle--tasten td:first-child { width: 46%; }
  .hdb-tabelle--vergleich tbody th { width: auto; }
  .hdb-kapitel__titel::after { display: none; }
  .hdb-marke { width: 1.15rem; height: 1.15rem; font-size: 0.62rem; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px var(--signal), 0 3px 8px rgba(14, 35, 64, 0.35); }
  /* Tasten-Übersicht: je Taste ein Block, darunter die Werkzeuge */
  .hdb-tabellenrahmen:has(.hdb-tabelle--matrix) { overflow: visible; }
  .hdb-tabelle--matrix { min-width: 0; }
  .hdb-tabelle--matrix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .hdb-tabelle--matrix, .hdb-tabelle--matrix tbody, .hdb-tabelle--matrix tr { display: block; }
  .hdb-tabelle--matrix tr { padding: 0.6rem 0.75rem 0.5rem; border-bottom: 1px solid var(--nebel); }
  .hdb-tabelle--matrix tbody tr:last-child { border-bottom: 0; }
  .hdb-tabelle--matrix tbody th { display: block; width: auto; padding: 0 0 0.3rem; border: 0; white-space: normal; }
  .hdb-tabelle--matrix td { display: block; padding: 0.15rem 0 0.25rem; border: 0; background: none; }
  .hdb-tabelle--matrix td::before { content: attr(data-spalte); display: block; color: var(--neben); font-size: var(--t-klein); line-height: 1.3; }
  .hdb-tabelle--matrix td[colspan]::before { content: none; }
  .hdb-tabelle--matrix td.hdb-nicht { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hdb-anker::after, .hdb-frage > summary::after, .hdb-inhalt__knopf::after { transition: none; }
}

@media print {
  .hdb-nav, .hdb-hoch, .hdb-legende, .hdb-gross, .hdb-leer, .hdb-anker::after, .hdb-bild--gekappt .hdb-bild__link::after { display: none !important; }
  .hdb { display: block; }
  .hdb-text { max-width: none; }
  .hdb-kapitel { break-before: page; }
  .hdb-kapitel:first-child { break-before: auto; }
  .hdb-bild, .hdb-hinweis, .hdb-tabelle tr, .hdb-frage { break-inside: avoid; }
  .hdb-bild__link { box-shadow: none; }
  .hdb-bild__link img { max-height: none; }
}


.hdb-pfad { margin-bottom: 0.8rem; }

/* --- P7.9: Übersicht, Kapitelseiten, Treffer in anderen Kapiteln ------------------------------------------------- */
.hdb-zurueck { margin: 0 0 0.6rem; font-size: 0.9rem; }
.hdb-inhalt__gruppe { list-style: none; margin: 0.9rem 0 0.25rem; padding: 0 0.6rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--neben); }
.hdb-inhalt__gruppe:first-child { margin-top: 0.2rem; }
.hdb-inhalt__kapitel.ist-hier > a { font-weight: 700; color: var(--plan-tief, #17466f); }
.hdb-fund { list-style: none; margin: 0.5rem 0 0; padding: 0.35rem 0; max-height: 19rem; overflow: auto; border: 1px solid var(--linie); border-radius: var(--rundung); background: #fff; }
.hdb-fund a { display: block; padding: 0.4rem 0.75rem; font-size: 0.9rem; line-height: 1.3; color: var(--tinte); }
.hdb-fund a:hover, .hdb-fund a:focus-visible { background: #EEF4FB; text-decoration: none; }
.hdb-fund small { display: block; font-size: 0.72rem; color: var(--neben); }
.hdb-fund__mehr { padding: 0.35rem 0.75rem; font-size: 0.8rem; color: var(--neben); }
.hdb-gruppe { margin: 0 0 2rem; }
.hdb-gruppe__titel { margin: 0 0 0.8rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--neben); }
.hdb-karten { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 0.9rem; }
.hdb-karte { padding: 1rem 1.1rem 1.05rem; background: #fff; border: 1px solid var(--linie); border-top: 3px solid var(--ebene, var(--plan)); border-radius: var(--rundung); }
.hdb-karte__titel { margin: 0 0 0.4rem; font-size: 1.08rem; line-height: 1.3; }
.hdb-karte__titel a { color: var(--tinte); }
.hdb-karte__titel .hdb-kapitel__nr { font-size: 0.8em; }
.hdb-karte__text { margin: 0 0 0.6rem; font-size: 0.9rem; color: #34475D; }
.hdb-karte__abschnitte { margin: 0; font-size: 0.82rem; line-height: 1.7; color: var(--neben); }
.hdb-weiter { display: flex; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1rem; padding-top: 1.2rem; border-top: 1px solid var(--linie); }
.hdb-weiter a { display: block; max-width: 48%; font-weight: 700; }
.hdb-weiter small { display: block; font-weight: 400; font-size: 0.8rem; color: var(--neben); }
.hdb-weiter__danach { margin-left: auto; text-align: right; }
@media print { .hdb-weiter, .hdb-fund, .hdb-zurueck { display: none; } }
.hdb-neu { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.9rem; }
.hdb-neu li { padding: 0.8rem 1rem; background: #fff; border: 1px solid var(--linie); border-radius: var(--rundung); line-height: 1.55; }
.hdb-neu__bereich { font-size: 0.8rem; color: var(--neben); margin-left: 0.3rem; }
