/* Hub - Seite "Alle Dienste" (DESIGN.md Abschnitt 7). Nur seitenbezogene Regeln; Bausteine
   (.h-app, .h-app-ico, .h-chip, .h-dot, .h-badge, .h-empty, .ifield, .chip) kommen aus theme.css.
   iOS 12: kein gap in Flexbox (Abstaende per margin), Grid-gap immer auch als grid-gap. */

/* ------------------------------------------------------------ Kopf ------- */
.dn-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin: 4px 0 22px; }
.dn-intro { min-width: 0; margin-right: 24px; }
.page h2.dn-title {
  display: block; margin: 0; font-size: 32px; font-weight: 700; line-height: 1.15;
  letter-spacing: -.02em; text-transform: none; color: var(--t1);
}
.page h2.dn-title::before { content: none; display: none; }
.dn-lead { display: flex; align-items: center; margin: 8px 0 0; font-size: 15px; color: var(--t2); }
.dn-lead svg { flex: 0 0 auto; width: 18px; height: 18px; margin-right: 9px; color: #5eead4; filter: drop-shadow(0 0 6px rgba(94,234,212,.55)); }
.dn-lead.away svg { color: #a78bfa; filter: drop-shadow(0 0 6px rgba(167,139,250,.6)); }
.dn-sum { margin-top: 14px; }
.dn-sum .h-chip { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------- Suche und Filter ------ */
.dn-tools { display: flex; align-items: center; flex-wrap: wrap; margin: 0 -6px 4px; }
.dn-tools > .dn-search, .dn-tools > .dn-filters { margin: 0 6px 12px; }
.dn-search { flex: 0 1 340px; min-width: 240px; }
.dn-search .input { min-height: 44px; padding-top: 9px; padding-bottom: 9px; padding-right: 44px; border-radius: 999px; }
.dn-search .input::-webkit-search-cancel-button, .dn-search .input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.dn-clear {
  position: absolute; top: 50%; right: 6px; width: 34px; height: 34px; margin-top: -17px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--t2); cursor: pointer;
}
.dn-clear:active { background: rgba(255,255,255,.16); }
.dn-filters { display: flex; align-items: center; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.dn-filters .chip { min-height: 40px; margin: 3px 8px 3px 0; padding: 5px 8px 5px 15px; border-radius: 999px; cursor: pointer; }
.dn-n {
  display: inline-block; min-width: 22px; height: 22px; margin-left: 8px; padding: 0 6px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: var(--t2); font-size: 12px; font-weight: 700; line-height: 22px;
  text-align: center; font-variant-numeric: tabular-nums;
}
.dn-filters .chip.active .dn-n { background: rgba(94,234,212,.2); color: #ccfbf1; }

/* ---------------------------------------------------------- Gruppen ------ */
.dn-group { margin-top: 26px; }
.dn-group:first-child { margin-top: 8px; }
.dn-ghead { display: flex; align-items: center; flex-wrap: wrap; min-height: 24px; margin: 0 0 14px; }
.dn-ghint { min-width: 0; margin-left: 14px; font-size: 13.5px; color: var(--t3); overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; }
.dn-ghead::after {           /* Linie bis zum Rand: die Gruppe liest sich als ganze Zeile */
  content: ""; flex: 1 1 40px; height: 1px; margin-left: 16px;
  background: linear-gradient(90deg, rgba(255,255,255,.09), rgba(255,255,255,0));
}
/* Punkt vor dem Gruppentitel in der Gruppenfarbe */
.dn-gt.cloud::before { background: #22d3ee; box-shadow: 0 0 8px rgba(34,211,238,.9); }
.dn-gt.media::before { background: #f472b6; box-shadow: 0 0 8px rgba(244,114,182,.9); }
.dn-gt.twitch::before { background: #a78bfa; box-shadow: 0 0 8px rgba(167,139,250,.9); }
.dn-gt.infra::before { background: #60a5fa; box-shadow: 0 0 8px rgba(96,165,250,.9); }
.dn-gt.hub::before { background: #c4b5fd; box-shadow: 0 0 8px rgba(196,181,253,.9); }

.dn-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-gap: 16px; gap: 16px; }

/* ------------------------------------------------------ App-Kachel ------- */
/* Desktop/Tablet: Karte (Symbol + Pfeil, Name, Beschreibung, Statuszeile unten) */
.dn-app {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr auto;
  grid-template-areas: "ico badge go" "name name name" "desc desc desc" "meta meta meta";
  align-items: start; min-height: 198px; padding: 18px; overflow: hidden;
  background: rgba(255,255,255,.045);
  background: radial-gradient(130% 95% at 0% 0%, rgba(167,139,250,.14), rgba(167,139,250,0) 58%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028)), rgba(4,7,15,.3);
}
.dn-app.cloud { background: radial-gradient(130% 95% at 0% 0%, rgba(34,211,238,.13), rgba(34,211,238,0) 58%),
  linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028)), rgba(4,7,15,.3); }
.dn-app.media { background: radial-gradient(130% 95% at 0% 0%, rgba(244,114,182,.13), rgba(244,114,182,0) 58%),
  linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028)), rgba(4,7,15,.3); }
.dn-app.twitch { background: radial-gradient(130% 95% at 0% 0%, rgba(124,58,237,.17), rgba(124,58,237,0) 58%),
  linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028)), rgba(4,7,15,.3); }
.dn-app.infra { background: radial-gradient(130% 95% at 0% 0%, rgba(96,165,250,.13), rgba(96,165,250,0) 58%),
  linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028)), rgba(4,7,15,.3); }
.dn-app::before {            /* Leuchtkante oben */
  content: ""; position: absolute; top: 0; left: 16%; right: 16%; height: 1px; pointer-events: none; opacity: .55;
  background: linear-gradient(90deg, rgba(94,234,212,0), rgba(94,234,212,.55), rgba(167,139,250,.55), rgba(167,139,250,0));
  transition: opacity .2s, left .3s var(--ease), right .3s var(--ease);
}
.dn-app .h-app-ico { grid-area: ico; }
.dn-go {
  grid-area: go; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; color: var(--t3);
  background: rgba(255,255,255,.05); border: 1px solid var(--edge);
  transition: color .2s, background-color .2s, border-color .2s, transform .25s var(--ease);
}
.dn-app .h-app-name { grid-area: name; margin-top: 14px; font-size: 16px; overflow-wrap: break-word; word-wrap: break-word; }
.dn-app .h-app-desc { grid-area: desc; overflow-wrap: break-word; word-wrap: break-word; }
.dn-badge { grid-area: badge; justify-self: end; align-self: start; margin: 7px 8px 0 12px; }
.dn-meta {
  grid-area: meta; display: flex; align-items: flex-start; flex-wrap: nowrap; min-width: 0;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); line-height: 1.45;
}
.dn-meta > .h-dot { margin: 6px 9px 0 0; }
.dn-st { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; word-wrap: break-word; color: var(--t2); }
.dn-st.warn { color: #fcd34d; }
.dn-st.crit { color: #fda4af; }
.dn-st.off, .dn-st.wait { color: var(--t3); }
.dn-note { display: none; }
.dn-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Nicht erreichbar (von unterwegs): entsaettigt, kein Link */
.dn-app.off { background: rgba(255,255,255,.025); border-style: dashed; border-color: rgba(255,255,255,.1); box-shadow: none; }
.dn-app.off::before { display: none; }
.dn-app.off .h-app-desc { color: #7f89a6; }
.dn-app.off .dn-go { background: transparent; }

a.dn-app:active { background-color: var(--glass-3); }
a.dn-app:focus-visible { outline-offset: 3px; }

@media (hover: hover) {
  a.dn-app:hover::before { opacity: 1; left: 8%; right: 8%; }
  a.dn-app:hover .dn-go { color: #05070d; background: #5eead4; border-color: transparent; box-shadow: 0 0 18px rgba(94,234,212,.55); transform: translateX(2px); }
  a.dn-app:hover .h-app-ico { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 14px 32px -10px rgba(167,139,250,.9); }
  .dn-clear:hover { background: rgba(255,255,255,.14); color: var(--t1); }
}

/* Einblenden beim Aufbau (prefers-reduced-motion: theme.css schaltet ab). "backwards", damit
   die Hover-Anhebung (transform) danach wieder greift. */
@keyframes dn-rise { 0% { opacity: 0; transform: translate3d(0, 12px, 0); } 100% { opacity: 1; transform: translate3d(0, 0, 0); } }
.dn-app { animation: dn-rise .55s var(--ease) backwards; }
.dn-grid > .dn-app:nth-child(2) { animation-delay: .05s; }
.dn-grid > .dn-app:nth-child(3) { animation-delay: .1s; }
.dn-grid > .dn-app:nth-child(4) { animation-delay: .15s; }
.dn-grid > .dn-app:nth-child(n+5) { animation-delay: .2s; }

/* --------------------------------------------- Laden, Fehler, leer ------- */
.dn-skcard { display: block; min-height: 198px; }
.dn-sk-ico { width: 64px; height: 64px; border-radius: 18px; }
.dn-sk-a { width: 55%; margin-top: 18px; }
.dn-sk-b { width: 85%; }
.dn-sk-c { width: 40%; margin-top: 30px; }
.dn-sk-t { width: 180px; margin: 0; }
.dn-err, .dn-none { margin-top: 8px; }
.dn-err .h-sub { margin: 4px 0 14px; }
.dn-none .h-btn, .dn-err .h-btn { margin-top: 14px; }

/* Touch (Wand-iPad, Tablets): Filter-Chips 44 px hoch */
@media (pointer: coarse) {
  .dn-filters .chip { min-height: 44px; }
}

/* ---------------------------------------------------------- Tablet ------- */
@media (max-width: 1099.98px) {
  .dn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 14px; gap: 14px; }
}
@media (min-width: 700px) and (max-width: 879.98px) {
  .dn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ----------------------------------------------- Handy: als Liste -------- */
@media (max-width: 699.98px) {
  .dn-head { margin: 2px 0 16px; }
  .page h2.dn-title { display: none; }          /* steht schon in der Kopfzeile ("Dienste · Alle Dienste") */
  .dn-lead { margin-top: 0; }
  .dn-lead { align-items: flex-start; font-size: 14px; line-height: 1.45; }
  .dn-lead svg { margin-top: 1px; }
  .dn-sum { margin-top: 12px; }
  .dn-tools { display: block; margin: 0 0 6px; }
  .dn-tools > .dn-search { margin: 0 0 10px; }
  .dn-search { min-width: 0; width: 100%; }
  /* Filter-Chips: eine waagrecht wischbare Zeile bis an den Bildschirmrand */
  .dn-tools > .dn-filters {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin: 0 -14px 6px; padding: 0 0 0 14px;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 86%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 86%, rgba(0,0,0,0) 100%);
  }
  .dn-filters::-webkit-scrollbar { display: none; }
  .dn-filters .chip { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
  .dn-filters .chip:last-child { margin-right: 28px; }
  .dn-group { margin-top: 22px; }
  .dn-ghead { margin-bottom: 10px; }
  .dn-ghint { flex: 1 0 100%; margin: 4px 0 0; padding-left: 16px; font-size: 13px; }
  .dn-ghead::after { display: none; }

  /* Gruppe = ein Glas-Paneel, Dienste als Zeilen */
  .dn-grid {
    display: block; overflow: hidden; border-radius: 20px;
    background: rgba(255,255,255,.045); background: var(--panel);
    border: 1px solid var(--edge); box-shadow: inset 0 1px 0 var(--edge-hi), var(--shadow);
  }
  .dn-app {
    grid-template-columns: 48px minmax(0, 1fr) 30px; grid-template-rows: auto auto auto;
    grid-template-areas: "ico name go" "ico desc go" "ico meta go";
    grid-column-gap: 14px; column-gap: 14px; align-items: center;
    min-height: 0; padding: 14px 14px 14px 16px; border: 0; border-top: 1px solid rgba(255,255,255,.06);
    border-radius: 0; box-shadow: none; background: transparent;
  }
  .dn-app.cloud, .dn-app.media, .dn-app.twitch, .dn-app.infra { background: transparent; }
  .dn-app.dn-first { border-top: 0; }
  .dn-app::before { display: none; }
  .dn-app .h-app-ico { width: 48px; height: 48px; border-radius: 14px; align-self: center; }
  .dn-app .h-app-ico > svg { width: 24px; height: 24px; }
  .dn-app .h-app-name { margin-top: 0; font-size: 15.5px; }
  .dn-app .h-app-desc { display: -webkit-box; margin-top: 1px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .dn-badge { display: none; }
  .dn-meta { display: block; margin-top: 5px; padding-top: 0; border-top: 0; font-size: 12.5px; }
  .dn-meta > .h-dot { margin: -2px 8px 0 0; vertical-align: middle; }
  .dn-meta > .dn-st, .dn-meta > .dn-note { display: inline; }
  .dn-note { color: var(--t3); }
  .dn-note::before { content: " · "; }
  .dn-sum .h-chip { height: 30px; padding: 0 11px; font-size: 12.5px; }
  .dn-sum .h-chip > .h-dot { margin-right: 7px; }
  .dn-go { width: 30px; height: 30px; background: transparent; border-color: transparent; }
  .dn-app.off { border-style: solid; border-color: rgba(255,255,255,.06); border-width: 1px 0 0; background: transparent; }
  .dn-app.off.dn-first { border-top: 0; }
  .dn-app.off .h-app-ico { opacity: .75; }
  a.dn-app:active { background: rgba(255,255,255,.06); }
  .dn-skcard { min-height: 76px; padding: 14px 16px; border: 0; border-radius: 0; background: transparent; }
  .dn-skcard .dn-sk-ico { width: 48px; height: 48px; border-radius: 14px; }
  .dn-skcard .dn-sk-c { display: none; }
}
