/*
 * Dokument-Viewer (Eddy, 18.11.2026, Entwurf „Dokument-Viewer A“): Baustein DocumentViewer (packages/ui-web/src/kit/DocumentViewer.tsx).
 * Ein Fenster für Backend, Trainer-Hub und Mein Bereich, darum eine eigene Datei, die alle drei laden (inc/admin.php, Shells von Hub und Mein Bereich).
 * Fenster mind. 70 % breit, höchstens 1100 px; am Handy bildschirmfüllend, eine Spalte (Seitenleiste unter dem Dokument), Knöpfe untereinander und gleich breit.
 * Stand-Farben wie die Kennzahl-Ampel: grün = erledigt, Ocker = warten, Dunkelrot = fehlt. Keine farbigen Ränder für Status.
 */

.hhs-dialog.hhs-dv{width:min(1100px,max(70vw,calc(100vw - 64px)));max-width:calc(100vw - 32px);height:min(880px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);padding:0;border:0;border-radius:24px;overflow:hidden;background:#ffffff;color:#36302c;font:400 15px/1.5 Montserrat,'Helvetica Neue',Arial,sans-serif;box-shadow:0 30px 80px rgba(0,0,0,.25)}
.hhs-dialog.hhs-dv[open]{display:flex;flex-direction:column;gap:0} /* admin.css macht offene Fenster ohne Formular zum Raster: hier füllt der Inhalt die ganze Höhe */
.hhs-dialog.hhs-dv::backdrop{background:rgba(54,48,44,.45);backdrop-filter:blur(3px)}
.hhs-dv *,.hhs-dv *::before,.hhs-dv *::after{box-sizing:border-box}
.hhs-dv-fenster{display:grid;grid-template-rows:auto minmax(0,1fr) auto;flex:1 1 auto;min-height:0}

/* Kopf in Schiefer */
.hhs-dv-kopf{display:flex;align-items:center;gap:16px;padding:22px 28px;background:#3f4458;color:#ffffff}
.hhs-dv-ico{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;border-radius:14px;background:rgba(255,255,255,.14)}
.hhs-dv-titel{display:flex;flex-direction:column;gap:4px;flex:1 1 auto;min-width:0}
.hhs-dv-titel h2{margin:0;color:#ffffff;font:600 20px/1.3 Montserrat,'Helvetica Neue',Arial,sans-serif;overflow-wrap:break-word;hyphens:auto;-webkit-hyphens:auto} /* Umbruch an Wortgrenzen, lange Wörter mit Trennstrich (lang=de), nie mitten im Wort ohne */
.hhs-dv-titel p{margin:0;color:#ffffff;opacity:.85;font-size:13px;line-height:1.45}
.hhs-dv-chip{flex-shrink:0;padding:7px 14px;border-radius:999px;font:600 13px/1.2 Montserrat,'Helvetica Neue',Arial,sans-serif;white-space:nowrap}
.hhs-dv-chip.ok{background:#dcefe3;color:#1f5f3a}
.hhs-dv-chip.warten{background:#f3d9a4;color:#5a3d06}
.hhs-dv-chip.fehlt{background:#f6dcd6;color:#8c3529}
.hhs-dv-chip.grau{background:#ece6df;color:#4a4540}
.hhs-dv-blaettern{display:flex;gap:8px;flex-shrink:0}
.hhs-dv-rund{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;padding:0;border:1px solid rgba(255,255,255,.3);border-radius:999px;background:transparent;color:#ffffff;cursor:pointer}
.hhs-dv-rund:hover:not(:disabled){background:rgba(255,255,255,.1)}
.hhs-dv-rund:disabled{opacity:.35;cursor:default}
.hhs-dv-kopf .mb-skelett{padding:0;gap:8px}
.hhs-dv-kopf .mb-skelett i{--sk-f:rgba(255,255,255,.14);--sk-g:rgba(255,255,255,.16);width:min(60%,360px);height:22px;border-radius:10px}
.hhs-dv-kopf .mb-skelett i.kurz{width:min(40%,260px);height:14px;border-radius:8px}

/* Mitte: Dokumentfläche links, Seitenleiste rechts */
.hhs-dv-mitte{display:grid;grid-template-columns:minmax(0,1fr) 340px;min-height:0}
.hhs-dv-flaeche{display:flex;flex-direction:column;min-height:0;min-width:0;background:#efe6dc}
.hhs-dv-werkzeug{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:36px;padding:20px 28px 0;color:#555555;font-size:13px}
.hhs-dv-zoom{display:flex;align-items:center;gap:8px}
.hhs-dv-zoom>span{min-width:48px;text-align:center}
.hhs-dv-eckig{display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:1px solid #c9bfb3;border-radius:10px;background:#ffffff;color:#3f4458;cursor:pointer}
.hhs-dv-eckig:hover:not(:disabled){border-color:#8fa3be}
.hhs-dv-eckig:disabled{opacity:.4;cursor:default}
.hhs-dv-seiten{flex:1 1 auto;display:flex;flex-direction:column;align-items:center;gap:16px;min-height:0;padding:16px 28px 28px;overflow:auto}
.hhs-dv-seite,.hhs-dv-bild{display:block;flex-shrink:0;max-width:none;border:0;border-radius:6px;background:#ffffff;box-shadow:0 6px 24px rgba(0,0,0,.10)}
.hhs-dv-bild{height:auto}
.hhs-dv-blatt-sk{width:560px;max-width:100%;padding:0}
.hhs-dv-blatt-sk i{height:auto;aspect-ratio:210/297;border-radius:6px}
.hhs-dv-meldung{display:grid;gap:16px;justify-items:start;max-width:520px;margin:24px auto;padding:24px;border-radius:16px;background:#ffffff}
.hhs-dv-meldung p{margin:0;font-size:15px;line-height:1.55}
.hhs-dv-fehler-fenster .hhs-dv-meldung{margin:32px auto}

/* Seitenleiste: Hinweis, Stand, Eckdaten, Aktionen */
.hhs-dv-leiste{display:flex;flex-direction:column;gap:20px;min-height:0;padding:24px;border-left:1px solid #eeeeee;overflow:auto}
.hhs-dv-hinweis{display:flex;gap:12px;margin:0;padding:16px;border-radius:16px;background:#f6f3ef;font-size:13px;line-height:1.5}
.hhs-dv-hinweis svg{flex-shrink:0;color:#3f4458}
.hhs-dv-abschnitt h3{margin:0 0 14px;color:#3f4458;font:600 13px/1.3 Montserrat,'Helvetica Neue',Arial,sans-serif}
.hhs-dv-stand{display:grid;gap:14px;margin:0;padding:0;list-style:none}
.hhs-dv-stand li{display:flex;gap:12px;align-items:flex-start}
.hhs-dv-stand b{display:block;font-size:14px;font-weight:500}
.hhs-dv-stand li.open b{font-weight:600}
.hhs-dv-stand small{display:block;color:#555555;font-size:12px;line-height:1.45}
.hhs-dv-punkt{flex-shrink:0;width:22px;height:22px;border-radius:999px;background:#2e7d4f}
.hhs-dv-stand li.open .hhs-dv-punkt{border:2px solid #c48a1e;background:transparent}
.hhs-dv-daten{display:grid;gap:10px;margin:0;font-size:13px}
.hhs-dv-daten div{display:flex;justify-content:space-between;gap:16px}
.hhs-dv-daten dt{color:#555555}
.hhs-dv-daten dd{margin:0;text-align:right;overflow-wrap:anywhere}
.hhs-dv-aktionen{display:grid;gap:10px;margin-top:auto}
.hhs-dv-erledigt{margin:0;color:#2e7d4f;font-size:13px}

/* Knöpfe: Schiefer und Outline, gleich hoch, mit Icon */
.hhs-dv-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 20px;border:0;border-radius:999px;background:#3f4458;color:#ffffff;font:500 15px/1 Heebo,'Helvetica Neue',Arial,sans-serif;text-decoration:none;white-space:nowrap;cursor:pointer}
.hhs-dv-btn:hover{background:#36302c;color:#ffffff}
.hhs-dv-btn.ol{background:#ffffff;color:#3f4458;box-shadow:inset 0 0 0 1.5px #3f4458}
.hhs-dv-btn.ol:hover{background:#f6f3ef;color:#3f4458}
.hhs-dv-btn:disabled{opacity:.5;cursor:default}
.hhs-dv button:focus{outline:none}
.hhs-dv a:focus-visible,.hhs-dv button:focus-visible{outline:2px solid #8fa3be;outline-offset:2px}

/* Fuß unten rechts */
.hhs-dv-fuss{display:flex;justify-content:flex-end;gap:12px;min-height:81px;padding:18px 28px;border-top:1px solid #eeeeee;background:#ffffff}

/* Drucken über einen unsichtbaren Rahmen */
.hhs-dv-druck{position:fixed;right:0;bottom:0;width:0;height:0;border:0}

@media (max-width:760px){
  .hhs-dv-mitte{display:block;overflow:auto}
  .hhs-dv-flaeche{min-height:auto}
  .hhs-dv-seiten{overflow:visible}
  .hhs-dv-leiste{border-left:0;border-top:1px solid #eeeeee;overflow:visible}
  .hhs-dv-aktionen{margin-top:0}
}
@media (max-width:640px){
  .hhs-dialog.hhs-dv{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border-radius:0}
  .hhs-dv-kopf{flex-wrap:wrap;gap:6px 10px;padding:16px}
  .hhs-dv-ico{display:none}
  .hhs-dv-titel{flex:1 1 0}
  /* Stand oder Blättern im Kopf: Knöpfe oben in einer Zeile, der Titel darunter über die volle Breite (sonst engen die Knöpfe ihn auf ~200 px ein, Fehler 19.11.2026) */
  .hhs-dv-kopf:has(.hhs-dv-chip,.hhs-dv-blaettern) .hhs-dv-titel{order:10;flex-basis:100%;margin-top:6px}
  .hhs-dv-kopf:has(.hhs-dv-chip,.hhs-dv-blaettern)>.hhs-dv-rund{margin-left:auto}
  .hhs-dv-blaettern{margin-left:auto}
  .hhs-dv-kopf>.hhs-dv-blaettern~.hhs-dv-rund{margin-left:0}
  .hhs-dv-titel h2{font-size:16px}
  .hhs-dv-titel p{font-size:12px}
  .hhs-dv-werkzeug{padding:12px 16px 0}
  .hhs-dv-seiten{padding:12px 16px 20px}
  .hhs-dv-leiste{padding:20px 16px}
  .hhs-dv-fuss{flex-direction:column-reverse;gap:10px;padding:16px}
  .hhs-dv-fuss .hhs-dv-btn,.hhs-dv-aktionen .hhs-dv-btn{width:100%}
}
@media (prefers-reduced-motion:reduce){.hhs-dv .mb-skelett i{animation:none}}
