/* Nexus-Prompt - Hub: Ringmenue, Modul-Fenster, Eck-Knoepfe, ZEN-Modus (js/hub.js); Grundfarben in css/intro.css. */

/* --- Bis zum Start des Intros und vor dem Hub ist nichts davon sichtbar --- */
.stage.is-waiting .hub,
.stage.is-waiting .space,
.stage.is-waiting .hub-menu { visibility: hidden; }

/* --- Raum hinter dem Hub (js/space.js): faengt keine Klicks ab; --px/--py (-1..1) = Parallax --- */
.space {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  --px: 0;
  --py: 0;
}
.stage.is-hub .space {
  opacity: 1;
  transition: opacity 1.4s ease 0.15s;
}
/* Vignette: dunkelt die Ränder ab, das lenkt den Blick in die Mitte */
.space::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, transparent 58%, rgba(2, 4, 8, 0.5) 100%);
}
/* Lichtkegel: weicher Schein hinter dem Ring und ein Hauch vom Boden her */
.space-glow {
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(ellipse 46% 52% at 50% calc(50% - var(--hub-shift)), rgba(70, 140, 200, 0.26), rgba(30, 70, 110, 0.12) 45%, transparent 72%),
    radial-gradient(ellipse 80% 40% at 50% 104%, rgba(40, 90, 140, 0.22), transparent 70%);
  translate: calc(var(--px) * -14px) calc(var(--py) * -9px);
}
.space-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.space-particles > i {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
}
.space-grid-wrap {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
  will-change: transform;
}
.space-grid-wrap > canvas { position: absolute; top: 0; }
/* Schwache oder stromsparende Geräte: Raster steht still */
@media (prefers-reduced-motion: reduce) {
}
/* "Skip intro" ist sichtbar, sobald "Enter" gedrueckt wurde (per Skript). */

/* --- Logo im Hub: kleiner, in der Mitte --- */
.stage.is-hub .splash-logo,
.stage.is-choosing .splash-logo {
  width: min(190px, 23vmin);
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* Das Logo wandert mit dem Ring um --hub-shift nach oben ("translate", weil der Hover transform nutzt). */
.splash { transition: transform 0.25s ease, translate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease; }
.stage.is-hub .splash,
.stage.is-choosing .splash { translate: 0 calc(var(--hub-shift) * -1); }

/* --- Auswahl "Enter" / "Intro" nach "Close Hub": Logo aus, Loader ohne Fortschrittsanzeige zurueck --- */
.stage.is-choosing .splash { opacity: 0; pointer-events: none; }
.stage.is-choosing .loader {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: transparent;          /* der Hub blendet darunter noch aus */
  transition: opacity 0.4s ease, visibility 0s;
}
/* Laeuft das Intro-Video nach "Close Hub" + "Intro", darf der Loader "Skip intro" nicht abfangen */
.stage.is-choosing.is-intro-video .loader { opacity: 0; visibility: hidden; pointer-events: none; }

/* --- "Skip intro" / "Close Hub" / "Open HUD" --- */
.hub-cta {
  position: absolute;
  left: 50%;
  bottom: max(54px, calc(env(safe-area-inset-bottom) + 38px));
  translate: -50% 0;
  z-index: 5;
  padding: 12px 26px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(99, 160, 202, 0.07);
  border: 1px solid rgba(99, 160, 202, 0.55);
  border-radius: 6px;
  cursor: pointer;
  animation: hub-fade-up 0.9s ease-out both;
  transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.hub-cta span { display: inline-block; margin-left: 4px; transition: translate 0.25s ease; }
.hub-cta:focus-visible { color: #fff; border-color: #9fd4ff; box-shadow: 0 0 22px rgba(99, 160, 202, 0.55); outline: none; }
@media (hover: hover) {
  .hub-cta:hover { color: #fff; border-color: #9fd4ff; background: rgba(99, 160, 202, 0.18); box-shadow: 0 0 22px rgba(99, 160, 202, 0.55); }
  .hub-cta:hover span { translate: 5px 0; }
}
@keyframes hub-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
:root { --hub-shift: 32px; }
.hub-cta { white-space: nowrap; }

/* --- Menue oben rechts (Burger): Close Hub, Login, Registrieren, Feedback, Zen, Sound --- */
.hub-menu {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.hub-menu[hidden] { display: none; }
/* Bei offenem Fenster ist das Menue weg (sonst deckte es am Handy den Schliessen-Knopf des Fensters zu). */
.stage.is-panel .hub-menu { opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.hub-menu-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--accent);
  background: rgba(8, 10, 15, 0.6);
  border: 1px solid rgba(99, 160, 202, 0.45);
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.7s ease;
}
.hub-menu-toggle:focus-visible { color: #fff; border-color: #9fd4ff; box-shadow: 0 0 16px rgba(99, 160, 202, 0.5); outline: none; }
@media (hover: hover) {
  .hub-menu-toggle:hover { color: #fff; border-color: #9fd4ff; box-shadow: 0 0 16px rgba(99, 160, 202, 0.5); }
}
/* Gast (nicht angemeldet): Der Knopf "atmet" langsam in Cyan und weist so auf das Menue hin (Anmelden, Registrieren ...).
   Aus, sobald das Menue offen ist oder die Maus darauf liegt; bei "Bewegung reduzieren" bleibt ein ruhiges Leuchten. */
.hub-menu-toggle.is-beckoning:not([aria-expanded="true"]) { animation: menu-breathe 7.2s ease-in-out infinite; }
/* Zyklus 7,2 s: 3,6 s Aufleuchten (1,8 s hoch, 1,8 s runter), dann 3,6 s Ruhe = halb so oft wie im Dauer-Takt. */
@keyframes menu-breathe {
  0%, 50%, 100% {
    color: var(--accent);
    border-color: rgba(99, 160, 202, 0.45);
    box-shadow: 0 0 0 rgba(99, 160, 202, 0), 0 0 0 rgba(99, 160, 202, 0), inset 0 0 0 rgba(99, 160, 202, 0);
  }
  25% {
    color: #e6f4ff;
    border-color: rgba(190, 228, 255, 1);
    box-shadow: 0 0 14px rgba(150, 205, 250, 0.95), 0 0 34px rgba(99, 160, 202, 0.7), inset 0 0 12px rgba(130, 190, 235, 0.5);
  }
}
@media (hover: hover) {
  .hub-menu-toggle.is-beckoning:hover { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hub-menu-toggle.is-beckoning:not([aria-expanded="true"]) {
    animation: none;
    border-color: rgba(190, 228, 255, 0.9);
    box-shadow: 0 0 14px rgba(150, 205, 250, 0.7), 0 0 30px rgba(99, 160, 202, 0.45);
  }
}
/* Drei Striche, die beim Oeffnen zum X werden */
.hub-menu-bars { position: relative; display: block; width: 18px; height: 14px; }
.hub-menu-bars i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}
.hub-menu-bars i:nth-child(1) { top: 0; }
.hub-menu-bars i:nth-child(2) { top: 6px; }
.hub-menu-bars i:nth-child(3) { top: 12px; }
.hub-menu.is-open .hub-menu-bars i:nth-child(1) { top: 6px; transform: rotate(45deg); }
.hub-menu.is-open .hub-menu-bars i:nth-child(2) { opacity: 0; }
.hub-menu.is-open .hub-menu-bars i:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* Eintraege: rechtsbuendig untereinander, nach Groesse sortiert (js/hub.js); sie fahren der Reihe nach von rechts ein.
   --d (Verzoegerung je Eintrag) setzt js/hub.js beim Oeffnen und Schliessen. */
.hub-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.hub-menu-item {
  --d: 0ms;
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.5, 0, 0.8, 0.4) var(--d), opacity 0.3s ease var(--d),
              visibility 0s linear calc(var(--d) + 0.4s);
}
.hub-menu-item[hidden] { display: none; }
.hub-menu.is-open .hub-menu-item {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d), opacity 0.3s ease var(--d), visibility 0s linear var(--d);
}
@media (prefers-reduced-motion: reduce) {
  .hub-menu-item, .hub-menu.is-open .hub-menu-item { transition: opacity 0.2s ease, visibility 0s linear 0.2s; transform: none; }
  .hub-menu.is-open .hub-menu-item { transition: opacity 0.2s ease, visibility 0s; }
}

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 18px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent);
  background: rgba(8, 10, 15, 0.7);
  border: 1px solid rgba(99, 160, 202, 0.45);
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.menu-btn[hidden] { display: none; }
.menu-btn:focus-visible { color: #fff; border-color: #9fd4ff; box-shadow: 0 0 18px rgba(99, 160, 202, 0.5); outline: none; }
@media (hover: hover) {
  .menu-btn:hover { color: #fff; border-color: #9fd4ff; background: rgba(99, 160, 202, 0.16); box-shadow: 0 0 18px rgba(99, 160, 202, 0.5); }
}
/* Close Hub: wie frueher der grosse Knopf oben in der Mitte */
.menu-btn.is-close { padding: 0 24px; font-size: 13px; letter-spacing: 0.28em; background: rgba(99, 160, 202, 0.07); border-color: rgba(99, 160, 202, 0.55); }
/* Registrieren: kraeftiger, damit man ihn nicht uebersieht */
.menu-btn.is-strong { color: #fff; background: rgba(99, 160, 202, 0.24); border-color: #9fd4ff; box-shadow: 0 0 16px rgba(99, 160, 202, 0.35); }
@media (hover: hover) {
  .menu-btn.is-strong:hover { background: rgba(99, 160, 202, 0.38); box-shadow: 0 0 22px rgba(99, 160, 202, 0.6); }
}
.menu-btn.is-icon { position: relative; width: 38px; padding: 0; }
.corner-icon { width: 17px; height: 17px; display: block; }
.menu-btn[aria-pressed="true"] { color: var(--accent); }
/* Aus: Symbol gedimmt und diagonal durchgestrichen */
.menu-btn[aria-pressed="false"] .corner-icon { opacity: 0.55; }
.menu-btn[aria-pressed="false"]::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 50%;
  height: 2px;
  background: var(--text-faint);
  border-radius: 1px;
  rotate: -45deg;
  box-shadow: 0 0 0 1px rgba(8, 10, 15, 0.85);   /* hebt den Strich vom Symbol ab */
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Hub: Ring --- */
.hub {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hub-title {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  translate: -50% 0;          /* oben mittig ueber dem Ring */
  text-align: center;
  white-space: nowrap;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--text-faint);
  opacity: 0;
  /* Beim Schließen sofort ausblenden, beim Öffnen mit 0,6 s Verzögerung ein. */
  transition: opacity 0.4s ease 0s;
}
.hub-title .hub-version {
  margin: 0 0 0 8px; padding: 0; font: inherit; letter-spacing: inherit; color: var(--accent);
  background: none; border: 0; border-bottom: 1px dotted transparent; cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.hub-title .hub-version:focus-visible { color: #fff; border-bottom-color: #9fd4ff; outline: none; }
@media (hover: hover) { .hub-title .hub-version:hover { color: #fff; border-bottom-color: #9fd4ff; } }
.hub-title { pointer-events: none; }
.hub-title .hub-version { pointer-events: auto; }
.stage:not(.is-hub) .hub-title .hub-version { pointer-events: none; }
.stage.is-hub .hub-title { opacity: 1; transition: opacity 0.8s ease 0.6s; }

.hub-ring {
  position: absolute;
  left: 50%;
  top: calc(50% - var(--hub-shift));
  /* Höchstens so groß, dass oben "Close Hub" und unten Login/Registrieren frei bleiben. */
  width: min(94vmin, 780px, calc(100vh - 200px));
  width: min(94vmin, 780px, calc(100dvh - 200px));
  aspect-ratio: 1;
  translate: -50% -50%;
  overflow: visible;
  opacity: 0;
  scale: 0.85;
  transition: opacity 0.9s ease, scale 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
}
.stage.is-hub .hub-ring { opacity: 1; scale: 1; pointer-events: auto; }

/* Fenster offen: Ring tritt zurück */
.stage.is-panel .hub-ring {
  opacity: 0.18;
  scale: 0.92;
  filter: blur(2px);
  pointer-events: none;
}

/* Drei drehende Ringe (aeussere Striche, innere Strichlinie, Scanner); die Linie innen steht. */
.ring-deco { fill: none; stroke: var(--accent); transform-box: view-box; transform-origin: 300px 300px; }
.ring-deco.outer-ticks { stroke-opacity: 0.4; stroke-width: 7; stroke-dasharray: 1 11.6; }
.ring-deco.inner-dash  { stroke-opacity: 0.45; stroke-width: 1.2; stroke-dasharray: 10 14; }
.ring-deco.inner-line  { stroke-opacity: 0.16; stroke-width: 1; }
/* Dekor-Ebenen drehen als eigene Ebene (rotate), unabhaengig von translate/scale des Rings. */
@keyframes decor-spin { to { rotate: 360deg; } }
.hub-decor { pointer-events: none !important; }
.stage.is-panel .hub-decor { filter: none; }
.decor-ticks   { animation: decor-spin 90s linear infinite; }
.decor-dash    { animation: decor-spin 40s linear infinite; }
.decor-scanner { animation: decor-spin 14s linear infinite; }

/* Wasser-Canvas (js/fluid.js) mit Klasse "hub-ring" (gleiche Groesse und Lage); faengt keine Klicks ab. */
.fluid-canvas { pointer-events: none !important; }

/* SVG-Wasserring (ohne WebGL): mit dem Hub ein, beim Schliessen sofort aus. */
.fluid {
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(99, 160, 202, 0.5));
  transition: opacity 0.4s ease 0s;
}
.stage.is-hub .fluid { opacity: 1; transition: opacity 1.2s ease 0.6s; }

/* Kernleuchten: atmet langsam (Radius 185 von 300 = 19,17 %). */
.decor-core > i {
  position: absolute;
  inset: 19.17%;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, rgba(99, 160, 202, 0.34) 0%, rgba(99, 160, 202, 0.09) 55%, rgba(99, 160, 202, 0) 100%);
  animation: core-breathe 6s ease-in-out infinite;
}
@keyframes core-breathe {
  0%, 100% { scale: 0.92; opacity: 0.75; }
  50%      { scale: 1.08; opacity: 1; }
}

/* Scanner: ein Lichtbogen mit Schweif läuft außen um den Ring */
.ring-rot { transform-box: view-box; transform-origin: 300px 300px; }
.scan-arc {
  fill: none;
  stroke: #9fd4ff;
  stroke-width: 2.2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(99, 160, 202, 0.9));
}

/* Segmente */
.seg {
  cursor: pointer;
  outline: none;
  opacity: 0;
  transform-box: view-box;
  transform-origin: 300px 300px;
  scale: 0.9;
  transition: opacity 0.45s ease, scale 0.45s cubic-bezier(0.8, 0, 0.8, 0.2);
  /* Schliessen: rueckwaerts, das letzte Segment verschwindet zuerst. */
  transition-delay: calc((4 - var(--i)) * 0.07s);
}
/* ÖFFNEN (Zielzustand = Hub): der Reihe nach von oben im Uhrzeigersinn. */
.stage.is-hub .seg {
  opacity: 1;
  scale: 1;
  transition: opacity 0.55s ease, scale 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(0.35s + var(--i) * 0.09s);
}
/* Module voll deckend; das Wasser bleibt als Rahmen und in den Luecken sichtbar. */
.seg-shape {
  fill: #0b1624;
  stroke: none;          /* keine feine Kontur: die Fläche steht für sich */
  transition: fill 0.2s ease, filter 0.2s ease;
}
.seg-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.26em;
  fill: #cfe3f2;
  pointer-events: none;
  transition: fill 0.2s ease;
}
.seg-num {
  font-size: 9px;
  letter-spacing: 0.2em;
  fill: var(--accent);
  fill-opacity: 0.8;
  pointer-events: none;
}
/* Symbol je Modul, unter der Beschriftung */
.seg-icon {
  fill: none;
  stroke: #9fd4ff;
  stroke-opacity: 0.85;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.2s ease, stroke-opacity 0.2s ease;
}
/* Gesperrt: etwas dunklere Fläche, gedimmte Schrift, Schloss-Symbol */
.seg.is-locked .seg-shape { fill: #0a111b; }
.seg.is-locked .seg-label { fill: #8fa3b5; }
.seg.is-locked .seg-icon { stroke-opacity: 0.5; }

/* Hover/Fokus: hellere Fläche mit Leuchten (ohne feine Linie) */
.seg:focus-visible .seg-shape,
.seg.is-active .seg-shape {
  fill: #1f3a52;
  filter: drop-shadow(0 0 7px rgba(99, 160, 202, 0.9));
}
.seg:focus-visible .seg-label,
.seg.is-active .seg-label { fill: #fff; }
.seg:focus-visible .seg-icon { stroke: #fff; stroke-opacity: 1; }
@media (hover: hover) {
  .seg:hover .seg-shape {
    fill: #1f3a52;
    filter: drop-shadow(0 0 7px rgba(99, 160, 202, 0.9));
  }
  .seg:hover .seg-label { fill: #fff; }
  .seg:hover .seg-icon { stroke: #fff; stroke-opacity: 1; }
}

/* --- Modul-Fenster --- */
.panel {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  width: min(940px, 94vw);
  max-height: min(78dvh, 720px);
  translate: -50% -50%;
}
/* Rahmen: anfangs zugeklappt, rollt auf, wenn alle vier Ecken da sind (.is-open). */
.panel-frame {
  max-height: inherit;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(7, 11, 18, 0.9);
  border: 1px solid rgba(99, 160, 202, 0.45);
  box-shadow: 0 0 50px rgba(99, 160, 202, 0.18), inset 0 0 40px rgba(99, 160, 202, 0.05);
  clip-path: inset(50% 0 50% 0);
  opacity: 0;
  pointer-events: none;     /* erst mit .is-open bedienbar (s. u.) */
}
/* Kurz wie die Klaenge: oeffnen 0,4 s, schliessen 0,45 s (PANEL_CLOSE_MS in js/hub.js). */
.panel.is-open .panel-frame {
  pointer-events: auto;
  animation: panel-open 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.panel.is-closing .panel-frame {
  animation: panel-close 0.45s cubic-bezier(0.5, 0, 0.8, 0.4) both;
}
/* Mitten im Aufblitzen der Ecken geschlossen: der Rahmen war nie sichtbar. */
.panel.is-aborted .panel-frame { animation: none; }
@keyframes panel-open {
  0%   { clip-path: inset(50% 0 50% 0); opacity: 0; }
  25%  { opacity: 1; }
  100% { clip-path: inset(0 0 0 0); opacity: 1; }
}
@keyframes panel-close {
  from { clip-path: inset(0 0 0 0); opacity: 1; }
  to   { clip-path: inset(50% 0 50% 0); opacity: 0; }
}

/* Ecken (3 px, 24 px lang) auf dem Rahmen: .has-c1 ... .has-c4 im Uhrzeigersinn, jede blitzt kurz auf. */
.panel-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid #8cc9f5;
  pointer-events: none;
  opacity: 0;
}
.panel-corner.tl { left: -2px;  top: -2px;    border-right: 0; border-bottom: 0; transform-origin: 0 0; }
.panel-corner.tr { right: -2px; top: -2px;    border-left: 0;  border-bottom: 0; transform-origin: 100% 0; }
.panel-corner.br { right: -2px; bottom: -2px; border-left: 0;  border-top: 0;    transform-origin: 100% 100%; }
.panel-corner.bl { left: -2px;  bottom: -2px; border-right: 0; border-top: 0;    transform-origin: 0 100%; }

.panel.has-c1 .panel-corner.tl,
.panel.has-c2 .panel-corner.tr,
.panel.has-c3 .panel-corner.br,
.panel.has-c4 .panel-corner.bl {
  opacity: 1;
  animation: corner-flash 0.4s ease-out both;
}
@keyframes corner-flash {
  0%   { opacity: 0; scale: 2.2; border-color: #fff; filter: drop-shadow(0 0 0 rgba(159, 212, 255, 0)); }
  30%  { opacity: 1; scale: 1;   border-color: #fff; filter: drop-shadow(0 0 12px rgba(190, 228, 255, 1)); }
  100% { opacity: 1; scale: 1;   border-color: #8cc9f5; filter: drop-shadow(0 0 5px rgba(120, 190, 240, 0.75)); }
}
/* Schliessen: erst der Rahmen, dann die Ecken gegen den Uhrzeigersinn (.out-c4 ... .out-c1);
   0,26 s = CORNER_OUT_MS in js/hub.js. */
.panel.has-c1.out-c1 .panel-corner.tl,
.panel.has-c2.out-c2 .panel-corner.tr,
.panel.has-c3.out-c3 .panel-corner.br,
.panel.has-c4.out-c4 .panel-corner.bl {
  animation: corner-out 0.26s ease-in both;
}
@keyframes corner-out {
  0%   { opacity: 1; scale: 1;    border-color: #8cc9f5; filter: drop-shadow(0 0 5px rgba(120, 190, 240, 0.75)); }
  35%  { opacity: 1; scale: 1.15; border-color: #fff;    filter: drop-shadow(0 0 12px rgba(190, 228, 255, 1)); }
  100% { opacity: 0; scale: 0.5;  border-color: #fff;    filter: drop-shadow(0 0 0 rgba(159, 212, 255, 0)); }
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(99, 160, 202, 0.25);
}
.panel-code { font-size: 11px; letter-spacing: 0.24em; color: var(--accent); }
.panel-head h2 { margin: 0; flex: 1; font-size: 20px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.panel-close {
  font: inherit; font-size: 20px; line-height: 1;
  padding: 6px 12px;
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(99, 160, 202, 0.35);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.panel-close span { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; vertical-align: 3px; }
.panel-close:focus-visible { border-color: #9fd4ff; color: #fff; outline: none; }
@media (hover: hover) { .panel-close:hover { border-color: #9fd4ff; color: #fff; } }

.panel-body { padding: 18px 20px; overflow: auto; font-size: 14px; line-height: 1.6; color: #cfd8e3; }
.panel-body p { margin: 0 0 12px; }
.panel-body .lead { color: var(--text); font-size: 15px; }
/* Info-Fenster (Klick aufs Logo): schmaler als die Modul-Fenster */
.panel[data-size="narrow"] { width: min(620px, 94vw); }
.info-head {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.info-list { margin: 0 0 14px; padding-left: 1.2em; }
.info-list li { margin: 0 0 6px; }
.info-small { margin-top: 18px; font-size: 12px; letter-spacing: 0.08em; color: var(--text-faint); }

/* "INFO"-Hinweis unter dem Logo im Ring */
.ring-info {
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease 0s;
}
.stage.is-hub .ring-info { opacity: 0.85; transition: opacity 0.8s ease 1.2s; }
.ring-info-dot { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.ring-info-i { font-size: 11px; font-weight: 700; fill: var(--accent); pointer-events: none; }
.ring-info-text { font-size: 12px; letter-spacing: 0.3em; fill: var(--accent); pointer-events: none; }
@media (hover: hover) {
  .ring-info:hover { opacity: 1; }
  .ring-info:hover .ring-info-dot { stroke: #9fd4ff; }
  .ring-info:hover .ring-info-text, .ring-info:hover .ring-info-i { fill: #fff; }
}

/* Bausteine der Modul-Fenster (Felder, Listen, Knöpfe) */
.hub-input {
  width: 100%; margin-bottom: 14px; padding: 10px 12px;
  font: inherit; color: var(--text);
  background: rgba(99, 160, 202, 0.06);
  border: 1px solid rgba(99, 160, 202, 0.3); border-radius: 6px;
}
.hub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hub-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(99, 160, 202, 0.05);
  border: 1px solid rgba(99, 160, 202, 0.2); border-radius: 6px;
}
.hub-row b { font-weight: 600; color: var(--text); flex: 1; }
.hub-tag { font-size: 11px; letter-spacing: 0.12em; color: var(--accent); white-space: nowrap; }
.hub-btn {
  font: inherit; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 6px 10px; color: var(--accent); background: transparent;
  border: 1px solid rgba(99, 160, 202, 0.45); border-radius: 5px; cursor: pointer;
}
.hub-btn:focus-visible { color: #fff; border-color: #9fd4ff; outline: none; }
@media (hover: hover) { .hub-btn:hover { color: #fff; border-color: #9fd4ff; } }

.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.opt-grid textarea, .opt-out {
  min-height: 190px; padding: 10px 12px; font: inherit; font-size: 13px; line-height: 1.5;
  color: var(--text); background: rgba(99, 160, 202, 0.05);
  border: 1px solid rgba(99, 160, 202, 0.3); border-radius: 6px; resize: vertical;
}
.opt-out { white-space: pre-wrap; color: #b8d6ea; }
.opt-bar { height: 3px; margin: 12px 0; background: #161c28; border-radius: 2px; overflow: hidden; }
.opt-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #316a91, var(--accent), #9fd4ff); }
@media (max-width: 640px) { .opt-grid { grid-template-columns: 1fr; } }

.chat { display: grid; gap: 10px; margin-bottom: 14px; }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(99, 160, 202, 0.25); }
.bubble.you { justify-self: end; background: rgba(99, 160, 202, 0.14); }
.bubble.bot { justify-self: start; background: rgba(8, 12, 20, 0.7); color: #b8d6ea; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }
.chat-form .hub-input { margin: 0; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-grid label { display: grid; gap: 4px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); }
.field-grid .wide { grid-column: 1 / -1; }
.field-grid .hub-input { margin: 0; text-transform: none; letter-spacing: 0; font-size: 14px; }
@media (max-width: 640px) { .field-grid { grid-template-columns: 1fr; } }

.lock-note { text-align: center; padding: 26px 10px; }
.lock-note .lock { font-size: 40px; color: var(--accent); }

/* --- Handy --- */
@media (max-width: 480px) {
  /* Handy: etwas größere Tippfläche (mind. ca. 40 px) */
  .hub-menu-toggle { width: 42px; height: 42px; }
  .menu-btn { min-height: 42px; }
  .menu-btn.is-icon { width: 42px; }
  .corner-icon { width: 19px; height: 19px; }
  /* Der Ring ist hier nur ~0,6 px je Einheit groß: Schrift größer als am Desktop. */
  .seg-label { font-size: 18px; letter-spacing: 0.14em; }
  .seg-num { font-size: 11px; }
  /* Fensterecken am Handy etwas kürzer */
  .panel-corner { width: 18px; height: 18px; }
  .hub-title { font-size: 10px; letter-spacing: 0.16em; }
  .hub-title .hub-version { display: block; margin: 2px 0 0; }
  .panel { width: 96vw; max-height: 84dvh; }
  .panel-head h2 { font-size: 16px; }
  .panel-close span { display: none; }
}
@media (max-height: 480px) and (orientation: landscape) {
  /* Querformat am Handy: Ring kleiner und hoeher, Knopf flacher. */
  :root { --hub-shift: 14px; }
  .hub-ring {
    width: min(66vh, 560px);
    width: min(66dvh, 560px);
  }
  .panel { max-height: 90dvh; }
  .hub-cta {
    bottom: max(10px, env(safe-area-inset-bottom));
    padding: 9px 22px;
  }
  /* Querformat: Menue etwas kompakter, damit es auf den Bildschirm passt */
  .hub-menu, .hub-menu-list { gap: 6px; }
  .hub-menu-toggle { width: 36px; height: 36px; }
  .menu-btn { min-height: 34px; }
  .menu-btn.is-icon { width: 34px; }
}

/* Jarvis-Fenster: fast volle Breite und Hoehe (30 px hoeher, endet 105 px ueber dem Rand), Chat ohne Innenabstand. */
.panel[data-module="jarvis"] {
  top: calc(50% - 30px);
  width: min(1120px, 96vw);
  max-height: min(calc(100vh - 150px), 920px);
  max-height: min(calc(100dvh - 150px), 920px);
}
.panel[data-module="jarvis"] .panel-body {
  padding: 0;
  overflow: hidden;
  height: calc(min(100vh - 150px, 920px) - 74px);    /* Fensterhöhe abzüglich Kopfzeile */
  height: calc(min(100dvh - 150px, 920px) - 74px);
}
.jarvis-frame { display: block; width: 100%; height: 100%; border: 0; background: #0b1118; }
.jarvis-host { height: 100%; }
/* Hinweise im Jarvis-Fenster (ohne Anmeldung / ohne Recht): das Fenster hat dort keinen Innenabstand */
.panel[data-module="jarvis"] .jarvis-host > .lead { margin: 18px 20px 12px; }
.panel[data-module="jarvis"] .jarvis-host > .hub-btn { margin: 0 20px; }
/* Anmeldung im Jarvis-Fenster (nur ohne gültige Sitzung) */
.panel[data-module="jarvis"] .jarvis-host:has(.jarvis-login) { padding: 18px 20px; overflow: auto; }
.jarvis-login { display: grid; gap: 10px; max-width: 360px; }
.jarvis-login .hub-input { margin: 0; text-transform: none; letter-spacing: 0; font-size: 14px; }
.jarvis-login .hub-btn { justify-self: start; padding: 8px 16px; }
.jarvis-msg { min-height: 1.4em; margin: 0; color: #e8a0a0; font-size: 13px; }
.jarvis-msg.is-ok { color: #9fd4ff; }

/* Modul "Konto": Kontodaten (nur lesen) und Passwort ändern (siehe mountAccount in js/hub.js) */
.acct-info { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 18px; }
.acct-info dt { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); align-self: center; }
.acct-info dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
/* "Was ist neu" (siehe mountWhatsNew in js/hub.js) */
.wn-entry { margin: 0 0 18px; padding: 0 0 14px; border-bottom: 1px solid rgba(99, 160, 202, 0.15); }
.wn-entry:last-child { border-bottom: 0; }
.wn-meta { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); }
.wn-entry.is-latest .wn-meta { color: var(--accent); }
.wn-title { margin: 4px 0 8px; font-size: 16px; font-weight: 600; color: var(--text); }
.wn-points { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: #cfd8e3; }

/* Modul "Admin": Benutzerverwaltung und Anmelde-Protokoll (siehe mountAdmin in js/hub.js) */
.adm-tabs { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.adm-tab {
  padding: 7px 14px; font: inherit; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-faint); background: transparent; border: 1px solid rgba(99, 160, 202, 0.25);
  border-radius: 6px; cursor: pointer;
}
.adm-tab.is-on, .adm-tab:focus-visible { color: var(--accent); border-color: rgba(99, 160, 202, 0.7); outline: none; }
@media (hover: hover) { .adm-tab:hover { color: #fff; border-color: #9fd4ff; } }
.adm-body { min-height: 360px; }   /* das Fenster springt beim Reiterwechsel nicht in der Höhe */
.adm-body.is-loading { opacity: 0.45; pointer-events: none; transition: opacity 0.15s ease; }
.adm-body .hub-input { margin: 0 0 8px; text-transform: none; letter-spacing: 0; font-size: 14px; }
.adm-count { margin: 0 0 10px; font-size: 12px; color: var(--text-faint); }
.adm-list { display: grid; gap: 8px; }
.adm-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 190px auto; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid rgba(99, 160, 202, 0.2); border-radius: 8px;
  background: rgba(99, 160, 202, 0.04);
}
.adm-row.is-off { opacity: 0.7; }
.adm-row.is-asking { grid-template-columns: 1fr; border-color: rgba(232, 160, 160, 0.6); }
.adm-who { display: grid; gap: 2px; min-width: 0; }
.adm-who span { overflow-wrap: anywhere; font-size: 13px; color: #cfd8e3; }
.adm-who .adm-sub { font-size: 12px; color: var(--text-faint); }
.adm-role { margin: 0 !important; }
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-actions .hub-btn, .adm-confirm .hub-btn { padding: 6px 12px; }
.adm-danger { color: #e8a0a0; border-color: rgba(232, 160, 160, 0.5); }
.adm-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.adm-confirm { display: grid; gap: 8px; max-width: 460px; }
.adm-hint { margin: 0 !important; font-size: 13px; color: #e8c8c8; }
.adm-log { display: grid; gap: 4px; margin-top: 12px; }
.adm-log-row {
  display: grid; grid-template-columns: 120px 160px minmax(0, 1fr) auto; gap: 10px; padding: 6px 4px;
  border-bottom: 1px solid rgba(99, 160, 202, 0.12); font-size: 12px; color: #cfd8e3;
}
.adm-log-at, .adm-log-ip { color: var(--text-faint); }
.adm-log-row span { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .adm-row { grid-template-columns: 1fr; }
  .adm-log-row { grid-template-columns: 1fr; gap: 2px; }
}
.acct-details { display: grid; gap: 10px; max-width: 640px; }
.acct-details .opt-note { margin: 0 0 4px; }
.acct-details .opt-actions { margin-top: 2px; }
.acct-signature { min-height: 92px; resize: vertical; font: inherit; line-height: 1.5; }
.acct-title { margin: 22px 0 8px; font-size: 12px; font-weight: 400; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); }

.auth-register { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(99, 160, 202, 0.2); display: grid; gap: 8px; justify-items: start; }
.auth-register p { margin: 0; font-size: 13px; color: var(--text-faint); }
.auth-links { display: flex; gap: 18px; flex-wrap: wrap; margin: 14px 0 0; font-size: 13px; }
.auth-links a { color: var(--accent); text-decoration: underline; }

/* Gast: Module halb deckend mit Schloss (Deckkraft in --guest-seg-fill). */
:root { --guest-seg-fill: 0.5; }
.seg-lock { display: none; }
.hub-ring.is-guest .seg-shape { fill-opacity: var(--guest-seg-fill); }
.hub-ring.is-guest .seg-icon:not(.seg-lock) { display: none; }
.hub-ring.is-guest .seg-lock { display: inline; }
.hub-ring.is-guest .seg-label { fill: #b9cddd; }
/* Gast: Module gesperrt (kein Hover, kein Zeiger). */
.hub-ring.is-guest .seg { pointer-events: none; cursor: default; outline: none; }
.hub-ring.names-hidden .seg-label { display: none; }

/* An-/Abmelden: Flaechen blenden weich, die Raender leuchten der Reihe nach (.edge-flash, --i). */
.seg-shape { transition: fill 0.2s ease, filter 0.2s ease, fill-opacity 0.9s ease; }
.hub-ring.edge-flash .seg-shape {
  animation: seg-edge-flash 1.25s ease-out both;
  animation-delay: calc(var(--i, 0) * 0.1s);
}
@keyframes seg-edge-flash {
  0%   { stroke: #9fd4ff; stroke-opacity: 0;   stroke-width: 1;   filter: drop-shadow(0 0 0 rgba(159, 212, 255, 0)); }
  22%  { stroke: #bfe4ff; stroke-opacity: 1;   stroke-width: 2.6; filter: drop-shadow(0 0 10px rgba(159, 212, 255, 0.95)); }
  100% { stroke: #9fd4ff; stroke-opacity: 0;   stroke-width: 1;   filter: drop-shadow(0 0 0 rgba(159, 212, 255, 0)); }
}
@media (prefers-reduced-motion: reduce) {
  .hub-ring.edge-flash .seg-shape { animation: none; }
  .seg-shape { transition: fill 0.2s ease, filter 0.2s ease; }
}

/* Optimizer im Modul-Fenster (echte Funktion, siehe mountOptimizer in js/hub.js) */
.optimizer-host .opt-grid textarea { width: 100%; box-sizing: border-box; }
.opt-actions { display: flex; gap: 10px; margin-top: 4px; }
.opt-usage { margin: 10px 0 0; font-size: 12.5px; color: var(--text-faint); }
.opt-note { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-faint); }

/* Prompt DB im Modul-Fenster */
.pd-bar { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; margin-bottom: 10px; }
.pd-bar .hub-input { margin: 0; }
.pd-select { width: auto; max-width: 190px; }
.pd-fav-filter.is-on { color: #fff; border-color: #9fd4ff; background: rgba(99, 160, 202, 0.2); }
.pd-row { display: block; }
.pd-head { display: flex; align-items: center; gap: 10px; }
.pd-title {
  flex: 1; text-align: left; font: inherit; font-weight: 600; color: var(--text);
  background: none; border: 0; padding: 4px 0; cursor: pointer;
}
.pd-title:focus-visible { outline: 1px solid #9fd4ff; }
.pd-star { font-size: 18px; line-height: 1; color: var(--text-faint); background: none; border: 0; cursor: pointer; padding: 2px 4px; }
.pd-star.is-on { color: #ffd479; }
.pd-body { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(99, 160, 202, 0.2); }
.pd-use { color: var(--text-faint); margin: 0 0 8px; }
.pd-content {
  margin: 0 0 10px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word;
  font: inherit; font-size: 13px; line-height: 1.5; color: #b8d6ea;
  background: rgba(99, 160, 202, 0.05); border: 1px solid rgba(99, 160, 202, 0.2); border-radius: 6px;
  max-height: 280px; overflow: auto;
}
.pd-fields { margin-bottom: 10px; }
.pd-fields label { text-transform: none; letter-spacing: 0; font-size: 12px; }
@media (max-width: 640px) {
  .pd-bar { grid-template-columns: 1fr 1fr; }
  .pd-bar .hub-input:first-child { grid-column: 1 / -1; }
  .pd-select { max-width: none; }
}

/* Glimmen der vier Fensterseiten, je um ein Viertel versetzt; nur Deckkraft animiert. */
.panel-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.panel.is-open .panel-orbit { opacity: 1; transition: opacity 1.2s ease 0.4s; }
.panel-orbit > i {
  position: absolute;
  opacity: 0.2;
  box-shadow: 0 0 9px 1px rgba(140, 201, 245, 0.6);
  animation: edge-glimmer 8s ease-in-out infinite;
}
.panel-orbit > .edge-t, .panel-orbit > .edge-b {
  left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, rgba(207, 233, 255, 0) 0%, rgba(207, 233, 255, 1) 18%, rgba(207, 233, 255, 1) 82%, rgba(207, 233, 255, 0) 100%);
}
.panel-orbit > .edge-r, .panel-orbit > .edge-l {
  top: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, rgba(207, 233, 255, 0) 0%, rgba(207, 233, 255, 1) 18%, rgba(207, 233, 255, 1) 82%, rgba(207, 233, 255, 0) 100%);
}
.panel-orbit > .edge-t { top: 0;    animation-delay: 0s; }
.panel-orbit > .edge-r { right: 0;  animation-delay: 2s; }
.panel-orbit > .edge-b { bottom: 0; animation-delay: 4s; }
.panel-orbit > .edge-l { left: 0;   animation-delay: 6s; }
@keyframes edge-glimmer {
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .panel-orbit { display: none; } }

/* Rechtevergabe (Admin) und "Das darf dein Konto" */
.adm-item { border-bottom: 1px solid rgba(99, 160, 202, 0.15); }
.rt-panel { padding: 6px 4px 14px; }
.rt-group { margin: 12px 0 2px; font-size: 11px; letter-spacing: 0.16em; color: var(--text-faint); }
.rt-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(99, 160, 202, 0.15); }
.rt-row.is-blocked .rt-text { opacity: 0.55; }
.rt-text { flex: 1; min-width: 0; }
.rt-text b { display: block; font-weight: 600; color: var(--text); font-size: 14px; }
.rt-text span { font-size: 12px; color: var(--text-faint); }
.rt-limit { width: 84px; margin: 0 !important; padding: 5px 8px !important; font-size: 13px !important; text-align: center; }
.rt-unit { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.rt-tag { font-size: 11px; padding: 2px 8px; border-radius: 8px; color: var(--text-faint); background: rgba(99, 160, 202, 0.1); white-space: nowrap; }
.rt-tag.is-own { color: #ffd479; background: rgba(255, 212, 121, 0.12); }
.rt-sw {
  position: relative; flex: none; width: 38px; height: 22px; padding: 0;
  border: 1px solid rgba(99, 160, 202, 0.45); border-radius: 11px; background: rgba(99, 160, 202, 0.12); cursor: pointer;
}
.rt-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #8fa3b5; transition: left 0.15s ease, background 0.15s ease; }
.rt-sw.is-on { background: rgba(90, 200, 150, 0.35); border-color: rgba(90, 200, 150, 0.7); }
.rt-sw.is-on::after { left: 18px; background: #bff0d6; }
.rt-sw:disabled { opacity: 0.5; cursor: default; }
.rt-sw:focus-visible { outline: 1px solid #9fd4ff; outline-offset: 2px; }
.rt-request { display: grid; gap: 6px; margin: 8px 0; padding: 10px 12px; border: 1px solid rgba(255, 212, 121, 0.5); border-radius: 6px; background: rgba(255, 212, 121, 0.07); font-size: 13px; }
.rt-request .hub-btn { justify-self: start; }
.rt-foot { margin-top: 10px; }
.rt-matrix { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 13px; }
.rt-matrix th { font-weight: 600; font-size: 11px; letter-spacing: 0.06em; color: var(--text-faint); padding: 4px 4px; text-align: center; vertical-align: bottom; }
.rt-matrix td { padding: 7px 4px; border-top: 1px solid rgba(99, 160, 202, 0.15); text-align: center; }
.rt-matrix td:first-child { text-align: left; color: var(--text); }
.acct-rights-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.acct-rights-list li { display: flex; gap: 10px; align-items: flex-start; }
.acct-mark { width: 18px; text-align: center; color: #7fdcae; }
.acct-rights-list .is-off .acct-mark { color: var(--text-faint); }
.acct-rights-list .is-off .acct-rights-text { opacity: 0.6; }
.acct-rights-text b { display: block; font-weight: 600; color: var(--text); font-size: 14px; }
.acct-rights-text span { font-size: 12px; color: var(--text-faint); }
.acct-request { display: grid; gap: 8px; margin-top: 10px; }
.acct-check { display: block; font-size: 14px; }
@media (max-width: 640px) { .rt-row { flex-wrap: wrap; } .rt-matrix { font-size: 11px; } }

/* Testkonto anlegen (Admin) */
.adm-shared-wrap { margin: 0 0 12px; }
.adm-shared { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid rgba(99, 160, 202, 0.3); border-radius: 6px; background: rgba(99, 160, 202, 0.05); }
.adm-shared .hub-input { margin: 0; }

/* Postfach im Admin-Fenster */
.fb-types { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-form { display: grid; gap: 10px; }
.fb-form .hub-input { margin: 0; }
.fb-form textarea { min-height: 150px; resize: vertical; font: inherit; line-height: 1.5; }
.fb-count { font-size: 12px; color: var(--text-faint); text-align: right; margin: -4px 0 0; }
.fb-thanks { display: grid; gap: 12px; justify-items: start; }
.fbx-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.fbx-filter .hub-btn.is-on { color: #fff; border-color: #9fd4ff; background: rgba(99, 160, 202, 0.2); }
.fbx-item { padding: 12px 0; border-top: 1px solid rgba(99, 160, 202, 0.2); display: grid; gap: 8px; }
.fbx-item.is-done { opacity: 0.6; }
.fbx-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12px; color: var(--text-faint); }
.fbx-head b { font-weight: 600; color: var(--text); font-size: 13px; }
.fbx-chip { padding: 2px 8px; border-radius: 8px; background: rgba(99, 160, 202, 0.12); color: var(--accent); font-size: 11px; }
.fbx-chip.is-bug { background: rgba(255, 120, 120, 0.14); color: #ff9c9c; }
.fbx-msg { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.55; color: var(--text); }
.fbx-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Auswahlfelder: aufgeklappte Liste dunkel. */
select.hub-input { color-scheme: dark; }
select.hub-input option,
select.hub-input optgroup { background: #0d141d; color: #e6edf5; }
select.hub-input option:checked { background: #1f3a52; color: #fff; }

/* Aktivität je Konto (Admin) */
.act-wrap { overflow-x: auto; }
.act-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.act-table th { font-weight: 600; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); padding: 4px 6px; text-align: center; vertical-align: bottom; }
.act-table th:first-child, .act-table td:first-child { text-align: left; }
.act-table td { padding: 8px 6px; border-top: 1px solid rgba(99, 160, 202, 0.15); text-align: center; color: var(--text); }
.act-table td b { display: block; font-weight: 600; font-size: 13px; }
.act-sub { display: block; font-size: 11px; color: var(--text-faint); }
.act-zero { color: var(--text-faint) !important; }
.act-table tr.is-off td { opacity: 0.55; }
.act-spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 24px; }
.act-spark i { display: block; width: 4px; background: #63a0ca; border-radius: 1px; }
.act-spark i.is-zero { background: rgba(99, 160, 202, 0.25); }
.act-when { white-space: nowrap; font-size: 12px; color: var(--text-faint) !important; }

/* Persönliche Prompt DB */
.pd-panel { display: block; }
.mine-bar { grid-template-columns: 1fr auto auto; }
.mine-editor { border: 1px solid rgba(99, 160, 202, 0.35); border-radius: 6px; padding: 12px; margin: 0 0 12px; background: rgba(8, 16, 26, 0.5); }
.mine-form { display: grid; gap: 10px; margin-bottom: 10px; }
.mine-form label { display: grid; gap: 4px; font-size: 12px; color: var(--text-faint); }
.mine-text { min-height: 140px; resize: vertical; font-family: inherit; }
.mine-actions { flex-wrap: wrap; }
@media (max-width: 640px) { .mine-bar { grid-template-columns: 1fr 1fr; } .mine-bar .hub-input:first-child { grid-column: 1 / -1; } }


/* --- ZEN-Modus (js/hub.js setZen, js/fluid.js) ---
   Alles ausser dem Wasser blendet gestaffelt in ca. 4 s aus, der Teich rueckt in die Mitte; beim Beenden
   laeuft alles in derselben Zeit zurueck (.zen-slow). Am Dateiende, damit die Regeln den Hub ueberstimmen. */

/* --- Ausblenden (Klasse .is-zen) --- */
/* Raum hinter dem Hub (Licht, Raster, Partikel): zuletzt und am langsamsten */
.stage.is-zen .space { opacity: 0; transition: opacity 3.2s ease 0.7s; }

/* Ringmenü, Dekor-Ringe, Kernleuchten (alles "hub-ring" außer dem Wasser) */
.stage.is-zen .hub-ring:not(.fluid-canvas) {
  opacity: 0;
  scale: 0.9;
  pointer-events: none;
  transition: opacity 1.8s ease 0.2s, scale 2.2s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

/* Das Wasser bleibt: rückt in die Mitte und füllt den Bildschirm (--zen-scale setzt fluid.js) */
.fluid-canvas {
  transition: opacity 0.9s ease, scale 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), top 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
}
.stage.is-zen canvas.fluid-canvas {
  top: calc(50% - 30px);
  scale: var(--zen-scale, 1.3);
  opacity: 1;
  transition: opacity 0.9s ease, scale 2.6s cubic-bezier(0.2, 0.8, 0.2, 1), top 2.6s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
}

/* Logo, Titel, Knöpfe */
.stage.is-zen .splash {
  opacity: 0;
  scale: 0.75;
  pointer-events: none;
  transition: opacity 1.4s ease 0.1s, scale 1.8s ease 0.1s, translate 1.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.25s ease;
}
.stage.is-zen .hub-title { opacity: 0; transition: opacity 1.2s ease 0s; pointer-events: none; }
.stage.is-zen .hub-title .hub-version { pointer-events: none; }
/* Menue: im ZEN-Modus bleibt nur der Burger (gedimmt); sein Menue zeigt dann nur den Knopf zum Beenden. */
.stage.is-zen .hub-menu-item:not(.is-zen-item) { display: none; }
.stage.is-zen .hub-menu-toggle { opacity: 0.5; }
.stage.is-zen .hub-menu-toggle:hover,
.stage.is-zen .hub-menu-toggle:focus-visible { opacity: 1; }

/* --- Wieder einblenden (Klasse .zen-slow, nach dem Entfernen von .is-zen) --- */
.stage.zen-slow .space { transition: opacity 3s ease 0.6s; }
.stage.zen-slow .hub-ring:not(.fluid-canvas) {
  transition: opacity 2s ease 0.5s, scale 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s, filter 0.5s ease;
}
.stage.zen-slow canvas.fluid-canvas {
  transition: opacity 0.9s ease, scale 2.6s cubic-bezier(0.2, 0.8, 0.2, 1), top 2.6s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
}
.stage.zen-slow .splash {
  transition: opacity 1.8s ease 0.8s, scale 2s ease 0.8s, translate 1.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.25s ease;
}
.stage.zen-slow .hub-title { transition: opacity 1.6s ease 1.8s; }
.stage.zen-slow .hub-menu-toggle { transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 1.6s ease 1.8s; }

.stage.is-zen { touch-action: none; }

/* Kurzer Hinweis beim Start, blendet von selbst wieder aus */
.zen-hint {
  position: absolute;
  left: 50%;
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 68px));
  translate: -50% 0;
  z-index: 5;
  margin: 0;
  max-width: 90vw;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0;
  pointer-events: none;
}
/* Anleitung: erscheint nach 2,6 s, bleibt 5 s sichtbar und blendet aus (7,4 s = 1,2 + 5 + 1,2) */
.zen-hint.is-shown { animation: zen-hint 7.4s ease 2.6s both; }
@keyframes zen-hint {
  0%   { opacity: 0; }
  16%  { opacity: 1; }
  84%  { opacity: 1; }
  100% { opacity: 0; }
}
/* Danach, an derselben Stelle, der Entspannungs-Text: blendet langsam ein und bleibt */
.zen-relax {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: none;
  line-height: 1.6;
  color: #9db4c7;
}
.zen-relax.is-shown { animation: zen-relax 3s ease 10.6s both; }
@keyframes zen-relax {
  from { opacity: 0; }
  to   { opacity: 0.85; }
}

/* Musik-Wechsel unten in der Mitte: erscheint erst, wenn die Oberfläche weg ist */
.zen-song {
  position: absolute;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px));
  translate: -50% 0;
  z-index: 31;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent);
  background: rgba(8, 10, 15, 0.55);
  border: 1px solid rgba(99, 160, 202, 0.35);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1s ease, visibility 0s linear 1s, color 0.2s ease, border-color 0.2s ease;
}
.zen-song[hidden] { display: none; }
.stage.is-zen .zen-song {
  opacity: 0.6;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 2s ease 2.4s, visibility 0s, color 0.2s ease, border-color 0.2s ease;
}
.stage.is-zen .zen-song:hover,
.stage.is-zen .zen-song:focus-visible { opacity: 1; color: #fff; border-color: #9fd4ff; outline: none; }
.zen-song-swap { opacity: 0.7; }
