/* RUESS Hub 3.2.0 - Start → Abläufe (Leitung). Nur Design-System-Tokens (--ds-*), vor ruess-design-system.css geladen. */
#ablaeufeLeitungView .ph-page { display: flex; flex-direction: column; gap: var(--ds-space-3); min-width: 0; }

/* Leiste: Suche links, Aktionen kompakt rechts */
#ablaeufeLeitungView .ph-leiste { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ds-space-3); }
#ablaeufeLeitungView .ph-suche, #ablaeufeLeitungView .ph-auswahl { display: flex; flex-direction: column; gap: var(--ds-space-1); min-width: 0; }
#ablaeufeLeitungView .ph-suche { flex: 1 1 260px; max-width: 420px; }
#ablaeufeLeitungView .ph-suche span, #ablaeufeLeitungView .ph-auswahl span { font-size: var(--ds-font-xs); color: var(--ds-muted); font-weight: 600; }
#ablaeufeLeitungView .ph-suche input, #ablaeufeLeitungView .ph-auswahl select {
  height: var(--ds-h-bar); padding: 0 var(--ds-space-3); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-radius-md);
  background: var(--ds-surface); color: var(--ds-text); font-size: var(--ds-font-sm); width: 100%; box-sizing: border-box; margin: 0;
}
#ablaeufeLeitungView .ph-suche input:focus-visible, #ablaeufeLeitungView .ph-auswahl select:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 1px; }
#ablaeufeLeitungView .ph-auswahl { display: none; flex: 1 1 100%; }
#ablaeufeLeitungView .ph-aktionen { margin-left: auto; display: flex; gap: var(--ds-space-2); justify-content: flex-end; }
#ablaeufeLeitungView .ap-btn {
  width: auto; height: var(--ds-h-bar); padding: 0 var(--ds-space-4); margin: 0; border: 1px solid var(--ds-line-strong);
  background: var(--ds-surface); color: var(--ds-text); font-size: var(--ds-font-sm); font-weight: 600; cursor: pointer;
}
#ablaeufeLeitungView .ap-btn:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }

/* Raster: Kapitel links, Inhalt rechts */
#ablaeufeLeitungView .ph-raster { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: var(--ds-space-4); align-items: start; }
#ablaeufeLeitungView .ph-nav {
  position: sticky; top: var(--ds-space-3); max-height: calc(100vh - 170px); overflow: auto; display: flex; flex-direction: column; gap: 2px;
  padding: var(--ds-space-2); background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-1);
}
#ablaeufeLeitungView .ph-nav-punkt {
  display: block; flex: 0 0 auto; width: 100%; height: auto; min-height: var(--ds-h-sm); margin: 0; padding: 6px var(--ds-space-2); text-align: left;
  background: transparent; border: 0; border-radius: var(--ds-radius-sm); color: var(--ds-text); font-size: var(--ds-font-sm); font-weight: 500;
  line-height: 1.35; cursor: pointer; transition: background-color var(--ds-dur-fast) var(--ds-ease);
}
#ablaeufeLeitungView .ph-nav-punkt:hover { background: var(--ds-surface-hover); }
#ablaeufeLeitungView .ph-nav-punkt:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: -2px; }
#ablaeufeLeitungView .ph-nav-punkt.aktiv { background: var(--ds-brand-soft); color: var(--ds-ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--ds-brand); }

/* Inhalt */
#ablaeufeLeitungView .ph-inhalt {
  min-width: 0; padding: var(--ds-space-5) var(--ds-space-6); background: var(--ds-surface); border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-1); color: var(--ds-text); font-size: var(--ds-font-sm); line-height: 1.55; outline: none;
}
#ablaeufeLeitungView .ph-inhalt > :first-child { margin-top: 0; }
#ablaeufeLeitungView .ph-h2 { font-size: var(--ds-font-xl); color: var(--ds-ink); margin: 0 0 var(--ds-space-3); }
#ablaeufeLeitungView .ph-h3 { font-size: var(--ds-font-lg); color: var(--ds-ink); margin: var(--ds-space-8) 0 var(--ds-space-2); padding-top: var(--ds-space-3); border-top: 1px solid var(--ds-line); }
#ablaeufeLeitungView .ph-h4 { font-size: var(--ds-font-md); color: var(--ds-ink); margin: var(--ds-space-5) 0 var(--ds-space-2); }
#ablaeufeLeitungView .ph-h5 { font-size: var(--ds-font-sm); color: var(--ds-ink); margin: var(--ds-space-4) 0 var(--ds-space-1); }
#ablaeufeLeitungView .ph-inhalt p { margin: 0 0 var(--ds-space-3); }
#ablaeufeLeitungView .ph-inhalt code { font-family: Consolas, "Courier New", monospace; font-size: .92em; padding: 1px 4px; border-radius: var(--ds-radius-sm); background: var(--ds-surface-2); color: var(--ds-ink); overflow-wrap: anywhere; }
#ablaeufeLeitungView .ph-code { margin: 0 0 var(--ds-space-3); padding: var(--ds-space-3); background: var(--ds-surface-2); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-md); overflow: auto; font-size: var(--ds-font-xs); white-space: pre; }
#ablaeufeLeitungView .ph-hinweis { margin: 0 0 var(--ds-space-4); padding: var(--ds-space-2) var(--ds-space-3); border-left: 3px solid var(--ds-brand); background: var(--ds-surface-2); border-radius: var(--ds-radius-sm); color: var(--ds-muted); }
#ablaeufeLeitungView .ph-liste { margin: 0 0 var(--ds-space-3); padding-left: var(--ds-space-6); }
#ablaeufeLeitungView .ph-liste li { margin: 2px 0; }
#ablaeufeLeitungView .ph-liste .ph-tiefe-1 { margin-left: var(--ds-space-5); }
#ablaeufeLeitungView .ph-liste .ph-tiefe-2 { margin-left: var(--ds-space-8); }
#ablaeufeLeitungView .ph-liste .ph-tiefe-3 { margin-left: calc(var(--ds-space-8) + var(--ds-space-5)); }
#ablaeufeLeitungView .ph-link { color: var(--ds-focus); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
#ablaeufeLeitungView .ph-pfad { font-family: Consolas, "Courier New", monospace; font-size: .92em; }
#ablaeufeLeitungView .ph-inhalt mark { background: var(--ds-warning-soft); color: inherit; border-radius: 2px; }
#ablaeufeLeitungView .ph-leer { color: var(--ds-muted); padding: var(--ds-space-2); margin: 0; }
#ablaeufeLeitungView .ph-fehler { color: var(--ds-danger); margin: 0; }

/* Tabellen: eigener Scroll-Rahmen, Seite scrollt nie waagerecht */
#ablaeufeLeitungView .ph-tabelle-wrap { max-width: 100%; overflow-x: auto; margin: 0 0 var(--ds-space-4); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-md); }
#ablaeufeLeitungView .ph-tabelle { width: 100%; border-collapse: collapse; font-size: var(--ds-font-xs); }
#ablaeufeLeitungView .ph-tabelle th { position: sticky; top: 0; background: var(--ds-surface-2); color: var(--ds-muted); text-align: left; font-weight: 700; padding: 6px var(--ds-space-2); border-bottom: 1px solid var(--ds-line-strong); white-space: nowrap; }
#ablaeufeLeitungView .ph-tabelle td { padding: 6px var(--ds-space-2); border-bottom: 1px solid var(--ds-line); vertical-align: top; min-width: 90px; }
#ablaeufeLeitungView .ph-tabelle tbody tr:last-child td { border-bottom: 0; }
#ablaeufeLeitungView .ph-tabelle tbody tr:hover { background: var(--ds-surface-hover); }

/* Diagramme: SVG als Bild, Klick vergroessert */
#ablaeufeLeitungView .ph-diagramm { margin: 0 0 var(--ds-space-4); padding: var(--ds-space-3); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-md); background: var(--ds-surface); overflow: auto; cursor: zoom-in; text-align: center; }
#ablaeufeLeitungView .ph-diagramm img { max-width: 100%; height: auto; }
#ablaeufeLeitungView .ph-diagramm.ph-gross { cursor: zoom-out; }
#ablaeufeLeitungView .ph-diagramm.ph-gross img { max-width: none; }
#ablaeufeLeitungView .ph-diagramm figcaption { font-size: var(--ds-font-xs); color: var(--ds-muted); margin-top: var(--ds-space-1); }

@media (max-width: 900px) {
  #ablaeufeLeitungView .ph-raster { grid-template-columns: minmax(0, 1fr); }
  #ablaeufeLeitungView .ph-nav { display: none; }
  #ablaeufeLeitungView .ph-auswahl { display: flex; }
  #ablaeufeLeitungView .ph-suche { max-width: none; }
  #ablaeufeLeitungView .ph-inhalt { padding: var(--ds-space-4); }
}

@media print {
  #ablaeufeLeitungView .ph-leiste, #ablaeufeLeitungView .ph-nav { display: none !important; }
  #ablaeufeLeitungView .ph-raster { display: block; }
  #ablaeufeLeitungView .ph-inhalt { border: 0; box-shadow: none; padding: 0; }
  #ablaeufeLeitungView .ph-tabelle-wrap { overflow: visible; }
  #ablaeufeLeitungView .ph-diagramm img { max-width: 100%; }
}
#ablaeufeLeitungView .ph-nav-punkt { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: var(--ds-space-1); }
#ablaeufeLeitungView .ph-nr { color: var(--ds-muted); font-variant-numeric: tabular-nums; font-weight: 600; }
/* breite Hintergrund-Tabellen: Spalten lesbar breit, Tabelle scrollt im eigenen Rahmen */
#ablaeufeLeitungView .ph-tabelle { width: 100%; }
#ablaeufeLeitungView .ph-tabelle td { min-width: 120px; max-width: 380px; }
#ablaeufeLeitungView .ph-tabelle td:first-child { min-width: 140px; font-weight: 600; color: var(--ds-ink); }
@media print { #ablaeufeLeitungView .ph-tabelle { width: 100%; } #ablaeufeLeitungView .ph-tabelle td { max-width: none; min-width: 0; } }

/* 3.3.0: Erklärfilm - Zeile je Kapitel (kompakte Links, keine Balken) */
#ablaeufeLeitungView .ph-film { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); margin: 0 0 var(--ds-space-4); font-size: var(--ds-font-sm); color: var(--ds-muted); }
#ablaeufeLeitungView .ph-film-link { display: inline-flex; align-items: center; min-height: 30px; padding: 0 var(--ds-space-3); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-pill); background: var(--ds-surface); color: var(--ds-ink); text-decoration: none; transition: border-color var(--ds-dur-fast) var(--ds-ease), background var(--ds-dur-fast) var(--ds-ease); }
#ablaeufeLeitungView .ph-film-link:hover { border-color: var(--ds-line-strong); background: var(--ds-surface-hover); }
#ablaeufeLeitungView .ph-film-link:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
@media print { #ablaeufeLeitungView .ph-film { display: none !important; } }
