/* Hub - Theme "Aurora Mission Control" (DESIGN.md, Abschnitte 2-4, 6 und 9).
   Reihenfolge der Stylesheets: app.css -> theme.css -> home.css, dienste.css, admin.css.
     1. Tokens            2. Grundlagen + Fokus      3. Weltraum (.space aus index.html)
     4. App-Rahmen         5. Bausteine h-*           6. Bestehende Ansichten angleichen
     7. Anmeldung + Start  8. Altes Startmenue        9. Emoji -> SVG-Masken
    10. Responsiv         11. Animationen            12. prefers-reduced-motion
    13. Raster SD.grid (grid.js)                     14. Seitenleiste "Dienste" + Schublade (app.js)
   iOS 12: kein gap in Flexbox (Abstaende per margin), kein inset/aspect-ratio/clamp/min/max,
   kein :is/:where/:has, backdrop-filter immer mit -webkit-Praefix und Fallback (@supports),
   sticky mit -webkit-sticky. Keine externen Ressourcen; Masken sind data:-SVGs (img-src data:). */

/* ============================================================== 1. Tokens == */
:root {
  color-scheme: dark;
  /* Flaechen */
  --bg: #05070d;            --bg-2: #0a0f1c;
  --glass: rgba(255,255,255,.045);  --glass-2: rgba(255,255,255,.07);  --glass-3: rgba(255,255,255,.10);
  --glass-solid: rgba(12,17,30,.92);           /* Fallback ohne backdrop-filter */
  --edge: rgba(255,255,255,.09);  --edge-2: rgba(255,255,255,.16);  --edge-hi: rgba(255,255,255,.06);
  /* Text: Kontrast >= 4.5:1 auf --bg und auf Glas (gemessen: siehe Kommentar bei .space) */
  --t1: #eef2ff;  --t2: #b4bdd6;  --t3: #8d97b3;
  /* Akzente */
  --cyan: #5eead4;  --cyan-2: #22d3ee;  --violet: #a78bfa;  --violet-2: #7c3aed;  --pink: #f472b6;
  --coral: #ff8f6b; --coral-2: #d97757;  /* alles rund um Claude */
  --ok: #34d399;  --warn: #fbbf24;  --crit: #fb7185;  --info: #60a5fa;  --off: #64708c;
  /* Konto-Farben (Fallback, wenn der Hub keine liefert) */
  --acc-1: #ff8f6b; --acc-2: #6aa8ff; --acc-3: #5eead4; --acc-4: #c4a5ff; --acc-5: #fbbf24;
  /* Form */
  --r-xs: 8px; --r-sm: 12px; --r: 18px; --r-lg: 24px; --r-full: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --shadow: 0 24px 60px -24px rgba(0,0,0,.75);
  --glow-cyan: 0 0 24px rgba(94,234,212,.28);  --glow-violet: 0 0 28px rgba(167,139,250,.28);
  --glow-coral: 0 0 28px rgba(255,143,107,.30);
  --ease: cubic-bezier(.2,.8,.2,1);  --fast: .16s;  --mid: .32s;  --slow: .8s;
  --topbar-h: 64px;
  /* Bruecke zu den alten Variablen aus app.css (bestehende Ansichten erben den Look) */
  --card: var(--glass); --card-2: var(--glass-2); --card-3: var(--glass-3);
  --line: var(--edge); --line-soft: rgba(255,255,255,.05);
  --text: var(--t1); --text-2: var(--t2); --text-3: var(--t3);
  --accent: var(--cyan-2); --danger: var(--crit); --radius: var(--r); --radius-sm: var(--r-sm);
  /* Ergaenzungen */
  --grad: linear-gradient(120deg, #5eead4 0%, #22d3ee 45%, #a78bfa 100%);
  --panel: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028)), rgba(4,7,15,.3);
  --bar-bg: rgba(7,10,19,.62);                 /* Kopfzeile, Tabs, untere Leiste */
}

/* ===================================================== 2. Grundlagen ====== */
html { background: #05070d; background: var(--bg); }
body {
  background: transparent;            /* der Weltraum (.space, z-index -1) liegt dahinter */
  color: var(--t1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--cyan); }
::selection { background: rgba(94,234,212,.3); color: #fff; }
.muted { color: var(--t3); }

/* Fokus: sichtbar fuer Tastatur. Alte Safari kennen :focus-visible nicht und behalten
   den :focus-Ring (eigene Regeln, damit eine unbekannte Pseudoklasse nichts mitreisst). */
a:focus, button:focus, summary:focus, [tabindex]:focus { outline: 2px solid #5eead4; outline-offset: 2px; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible), summary:focus:not(:focus-visible), [tabindex]:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }
.range:focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }

/* ======================================================= 3. Weltraum ====== */
/* Statisch in index.html: .space > i.aurora.a1/.a2/.a3 + i.stars + i.grid-floor;
   .space::before = helle Sterne mit Lichthof, .space::after = seltene Sternschnuppe.
   Die Farbe sitzt vor allem hinter der Kopfzeile (deren dunkles Glas schuetzt die Schrift).
   Gemessen per Pixelprobe ueber den ganzen Drift-Zyklus (Median, Sterne ausgenommen):
   --t3 >= 4.77:1, --t2 >= 7.40:1, --t1 >= 12.4:1 - auf Glas wie direkt auf dem Weltraum
   (Handy, Tablet, Desktop). */
.space {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
  background: #05070d;
  background:
    radial-gradient(ellipse 46% 150px at 18% 0, rgba(94,234,212,.2), rgba(94,234,212,0)),
    radial-gradient(ellipse 42% 140px at 82% 0, rgba(167,139,250,.22), rgba(167,139,250,0)),
    radial-gradient(ellipse at 50% -20%, #111a33 0%, #05070d 60%);
}
.space::before {            /* wenige helle Sterne mit Lichthof */
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(circle at 180px 220px, rgba(255,255,255,.95) 0, rgba(255,255,255,.95) 1px, rgba(190,250,240,.2) 2px, rgba(190,250,240,0) 6px),
    radial-gradient(circle at 760px 90px, rgba(255,255,255,.9) 0, rgba(255,255,255,.9) 1px, rgba(220,210,255,.2) 2px, rgba(220,210,255,0) 5px),
    radial-gradient(circle at 1010px 520px, rgba(255,255,255,.9) 0, rgba(255,255,255,.9) 1px, rgba(255,220,205,.18) 2px, rgba(255,220,205,0) 5px),
    radial-gradient(circle at 420px 690px, rgba(255,255,255,.85) 0, rgba(255,255,255,.85) 1px, rgba(190,250,240,.16) 2px, rgba(190,250,240,0) 5px);
  background-size: 1180px 980px;
}
.space::after {             /* Sternschnuppe: alle 31 s fuer eine dreiviertel Sekunde */
  content: ""; position: absolute; top: 12vh; left: 70vw; width: 140px; height: 1px; border-radius: 1px; opacity: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.75) 85%, #fff);
  transform: rotate(160deg);
  animation: h-meteor 31s linear 9s infinite;
}
.space > i { position: absolute; display: block; }
.space .aurora {
  border-radius: 50%; opacity: .35;
  filter: blur(40px);
  will-change: transform;
}
.space .a1, .space .a2 {     /* Vorhang-Struktur der Polarlichter */
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0, rgba(0,0,0,.5) 1.3vmax, #000 2.3vmax, rgba(0,0,0,.68) 3.4vmax, rgba(0,0,0,.9) 4.1vmax, rgba(0,0,0,.52) 5vmax, #000 6.2vmax);
  mask-image: repeating-linear-gradient(90deg, #000 0, rgba(0,0,0,.5) 1.3vmax, #000 2.3vmax, rgba(0,0,0,.68) 3.4vmax, rgba(0,0,0,.9) 4.1vmax, rgba(0,0,0,.52) 5vmax, #000 6.2vmax);
}
.space .a1 {            /* Cyan/Tuerkis, oben links */
  width: 74vmax; height: 46vmax; top: -31vmax; left: -20vmax;
  background: radial-gradient(closest-side, rgba(94,234,212,.55), rgba(45,212,191,.2) 55%, rgba(94,234,212,0));
  animation: h-aurora-1 64s ease-in-out infinite alternate;
}
.space .a2 {            /* Violett, oben rechts */
  width: 66vmax; height: 44vmax; top: -29vmax; right: -22vmax;
  background: radial-gradient(closest-side, rgba(167,139,250,.55), rgba(124,58,237,.22) 55%, rgba(167,139,250,0));
  animation: h-aurora-2 78s ease-in-out infinite alternate;
}
.space .a3 {            /* Koralle, unten - waermt den Boden */
  width: 62vmax; height: 36vmax; bottom: -26vmax; left: 22vw;
  background: radial-gradient(closest-side, rgba(255,143,107,.45), rgba(244,114,182,.16) 55%, rgba(255,143,107,0));
  opacity: .28;
  animation: h-aurora-3 52s ease-in-out infinite alternate;
}
/* Sternenfeld: drei Kachelgroessen gegeneinander versetzt, damit kein Muster sichtbar wird */
.space .stars { top: 0; left: 0; width: 100%; height: 100%; }
.space .stars::before, .space .stars::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; }
.space .stars {
  background-image:
    radial-gradient(1px 1px at 215px 222px, rgba(255,255,255,.65), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 355px 226px, rgba(255,255,255,.65), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 37px 223px, rgba(255,255,255,.4), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 202px 352px, rgba(255,255,255,.65), rgba(255,255,255,0)),
    radial-gradient(1.2px 1.2px at 177px 280px, rgba(255,255,255,.5), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 285px 70px, rgba(255,255,255,.4), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 78px 118px, rgba(255,255,255,.65), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 167px 159px, rgba(255,255,255,.5), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 336px 321px, rgba(255,255,255,.4), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 108px 27px, rgba(255,255,255,.4), rgba(255,255,255,0)),
    radial-gradient(1.2px 1.2px at 309px 407px, rgba(255,255,255,.5), rgba(255,255,255,0)),
    radial-gradient(1.2px 1.2px at 310px 147px, rgba(255,255,255,.5), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 352px 63px, rgba(255,255,255,.5), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 36px 351px, rgba(255,255,255,.4), rgba(255,255,255,0)),
    radial-gradient(1.2px 1.2px at 115px 211px, rgba(255,255,255,.4), rgba(255,255,255,0)),
    radial-gradient(1.2px 1.2px at 410px 180px, rgba(255,255,255,.5), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 264px 261px, rgba(255,255,255,.65), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 216px 47px, rgba(255,255,255,.4), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 161px 79px, rgba(255,255,255,.4), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 30px 39px, rgba(255,255,255,.4), rgba(255,255,255,0)),
    radial-gradient(1.2px 1.2px at 382px 409px, rgba(255,255,255,.5), rgba(255,255,255,0)),
    radial-gradient(1px 1px at 250px 167px, rgba(255,255,255,.4), rgba(255,255,255,0));
  background-size: 420px 420px;
}
.space .stars::before {
  background-image:
    radial-gradient(1.6px 1.6px at 63px 47px, rgba(255,255,255,.75), rgba(255,255,255,0)),
    radial-gradient(1.6px 1.6px at 403px 197px, rgba(255,255,255,.6), rgba(255,255,255,0)),
    radial-gradient(1.3px 1.3px at 209px 139px, rgba(255,255,255,.6), rgba(255,255,255,0)),
    radial-gradient(1.3px 1.3px at 328px 607px, rgba(255,255,255,.75), rgba(255,255,255,0)),
    radial-gradient(1.6px 1.6px at 526px 10px, rgba(255,220,205,.6), rgba(255,220,205,0)),
    radial-gradient(1.6px 1.6px at 535px 302px, rgba(220,210,255,.75), rgba(220,210,255,0)),
    radial-gradient(1.3px 1.3px at 290px 418px, rgba(200,255,250,.6), rgba(200,255,250,0)),
    radial-gradient(1.3px 1.3px at 539px 149px, rgba(200,255,250,.75), rgba(200,255,250,0)),
    radial-gradient(1.6px 1.6px at 125px 499px, rgba(255,220,205,.75), rgba(255,220,205,0)),
    radial-gradient(1.3px 1.3px at 602px 488px, rgba(255,220,205,.6), rgba(255,220,205,0)),
    radial-gradient(1.6px 1.6px at 412px 517px, rgba(200,255,250,.6), rgba(200,255,250,0)),
    radial-gradient(1.6px 1.6px at 200px 331px, rgba(255,255,255,.75), rgba(255,255,255,0));
  background-size: 640px 640px;
}
.space .stars::after {      /* funkelnde Ebene */
  background-image:
    radial-gradient(1.8px 1.8px at 444px 854px, rgba(190,250,240,.8), rgba(190,250,240,0)),
    radial-gradient(2px 2px at 26px 634px, rgba(255,255,255,.9), rgba(255,255,255,0)),
    radial-gradient(1.5px 1.5px at 173px 505px, rgba(225,215,255,.8), rgba(225,215,255,0)),
    radial-gradient(1.8px 1.8px at 154px 821px, rgba(225,215,255,.8), rgba(225,215,255,0)),
    radial-gradient(2px 2px at 548px 427px, rgba(190,250,240,.9), rgba(190,250,240,0)),
    radial-gradient(1.8px 1.8px at 515px 681px, rgba(255,255,255,.8), rgba(255,255,255,0)),
    radial-gradient(1.5px 1.5px at 823px 198px, rgba(190,250,240,.9), rgba(190,250,240,0)),
    radial-gradient(1.5px 1.5px at 264px 646px, rgba(255,255,255,.8), rgba(255,255,255,0)),
    radial-gradient(2px 2px at 598px 274px, rgba(255,255,255,.9), rgba(255,255,255,0)),
    radial-gradient(1.5px 1.5px at 674px 638px, rgba(190,250,240,.8), rgba(190,250,240,0));
  background-size: 860px 860px;
  will-change: opacity;
  animation: h-twinkle 6s ease-in-out infinite alternate;
}
/* Boden: feines Perspektiv-Raster, zum Horizont hin ausgeblendet; die Linien gleiten langsam */
.space .grid-floor {
  left: -60%; width: 220%; bottom: -2vh; height: 46vh;
  overflow: hidden; opacity: .13;
  transform: perspective(380px) rotateX(64deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0,0,0,.55) 40%, rgba(0,0,0,0) 82%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0,0,0,.55) 40%, rgba(0,0,0,0) 82%);
}
.space .grid-floor::before {
  content: ""; position: absolute; left: 0; right: 0; top: -56px; bottom: 0;
  background-image: linear-gradient(rgba(94,234,212,.95) 1px, rgba(94,234,212,0) 1px),
    linear-gradient(90deg, rgba(167,139,250,.95) 1px, rgba(167,139,250,0) 1px);
  background-size: 56px 56px; background-position: 50% 0;
  animation: h-floor 22s linear infinite;
}

/* ===================================================== 4. App-Rahmen ====== */
/* Kopfzeile: Brand | Titel (Handy) | Hauptnavigation (Desktop) | Pills rechts */
.topbar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center;
  height: 64px; height: calc(64px + env(safe-area-inset-top));
  padding: 0 24px; padding-top: env(safe-area-inset-top);
  background: rgba(7,10,19,.9);
  border-bottom: 1px solid var(--edge);
  box-shadow: 0 12px 32px -24px rgba(0,0,0,.9);
}
.topbar::after {              /* Leuchtlinie unter der Kopfzeile */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(94,234,212,0) 5%, rgba(94,234,212,.35) 35%, rgba(167,139,250,.35) 65%, rgba(167,139,250,0) 95%);
}
html[data-area="steuerung"] .topbar::after, html[data-area="admin"] .topbar::after, html[data-area="infra"] .topbar::after { opacity: 0; }

.topbar .brand {
  display: inline-flex; align-items: center; flex: 0 0 auto; min-width: 0; height: 44px;
  margin-right: 12px; padding-right: 6px; border-radius: 12px;
  color: var(--t1); text-decoration: none;
}
.brand-name { margin-left: 11px; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }

/* Brand-Mark: leuchtender Ring mit konischem Verlauf, darueber wandert ein Glanz */
.brand-mark {
  position: relative; display: inline-block; flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 50%; overflow: hidden;
  background: #5eead4;
  background: linear-gradient(135deg, #5eead4, #a78bfa 55%, #ff8f6b);
  background: conic-gradient(from 210deg, #5eead4, #22d3ee, #a78bfa, #f472b6, #ff8f6b, #5eead4);
  box-shadow: 0 0 14px rgba(94,234,212,.38), 0 0 30px rgba(167,139,250,.22);
}
.brand-mark::before {         /* wandernder Glanz */
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,255,255,0) 0deg, rgba(255,255,255,.85) 38deg, rgba(255,255,255,0) 80deg, rgba(255,255,255,0) 360deg);
  animation: h-spin 9s linear infinite;
}
.brand-mark::after {          /* dunkler Kern -> Ring ("Hub") */
  content: ""; position: absolute; top: 26%; left: 26%; right: 26%; bottom: 26%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1c2644 0%, #070a13 72%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), inset 0 0 4px rgba(94,234,212,.35);
}

.topbar .titles { min-width: 0; flex: 1 1 auto; }
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.topbar .sub { font-size: 12.5px; color: var(--t3); }
.topbar .back {
  width: 40px; height: 40px; margin-right: 10px; border-radius: 12px;
  border: 1px solid var(--edge); background: var(--glass-2); color: var(--t1);
  box-shadow: inset 0 1px 0 var(--edge-hi);
}

/* Hauptnavigation (Desktop/Tablet): Segment-Pille */
.mainnav { display: none; }
.mn {
  position: relative; display: inline-flex; align-items: center; flex: 0 0 auto;
  height: 38px; padding: 0 16px 0 13px; border-radius: 999px;
  color: var(--t2); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: color .16s, background-color .16s, box-shadow .16s;
}
.mn + .mn { margin-left: 2px; }
.mn svg { width: 18px; height: 18px; margin-right: 8px; flex: 0 0 auto; }
.mn.active {
  color: #fff; background: var(--glass-3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 0 1px rgba(255,255,255,.07), 0 6px 22px -8px rgba(94,234,212,.55);
}
.mn.active svg { color: #5eead4; filter: drop-shadow(0 0 5px rgba(94,234,212,.75)); }
/* Beschriftung mit Kurzform (NAV in app.js): .nl = lang ("Infrastruktur"), .ns = kurz ("Infra") - wo sechs Ziele eng werden */
.mn > .ns, .bn > .ns { display: none; }
@media (max-width: 1239.98px) {
  .mn > .nl, .bn > .nl { display: none; }
  .mn > .ns, .bn > .ns { display: inline; }
}
.mn.active::after {
  content: ""; position: absolute; left: 30%; right: 30%; bottom: 3px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #5eead4, #a78bfa); box-shadow: 0 0 8px rgba(94,234,212,.85);
}

/* Pills rechts */
.topbar .right { display: flex; align-items: center; justify-content: flex-end; margin-left: 12px; }
.pill {
  height: 34px; padding: 0 12px; margin-left: 8px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--edge); color: var(--t2);
  font-size: 13px; font-weight: 600; box-shadow: inset 0 1px 0 var(--edge-hi);
}
.pill.power { font-size: 0; }                /* blendet das alte Zeichen aus; Symbol per Maske (Abschnitt 9) */
.pill.power b { margin-left: 0; font-size: 13px; font-weight: 650; color: var(--t1); font-variant-numeric: tabular-nums; }
.pill .dot { position: relative; width: 8px; height: 8px; margin-right: 8px; background: var(--ok); box-shadow: 0 0 8px rgba(52,211,153,.85); }
.pill .dot::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%;
  background: #34d399; opacity: 0;
  animation: h-ping 2.4s var(--ease) infinite;
}
.pill.conn.off { color: #fda4af; border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.1); }
.pill.conn.off .dot { background: var(--crit); box-shadow: 0 0 8px rgba(251,113,133,.85); }
.pill.conn.off .dot::after { animation: none; }
.pill.admin { background: rgba(167,139,250,.14); border-color: rgba(167,139,250,.45); color: #ddd6fe; }
.pill.admin > svg { flex: 0 0 auto; margin-right: 6px; }
.pill.admin:not([hidden]) + .pill.power { display: none; }   /* Platz in der Kopfzeile */
.icon-btn {
  width: 40px; height: 40px; margin-left: 8px; border-radius: 12px;
  border: 1px solid var(--edge); background: var(--glass-2); color: var(--t2);
  box-shadow: inset 0 1px 0 var(--edge-hi);
  transition: color .16s, background-color .16s, border-color .16s;
}
.icon-btn:active { background: var(--glass-3); }

/* Tabs: klebt unter der Kopfzeile, Segment-Pillen, waagrecht wischbar */
.tabs {
  position: -webkit-sticky; position: sticky; top: 64px; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 29;
  display: flex; align-items: center;
  padding: 10px 24px; background: rgba(7,10,19,.9);
  border-bottom: 1px solid var(--edge);
}
.tabs::after {               /* Leuchtlinie unter den Tabs (statt unter der Kopfzeile) */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(94,234,212,0) 5%, rgba(94,234,212,.3) 35%, rgba(167,139,250,.3) 65%, rgba(167,139,250,0) 95%);
}
.tab {
  position: relative; flex: 0 0 auto; height: 36px; padding: 0 16px; margin: 0 6px 0 0;
  border: 1px solid transparent; border-radius: 999px; background: transparent;
  color: var(--t2); font-size: 14px; font-weight: 600;
  transition: color .16s, background-color .16s, border-color .16s, box-shadow .16s;
}
.tab.active {
  color: #fff; background: var(--glass-3); border-color: var(--edge-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 6px 20px -10px rgba(94,234,212,.6);
}
.tab.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -6px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #5eead4, #a78bfa); box-shadow: 0 0 10px rgba(94,234,212,.85);
}

.page { max-width: 1360px; padding: 24px 24px 64px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

/* Untere Leiste (nur Handy, Aufbau im Handy-Block unten) */
.bottomnav { display: none; background: rgba(7,10,19,.92); }
/* Kopfzeile, Tabs und untere Leiste als Glas, wo backdrop-filter geht (sonst fast deckend) */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar, .tabs, .bottomnav {
    background: var(--bar-bg);
    -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  }
}
.bn {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 54px; padding: 6px 2px 4px; border-radius: 14px;
  color: var(--t3); text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .01em;
  transition: color .16s;
}
.bn svg { width: 22px; height: 22px; margin-bottom: 4px; }
.bn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn.active { color: #5eead4; }
.bn.active svg { filter: drop-shadow(0 0 6px rgba(94,234,212,.7)); }
.bn.active::before {
  content: ""; position: absolute; top: -7px; left: 32%; right: 32%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #5eead4, #a78bfa); box-shadow: 0 0 12px rgba(94,234,212,.9);
}

/* Abschnittstitel (auch .h-title) */
.page h2 {
  align-items: center; flex-wrap: wrap;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--t2);
  margin: 30px 0 14px;
}
.page h2::before, .h-title::before {
  content: ""; flex: 0 0 auto; width: 6px; height: 6px; margin-right: 10px; border-radius: 50%;
  background: #5eead4; box-shadow: 0 0 8px rgba(94,234,212,.9), 0 0 2px #5eead4;
}
.page h2:first-child { margin-top: 6px; }
.page h2 .hint { margin-left: 12px; text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 500; color: var(--t3); }
.page h2 .right { letter-spacing: 0; }
.page .h-title, .page h2.h-title { margin: 0; }   /* <h2 class="h-title"> in .h-head: keine Abschnitts-Abstaende */

/* ===================================================== 5. Bausteine h- ===== */
/* DESIGN 6.1 Glas-Paneel. Varianten: .claude (Kante koralle/violett), .alert (warn/crit).
   Als Link/Knopf (a.h-panel, button.h-panel) mit Hover-Anhebung. */
.h-panel {
  position: relative; padding: 20px; color: var(--t1);
  background: var(--glass); background: var(--panel);
  border: 1px solid var(--edge); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--shadow);
}
.h-panel, .card, .fp-stage {
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
}
.h-panel::before, .card::before {   /* Leuchtkante oben */
  content: ""; position: absolute; top: -1px; left: 12%; right: 12%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(94,234,212,0), rgba(94,234,212,.5), rgba(167,139,250,.5), rgba(167,139,250,0));
}
.h-panel.claude { border-color: rgba(255,143,107,.16); }
.h-panel.claude::before { background: linear-gradient(90deg, rgba(255,143,107,0), rgba(255,143,107,.65), rgba(167,139,250,.5), rgba(167,139,250,0)); }
.h-panel.alert { border-color: rgba(251,113,133,.25); }
.h-panel.alert::before { background: linear-gradient(90deg, rgba(251,191,36,0), rgba(251,191,36,.6), rgba(251,113,133,.6), rgba(251,113,133,0)); }
a.h-panel, button.h-panel { display: block; width: 100%; text-align: left; text-decoration: none; font: inherit; cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }

/* Kopfzeile eines Paneels: .h-title links, .h-link rechts */
.h-head { display: flex; align-items: center; min-height: 30px; margin: -2px 0 14px; }
.h-title {
  display: flex; align-items: center; min-width: 0; margin: 0;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--t2);
}
.h-panel.claude .h-title::before { background: #ff8f6b; box-shadow: 0 0 8px rgba(255,143,107,.9), 0 0 2px #ff8f6b; }
.h-panel.alert .h-title::before { background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,.9), 0 0 2px #fbbf24; }
.h-link {
  display: inline-flex; align-items: center; flex: 0 0 auto; margin-left: auto; min-height: 32px; padding: 4px 6px 4px 12px;
  border-radius: 999px; color: var(--t2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: color .16s, background-color .16s;
}
.h-link svg { width: 16px; height: 16px; margin-left: 4px; }
.h-sub { font-size: 13px; color: var(--t3); }

/* Raster: 12 Spalten ab 1100 px, 6 Spalten 700-1099 px (.h-t-N), 1 Spalte auf dem Handy */
.h-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-gap: 18px; gap: 18px; }
.h-span-1 { grid-column: span 1; } .h-span-2 { grid-column: span 2; } .h-span-3 { grid-column: span 3; }
.h-span-4 { grid-column: span 4; } .h-span-5 { grid-column: span 5; } .h-span-6 { grid-column: span 6; }
.h-span-7 { grid-column: span 7; } .h-span-8 { grid-column: span 8; } .h-span-9 { grid-column: span 9; }
.h-span-10 { grid-column: span 10; } .h-span-11 { grid-column: span 11; } .h-span-12 { grid-column: span 12; }

/* Leuchtzahl */
.h-num { color: var(--t1); font-variant-numeric: tabular-nums; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .h-num, .kpi.accent .val, .login-title {
    background: linear-gradient(120deg, #fff 0%, #5eead4 45%, #a78bfa 100%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
  }
}

/* DESIGN 6.2 Ring (SD.ring): <div class="h-ring">SVG<div class="h-ring-val">…</div></div> */
.h-ring { position: relative; display: inline-block; flex: 0 0 auto; width: 120px; height: 120px; }
.h-ring > svg { display: block; width: 100%; height: 100%; }
.h-ring-val {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; line-height: 1.15; font-variant-numeric: tabular-nums;
}
.h-ring-svg { color: #5eead4; overflow: visible; filter: drop-shadow(0 0 6px rgba(94,234,212,.45)); }
.h-ring-svg.warning { color: #fbbf24; filter: drop-shadow(0 0 6px rgba(251,191,36,.5)); }
.h-ring-svg.critical { color: #fb7185; filter: drop-shadow(0 0 7px rgba(251,113,133,.6)); }
.h-ring-svg.empty { filter: none; padding: 0; }   /* app.css ".empty" (Leerzeilen) gibt sonst Innenabstand: der leere Ring schrumpft */
.h-ring-track { stroke: rgba(255,255,255,.08); }
.h-ring-bar { transition: stroke-dashoffset 1.2s var(--ease); }
.h-ring-svg.intro .h-ring-bar { animation: h-ring-in 1.2s var(--ease); }

/* DESIGN 6.3 Chip: Pille mit Symbol + Text */
.h-chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--edge); color: var(--t2);
  font-size: 13px; font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.h-chip > svg { width: 16px; height: 16px; margin-right: 7px; flex: 0 0 auto; }
.h-chip > .h-dot { margin-right: 8px; }
.h-chip.ok { color: #6ee7b7; background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.35); }
.h-chip.warn { color: #fcd34d; background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.38); }
.h-chip.crit { color: #fda4af; background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.4); }
.h-chip.info { color: #93c5fd; background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.38); }
.h-chip.claude { color: #ffb59c; background: rgba(255,143,107,.1); border-color: rgba(255,143,107,.4); }
.h-chips { display: flex; flex-wrap: wrap; align-items: center; margin: -4px; }
.h-chips > * { margin: 4px; }

/* DESIGN 6.4 Knopf: 44 px, Glas; .primary Verlauf mit dunkler Schrift, .danger rot */
.h-btn {
  -webkit-appearance: none; appearance: none; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 16px; border-radius: 14px;
  border: 1px solid var(--edge); background: var(--glass-2); color: var(--t1);
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
  cursor: pointer; touch-action: manipulation; box-shadow: inset 0 1px 0 var(--edge-hi);
  transition: transform .18s var(--ease), background-color .18s, border-color .18s, box-shadow .18s;
}
/* Symbol vorn: <svg>Text | Symbol hinten: <span>Text</span><svg> | nur Symbol: .h-btn.icon-only (mit aria-label) */
.h-btn > svg { width: 20px; height: 20px; flex: 0 0 auto; margin-right: 9px; }
.h-btn > span + svg { margin-left: 8px; margin-right: 0; }
.h-btn.icon-only { min-width: 44px; padding: 10px; }
.h-btn.icon-only > svg { margin: 0; }
.h-btn.primary {
  background: #22d3ee; background: linear-gradient(120deg, #5eead4 0%, #22d3ee 45%, #a78bfa 100%);
  color: #05070d; border-color: transparent; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 28px -12px rgba(34,211,238,.65);
}
.h-btn.danger { background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.45); color: #fecdd3; }
.h-btn:active { transform: scale(.98); }
.h-btn:disabled, .h-btn.disabled { opacity: .45; cursor: default; transform: none; }

/* DESIGN 6.5 Abzeichen, Live-Punkt, Balken, Skeleton, Leerzustand */
.h-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px;
  background: rgba(255,255,255,.07); border: 1px solid var(--edge); color: var(--t2);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; vertical-align: middle;
}
.h-badge.ok { color: #6ee7b7; background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.32); }
.h-badge.warn { color: #fcd34d; background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.34); }
.h-badge.crit { color: #fda4af; background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.36); }
.h-badge.info { color: #93c5fd; background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.34); }
.h-badge.claude { color: #ffb59c; background: rgba(255,143,107,.1); border-color: rgba(255,143,107,.36); }
.h-badge.violet { color: #c4b5fd; background: rgba(167,139,250,.12); border-color: rgba(167,139,250,.36); }

.h-dot {
  position: relative; display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: #64708c; color: #64708c; vertical-align: middle;
}
.h-dot.ok { background: #34d399; color: #34d399; box-shadow: 0 0 8px rgba(52,211,153,.7); }
.h-dot.warn { background: #fbbf24; color: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,.7); }
.h-dot.crit { background: #fb7185; color: #fb7185; box-shadow: 0 0 8px rgba(251,113,133,.75); }
.h-dot.busy { background: #5eead4; color: #5eead4; box-shadow: 0 0 8px rgba(94,234,212,.75); }
.h-dot.info { background: #60a5fa; color: #60a5fa; box-shadow: 0 0 8px rgba(96,165,250,.7); }
.h-dot.claude { background: #ff8f6b; color: #ff8f6b; box-shadow: 0 0 8px rgba(255,143,107,.7); }
.h-dot.off { background: #64708c; color: #64708c; box-shadow: none; }
.h-dot.live::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%;
  background: currentColor; opacity: 0;
  animation: h-ping 2s var(--ease) infinite;
}

.h-meter { position: relative; height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.h-meter > i {
  display: block; width: 0; height: 100%; border-radius: 999px;
  background: #22d3ee; background: linear-gradient(90deg, #5eead4, #22d3ee 50%, #a78bfa);
  box-shadow: 0 0 10px rgba(94,234,212,.5);
  transition: width 1s var(--ease);
}
.h-meter.warn > i, .h-meter > i.warn { background: #fbbf24; box-shadow: 0 0 10px rgba(251,191,36,.55); }
.h-meter.crit > i, .h-meter > i.crit { background: #fb7185; box-shadow: 0 0 10px rgba(251,113,133,.6); }

.h-skel { position: relative; display: block; overflow: hidden; min-height: 14px; border-radius: 12px; background: rgba(255,255,255,.055); }
.h-skel::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(100deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.09) 50%, rgba(255,255,255,0) 80%);
  transform: translateX(-100%);
  animation: h-shimmer 1.4s ease-in-out infinite;
}
.h-skel.line { height: 12px; min-height: 0; margin: 9px 0; border-radius: 6px; }
.h-skel.round { border-radius: 50%; }

.h-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 12px; text-align: center; color: var(--t3); font-size: 14px; line-height: 1.5;
}
.h-empty > svg { width: 28px; height: 28px; margin-bottom: 10px; color: var(--t3); }
.h-empty.err, .h-empty.error { color: #fda4af; }
.h-empty.err > svg, .h-empty.error > svg { color: #fb7185; }

/* DESIGN 6.6 App-Kachel: .h-app (a oder div) > .h-app-ico(.hub|.cloud|.media|.twitch|.infra|.claude) + Texte */
.h-app {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; min-width: 0;
  padding: 16px; border-radius: var(--r);
  background: var(--glass); background: var(--panel);
  border: 1px solid var(--edge); box-shadow: inset 0 1px 0 var(--edge-hi);
  color: var(--t1); text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s, background-color .2s;
}
.h-app-ico {
  position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 64px; height: 64px; border-radius: 18px; color: #fff; overflow: hidden;
  background: #7c3aed; background: linear-gradient(140deg, #a78bfa 0%, #6d28d9 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 26px -10px rgba(167,139,250,.7);
}
.h-app-ico::after {           /* Glanz oben */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 50%; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0));
}
.h-app-ico > svg { position: relative; z-index: 1; width: 30px; height: 30px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.h-app-ico.hub, .h-app.hub .h-app-ico { background: linear-gradient(140deg, #a78bfa 0%, #6d28d9 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 26px -10px rgba(167,139,250,.75); }
.h-app-ico.cloud, .h-app.cloud .h-app-ico { background: linear-gradient(140deg, #22d3ee 0%, #0e7490 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 26px -10px rgba(34,211,238,.7); }
.h-app-ico.media, .h-app.media .h-app-ico { background: linear-gradient(140deg, #f472b6 0%, #be185d 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 26px -10px rgba(244,114,182,.7); }
.h-app-ico.twitch, .h-app.twitch .h-app-ico { background: linear-gradient(140deg, #8b5cf6 0%, #4c1d95 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 10px 26px -10px rgba(124,58,237,.75); }
.h-app-ico.infra, .h-app.infra .h-app-ico { background: linear-gradient(140deg, #60a5fa 0%, #1d4ed8 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 26px -10px rgba(96,165,250,.7); }
.h-app-ico.claude, .h-app.claude .h-app-ico { background: linear-gradient(140deg, #ff8f6b 0%, #c2410c 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 26px -10px rgba(255,143,107,.7); }
.h-app-name { margin-top: 12px; font-size: 15px; font-weight: 650; line-height: 1.3; }
.h-app-desc { margin-top: 3px; font-size: 13px; color: var(--t3); line-height: 1.45; }
.h-app-meta { display: flex; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--t2); }
.h-app-meta > .h-dot { margin-right: 7px; }
.h-app-meta > .h-badge { margin-left: 8px; }
.h-app.off { cursor: default; }
.h-app.off .h-app-ico { background: rgba(255,255,255,.07); color: var(--t3); box-shadow: inset 0 0 0 1px var(--edge); }
.h-app.off .h-app-ico > svg { filter: none; }
.h-app.off .h-app-name { color: var(--t2); }

/* =============================== 6. Bestehende Ansichten angleichen ====== */
.card {
  position: relative; padding: 18px;
  background: var(--glass); background: var(--panel);
  border: 1px solid var(--edge); border-radius: var(--r);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--shadow);
}
.card::before { left: 14%; right: 14%; opacity: .7; }
.card-head h3 { font-size: 16px; font-weight: 650; letter-spacing: -.005em; }
.card-head .sub { color: var(--t3); }
.note { color: var(--t3); }
.note b { color: var(--t2); font-weight: 650; }
.empty { color: var(--t3); }

/* Kennzahlen */
.kpi .lab { font-size: 11.5px; letter-spacing: .12em; color: var(--t2); }
.kpi .val { font-size: 32px; font-weight: 600; line-height: 1.15; margin-top: 6px; color: var(--t1); }
.kpi .val small { font-size: 15px; font-weight: 600; color: var(--t3); -webkit-text-fill-color: #8d97b3; margin-left: 4px; }
.kpi .note2 { color: var(--t3); }
.kpi .note2 b { color: var(--t2); font-weight: 650; }
.kpi.warn .val { color: #fbbf24; text-shadow: 0 0 22px rgba(251,191,36,.3); }

/* Geraete-Kacheln */
.tile {
  border-radius: var(--r); border: 1px solid var(--edge);
  background: rgba(255,255,255,.045); background: var(--panel);
  box-shadow: inset 0 1px 0 var(--edge-hi);
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s, background-color .2s;
}
.tile:active { background: var(--glass-3); transform: scale(.98); }
.tile .sub, .tile .watt { color: var(--t3); }
.tile .state { color: var(--t2); }
.knob { background: rgba(255,255,255,.08); border: 1px solid var(--edge); }
.knob:after { background: #8d97b3; }
.tile.on .knob:after { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.tile.light.on {
  background: rgba(251,191,36,.12);
  background: linear-gradient(160deg, rgba(251,191,36,.2), rgba(251,191,36,.05) 70%);
  border-color: rgba(251,191,36,.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 30px -10px rgba(251,191,36,.6);
}
.tile.light.on .knob { background: #fbbf24; background: linear-gradient(90deg, #f59e0b, #fbbf24); border-color: rgba(251,191,36,.9); box-shadow: 0 0 12px rgba(251,191,36,.55); }
.tile.light.on .state { color: #fcd34d; }
.tile.plug.on {
  background: rgba(52,211,153,.1);
  background: linear-gradient(160deg, rgba(52,211,153,.18), rgba(52,211,153,.04) 70%);
  border-color: rgba(52,211,153,.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 30px -10px rgba(52,211,153,.55);
}
.tile.plug.on .knob { background: #34d399; background: linear-gradient(90deg, #10b981, #34d399); border-color: rgba(52,211,153,.9); box-shadow: 0 0 12px rgba(52,211,153,.5); }
.tile.plug.on .state { color: #6ee7b7; }
.tile.plug.on .watt { color: #a7f3d0; }
.tile .tico { background: rgba(255,255,255,.08); border: 1px solid var(--edge); color: #a3aec6; }
.tile.pc.on {
  background: rgba(96,165,250,.12);
  background: linear-gradient(160deg, rgba(96,165,250,.2), rgba(96,165,250,.05) 70%);
  border-color: rgba(96,165,250,.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 30px -10px rgba(96,165,250,.6);
}
.tile.pc.on .tico { background: #60a5fa; background: linear-gradient(140deg, #3b82f6, #60a5fa); border-color: rgba(147,197,253,.9);
                    color: #061a33; box-shadow: 0 0 12px rgba(96,165,250,.55); }
.tile.pc.on .state { color: #93c5fd; }
.tile.dead { opacity: .5; }

/* Knoepfe (wie .h-btn) */
.btn {
  border-radius: 14px; border: 1px solid var(--edge); background: var(--glass-2); color: var(--t1);
  font-weight: 600; box-shadow: inset 0 1px 0 var(--edge-hi);
  transition: transform .18s var(--ease), background-color .18s, border-color .18s, box-shadow .18s, opacity .18s;
}
.btn:active { opacity: .85; transform: scale(.98); }
.btn:disabled { opacity: .4; transform: none; }
.btn.sm { border-radius: 11px; }
.btn.lg { border-radius: 16px; }
.btn.primary { background: rgba(34,211,238,.13); border-color: rgba(34,211,238,.45); color: #a5f3fc; }
.btn.good { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.42); color: #a7f3d0; }
.btn.bad { background: rgba(251,113,133,.11); border-color: rgba(251,113,133,.42); color: #fecdd3; }
.btn.violet { background: rgba(167,139,250,.14); border-color: rgba(167,139,250,.48); color: #ddd6fe; box-shadow: inset 0 1px 0 var(--edge-hi), 0 8px 26px -14px rgba(167,139,250,.7); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.solid {
  background: #22d3ee; background: linear-gradient(120deg, #5eead4 0%, #22d3ee 45%, #a78bfa 100%);
  border-color: transparent; color: #05070d; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 28px -12px rgba(34,211,238,.6);
}
.btn .ico { display: inline-block; flex: 0 0 auto; margin-right: 8px; }

/* Chips, Tags */
.chip { min-height: 34px; padding: 5px 13px; background: var(--glass-2); border: 1px solid var(--edge); color: var(--t2); font-weight: 600;
  transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s; }
.chip.active { background: rgba(94,234,212,.13); border-color: rgba(94,234,212,.5); color: #ccfbf1; box-shadow: 0 0 18px -6px rgba(94,234,212,.6); }
/* "Fortsetzen" (Bewegungserkennung) ist eine Aktion, keine Auswahl: Umriss in Akzentfarbe statt "gewaehlt"-Fuellung */
.chip.resume { background: transparent; border-color: rgba(94,234,212,.38); color: #99f6e4; box-shadow: none; }
.tag { background: var(--glass-2); border: 1px solid var(--edge); }
.tag.live { border-color: rgba(52,211,153,.55); color: #a7f3d0; box-shadow: 0 0 16px -6px rgba(52,211,153,.6); }
.tag button { color: var(--t3); }
.tag button:active { color: #fb7185; background: rgba(251,113,133,.12); }

/* Formulare */
.field label, .lsheet .ltitle { color: var(--t2); letter-spacing: .1em; font-size: 11.5px; }
.input, .select {
  border: 1px solid var(--edge-2); border-radius: 12px; color: var(--t1);
  background: rgba(3,6,14,.55);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
  transition: border-color .16s, box-shadow .16s, background-color .16s;
}
.input::-webkit-input-placeholder { color: #7b85a1; }
.input::placeholder { color: #7b85a1; }
.input:focus, .select:focus {
  outline: none; border-color: rgba(94,234,212,.7); background: rgba(3,6,14,.7);
  box-shadow: 0 0 0 3px rgba(94,234,212,.16), 0 0 22px -6px rgba(94,234,212,.55);
}
.check { color: var(--t2); }
.check input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; position: relative; flex: 0 0 auto;
  width: 22px; height: 22px; margin: 0 11px 0 0; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--edge-2); background: rgba(3,6,14,.55);
  transition: background-color .16s, border-color .16s, box-shadow .16s;
}
.check input[type="checkbox"]:checked {
  border-color: transparent; background: #22d3ee; background: linear-gradient(135deg, #5eead4, #a78bfa);
  box-shadow: 0 0 14px -2px rgba(94,234,212,.6);
}
.check input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid #05070d; border-width: 0 2.4px 2.4px 0;
  transform: rotate(45deg);
}
.form-error { color: #fda4af; }
.form-ok { color: #a7f3d0; }
.banner { position: relative; border-radius: 14px; padding: 11px 14px; }
.banner.warn { background: rgba(251,191,36,.09); border: 1px solid rgba(251,191,36,.36); color: #fde68a; }
.banner.bad { background: rgba(251,113,133,.09); border: 1px solid rgba(251,113,133,.38); color: #fecdd3; }
.banner.info { background: rgba(94,234,212,.08); border: 1px solid rgba(94,234,212,.32); color: #ccfbf1; }

/* Regler */
.range::-webkit-slider-runnable-track { background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px var(--edge); }
.range::-moz-range-track { background: rgba(255,255,255,.1); }
.range::-webkit-slider-thumb { box-shadow: 0 2px 10px rgba(0,0,0,.55), 0 0 0 4px rgba(255,255,255,.12), 0 0 18px rgba(94,234,212,.35); }
.range.bri::-webkit-slider-runnable-track { background: linear-gradient(90deg, #3b3322, #fbbf24); }
.range.bri::-moz-range-track { background: linear-gradient(90deg, #3b3322, #fbbf24); }
.range.ct::-webkit-slider-runnable-track { background: linear-gradient(90deg, #ff9f43, #fff3dc, #cfe3ff); }
.range.ct::-moz-range-track { background: linear-gradient(90deg, #ff9f43, #fff3dc, #cfe3ff); }
.lcolor.active { border-color: #fff; box-shadow: 0 0 0 3px rgba(94,234,212,.7), 0 0 18px rgba(94,234,212,.5); }

/* Listen, Punkte */
.rows > .r { border-top-color: var(--line-soft); }
.fp-palette .chip .kind { display: inline-flex; color: var(--t3); }   /* Grundriss-Editor: Lampe/Steckdose */
.fp-palette .chip.active .kind { color: #99f6e4; }
.rows > .r > svg:first-child { position: relative; top: -1px; flex: 0 0 auto; margin-right: 10px; color: var(--t3); }   /* Einkauf: Symbol statt Emoji (optisch 1 px hoeher: Raeder) */
.rows .r .k { color: var(--t3); }
.dot { background: #64708c; }
.dot.on { background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,.7); }
.dot.warn { background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,.7); }
.dot.bad { background: #fb7185; box-shadow: 0 0 8px rgba(251,113,133,.75); }
.svc, .hist-row, .room-rows .room-row { border-top-color: var(--line-soft); }
.svc .desc, .hist-row .t, .room-row .rinfo, .audit .r .when, .audit .r .who { color: var(--t3); }
.room-row .rinfo.lit { color: #fcd34d; }
.audit .r.bad .ev { color: #fda4af; }
.audit .r.good .ev { color: #a7f3d0; }
.audit .r > div { flex: 1 1 auto; min-width: 0; }
.audit .r .who { flex: 0 1 auto; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }   /* lange IPs/Geraetenamen brechen statt zu ueberlaufen */
.guest { border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 var(--edge-hi); }
.guest .gh .kind { border-color: var(--edge-2); border-radius: 6px; color: var(--t2); }
.guest .gh .id, .guest .gs { color: var(--t3); }

/* Grundriss: Glasbuehne mit feinem Blaupausen-Raster; Raum- und Geraetefarben bleiben */
.fp-stage {
  background-color: rgba(6,10,20,.55);
  background-image: linear-gradient(rgba(94,234,212,.035) 1px, rgba(94,234,212,0) 1px),
    linear-gradient(90deg, rgba(94,234,212,.035) 1px, rgba(94,234,212,0) 1px);
  background-size: 28px 28px;
  border: 1px solid var(--edge); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--shadow);
}
.fp-stage.editing { border-color: rgba(167,139,250,.6); box-shadow: 0 0 0 1px rgba(167,139,250,.25), 0 0 40px -12px rgba(167,139,250,.55); }
.fp-room-label, .fp-dev .lbl, .fp-dev .val { stroke: #070b16; }
.fp-room-label { fill: #c3cbe0; }
.fp-dev .bg { fill: #141b2c; stroke: #34405a; }
.fp-dev .ic { stroke: #a3aec6; }
.fp-dev .lbl { fill: var(--t2); }
.fp-dev .val { fill: var(--t3); }
.fp-toolbar .sep { background: var(--edge-2); }
.room-open:active .rname { color: #5eead4; }
.fp-below > h2:first-child { margin-top: 28px; }

/* Diagramme: Farben bleiben, Rahmen werden Glas */
.chart-tip {
  background: rgba(10,14,26,.94); border: 1px solid var(--edge-2); border-radius: 12px;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.9);
}
.chart-tip .tt { color: var(--t3); }
.legend .li { background: var(--glass-2); border-color: var(--edge); color: var(--t2); }
.price { color: var(--t3); }
table.data th { color: var(--t3); letter-spacing: .1em; }
table.data td { border-top-color: var(--line-soft); }
table.data tfoot td { border-top-color: var(--edge-2); }
.bar { background: rgba(255,255,255,.08); }
.bar i { background: #22d3ee; background: linear-gradient(90deg, #5eead4, #a78bfa); }
.bar i.c0 { background: #4da3ff; } .bar i.c1 { background: #34d399; } .bar i.c2 { background: #fbbf24; } .bar i.c3 { background: #a78bfa; }
.bar i.c4 { background: #f472b6; } .bar i.c5 { background: #22d3ee; } .bar i.c6 { background: #fb923c; }
.bar i.warn { background: #fbbf24; } .bar i.bad { background: #fb7185; }

/* Kameras */
.cam-media { border-radius: 14px; box-shadow: inset 0 0 0 1px var(--edge); }
.cam-tag {
  background: rgba(5,7,13,.62); border: 1px solid var(--edge); border-radius: 999px; padding: 4px 11px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.clip-layer { background: rgba(2,4,9,.94); }
.clip-layer .close { background: var(--glass-2); border-color: var(--edge-2); color: var(--t1); }

/* Dialoge: Glas ueber abgedunkeltem, weichgezeichnetem Hintergrund; Handy: Blatt von unten */
.dialog-layer {
  background: rgba(2,4,9,.66);
  animation: h-fade .18s ease-out;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .dialog-layer { background: rgba(2,4,9,.5); -webkit-backdrop-filter: blur(8px) saturate(120%); backdrop-filter: blur(8px) saturate(120%); }
}
.dialog {
  position: relative; padding: 22px;
  background: rgba(14,19,34,.95); background: linear-gradient(180deg, rgba(20,27,46,.96), rgba(11,15,28,.96));
  border: 1px solid var(--edge-2); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 40px 90px -30px rgba(0,0,0,.95), 0 0 60px -30px rgba(94,234,212,.35);
  animation: h-pop .26s var(--ease);
}
.dialog::before {
  content: ""; position: absolute; top: -1px; left: 14%; right: 14%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(94,234,212,0), rgba(94,234,212,.6), rgba(167,139,250,.6), rgba(167,139,250,0));
}
.dialog h3 { font-size: 19px; font-weight: 650; letter-spacing: -.005em; }
.dialog h3 .dsub, .dialog .note { color: var(--t3); }
.dialog .dtext { color: var(--t2); }

/* Meldung unten: Glas, farbige Kante; versteckt wirklich unsichtbar */
.toast {
  display: flex; align-items: center; justify-content: center;
  width: -webkit-max-content; width: max-content; max-width: 92%; padding: 12px 20px 12px 16px; border-radius: 999px;
  background: rgba(14,19,34,.95); border: 1px solid var(--edge-2); color: var(--t1); font-weight: 600;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.9);
  opacity: 0; visibility: hidden;
  transform: translate(-50%, 18px);
  transition: opacity .22s, transform .3s var(--ease), visibility 0s linear .3s;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .toast { background: rgba(14,19,34,.72); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); }
}
.toast::before {
  content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%;
  background: #5eead4; box-shadow: 0 0 8px rgba(94,234,212,.9);
}
.toast.show {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
  transition: opacity .2s, transform .3s var(--ease), visibility 0s;
}
.toast.ok { border-color: rgba(52,211,153,.5); color: #a7f3d0; box-shadow: 0 18px 40px -16px rgba(0,0,0,.9), 0 0 26px -8px rgba(52,211,153,.5); }
.toast.ok::before { background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,.9); }
.toast.err { border-color: rgba(251,113,133,.55); color: #fecdd3; box-shadow: 0 18px 40px -16px rgba(0,0,0,.9), 0 0 26px -8px rgba(251,113,133,.5); }
.toast.err::before { background: #fb7185; box-shadow: 0 0 8px rgba(251,113,133,.9); }

/* ============================================ 7. Anmeldung + Start ======= */
.login-wrap { position: relative; overflow: hidden; padding: 24px 16px; }
.login-wrap::before {          /* Lichthof hinter der Karte */
  content: ""; position: absolute; left: 50%; top: 50%; width: 640px; height: 640px; margin: -320px 0 0 -320px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(94,234,212,.13), rgba(167,139,250,.07) 55%, rgba(167,139,250,0));
}
.login.card {
  max-width: 410px; padding: 34px 30px 24px; border-radius: 28px;
  background: rgba(14,19,34,.9);
  background: linear-gradient(180deg, rgba(24,31,52,.66), rgba(10,14,26,.6));
  border-color: var(--edge-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 40px 100px -30px rgba(0,0,0,.9), 0 0 90px -40px rgba(94,234,212,.45);
}
.login.card { -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); }
.login.card::before { left: 18%; right: 18%; opacity: 1; }
.login-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.login-head .brand-mark { width: 64px; height: 64px; margin-bottom: 18px; box-shadow: 0 0 26px rgba(94,234,212,.45), 0 0 60px rgba(167,139,250,.3); }
.login-title { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--t1); }
.login-sub { margin: 6px 0 0; font-size: 14px; color: var(--t3); }
.ifield { position: relative; }
.ifield > svg { position: absolute; left: 14px; top: 50%; margin-top: -9px; width: 18px; height: 18px; color: var(--t3); pointer-events: none;
  transition: color .16s; }
.ifield > .input { padding-left: 44px; }
.ifield > .input:focus + svg { color: #5eead4; }
.login .check { margin: 4px 0 18px; }
.login .btn.solid { width: 100%; margin: 6px 0 0; }
.login .btn.solid svg { width: 20px; height: 20px; margin-left: 10px; }
.login-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 12.5px; line-height: 1.5; color: var(--t3); text-align: center; }
.login-foot svg { display: inline-block; width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; color: var(--t3); }

/* Startbildschirm beim Laden: pulsierende Brand-Mark */
.boot { color: var(--t2); }
.boot-mark { position: relative; width: 76px; height: 76px; margin-bottom: 26px; }
.boot-mark .brand-mark {
  width: 76px; height: 76px;
  box-shadow: 0 0 30px rgba(94,234,212,.45), 0 0 70px rgba(167,139,250,.3);
  animation: h-breathe 2.6s ease-in-out infinite;
}
.boot-mark::after {             /* Funkwelle */
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%;
  border: 1px solid rgba(94,234,212,.6); opacity: 0;
  animation: h-wave 2.6s var(--ease) infinite;
}
#boot-msg { font-size: 15px; letter-spacing: .01em; }
.boot-error { color: #fda4af; }

/* ==================================== 8. Altes Startmenue (Uebergang) ===== */
.menu { max-width: 1040px; margin-top: 6vh; }
.menu-tile {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  background: var(--glass); background: var(--panel);
  border: 1px solid var(--edge); box-shadow: inset 0 1px 0 var(--edge-hi), var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.menu-tile::before {
  content: ""; position: absolute; top: -1px; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, rgba(94,234,212,0), rgba(94,234,212,.5), rgba(167,139,250,.5), rgba(167,139,250,0));
}
.menu-tile .icon {
  position: relative; width: 58px; height: 58px; margin-bottom: 24px; border-radius: 17px; font-size: 0; overflow: hidden;
  background: linear-gradient(140deg, #22d3ee, #0e7490); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 28px -10px rgba(34,211,238,.7);
}
.menu-tile .icon::after {
  content: ""; position: absolute; top: 14px; left: 14px; width: 30px; height: 30px; background-color: #fff;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: contain; mask-size: contain;
}
.menu-tile .label { font-size: 25px; font-weight: 650; }
.menu-tile .desc { color: var(--t3); }
.menu-tile.automation, .menu-tile.admin, .menu-tile.claude, .menu-tile.monitor { border-color: var(--edge); }
.menu-tile.admin .icon { background: linear-gradient(140deg, #a78bfa, #6d28d9); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 28px -10px rgba(167,139,250,.75); }
.menu-tile.claude .icon { background: linear-gradient(140deg, #ff8f6b, #c2410c); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 28px -10px rgba(255,143,107,.7); }
.menu-tile.monitor .icon { background: linear-gradient(140deg, #60a5fa, #1d4ed8); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 28px -10px rgba(96,165,250,.7); }
.menu-status { color: var(--t3); }
.menu-status b { color: var(--t1); }

/* ============================================ 9. Emoji -> SVG-Masken ====== */
/* Die bestehenden Ansichten setzen noch Emoji in .ico-Felder (bzw. ein Zeichen vor die
   Leistungsanzeige). Gezielt ersetzt durch dieselben Liniensymbole wie in icons.js -
   das Zeichen selbst wird ausgeblendet (font-size 0), das Symbol als Maske in currentColor. */
.pill.power::before,
.btn[data-act] .ico, .btn[data-fp] .ico, .btn[data-scene] .ico {
  content: ""; display: inline-block; flex: 0 0 auto; width: 18px; height: 18px;
  font-size: 0; overflow: hidden; vertical-align: middle; background-color: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.pill.power::before { width: 16px; height: 16px; margin-right: 6px; background-color: #fbbf24; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12.9 6.4 8.6 12.7h3.3l-.8 4.9 4.3-6.3h-3.3z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12.9 6.4 8.6 12.7h3.3l-.8 4.9 4.3-6.3h-3.3z'/%3E%3C/svg%3E"); }
.btn[data-act="all-off"] .ico, .btn[data-fp="all-off"] .ico { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.6A8.5 8.5 0 1 1 9.4 4a7.4 7.4 0 0 0 10.6 10.6z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.6A8.5 8.5 0 1 1 9.4 4a7.4 7.4 0 0 0 10.6 10.6z'/%3E%3C/svg%3E"); }
.btn[data-act="all-on"] .ico { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6.2 6.2 0 0 0-3.9 11c.7.6 1.1 1.4 1.1 2.3v.2h5.6v-.2c0-.9.4-1.7 1.1-2.3A6.2 6.2 0 0 0 12 3z'/%3E%3Cpath d='M9.3 19h5.4M10.3 21.5h3.4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6.2 6.2 0 0 0-3.9 11c.7.6 1.1 1.4 1.1 2.3v.2h5.6v-.2c0-.9.4-1.7 1.1-2.3A6.2 6.2 0 0 0 12 3z'/%3E%3Cpath d='M9.3 19h5.4M10.3 21.5h3.4'/%3E%3C/svg%3E"); }
.btn[data-fp="edit"] .ico { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.5 4.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4z'/%3E%3Cpath d='m13.5 6.5 3 3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.5 4.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4z'/%3E%3Cpath d='m13.5 6.5 3 3'/%3E%3C/svg%3E"); }
.btn[data-tool="select"] .ico { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 3.5 18.5 10l-5.8 1.8-2.2 5.7z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 3.5 18.5 10l-5.8 1.8-2.2 5.7z'/%3E%3C/svg%3E"); }
.btn[data-tool="rect"] .ico { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='4.5' width='15' height='15' rx='2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='4.5' width='15' height='15' rx='2'/%3E%3C/svg%3E"); }
.btn[data-tool="poly"] .ico { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5l8.5 6.2-3.2 10H6.7L3.5 9.7z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5l8.5 6.2-3.2 10H6.7L3.5 9.7z'/%3E%3C/svg%3E"); }
.btn[data-scene] .ico { width: 20px; height: 20px; margin-right: 10px; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.5 3.5c.6 3.6 2.4 5.4 6 6-3.6.6-5.4 2.4-6 6-.6-3.6-2.4-5.4-6-6 3.6-.6 5.4-2.4 6-6z'/%3E%3Cpath d='M18.5 14.5c.3 1.6 1 2.3 2.5 2.5-1.5.3-2.2 1-2.5 2.5-.3-1.5-1-2.2-2.5-2.5 1.5-.2 2.2-.9 2.5-2.5z'/%3E%3Cpath d='M18.5 3.5v3M17 5h3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.5 3.5c.6 3.6 2.4 5.4 6 6-3.6.6-5.4 2.4-6 6-.6-3.6-2.4-5.4-6-6 3.6-.6 5.4-2.4 6-6z'/%3E%3Cpath d='M18.5 14.5c.3 1.6 1 2.3 2.5 2.5-1.5.3-2.2 1-2.5 2.5-.3-1.5-1-2.2-2.5-2.5 1.5-.2 2.2-.9 2.5-2.5z'/%3E%3Cpath d='M18.5 3.5v3M17 5h3'/%3E%3C/svg%3E"); }
.btn[data-scene="party"] .ico { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20.5 8.2 8.7l7.1 7.1z'/%3E%3Cpath d='M6.4 13.8 10 17.4'/%3E%3Cpath d='M12.3 8.2c.2-1.8 1.2-3.1 2.9-3.7M15.8 11.7c1.8-.2 3.1-1.2 3.7-2.9'/%3E%3Ccircle cx='11' cy='3.8' r='1' fill='%23000' stroke='none'/%3E%3Ccircle cx='19.6' cy='4.6' r='1' fill='%23000' stroke='none'/%3E%3Ccircle cx='20.3' cy='13.2' r='1' fill='%23000' stroke='none'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20.5 8.2 8.7l7.1 7.1z'/%3E%3Cpath d='M6.4 13.8 10 17.4'/%3E%3Cpath d='M12.3 8.2c.2-1.8 1.2-3.1 2.9-3.7M15.8 11.7c1.8-.2 3.1-1.2 3.7-2.9'/%3E%3Ccircle cx='11' cy='3.8' r='1' fill='%23000' stroke='none'/%3E%3Ccircle cx='19.6' cy='4.6' r='1' fill='%23000' stroke='none'/%3E%3Ccircle cx='20.3' cy='13.2' r='1' fill='%23000' stroke='none'/%3E%3C/svg%3E"); }
.menu-tile.automation .icon::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.2 2.8 5.2 13.4h6.1l-.9 7.8 8.4-11.1h-6.2z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.2 2.8 5.2 13.4h6.1l-.9 7.8 8.4-11.1h-6.2z'/%3E%3C/svg%3E"); }
.menu-tile.admin .icon::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.92 5.21 10.17 2.58A9.6 9.6 0 0 1 13.83 2.58L14.08 5.21A7.1 7.1 0 0 1 15.33 5.73L17.37 4.04A9.6 9.6 0 0 1 19.96 6.63L18.27 8.67A7.1 7.1 0 0 1 18.79 9.92L21.42 10.17A9.6 9.6 0 0 1 21.42 13.83L18.79 14.08A7.1 7.1 0 0 1 18.27 15.33L19.96 17.37A9.6 9.6 0 0 1 17.37 19.96L15.33 18.27A7.1 7.1 0 0 1 14.08 18.79L13.83 21.42A9.6 9.6 0 0 1 10.17 21.42L9.92 18.79A7.1 7.1 0 0 1 8.67 18.27L6.63 19.96A9.6 9.6 0 0 1 4.04 17.37L5.73 15.33A7.1 7.1 0 0 1 5.21 14.08L2.58 13.83A9.6 9.6 0 0 1 2.58 10.17L5.21 9.92A7.1 7.1 0 0 1 5.73 8.67L4.04 6.63A9.6 9.6 0 0 1 6.63 4.04L8.67 5.73A7.1 7.1 0 0 1 9.92 5.21z'/%3E%3Ccircle cx='12' cy='12' r='2.9'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.92 5.21 10.17 2.58A9.6 9.6 0 0 1 13.83 2.58L14.08 5.21A7.1 7.1 0 0 1 15.33 5.73L17.37 4.04A9.6 9.6 0 0 1 19.96 6.63L18.27 8.67A7.1 7.1 0 0 1 18.79 9.92L21.42 10.17A9.6 9.6 0 0 1 21.42 13.83L18.79 14.08A7.1 7.1 0 0 1 18.27 15.33L19.96 17.37A9.6 9.6 0 0 1 17.37 19.96L15.33 18.27A7.1 7.1 0 0 1 14.08 18.79L13.83 21.42A9.6 9.6 0 0 1 10.17 21.42L9.92 18.79A7.1 7.1 0 0 1 8.67 18.27L6.63 19.96A9.6 9.6 0 0 1 4.04 17.37L5.73 15.33A7.1 7.1 0 0 1 5.21 14.08L2.58 13.83A9.6 9.6 0 0 1 2.58 10.17L5.21 9.92A7.1 7.1 0 0 1 5.73 8.67L4.04 6.63A9.6 9.6 0 0 1 6.63 4.04L8.67 5.73A7.1 7.1 0 0 1 9.92 5.21z'/%3E%3Ccircle cx='12' cy='12' r='2.9'/%3E%3C/svg%3E"); }
.menu-tile.claude .icon::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9.8V2.5M12 14.2v7.3M14.2 12h6.4M9.8 12H3.4M13.56 10.44l3.81-3.81M10.44 13.56l-3.81 3.81M13.56 13.56l3.39 3.39M10.44 10.44 7.05 7.05'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9.8V2.5M12 14.2v7.3M14.2 12h6.4M9.8 12H3.4M13.56 10.44l3.81-3.81M10.44 13.56l-3.81 3.81M13.56 13.56l3.39 3.39M10.44 10.44 7.05 7.05'/%3E%3C/svg%3E"); }
.menu-tile.monitor .icon::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='4' width='19' height='13.5' rx='2.5'/%3E%3Cpath d='M6 11h2.6l1.6-3 2.6 6 1.6-3H18'/%3E%3Cpath d='M9 20.5h6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='4' width='19' height='13.5' rx='2.5'/%3E%3Cpath d='M6 11h2.6l1.6-3 2.6 6 1.6-3H18'/%3E%3Cpath d='M9 20.5h6'/%3E%3C/svg%3E"); }

/* =============================================== 10. Responsiv ========== */
@media (hover: hover) {
  .mn:hover { color: var(--t1); background: rgba(255,255,255,.05); }
  .mn.active:hover { color: #fff; background: var(--glass-3); }
  .tab:hover { color: var(--t1); background: var(--glass); }
  .tab.active:hover { background: var(--glass-3); }
  .icon-btn:hover, .topbar .back:hover { color: var(--t1); background: var(--glass-3); border-color: var(--edge-2); }
  .h-link:hover { color: var(--t1); background: var(--glass-2); }
  .h-btn:hover { background-color: var(--glass-3); border-color: var(--edge-2); transform: translateY(-2px);
    box-shadow: inset 0 1px 0 var(--edge-hi), 0 12px 28px -14px rgba(94,234,212,.55); }
  .h-btn.primary:hover { background: linear-gradient(120deg, #7ff0dc 0%, #3ddcf2 45%, #b9a2fb 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 14px 32px -12px rgba(34,211,238,.75); }
  .h-btn.danger:hover { background: rgba(251,113,133,.2); border-color: rgba(251,113,133,.6); }
  .h-btn:disabled:hover, .h-btn.disabled:hover { transform: none; box-shadow: inset 0 1px 0 var(--edge-hi); }
  a.h-panel:hover, button.h-panel:hover, a.h-app:hover {
    transform: translateY(-2px); border-color: var(--edge-2);
    box-shadow: inset 0 1px 0 var(--edge-hi), 0 18px 40px -20px rgba(0,0,0,.9), 0 0 30px -12px rgba(94,234,212,.45);
  }
  .tile:hover { border-color: var(--edge-2); transform: translateY(-2px); }
  .btn:hover:not(:disabled) { border-color: var(--edge-2); background-color: var(--glass-3); transform: translateY(-1px); }
  .btn.solid:hover:not(:disabled) { background: linear-gradient(120deg, #7ff0dc 0%, #3ddcf2 45%, #b9a2fb 100%); }
  .btn.primary:hover:not(:disabled) { background-color: rgba(34,211,238,.2); border-color: rgba(34,211,238,.6); }
  .btn.good:hover:not(:disabled) { background-color: rgba(52,211,153,.2); border-color: rgba(52,211,153,.6); }
  .btn.bad:hover:not(:disabled) { background-color: rgba(251,113,133,.18); border-color: rgba(251,113,133,.6); }
  .btn.violet:hover:not(:disabled) { background-color: rgba(167,139,250,.22); border-color: rgba(167,139,250,.65); }
  .chip:hover:not(:disabled) { color: var(--t1); border-color: var(--edge-2); }
  .menu-tile:hover { transform: translateY(-3px); border-color: var(--edge-2);
    box-shadow: inset 0 1px 0 var(--edge-hi), 0 24px 50px -24px rgba(0,0,0,.9), 0 0 36px -14px rgba(94,234,212,.4); }
}

/* Desktop und Tablet: Hauptnavigation oben, keine Zurueck-Taste, kein Titel */
@media (min-width: 700px) {
  .topbar .back, .topbar .titles { display: none; }
  .topbar .right { flex: 0 0 auto; margin-left: 12px; }
  .mainnav {
    display: flex; align-items: center; flex: 0 0 auto; margin: 0 auto; padding: 4px; border-radius: 999px;
    background: rgba(255,255,255,.035); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 var(--edge-hi);
  }
  .pill.power:not([hidden]) { display: inline-flex; }
  .pill.conn .txt { display: inline; }
}
/* Ab 1100 px exakt mittig, unabhaengig von der Breite links/rechts */
@media (min-width: 1100px) {
  .mainnav { position: absolute; left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%); }
  .topbar .right { margin-left: auto; }
  .topbar .mainnav { top: 50%; top: calc(50% + env(safe-area-inset-top) / 2); }
}
/* Grosse Bildschirme: Kopfzeile und Tabs an der Inhaltskante ausrichten */
@media (min-width: 1360px) {
  .topbar, .tabs { padding-left: calc(50% - 656px); padding-right: calc(50% - 656px); }
}
/* Tablets: Menueknopf + sechs Bereiche + Pills muessen in eine Zeile passen (gemessen 700-1099 px; "Infrastruktur"
   heisst hier "Infra", siehe unten) */
@media (min-width: 700px) and (max-width: 1099.98px) {
  .mn { padding: 0 12px 0 10px; }
  .mn svg { margin-right: 6px; }
  .pill.conn { width: 34px; padding: 0; justify-content: center; }
  .pill.conn .txt { display: none; }
  .pill.conn .dot { margin-right: 0; }
}
@media (min-width: 700px) and (max-width: 1099.98px) {
  .topbar .brand-name { display: none; }
}
@media (min-width: 700px) and (max-width: 939.98px) {
  .topbar { padding-left: 16px; padding-right: 16px; }
}
@media (min-width: 700px) and (max-width: 999.98px) {
  .topbar .pill.power { display: none; }      /* Leistung steht auch auf der Startseite */
}
@media (min-width: 700px) and (max-width: 899.98px) {
  .mn { padding: 0 11px; }
  .mn svg { display: none; }                   /* nur Text: die sechs Bereiche bleiben lesbar */
}
@media (min-width: 700px) and (max-width: 789.98px) {
  .mn { padding: 0 8px; font-size: 13.5px; }   /* iPad hochkant und schmaler: sechs Bereiche + Knoepfe in einer Zeile */
}
/* 700-759 px: etwas enger, damit auch die Admin-Pille (entsperrt, nur mit Admin-Passwort) noch in die Zeile passt */
@media (min-width: 700px) and (max-width: 759.98px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar .right { margin-left: 8px; }
  .mn { padding: 0 7px; }
}
/* Admin-Pill (Freigabe laeuft - nur mit Admin-Passwort, settings.SUDO_REQUIRED) unter 1300 px nur als Symbol, der
   Titel nennt die Funktion; ab 1400 px zeigt die Verbindung neben ihr nur ihren Punkt (darunter ohnehin). So passen
   sechs Bereiche in die Mitte (gemessen 700-1920 px, Szenarien nav-admin-* in harness/shots.js) */
@media (max-width: 1299.98px) {
  .pill.admin { width: 34px; padding: 0; justify-content: center; }
  .pill.admin > span { display: none; }
  .pill.admin > svg { margin-right: 0; }
}
@media (min-width: 1400px) {
  .pill.admin:not([hidden]) ~ .pill.conn { width: 34px; padding: 0; justify-content: center; }
  .pill.admin:not([hidden]) ~ .pill.conn .txt { display: none; }
  .pill.admin:not([hidden]) ~ .pill.conn .dot { margin-right: 0; }
}
/* Raster der Startseite: Tablet 6 Spalten (.h-t-N), Handy 1 Spalte */
@media (max-width: 1099.98px) {
  .h-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .h-grid > [class*="h-span-"] { grid-column: span 6; }
  .h-grid > .h-t-1 { grid-column: span 1; } .h-grid > .h-t-2 { grid-column: span 2; } .h-grid > .h-t-3 { grid-column: span 3; }
  .h-grid > .h-t-4 { grid-column: span 4; } .h-grid > .h-t-5 { grid-column: span 5; } .h-grid > .h-t-6 { grid-column: span 6; }
}

/* Handy */
@media (max-width: 699.98px) {
  :root { --topbar-h: 56px; }
  .topbar { height: 56px; height: calc(56px + env(safe-area-inset-top)); padding: 0 12px; padding-top: env(safe-area-inset-top); }
  .topbar .brand { margin-right: 11px; padding-right: 0; }
  .topbar .brand-name { display: none; }
  .topbar .back:not([hidden]) + .brand { display: none; }
  .topbar h1 { font-size: 17px; }
  .topbar .right { margin-left: 8px; }
  .pill.conn { width: 36px; padding: 0; justify-content: center; }
  .pill.conn .dot { margin-right: 0; }
  .tabs {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding: 8px 12px;
    -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0, #000 14px, #000 88%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0, #000 14px, #000 88%, rgba(0,0,0,0) 100%);
  }
  .tab { height: 40px; padding: 0 14px; font-size: 14px; }
  .tab:last-child { margin-right: 24px; }
  .tab.active::after { bottom: -5px; }
  .page { padding: 14px 14px 96px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .page h2 { margin-top: 24px; }
  .bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; align-items: stretch;
    padding: 6px 8px 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--edge);
    box-shadow: 0 -14px 34px -22px rgba(0,0,0,.95);
  }
  .bn { flex: 1 1 auto; padding-left: 1px; padding-right: 1px; }   /* sechs Ziele: Breite nach Inhalt, Rest gleich verteilt */
  .bottomnav::before {
    content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; pointer-events: none;
    background: linear-gradient(90deg, rgba(94,234,212,0) 5%, rgba(94,234,212,.3) 35%, rgba(167,139,250,.3) 65%, rgba(167,139,250,0) 95%);
  }
  .toast { bottom: 88px; bottom: calc(88px + env(safe-area-inset-bottom)); }
  .space .a1 { width: 150vw; height: 100vw; top: -66vw; left: -58vw; }
  .space .a2 { width: 140vw; height: 96vw; top: -62vw; right: -64vw; }
  .space .a3 { width: 160vw; height: 90vw; bottom: -52vw; left: -10vw; }
  .h-panel { padding: 16px; border-radius: 20px; }
  .h-grid { grid-template-columns: minmax(0, 1fr); grid-gap: 14px; gap: 14px; }
  .h-grid > [class*="h-span-"], .h-grid > [class*="h-t-"] { grid-column: auto; }
  .card { padding: 16px; }
  .fp-stage { border-radius: 0; border-left: 0; border-right: 0; }   /* Grundriss randlos (wie app.css) */
  .kpi .val { font-size: 26px; }
  .login.card { padding: 28px 20px 20px; border-radius: 24px; }
  .login-title { font-size: 30px; }
  .menu { margin-top: 2vh; }
  /* Alle Dialoge als Blatt von unten (Daumenreichweite) */
  .dialog-layer { align-items: flex-end; padding: 0; }
  .dialog {
    max-width: none; max-height: 88vh; border-radius: 24px 24px 0 0; border-bottom: 0;
    padding: 22px 18px 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom));
    animation: h-sheet .3s var(--ease);
  }
  .dialog .dbtns { margin-right: 0; }
  .dialog .dbtns .btn { flex: 1 1 0; margin-right: 0; }
  .dialog .dbtns .btn + .btn { margin-left: 10px; }
  /* Breite Tabellen (Energie › Gerätedetails): der rechte Rand blendet aus = "hier geht es weiter";
     am Ende der Zeile (Klasse .at-end aus app.js) wieder voll sichtbar */
  .table-wrap {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 88%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 88%, rgba(0,0,0,0) 100%);
  }
  .table-wrap.at-end { -webkit-mask-image: none; mask-image: none; }
}

/* Sehr schmale Handys (320 px): sechs Ziele unten - etwas kleinere Schrift, damit "Steuerung" frei steht;
   oben kein Start-Knopf neben dem Menueknopf (Start ist unten erreichbar) - der Titel braucht den Platz */
@media (max-width: 359.98px) {
  .bottomnav { padding-left: 4px; padding-right: 4px; }
  .bn { padding-left: 0; padding-right: 0; font-size: 10px; letter-spacing: -.01em; }
  .topbar .back { display: none; }
}

/* Bedienziele >= 44 px auf Touch-Geraeten (Handy und Wand-iPad): Knoepfe wachsen; kleine, dicht stehende
   Elemente (Tabs, Legende) bekommen zusaetzlich eine unsichtbare Trefferflaeche statt noch mehr Hoehe */
@media (max-width: 699.98px), (pointer: coarse) {
  .icon-btn, .topbar .back { width: 44px; height: 44px; }
  .btn, .btn.sm, .chip, .h-link { min-height: 44px; }
  .fp-roomnav .chip, .input.date, .price .input { min-height: 44px; }   /* app.css setzt hier 36-38 px */
  .tab { height: 40px; }
  .tab::before { content: ""; position: absolute; top: -2px; bottom: -2px; left: -3px; right: -3px; }
  .mn { height: 44px; }
  .legend .li { position: relative; min-height: 36px; margin: 4px; }
  .legend .li::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: -4px; right: -4px; }
}

/* =============================================== 11. Animationen ======= */
@keyframes h-aurora-1 { 0% { transform: translate3d(0,0,0) rotate(-8deg) scale(1); } 100% { transform: translate3d(16vw,2vh,0) rotate(9deg) scale(1.12); } }
@keyframes h-aurora-2 { 0% { transform: translate3d(0,0,0) rotate(7deg) scale(1.04); } 100% { transform: translate3d(-18vw,3vh,0) rotate(-11deg) scale(.94); } }
@keyframes h-aurora-3 { 0% { transform: translate3d(0,0,0) rotate(0deg) scale(.94); } 100% { transform: translate3d(-14vw,-9vh,0) rotate(12deg) scale(1.12); } }
@keyframes h-meteor {
  0% { opacity: 0; transform: rotate(160deg) translate3d(0,0,0); }
  .5% { opacity: .8; }
  2.4% { opacity: 0; transform: rotate(160deg) translate3d(34vw,0,0); }
  100% { opacity: 0; transform: rotate(160deg) translate3d(34vw,0,0); }
}
@keyframes h-twinkle { 0% { opacity: .15; } 55% { opacity: 1; } 100% { opacity: .35; } }
@keyframes h-floor { 0% { transform: translate3d(0,0,0); } 100% { transform: translate3d(0,56px,0); } }
@keyframes h-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes h-ping { 0% { transform: scale(1); opacity: .55; } 75%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes h-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes h-ring-in { 0% { stroke-dashoffset: 326.7; } }
@keyframes h-fade { 0% { opacity: 0; } }
@keyframes h-pop { 0% { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes h-sheet { 0% { opacity: .3; transform: translateY(60px); } }
@keyframes h-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes h-wave { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.1); opacity: 0; } }

/* Ohne backdrop-filter (alte Browser): Glasflaechen fast deckend, damit Text lesbar bleibt */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .h-panel, .card, .fp-stage, .login.card, .menu-tile { background: var(--glass-solid); }
}

/* ==================================== 12. prefers-reduced-motion ======= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .space .aurora, .space .stars::after, .space .grid-floor::before, .space::after, .brand-mark::before { animation: none !important; }
}

/* ============================================ 13. Raster (SD.grid) ======= */
/* grid.js setzt Lage und Groesse per CSSOM (transform, width, height); der Container ist .g-grid
   (position: relative, Hoehe aus JS). Bearbeitungsmodus .g-edit: Rahmen je Element, Griff .g-resize
   (kompakt bei .g-small), Ziehen mit Platzhalter; Spalten-Hilfslinien nur waehrend gezogen/vergroessert
   wird (.g-active) und in leeren Rastern. Eckenradius der Rahmen/Platzhalter: --g-radius (Standard 24px).
   Fuer Nutzer: .g-handle (Ziehgriff), .g-grip (Symbol aus SD.grid.grip()), .g-inert / [data-g-inert]
   (im Bearbeitungsmodus nicht bedienbar), .g-scroll (Inhalt scrollt im Element, dezenter Balken),
   .g-drop an der Ziel-zone eines anderen Containers (Standard: Leuchtrand, ueberschreibbar). */
.g-grid { position: relative; }
.g-item { position: absolute; top: 0; left: 0; z-index: 1; }
.g-item[hidden] { display: none !important; }
.g-body { position: relative; width: 100%; height: 100%; }
.g-resize, .g-size { display: none; }
.g-live {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.g-scroll {
  overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent;
}
.g-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.g-scroll::-webkit-scrollbar-track { background: transparent; }
.g-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 6px; }
.g-scroll:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.24); }

/* Feine Spaltenstreifen zeigen das Raster - nur waehrend gezogen/vergroessert wird und in leeren Rastern
   (sonst schimmerten sie durch die Glas-Kacheln) */
.g-grid.g-edit.g-active, .g-grid.g-edit.g-empty {
  background-image: linear-gradient(90deg, rgba(94,234,212,.05) 0, rgba(94,234,212,.05) var(--g-colw, 0px), rgba(94,234,212,0) var(--g-colw, 0px));
  background-size: calc(var(--g-colw, 0px) + var(--g-gap, 0px)) 100%;
  background-origin: content-box; background-clip: content-box;
}
/* leeres Raster im Bearbeitungsmodus: eine gestrichelte Zeile als Ablageflaeche */
.g-grid.g-edit.g-empty::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 40px; height: var(--g-rowh, 40px); pointer-events: none;
  border: 1.5px dashed rgba(255,255,255,.16); border-radius: 16px; border-radius: var(--g-radius, 16px);
}
.g-grid.g-edit.g-empty.g-active::before { border-color: rgba(94,234,212,.5); }
.g-grid.g-edit > .g-item {
  cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: transform .22s var(--ease), width .22s var(--ease), height .22s var(--ease);
}
.g-grid.g-edit > .g-item.g-locked { cursor: default; }
.g-grid.g-edit > .g-item a, .g-grid.g-edit > .g-item img { -webkit-user-drag: none; }
.g-grid.g-edit .g-inert, .g-grid.g-edit [data-g-inert] { pointer-events: none; }
/* Kopfleiste: auf Touch wie der Inhalt (Wischen scrollt, Festhalten zieht) - sofort zieht nur der Griff */
.g-grid.g-edit .g-handle { cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.g-grid.g-edit .g-grip, .g-grid.g-edit [data-g-grip] { touch-action: none; }
.g-grid.g-edit > .g-item > .g-body { transition: transform .18s var(--ease), box-shadow .18s, opacity .18s; }
/* Rahmen je Element (ueber dem Inhalt, faengt keine Klicks) */
.g-grid.g-edit > .g-item::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 4; pointer-events: none;
  border-radius: 24px; border-radius: var(--g-radius, 24px);
  box-shadow: 0 0 0 1px rgba(94,234,212,.28), 0 0 0 4px rgba(94,234,212,.045);
  transition: box-shadow .16s;
}
.g-grid.g-edit > .g-item.g-locked::after { box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.g-grid.g-edit > .g-item:focus { outline: none; }
.g-grid.g-edit > .g-item:focus::after { box-shadow: 0 0 0 2px #5eead4, 0 0 28px -4px rgba(94,234,212,.65); }
/* Fokus per Antippen (Android) ohne Ring - nur Tastatur zeigt ihn (alte Safari ignorieren diese Regel) */
.g-grid.g-edit > .g-item:focus:not(:focus-visible)::after { box-shadow: 0 0 0 1px rgba(94,234,212,.28), 0 0 0 4px rgba(94,234,212,.045); }
/* Groessen-Griff unten rechts (Trefferflaeche 44 px) */
.g-grid.g-edit > .g-item > .g-resize {
  position: absolute; right: 6px; bottom: 6px; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 10px;
  color: #ccfbf1; background: rgba(9,13,24,.88); border: 1px solid rgba(94,234,212,.45);
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.85), 0 0 16px -4px rgba(94,234,212,.55);
  cursor: nwse-resize; touch-action: none;
  transition: background-color .16s, border-color .16s, transform .16s var(--ease);
}
.g-grid.g-edit > .g-item > .g-resize::before { content: ""; position: absolute; top: -10px; left: -10px; right: -6px; bottom: -6px; }
.g-grid.g-edit > .g-item > .g-resize > svg { width: 14px; height: 14px; }
.g-grid.g-edit > .g-item.g-locked > .g-resize { display: none; }
/* kleine Elemente (z. B. Website-Kacheln): kompakter Griff in der Ecke, verdeckt den Inhalt kaum */
.g-grid.g-edit > .g-item.g-small > .g-resize { right: 3px; bottom: 3px; width: 20px; height: 20px; border-radius: 7px; }
.g-grid.g-edit > .g-item.g-small > .g-resize > svg { width: 11px; height: 11px; }
.g-grid.g-edit > .g-item.g-small > .g-resize::before { top: -8px; left: -8px; right: -3px; bottom: -3px; }
/* Ziehgriff-Symbol (SD.grid.grip) */
.g-grip { flex: 0 0 auto; color: var(--t3); opacity: .8; transition: color .16s, opacity .16s; }
.g-grid.g-edit .g-handle .g-grip { color: #99f6e4; opacity: 1; }
/* Ziel-zone eines anderen Containers (z. B. Kategorie-Paneel) waehrend des Ziehens */
.g-drop:not(.g-grid) {
  border-color: rgba(94,234,212,.55);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 0 0 1px rgba(94,234,212,.5), 0 0 40px -12px rgba(94,234,212,.55), var(--shadow);
  transition: box-shadow .18s, border-color .18s;
}
/* Platzhalter: zeigt, wo das Element landet */
.g-placeholder {
  position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none;
  border-radius: 24px; border-radius: var(--g-radius, 24px);
  border: 1.5px dashed rgba(94,234,212,.7);
  background: rgba(94,234,212,.07);
  background: linear-gradient(135deg, rgba(94,234,212,.13), rgba(167,139,250,.09));
  box-shadow: inset 0 0 40px -14px rgba(94,234,212,.55), 0 0 32px -12px rgba(94,234,212,.6);
  transition: transform .22s var(--ease), width .22s var(--ease), height .22s var(--ease);
  animation: g-glow 1.3s ease-in-out infinite alternate;
}
/* gezogenes Element: angehoben, folgt dem Zeiger ohne Verzoegerung */
.g-grid > .g-item.g-dragging { z-index: 50; transition: none; cursor: grabbing; will-change: transform; }
.g-grid > .g-item.g-dragging::after { box-shadow: 0 0 0 1.5px rgba(94,234,212,.75), 0 0 34px -6px rgba(94,234,212,.6); }
.g-grid > .g-item.g-dragging > .g-body {
  border-radius: 24px; border-radius: var(--g-radius, 24px);
  transform: scale(1.025); opacity: .96;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.95), 0 18px 40px -24px rgba(0,0,0,.9);
}
.g-grid > .g-item.g-dropping { z-index: 49; transition: transform .26s var(--ease), width .22s var(--ease), height .22s var(--ease); }
.g-grid > .g-item.g-resizing { z-index: 48; }
.g-grid > .g-item.g-resizing::after { box-shadow: 0 0 0 2px rgba(94,234,212,.85), 0 0 32px -6px rgba(94,234,212,.6); }
.g-grid > .g-item.g-resizing > .g-resize { background: rgba(94,234,212,.24); border-color: rgba(94,234,212,.85); }
.g-grid > .g-item.g-resizing > .g-size {
  display: block; position: absolute; left: 50%; top: 50%; z-index: 6; pointer-events: none;
  transform: translate(-50%, -50%);
  padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  background: rgba(5,7,13,.88); border: 1px solid rgba(94,234,212,.55);
  color: #ccfbf1; font-size: 15px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.9), 0 0 22px -6px rgba(94,234,212,.6);
}
html.g-busy, html.g-busy * { cursor: grabbing !important; -webkit-user-select: none !important; user-select: none !important; }
html.g-busy-resize, html.g-busy-resize * { cursor: nwse-resize !important; }
@media (hover: hover) {
  .g-grid.g-edit > .g-item:not(.g-locked):hover::after { box-shadow: 0 0 0 1px rgba(94,234,212,.62), 0 0 28px -6px rgba(94,234,212,.5); }
  .g-grid.g-edit > .g-item > .g-resize:hover { background: rgba(94,234,212,.22); border-color: rgba(94,234,212,.8); transform: scale(1.08); }
}
@media (pointer: coarse) {
  .g-grid.g-edit > .g-item > .g-resize { width: 32px; height: 32px; right: 5px; bottom: 5px; }
  .g-grid.g-edit > .g-item.g-small > .g-resize { width: 24px; height: 24px; right: 3px; bottom: 3px; }
}
@keyframes g-glow { 0% { opacity: .72; } 100% { opacity: 1; } }

/* ============================ 14. Seitenleiste "Dienste" + Schublade ====== */
/* Markup aus app.js (renderShell): .side-scrim, aside.side#side (.side-top nur Schublade | .side-head |
   nav.side-list > .side-group > .side-gt + .side-item.svc | .side-foot), .side-tip; der Seiteninhalt steht in
   .shell-main. Desktop >= 1100 px: feste Leiste unter der Kopfzeile, 240 px, eingeklappt (#app.side-mini) 64 px -
   die Symbole bleiben dabei an ihrem Platz, Namen werden abgeschnitten. Kleiner: Schublade (#app.side-open). */
#app { --side-w: 240px; }
#app.side-mini { --side-w: 64px; }
.shell-main { position: relative; margin-left: 240px; margin-left: var(--side-w); transition: margin-left .28s var(--ease); }
.side {
  position: fixed; left: 0; bottom: 0; z-index: 26;
  top: 64px; top: calc(64px + env(safe-area-inset-top));
  display: flex; flex-direction: column; overflow: hidden;
  width: 240px; width: var(--side-w);
  /* Glas ohne backdrop-filter: hinter der festen Leiste liegt nur der (ohnehin weiche) Weltraum - Unschaerfe
     saehe gleich aus, kostete aber bei jedem Bild der Polarlicht-Animation Rechenzeit. Die Schublade (unten)
     liegt ueber Inhalten und bekommt die echte Unschaerfe. */
  background: rgba(7,10,19,.72);
  border-right: 1px solid var(--edge);
  box-shadow: 20px 0 44px -36px rgba(0,0,0,.95);
  transition: width .28s var(--ease);
}
.side::after {               /* Leuchtlinie an der rechten Kante */
  content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 1px; pointer-events: none;
  background: linear-gradient(180deg, rgba(94,234,212,.4), rgba(167,139,250,.28) 38%, rgba(167,139,250,0) 82%);
}
.side-scrim, .side-top { display: none; }
.side-head {
  display: flex; align-items: center; flex: 0 0 auto; height: 46px; padding: 6px 14px 0 20px; white-space: nowrap;
}
.page .side-title, .side-title {
  display: flex; align-items: center; min-width: 0; margin: 0;
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--t2);
}
.side-title::before {
  content: ""; flex: 0 0 auto; width: 6px; height: 6px; margin-right: 10px; border-radius: 50%;
  background: #5eead4; box-shadow: 0 0 8px rgba(94,234,212,.9), 0 0 2px #5eead4;
}
.side-sum {
  display: inline-flex; align-items: center; flex: 0 0 auto; height: 22px; margin-left: auto; padding: 0 8px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--edge); color: var(--t2);
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.side-sum:empty { display: none; }
.side-sum > .h-dot { width: 6px; height: 6px; margin-right: 6px; }
.side-sum.warn { color: #fcd34d; border-color: rgba(251,191,36,.34); background: rgba(251,191,36,.08); }
.side-sum.crit { color: #fda4af; border-color: rgba(251,113,133,.36); background: rgba(251,113,133,.08); }
.side-list {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 2px 10px 12px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent;
  /* unten weich auslaufen: zeigt, dass die Liste weitergeht */
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 22px), rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 22px), rgba(0,0,0,0) 100%);
}
.side-list::-webkit-scrollbar { width: 6px; }
.side-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 6px; }
.side-list::-webkit-scrollbar-track { background: transparent; }
.side-group + .side-group { margin-top: 6px; }
.side-gt {
  position: relative; display: flex; align-items: center; height: 22px; padding: 0 10px; white-space: nowrap; overflow: hidden;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--t3);
}
.side-gt > span { overflow: hidden; text-overflow: ellipsis; transition: opacity .2s; }
.side-gt::after {            /* Trennlinie (eingeklappt) */
  content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 1px; opacity: 0;
  background: var(--edge); transition: opacity .2s;
}

/* Eintrag: Symbolfeld in Gruppenfarbe, Name, LAN, Status-Punkt */
.side-item {
  -webkit-appearance: none; appearance: none; position: relative;
  display: flex; align-items: center; width: 100%; min-height: 34px; margin: 1px 0; padding: 3px 8px;
  border: 0; border-radius: 11px; background: transparent;
  color: var(--t2); font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.2; text-align: left;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .16s, color .16s;
}
.side-ico {
  position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 8px; color: #fff;
  background: #7c3aed; background: linear-gradient(140deg, #a78bfa 0%, #6d28d9 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 6px 14px -8px rgba(167,139,250,.8);
}
.side-ico > svg { width: 16px; height: 16px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.side-ico.cloud { background: linear-gradient(140deg, #22d3ee 0%, #0e7490 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 6px 14px -8px rgba(34,211,238,.8); }
.side-ico.media { background: linear-gradient(140deg, #f472b6 0%, #be185d 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 6px 14px -8px rgba(244,114,182,.8); }
.side-ico.twitch { background: linear-gradient(140deg, #8b5cf6 0%, #4c1d95 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 14px -8px rgba(124,58,237,.85); }
.side-ico.infra { background: linear-gradient(140deg, #60a5fa 0%, #1d4ed8 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 6px 14px -8px rgba(96,165,250,.8); }
.side-ico.claude { background: linear-gradient(140deg, #ff8f6b 0%, #c2410c 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 6px 14px -8px rgba(255,143,107,.8); }
.side-name { flex: 1 1 auto; min-width: 0; margin-left: 10px; overflow: hidden; text-overflow: ellipsis; transition: opacity .2s; }
.side-lan {
  flex: 0 0 auto; margin-left: 6px; padding: 0 4px; height: 16px; border-radius: 5px;
  font-size: 9px; font-weight: 800; letter-spacing: .08em; line-height: 14px;
  color: #93c5fd; background: rgba(96,165,250,.1); border: 1px solid rgba(96,165,250,.3);
}
.side-st { flex: 0 0 auto; width: 7px; height: 7px; margin: 0 3px 0 8px; }
.side-dot {                  /* Status am Symbol (nur eingeklappt) */
  display: none; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px;
  border: 2px solid #0b1020;
}
.side-lock { display: flex; flex: 0 0 auto; margin: 0 1px 0 8px; color: var(--t3); }
.side-lock > svg { width: 14px; height: 14px; }
.side-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.side-item.off { cursor: default; color: #8d97b3; }
.side-item.off .side-ico { background: rgba(255,255,255,.06); color: #8d97b3; box-shadow: inset 0 0 0 1px var(--edge); }
.side-item.off .side-ico > svg { filter: none; }
.side-item.active { color: #fff; background: var(--glass-3); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.side-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #5eead4, #a78bfa); box-shadow: 0 0 10px rgba(94,234,212,.85);
}
.side-item:focus { outline-offset: -2px; }
/* Fussleiste: Alle Dienste, Wetter, Einklappen - ausgeklappt eine Reihe (Symbol ueber kurzer Beschriftung, spart zwei
   Zeilen fuer die Dienste), eingeklappt untereinander. Feste Breiten: beim Ausklappen schiebt die Leiste sie ins Bild. */
.side-foot {
  position: relative; display: flex; justify-content: space-between; flex: 0 0 auto;
  padding: 8px 10px 10px; border-top: 1px solid var(--line-soft);
}
.side-foot > .side-item {
  flex: 1 1 auto; flex-direction: column; justify-content: center; width: auto; min-width: 60px; min-height: 54px; margin: 0; padding: 6px 2px 5px;
}
.side-foot > .side-item.active::before { display: none; }
.side-foot .side-ico { width: 26px; height: 26px; }
.side-foot .side-name {
  flex: 0 0 auto; max-width: 100%; margin: 4px 0 0; font-size: 10.5px; font-weight: 650; line-height: 1.2; text-align: center;
}
/* "3 weitere": schwebt ueber der Fussleiste, solange Dienste unter dem sichtbaren Teil der Liste liegen */
.side-more {
  -webkit-appearance: none; appearance: none; position: absolute; bottom: 100%; left: 50%; z-index: 2;
  display: inline-flex; align-items: center; height: 26px; margin-bottom: 6px; padding: 0 9px 0 11px; border-radius: 999px;
  transform: translateX(-50%); white-space: nowrap; cursor: pointer;
  border: 1px solid rgba(94,234,212,.4); background: rgba(10,15,28,.96); color: #ccfbf1;
  font: inherit; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.95), 0 0 16px -6px rgba(94,234,212,.6);
}
.side-more[hidden] { display: none; }
.side-more > svg { width: 14px; height: 14px; margin-left: 5px; }
.side-more::before { content: ""; position: absolute; top: -9px; bottom: -9px; left: -4px; right: -4px; }   /* 44 px Trefferflaeche */
.side-nav .side-ico, .side-fold .side-ico {
  background: var(--glass-2); color: var(--t2); box-shadow: inset 0 0 0 1px var(--edge);
}
.side-nav .side-ico > svg, .side-fold .side-ico > svg { filter: none; }
.side-nav.active .side-ico {
  color: #5eead4; background: rgba(94,234,212,.12);
  box-shadow: inset 0 0 0 1px rgba(94,234,212,.42), 0 0 16px -4px rgba(94,234,212,.55);
}
.side-fold { color: var(--t3); }
.side-fold .side-ico > svg { transition: transform .28s var(--ease); }
#app.side-mini .side-fold .side-ico > svg { transform: rotate(180deg); }
/* Laden / Fehler */
.side-skel { display: flex; align-items: center; height: 38px; padding: 0 8px; }
.side-skel-ico { flex: 0 0 auto; width: 28px; height: 28px; min-height: 0; border-radius: 8px; }
.side-skel-txt { flex: 1 1 auto; margin: 0 24px 0 10px; }
.side-skel-gt { width: 70px; height: 9px; margin: 0; }
.side-err { display: flex; flex-direction: column; align-items: flex-start; padding: 10px; color: var(--t3); font-size: 13px; line-height: 1.45; white-space: normal; }
.side-err > svg { color: #fb7185; margin-bottom: 6px; }
.side-retry {
  margin-top: 10px; min-height: 34px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--edge); background: var(--glass-2); color: var(--t1); font-size: 13px; font-weight: 600;
}
/* Hinweis beim Zeigen (fest positioniert, Lage aus app.js) */
.side-tip {
  position: fixed; left: 0; top: 0; z-index: 70; max-width: 280px; padding: 8px 12px; border-radius: 12px;
  background: rgba(14,19,34,.97); border: 1px solid var(--edge-2); color: var(--t1);
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.95), 0 0 24px -10px rgba(94,234,212,.4);
  font-size: 13px; line-height: 1.35; pointer-events: none;
  opacity: 0; visibility: hidden; transform: translate(-4px, -50%);
  transition: opacity .14s, transform .14s var(--ease), visibility 0s linear .14s;
}
.side-tip.show { opacity: 1; visibility: visible; transform: translate(0, -50%); transition: opacity .14s, transform .14s var(--ease), visibility 0s; }
.side-tip::before {
  content: ""; position: absolute; left: -5px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  background: rgba(14,19,34,.97); border-left: 1px solid var(--edge-2); border-bottom: 1px solid var(--edge-2);
  transform: rotate(45deg);
}
.side-tip b { display: block; font-weight: 650; white-space: nowrap; }
.side-tip span { display: block; color: var(--t2); font-size: 12.5px; }
.side-tip b:empty, .side-tip span:empty { display: none; }
.side-tip b + span { margin-top: 2px; }
/* Menueknopf der Kopfzeile: nur fuer die Schublade */
.tb-menu { display: none; }
@media (hover: hover) {
  .side-item.svc:not(.off):hover, .side-nav:hover, .side-fold:hover { background: var(--glass-2); color: var(--t1); }
  .side-item.active:hover { background: var(--glass-3); }
  .side-retry:hover { background: var(--glass-3); border-color: var(--edge-2); }
  .side-more:hover { background: rgba(20,32,46,.98); border-color: rgba(94,234,212,.7); color: #fff; }
}

/* Desktop: Kopfzeile ueber der Leiste ausgerichtet, Inhalt mittig im Rest */
@media (min-width: 1100px) {
  .topbar { padding-left: 19px; padding-right: 24px; }     /* Brand-Mark mittig ueber den Symbolen (32 px) */
  #app .tabs { padding-left: 24px; padding-right: 24px; }
  /* eingeklappt: nur Symbole; Status als Punkt am Symbol, Gruppen als Trennlinie */
  #app.side-mini .side-head { padding: 6px 0 0; justify-content: center; }
  #app.side-mini .side-title { display: none; }
  #app.side-mini .side-sum { margin-left: 0; padding: 0 6px; font-size: 11px; }
  #app.side-mini .side-sum > .h-dot { display: none; }
  #app.side-mini .side-gt { height: 16px; }
  #app.side-mini .side-gt > span { opacity: 0; }
  #app.side-mini .side-gt::after { opacity: 1; }
  #app.side-mini .side-group:first-child > .side-gt { height: 4px; }
  #app.side-mini .side-group:first-child > .side-gt::after { opacity: 0; }
  #app.side-mini .side-name { opacity: 0; }
  #app.side-mini .side-lan, #app.side-mini .side-st, #app.side-mini .side-lock { display: none; }
  #app.side-mini .side-dot { display: block; }
  #app.side-mini .side-item.off .side-dot { display: none; }
  /* eingeklappt: Fussleiste wieder untereinander, nur Symbole (Name im Hinweis beim Zeigen) */
  #app.side-mini .side-foot { display: block; padding: 8px 10px 12px; }
  #app.side-mini .side-foot > .side-item { flex-direction: row; justify-content: flex-start; width: 100%; min-width: 0; min-height: 36px; margin: 1px 0; padding: 4px 8px; }
  #app.side-mini .side-foot > .side-item.active::before { display: block; }
  #app.side-mini .side-foot .side-ico { width: 28px; height: 28px; }
  #app.side-mini .side-foot .side-name { display: none; }
  #app.side-mini .side-more { padding: 0 6px 0 8px; }
  #app.side-mini .side-more > svg { display: none; }
}
/* Kopfzeile: ab 1600 px (ausgeklappt) bzw. 1424 px (eingeklappt) rechts buendig mit dem Inhalt */
@media (min-width: 1600px) {
  #app:not(.side-mini) .topbar { padding-right: calc(50% - 776px); }
  #app:not(.side-mini) .tabs { padding-left: calc(50% - 656px); padding-right: calc(50% - 656px); }
}
@media (min-width: 1424px) {
  #app.side-mini .topbar { padding-right: calc(50% - 688px); }
  #app.side-mini .tabs { padding-left: calc(50% - 656px); padding-right: calc(50% - 656px); }
}
/* Touch-Bildschirme mit Leiste (Wand-iPad): Bedienziele 44 px */
@media (min-width: 1100px) and (pointer: coarse) {
  .side-item { min-height: 44px; }
}
/* Kleine Desktops: Platz fuer sechs Bereiche in der Mitte - bis 1399 px zeigt die Verbindung nur ihren Punkt
   (Text als Tooltip), bis 1239 px heisst "Infrastruktur" "Infra" und die Bereiche ruecken zusammen */
@media (min-width: 1100px) and (max-width: 1399.98px) {
  .pill.conn { width: 34px; padding: 0; justify-content: center; }
  .pill.conn .txt { display: none; }
  .pill.conn .dot { margin-right: 0; }
}
@media (min-width: 1100px) and (max-width: 1239.98px) {
  .mn { padding: 0 11px 0 9px; }
  .mn svg { margin-right: 6px; }
}

/* Tablet und Handy: Schublade von links mit Abdunklung */
@media (max-width: 1099.98px) {
  .shell-main { margin-left: 0; transition: none; }
  .tb-menu { display: inline-flex; flex: 0 0 auto; margin: 0 10px 0 0; }
  .side {
    top: 0; z-index: 60; width: 304px; max-width: 86vw;
    padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10,14,26,.98);
    border-right: 1px solid var(--edge-2);
    box-shadow: 30px 0 80px -24px rgba(0,0,0,.95);
    transform: translate3d(-105%, 0, 0); visibility: hidden;
    transition: transform .3s var(--ease), visibility 0s linear .3s;
  }
  #app.side-mini .side { width: 304px; }
  #app.side-open .side { transform: translate3d(0, 0, 0); visibility: visible; transition: transform .32s var(--ease), visibility 0s; }
  .side-top {
    display: flex; align-items: center; flex: 0 0 auto; height: 60px; padding: 0 10px 0 18px;
    border-bottom: 1px solid var(--line-soft);
  }
  .side-brand { display: flex; align-items: center; min-height: 44px; color: var(--t1); text-decoration: none; font-size: 18px; font-weight: 700; }
  .side-brand .brand-mark { margin-right: 11px; }
  .side-x { margin-left: auto; }
  .side-head { height: 48px; padding-top: 8px; }
  .side-item { min-height: 44px; }
  .side-fold, .side-tip { display: none; }
  /* Schublade: zwei gleich breite Knoepfe nebeneinander, Symbol ueber dem Namen (wie die ausgeklappte Leiste) */
  .side-foot > .side-item { min-height: 58px; }
  .side-foot > .side-item + .side-item { margin-left: 8px; }
  .side-foot .side-ico { width: 28px; height: 28px; }
  .side-foot .side-name { font-size: 12px; }
  .side-scrim {
    display: block; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 59;
    background: rgba(2,4,9,.62); opacity: 0; visibility: hidden;
    transition: opacity .3s, visibility 0s linear .3s;
  }
  #app.side-open .side-scrim { opacity: 1; visibility: visible; transition: opacity .3s, visibility 0s; }
  .side-foot { padding-bottom: 14px; }
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  @media (max-width: 1099.98px) {
    .side { background: rgba(10,14,26,.86); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); }
    .side-scrim { background: rgba(2,4,9,.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  }
}
