/* Punkt 142: Mega-Menü volle Breite, einzeilige Einträge, dynamische Schrift (Desktop + Tablet mit Mega-Menü, ab 861 px;
   darunter gibt es kein Mega-Menü – Handy unverändert).
   - Lage/Breite: --mega-l, --mega-w, --mega-o setzt assets/menue.js (megaMass) einmal beim Laden/bei Größenänderung auf .gruppen
     → das Menü deckt genau die Kopfleiste ab (= Inhaltsbreite) und ragt nie aus dem Fenster.
   - Spalten: je Gruppe eine Spalte (--sp aus _lib/menue_mega.php), gleich breit; wird es zu eng (< --mm-spalte), rutschen Spalten in eine 2. Reihe.
   - Schrift: --mm-t (Überschriften) und --mm-s (Erklärungen) – eine Größe für alle Mega-Menüs, mindestens 13 px.
   Eine Zeile je Text, keine Silbentrennung; Zoom der Kopfleiste (Punkt 139) gilt hier nicht (Effektiv-Zoom 1). */
@media (min-width:861px) {
  html .nav.glas-pille { --mm-spalte:214px; }
  html .nav.glas-pille .gruppen .gruppe { position:static; }
  html body .nav.glas-pille .gruppen .gruppe .mega.neu-mega { zoom:calc(1 / var(--nz, 1)) !important; box-sizing:border-box;
    left:var(--mega-l, 0px) !important; right:auto !important; top:var(--mega-o, calc(100% + 8px)) !important;
    width:var(--mega-w, 100%) !important; min-width:0 !important; max-width:none !important; padding:14px 16px !important;
    transform:none !important; transition:opacity .2s ease, visibility 0s linear .2s !important; }   /* nur Einblenden, keine Größen-/Lageänderung beim Öffnen (Regel 26) */
  html body .nav.glas-pille .gruppen .gruppe.offen .mega.neu-mega { transition:opacity .2s ease, visibility 0s !important; }
  /* Raster: --sp gleich breite Spalten; Mindestbreite je Spalte, sonst Umbruch in eine weitere Reihe */
  html body .nav.glas-pille .gruppe .mega .mega-spalten.mega-spalten:not(#mm-x) { display:grid !important; grid-auto-flow:row !important; grid-template-rows:none !important;
    grid-template-columns:repeat(auto-fill, minmax(max(var(--mm-spalte), calc((100% - (var(--sp, 3) - 1) * 12px) / var(--sp, 3))), 1fr)) !important;
    gap:6px 12px !important; align-items:start; }
  html body .nav.glas-pille .mega .m-spalte { display:flex; flex-direction:column; gap:2px; min-width:0; }
  html body .nav.glas-pille .mega .m-spalte > h4 { margin:2px 10px 6px !important; min-height:14px; line-height:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  html body .nav.glas-pille .mega .m-spalte > h4 .kt-kl { text-transform:none; letter-spacing:0; }
  /* Verwalten (nur Admins): abgesetzte Spalte in Schiefer */
  html body .nav.glas-pille .mega .m-spalte.m-verwalten { --ga1:var(--g-admin1, #56606e); --gakz:var(--g-admin-akz, #c3cad6);
    position:relative; padding:0 0 4px 12px; border-radius:0 14px 14px 0;
    background:linear-gradient(180deg, color-mix(in srgb, var(--g-admin1, #56606e) 26%, transparent), color-mix(in srgb, var(--g-admin1, #56606e) 10%, transparent)); }
  html body .nav.glas-pille .mega .m-spalte.m-verwalten::before { content:""; position:absolute; left:0; top:0; bottom:0; border-left:2px solid color-mix(in srgb, var(--g-admin-akz, #c3cad6) 70%, transparent); }
  html body .nav.glas-pille .mega .m-spalte.m-verwalten > h4 { color:var(--g-admin-akz, #c3cad6) !important; }

  /* Einträge: Symbol + Text, Text einzeilig in --mm-t / --mm-s */
  html body .nav.glas-pille .mega .m-item { display:flex; align-items:center !important; gap:10px; padding:7px 10px; min-height:44px; box-sizing:border-box; min-width:0; }
  html body .nav.glas-pille .mega .m-item .m-ic { width:34px; height:34px; margin-top:0 !important; flex:none; }
  html body .nav.glas-pille .mega .m-item .m-ic .hp-ic { width:19px; height:19px; }
  html body .nav.glas-pille .mega .m-item .m-ic .hp-duo { width:23px; height:23px; }
  html body .nav.glas-pille .mega .m-item .m-txt { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:1px; }
  html body .nav.glas-pille .mega .m-item .m-txt > b, html body .nav.glas-pille .mega .m-item .m-txt > small {
    display:block !important; -webkit-line-clamp:unset !important; white-space:nowrap !important; overflow:hidden !important; text-overflow:ellipsis !important;
    overflow-wrap:normal !important; word-break:normal !important; hyphens:none !important; -webkit-hyphens:none !important; max-width:none !important; }
  html body .nav.glas-pille .mega .m-item .m-txt > b { font-size:var(--mm-t, 15px) !important; line-height:1.25 !important; }
  html body .nav.glas-pille .mega .m-item .m-txt > small { font-size:var(--mm-s, 13px) !important; line-height:1.3 !important; }
  /* Teile einer Seite: eingerückt unter dem Gruppenkopf, kleineres Symbol, nur Überschrift */
  /* Teile und kompakte Einträge („Alle Bereiche“) zeigen wie bisher nur die Überschrift */
  html body .nav.glas-pille .mega .m-item:is(.m-teil, .m-kompakt) .m-txt > small { display:none !important; }
  html body .nav.glas-pille .mega .m-item.m-teil { margin-left:24px; padding-top:5px; padding-bottom:5px; gap:9px; }
  html body .nav.glas-pille .mega .m-item.m-teil::before { left:-12px; }
  html body .nav.glas-pille .mega .m-item.m-teil .m-ic { width:28px; height:28px; border-radius:9px; }
  html body .nav.glas-pille .mega .m-item.m-teil .m-ic .hp-ic { width:16px; height:16px; }
  html body .nav.glas-pille .mega .m-item.m-teil .m-ic .hp-duo { width:20px; height:20px; }
  html body .nav.glas-pille .mega-alle .m-item.m-teil { margin-left:18px; }
  html body .nav.glas-pille .mega-alle .m-item.m-teil::before { left:-9px; }
  html body .nav.glas-pille .mega .m-item .m-zahl, html body .nav.glas-pille .mega .m-item .m-neu { align-self:center !important; flex:none; }
}
@media (min-width:861px) and (prefers-reduced-motion:reduce) {
  html body .nav.glas-pille .gruppen .gruppe.gruppe.gruppe .mega.neu-mega { transition:none !important; transform:none !important; }
}

/* Punkt 189: Kopfzeile der Bereichs-Mega-Menüs – Bereichsname als Link auf die Übersicht (uebersicht.php?g=…), eine Zeile über den Spalten */
@media (min-width:861px) {
  html body .nav.glas-pille .mega .m-bereich-kopf { display:flex; align-items:center; gap:10px; min-height:44px; box-sizing:border-box; margin:0 0 8px; padding:5px 10px;
    border-radius:12px; text-decoration:none; color:inherit; border-bottom:1px solid color-mix(in srgb, currentColor 14%, transparent); white-space:nowrap; }
  html body .nav.glas-pille .mega .m-bereich-kopf:hover, html body .nav.glas-pille .mega .m-bereich-kopf:focus-visible, html body .nav.glas-pille .mega .m-bereich-kopf.aktiv { background:color-mix(in srgb, currentColor 9%, transparent); }
  html body .nav.glas-pille .mega .m-bereich-kopf .m-bk-ic { display:grid; place-items:center; flex:none; width:30px; height:30px; }
  html body .nav.glas-pille .mega .m-bereich-kopf .m-bk-ic .hp-ic { width:22px; height:22px; }
  html body .nav.glas-pille .mega .m-bereich-kopf .m-bk-name { min-width:0; overflow:hidden; text-overflow:ellipsis; font-weight:800; font-size:var(--mm-t, 15px); }
  html body .nav.glas-pille .mega .m-bereich-kopf .m-bk-name small { font-weight:600; font-size:var(--mm-s, 13px); opacity:.8; }
  html body .nav.glas-pille .mega .m-bereich-kopf .m-bk-mehr { margin-left:auto; flex:none; display:inline-flex; align-items:center; gap:5px; font-size:var(--mm-s, 13px); font-weight:700; opacity:.85; }
  html body .nav.glas-pille .mega .m-bereich-kopf .m-bk-mehr .hp-ic { width:15px; height:15px; }
  html body .nav.glas-pille .mega-alle .m-alle-ue { color:inherit; text-decoration:none; display:inline-flex; align-items:center; gap:4px; min-height:24px; border-radius:8px; }
  html body .nav.glas-pille .mega-alle .m-alle-ue:hover, html body .nav.glas-pille .mega-alle .m-alle-ue:focus-visible { text-decoration:underline; text-underline-offset:3px; }
}
