/* Baustein abschnitt: Akte-Abschnitte (Bedienkonzept, Pilot Maschinen,
   Bauplan 1.3 und WP3). Besitzer: WP3. Die Grundvorlage bindet die Datei
   nach dem globalen Stylesheet ein. Nur Regeln fuer eigene, neue Klassen
   (globale Klassen wie .karte, .liste, .symbol nur im Zusammenhang mit
   einer eigenen); Farben als Token mit Rueckfall; eine Regel fuer die
   Telefonbreite (560px). Kein Ocker #906612 und kein pill-offen
   (Korrektur B zu R1). */

/* --- Abschnitt (R15): Kasten mit hellgraublauem Kopf --------------------
   Das Polster sitzt in Kopf und Inhalt, damit der Kopf als Streifen ueber
   die ganze Breite geht. Kein overflow: hidden, sonst schnitte er die
   aufgeklappten Wege und "Weitere" ab. */
.karte.abschnitt { padding: 0; margin-top: 20px; }
.abschnitt-kopf {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 16px;
  padding: 12px 28px;
  background: var(--grau-hell, #f4f6f9);
  border-bottom: 1px solid var(--grau, #e2e7ee);
  border-radius: 10px 10px 0 0;
}
/* Schriftstufen 26 (Kopfband), 19 (Abschnitt), 16 (Unterabschnitt). */
.abschnitt-titel {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 1.1875rem; line-height: 1.3; color: var(--navy, #1F4570);
}
.abschnitt-titel .symbol { width: 20px; height: 20px; }
.abschnitt-zaehler {
  display: inline-block; min-width: 1.8em; padding: 1px 8px;
  border: 1px solid var(--grau, #e2e7ee); border-radius: 999px;
  background: var(--surface, #ffffff); color: var(--navy-mid, #305186);
  font-size: 0.8rem; font-weight: 600; line-height: 1.5; text-align: center;
  font-variant-numeric: tabular-nums;
}
.abschnitt-werkzeuge {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-left: auto;
}
.abschnitt-inhalt { padding: 18px 28px 24px; }
.abschnitt-inhalt > :first-child { margin-top: 0; }
.abschnitt-inhalt > :last-child { margin-bottom: 0; }

/* Wege hinter "+ <Ding> hinzufuegen": ein Feld unter dem Knopf, der
   erste Weg ist die Vorgabe. */
.abschnitt-wege { position: relative; }
.abschnitt-wege-knopf { list-style: none; cursor: pointer; }
.abschnitt-wege-knopf::-webkit-details-marker { display: none; }
.abschnitt-wege-liste {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 15;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  min-width: 240px; padding: 10px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--grau, #e2e7ee); border-radius: 10px;
  box-shadow: var(--shadow-2, 0 6px 20px rgba(20, 40, 70, 0.12));
}

/* --- Unterabschnitt (Kaeltemittel > Logbuch) ---------------------------- */
.unterabschnitt {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--grau, #e2e7ee);
}
.unterabschnitt-kopf {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px;
}
.unterabschnitt-titel {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 1rem; line-height: 1.3; color: var(--navy, #1F4570);
}

/* --- Abschnittstabelle (R16) -------------------------------------------- */
.abschnitt-leer { margin: 0; color: var(--muted, #5f7183); }
.abschnitt-tabelle-rahmen > :first-child { margin-top: 0; }
.abschnitt-tabelle { margin-top: 0; }
.abschnitt-alle { margin: 10px 0 0; }
.abschnitt-erledigt { margin-top: 14px; }
.abschnitt-erledigt-kopf {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; list-style: none;
  color: var(--navy-mid, #305186); font-weight: 600;
}
.abschnitt-erledigt-kopf::-webkit-details-marker { display: none; }
/* Winkel statt "+": das Plus heisst in VorabSafe "neu anlegen". */
.abschnitt-erledigt-kopf::before,
.abschnitt-kopf-klapp::after {
  content: ''; width: 7px; height: 7px; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}
.abschnitt-erledigt[open] > .abschnitt-erledigt-kopf::before { transform: rotate(45deg); }
.abschnitt-zeile-erledigt td { color: var(--muted, #5f7183); }

/* --- Abgeleiteter Abschnitt (R16) --------------------------------------- */
.abgeleitet > :first-child { margin-top: 0; }
.abgeleitet-offen, .abgeleitet-nichts { margin: 10px 0 0; }
.abgeleitet-nichts { color: var(--muted, #5f7183); }

/* --- Sprungleiste und Reiter (R17) --------------------------------------
   Die Sprungleiste klebt unter der festen Kopfzeile; base.html misst
   deren Hoehe in --kopf-hoehe, abschnitt.js die der Leiste in
   --sprung-hoehe (sie bricht bei vielen Abschnitten um). Sprungziele
   landen darunter, nicht dahinter. */
.sprung { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.sprung-leiste {
  position: sticky; top: var(--kopf-hoehe, 60px); z-index: 10;
  padding: 8px 0; background: var(--ground, #eef1f6);
}
html:has(.sprung-leiste) {
  scroll-padding-top: calc(var(--kopf-hoehe, 60px) + var(--sprung-hoehe, 52px) + 12px);
}
.sprung-marke {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--grau, #e2e7ee);
  border-radius: 999px; background: var(--surface, #ffffff);
  color: var(--navy, #1F4570); font-size: 0.9rem; text-decoration: none;
}
.sprung-marke:hover, .sprung-marke:focus-visible {
  border-color: var(--navy-mid, #305186);
}
.sprung-marke.sprung-aktiv {
  background: var(--navy, #1F4570); border-color: var(--navy, #1F4570);
  color: #ffffff;
}
.sprung-zaehler { font-size: 0.8rem; font-weight: 600;
                  font-variant-numeric: tabular-nums; }
.sprung-reiter {
  gap: 4px; margin: 18px 0 0;
  border-bottom: 1px solid var(--grau, #e2e7ee);
}
.sprung-reiter .sprung-marke {
  border-bottom: 0; border-radius: 6px 6px 0 0;
  background: var(--grau-hell, #f4f6f9);
}
.sprung-reiter .sprung-marke.sprung-aktiv { background: var(--navy, #1F4570); }

/* --- Nicht belegt (R18): EINE Zeile -------------------------------------- */
.nicht-belegt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 20px 0 0; padding: 12px 16px;
  border: 1px dashed var(--grau, #e2e7ee); border-radius: 10px;
  color: var(--muted, #5f7183);
}
.nicht-belegt-titel { font-weight: 600; }
.nicht-belegt-eintrag { display: inline-flex; align-items: center; gap: 6px; }

/* --- Auf einen Blick (R14) ----------------------------------------------- */
.karte.blick {
  margin-top: 20px; border-left: 4px solid var(--navy-mid, #305186);
}
.blick-titel {
  margin: 0 0 6px; font-size: 1.1875rem; line-height: 1.3;
  color: var(--navy, #1F4570);
}
.blick-gruppe {
  margin: 14px 0 4px; font-size: 1rem; color: var(--navy, #1F4570);
}
.blick-liste { list-style: none; margin: 0; padding: 0; }
.blick-eintrag {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  padding: 7px 0; border-top: 1px solid var(--grau-hell, #f4f6f9);
}
.blick-eintrag:first-child { border-top: 0; }
.blick-satz { color: var(--text, #1c2733); }
a.blick-satz { color: var(--navy, #1F4570); }
.blick-aktion { display: inline-flex; gap: 8px; margin-left: auto; }

/* --- Verlauf (R19): zugeklappt, der Kopf ist die Zusammenfassung ---------- */
.abschnitt-kopf-klapp { cursor: pointer; list-style: none;
                        color: var(--navy-mid, #305186); }
.abschnitt-kopf-klapp::-webkit-details-marker { display: none; }
.abschnitt-kopf-klapp::after { margin-left: auto; transform: rotate(45deg); }
.abschnitt-verlauf[open] > .abschnitt-kopf-klapp::after { transform: rotate(-135deg); }
.abschnitt-verlauf:not([open]) > .abschnitt-kopf {
  border-bottom: 0; border-radius: 10px;
}

/* --- Fachzeichen in einer Abschnittstabelle (R44) ------------------------
   GHS und ISO 7010 als Bild mit Code und Kurztext DARUNTER: so bleibt die
   Spalte schmal, und jedes Zeichen behaelt sein Wort. Nur die Richtung;
   Bildgroesse und Schrift kommen aus .ghs-kachel/.ghs-text. */
.ghs-kachel-unter { flex-direction: column; text-align: center; gap: 2px; }

/* --- Telefon ------------------------------------------------------------
   Kopf und Inhalt mit dem Polster der Karte auf dem Telefon; die Wege
   stehen im Fluss (die Karte scrollt dort seitwaerts und schnitte ein
   schwebendes Feld ab); die Sprungleiste bleibt nicht stehen (R17). */
@media (max-width: 560px) {
  .abschnitt-kopf { padding: 10px 14px; }
  .abschnitt-inhalt { padding: 14px 14px 18px; }
  .abschnitt-werkzeuge { margin-left: 0; width: 100%; }
  .abschnitt-wege-liste {
    position: static; margin-top: 6px; min-width: 0; box-shadow: none;
  }
  .sprung-leiste { position: static; padding: 0; background: none; }
  html:has(.sprung-leiste) {
    scroll-padding-top: calc(var(--kopf-hoehe, 60px) + 12px);
  }
  .nicht-belegt { padding: 10px 12px; }
  .blick-aktion { margin-left: 0; }
}
