/* =====================================================
   CSS VARIABLES & RESET
   ===================================================== */
:root {
  /* ══ LESBARKEIT IM DUNKELMODUS, korrigiert am 11.09.2026 ══
     Kris: "in dunkel modus sieht man die schriften nicht so gut und das
     ist in juno ueberall so."

     Nachgemessen statt geraten, mit dem WCAG-Kontrastverhaeltnis. Gefordert
     sind 4,5:1 fuer normalen Text. Gemessen wurde gegen alle vier Flaechen,
     die in JUNO vorkommen: --bg #030812, surface (4% Weiss), surface2
     (7% Weiss) und die Panels #0d1117. Der schlechteste Wert zaehlt.

     DREI URSACHEN, alle belegt:

     1. --text-secondary und --text-primary werden 57mal benutzt (40 + 16
        davon OHNE Ersatzwert) — waren aber NIRGENDS definiert. Eine
        var()-Angabe auf eine unbekannte Variable ohne Ersatzwert macht die
        ganze Regel ungueltig; die Schrift erbt dann die Farbe des
        Elternelements statt der gemeinten. Das ist der Hauptgrund, warum es
        "ueberall" auffiel und nicht nur an einer Stelle.

     2. --text-muted war #5a7a96 und schafft nur 4,45:1 auf dem dunkelsten
        Grund und 3,90:1 auf den Flaechen — unter der Anforderung. Dabei
        steht damit sehr viel Kleingedrucktes, teils in 9 bis 11 px.

     3. color-scheme fehlte ganz. Ohne diese Zeile zeichnet der Browser seine
        EIGENEN Bedienelemente hell: die aufgeklappte Auswahlliste, die
        Datums- und Uhrzeitfelder, die Bildlaufleisten. Genau das war auf
        Kris' Bildschirmfoto zu sehen — die Ortsauswahl im Fahrten-Fenster
        war kaum zu entziffern. Eine Zeile, die alle nativen Elemente auf
        einmal richtigstellt.

     Die neue Stufenleiter (schlechtester Wert ueber allen vier Flaechen):
        --text-primary   #e6edf3   14,87:1
        --text           #e2e8f0   14,25:1
        --text-secondary #a3b2c0    8,10:1
        --text-muted     #8aa5bf    6,87:1
     Die Abstufung bleibt also deutlich sichtbar — nur eben lesbar. */
  color-scheme: dark;

  --primary:    #2d6a4f;
  --primary-h:  #245840;
  --accent:     #22c55e;
  --accent-2:   #06b6d4;
  --accent-d:   #16a34a;
  --bg:         #030812;
  --surface:    rgba(255,255,255,0.04);
  --surface2:   rgba(255,255,255,0.07);
  --surface3:   rgba(255,255,255,0.11);
  --surface-1:  rgba(255,255,255,0.04);
  --text:       #e2e8f0;
  --text-primary:   #e6edf3;
  --text-secondary: #a3b2c0;
  --text-muted: #8aa5bf;
  --border:     rgba(34,197,94,0.15);
  --danger:     #ef4444;
  --warning:    #f59e0b;
  --info:       #3b82f6;
  --radius:     14px;
  --radius-sm:  10px;
  --shadow:     0 8px 32px rgba(0,0,0,0.7), 0 2px 8px rgba(0,0,0,0.4);
  --neon-glow:  0 0 10px rgba(34,197,94,0.5), 0 0 30px rgba(34,197,94,0.2);
  --neon-hover-shadow: 0 20px 40px rgba(34,197,94,0.2);
}

body.light {
  /* Auch hier nachgemessen: --text-muted #64748b kam auf 4,23:1 und lag
     damit ebenfalls knapp unter der Anforderung. */
  color-scheme: light;

  --bg:        #eef2f7;
  --surface:   rgba(255,255,255,0.75);
  --surface2:  rgba(240,244,249,0.8);
  --surface3:  rgba(226,232,244,0.7);
  --surface-1: rgba(255,255,255,0.75);
  --text:      #1a2940;
  --text-primary:   #111827;
  --text-secondary: #475569;
  --text-muted:#556478;
  --border:    rgba(45,106,79,0.18);
  --shadow:    0 4px 24px rgba(0,0,0,0.1);
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }

html,body { height:100%; overflow:hidden; }

body {
  font-family:'DM Sans',sans-serif;
  background:#030812;
  color:var(--text);
  display:flex;
  flex-direction:column;
  transition:color .3s;
  position:relative;
}

/* ══════════════════════════════════════════════════════════════════
   HINTERGRUND — zwei Varianten, umschaltbar

   Bis 09.09.2026 gab es nur eine: die animierte. Sie besteht aus drei
   Lagen (Farbverlauf-Gitter, Sternenfeld, zwei schwebende Kugeln) und
   war fest verdrahtet — genau deshalb liess sie sich nicht gegen ein
   Bild tauschen.

   Jetzt entscheidet eine Klasse am <html>-Element:
     ohne Klasse       → die animierte Variante wie bisher
     .hg-bild          → ein festes Bild, Animation komplett aus

   Das Bild selbst steht in der Variablen --hg-bild und wird beim Laden
   aus der Auswahl gesetzt. Die Animation wird dabei nicht nur
   uebermalt, sondern abgeschaltet: eine Animation, die unsichtbar
   weiterlaeuft, kostet auf einem Laptop ohne Grafikchip trotzdem
   Rechenzeit.
   ══════════════════════════════════════════════════════════════════ */
html.hg-bild body::before,
html.hg-bild body::after { animation:none!important; }

html.hg-bild body::after { display:none; }          /* Sternenfeld weg */
html.hg-bild .orb        { display:none!important; } /* schwebende Kugeln weg */

html.hg-bild body::before {
  background:
    linear-gradient(rgba(3,8,18,.72), rgba(3,8,18,.72)),
    var(--hg-bild, none) center center / cover no-repeat fixed,
    linear-gradient(135deg, #030812 0%, #050d1a 50%, #040a16 100%)!important;
  background-size:auto, cover, auto!important;
  opacity:1!important;
}

/* Das J-Wasserzeichen hinter dem Chat waere neben einem Bildhintergrund
   doppelt gemoppelt — bei Bildhintergrund also aus. */
html.hg-bild #messages::before { display:none; }

/* Deep space animated background + holographic grid */
body::before {
  content:'';
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(45,106,79,0.13) 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at 85% 80%, rgba(6,182,212,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(34,197,94,0.04) 0%, transparent 70%),
    linear-gradient(rgba(34,197,94,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,197,94,0.03) 1px, transparent 1px),
    linear-gradient(135deg, #030812 0%, #050d1a 50%, #040a16 100%);
  background-size:auto,auto,auto,40px 40px,40px 40px,auto;
  animation:bgShift 16s ease-in-out infinite alternate;
}

/* Starfield / particle layer */
body::after {
  content:'';
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background-image:
    radial-gradient(1px 1px at 8%  12%, rgba(34,197,94,0.55) 0%,transparent 100%),
    radial-gradient(1px 1px at 22% 38%, rgba(255,255,255,0.18) 0%,transparent 100%),
    radial-gradient(1.5px 1.5px at 43% 18%, rgba(6,182,212,0.4) 0%,transparent 100%),
    radial-gradient(1px 1px at 61% 52%, rgba(34,197,94,0.3)  0%,transparent 100%),
    radial-gradient(1px 1px at 77% 28%, rgba(255,255,255,0.14) 0%,transparent 100%),
    radial-gradient(1px 1px at 89% 68%, rgba(6,182,212,0.25) 0%,transparent 100%),
    radial-gradient(1.5px 1.5px at 33% 74%, rgba(34,197,94,0.35) 0%,transparent 100%),
    radial-gradient(1px 1px at 53% 88%, rgba(255,255,255,0.16) 0%,transparent 100%),
    radial-gradient(1px 1px at 14% 63%, rgba(34,197,94,0.22) 0%,transparent 100%),
    radial-gradient(1px 1px at 72%  8%, rgba(255,255,255,0.18) 0%,transparent 100%),
    radial-gradient(1px 1px at 95% 44%, rgba(34,197,94,0.18) 0%,transparent 100%),
    radial-gradient(1px 1px at 38% 55%, rgba(6,182,212,0.2)  0%,transparent 100%);
  animation:starDrift 40s linear infinite;
}

@keyframes bgShift  { 0%{opacity:.75} 100%{opacity:1} }
@keyframes starDrift{ 0%{transform:translateY(0) translateX(0)} 100%{transform:translateY(-18px) translateX(8px)} }

/* Floating holographic orbs */
.orb {
  position:fixed;
  border-radius:50%;
  filter:blur(80px);
  opacity:0.15;
  pointer-events:none;
  z-index:0;
  animation:orbFloat 20s ease-in-out infinite;
}
.orb-1 {
  width:600px; height:600px;
  background:radial-gradient(circle, #22c55e, transparent);
  top:-200px; left:-200px;
  animation-delay:0s;
}
.orb-2 {
  width:400px; height:400px;
  background:radial-gradient(circle, #06b6d4, transparent);
  bottom:-100px; right:-100px;
  animation-delay:-10s;
}
@keyframes orbFloat {
  0%,100% { transform:translate(0,0) scale(1); }
  33%     { transform:translate(30px,-30px) scale(1.05); }
  66%     { transform:translate(-20px,20px) scale(0.95); }
}
body.light .orb { display:none; }

/* Lift everything above the background */
#topbar,#layout,#toast,.overlay,#mic-error-banner { position:relative; z-index:1; }

/* Light theme overrides */
body.light { background:#eef2f7; }
body.light::before,body.light::after { display:none; }

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width:4px; height:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(34,197,94,0.3); border-radius:2px; }
::-webkit-scrollbar-thumb:hover { background:rgba(34,197,94,0.55); }

/* =====================================================
   TOP STATUS BAR
   ===================================================== */
#topbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 20px;
  height:54px;
  background:rgba(3,8,18,0.8);
  backdrop-filter:blur(30px) saturate(180%);
  -webkit-backdrop-filter:blur(30px) saturate(180%);
  border-bottom:1px solid rgba(34,197,94,0.2);
  flex-shrink:0;
  gap:12px;
  z-index:10;
  position:relative;
  overflow:visible;
  box-shadow:0 4px 32px rgba(0,0,0,0.5), inset 0 -1px 0 rgba(34,197,94,0.08);
}
body.light #topbar { background:rgba(238,242,247,0.92); border-bottom-color:rgba(45,106,79,0.18); }

.topbar-left { display:flex; align-items:center; gap:10px; flex-shrink:0; }

@keyframes shimmer { 0%{background-position:0% center} 100%{background-position:200% center} }

.topbar-center { display:flex; align-items:center; gap:14px; flex:1; justify-content:center; }

/* Centered JUNO title block */
.juno-title-block {
  display:flex; align-items:center; gap:12px;
}
.juno-logo-img {
  height:40px; width:auto;
  display:block;
}
.juno-logo-img, .juno-logo-fallback { animation:logoGlow 3s ease-in-out infinite; }
@keyframes logoGlow {
  0%,100% { filter:drop-shadow(0 0 8px rgba(34,197,94,0.6)); }
  50%     { filter:drop-shadow(0 0 20px rgba(34,197,94,0.9)); }
}
.juno-logo-fallback {
  width:40px; height:40px;
  background:linear-gradient(135deg,#2d6a4f,#163d2c);
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-family:'Playfair Display',serif;
  font-size:20px; font-weight:900;
  color:#22c55e;
  box-shadow:0 0 18px rgba(34,197,94,0.45);
  flex-shrink:0;
}
.juno-name {
  font-size:36px; font-weight:700;
  background:linear-gradient(135deg,#22c55e,#06b6d4);
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 0 20px rgba(34,197,94,0.5));
  font-family:'DM Sans',sans-serif;
  letter-spacing:1px;
  line-height:1;
  flex-shrink:0;
}
body.light .juno-name {
  background:linear-gradient(135deg,#16a34a,#0891b2);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  filter:none;
}
.juno-subtitles { display:flex; flex-direction:column; justify-content:center; gap:1px; }
.juno-sub1 { font-size:13px; color:#e2e8f0; white-space:nowrap; }
.juno-sub2 { font-size:11px; color:#94a3b8; white-space:nowrap; }

.status-pill {
  display:flex; align-items:center; gap:7px;
  padding:5px 14px;
  background:rgba(255,255,255,0.05);
  backdrop-filter:blur(12px);
  border:1px solid rgba(34,197,94,0.12);
  border-radius:20px;
  font-size:11.5px; color:var(--text-muted);
  white-space:nowrap;
}
body.light .status-pill { background:rgba(255,255,255,0.6); border-color:rgba(45,106,79,0.15); }

.dot {
  width:8px; height:8px; border-radius:50%;
  background:var(--text-muted);
  flex-shrink:0; transition:background .4s,box-shadow .4s;
}
.dot.green  { background:var(--accent); animation:neonPulse 1.8s infinite; }
.dot.red    { background:var(--danger); box-shadow:0 0 8px rgba(239,68,68,0.8); }
.dot.orange { background:var(--warning); animation:pulseRing 1.5s infinite; }

@keyframes pulseRing {
  0%   { box-shadow:0 0 0 0 rgba(245,158,11,.8); }
  70%  { box-shadow:0 0 0 8px rgba(245,158,11,0); }
  100% { box-shadow:0 0 0 0 rgba(245,158,11,0); }
}

/* Neon pulse – used on active mic / listening indicators */
@keyframes neonPulse {
  0%,100% { box-shadow:0 0 5px #22c55e, 0 0 10px #22c55e; }
  50%     { box-shadow:0 0 20px #22c55e, 0 0 40px #22c55e, 0 0 60px #22c55e; }
}

/* Keep old pulse-dot name alive for any remaining references */
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.4)} }

.topbar-right { display:flex; align-items:center; gap:8px; flex-shrink:0; }

/* Teil D: FlowMind/Werkstatt Kopfzeilen-Buttons — "besondere Eingänge".
   Gradient-Border-Trick: zwei Hintergrund-Ebenen (padding-box = Füllung,
   border-box = Gradient), kein extra Wrapper-Element nötig. Farbe/Glow pro
   Variante über CSS-Variablen, damit Keyframes/Hover eine Regel bedienen. */
.header-entry-btn {
  position:relative;
  display:inline-flex; align-items:center; gap:6px;
  padding:7px 16px 7px 12px;
  border-radius:999px;
  border:1.5px solid transparent;
  background:
    linear-gradient(rgba(8,12,22,0.78),rgba(8,12,22,0.78)) padding-box,
    var(--header-entry-gradient) border-box;
  color:#fff; font-family:'DM Sans',sans-serif;
  font-size:12.5px; font-weight:600;
  cursor:pointer; white-space:nowrap;
  transition:transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  animation:headerEntryPulse 2.5s ease-in-out infinite;
}
.header-entry-btn .header-entry-icon { font-size:15px; line-height:1; }
.header-entry-btn.flowmind  { --header-entry-gradient:linear-gradient(135deg,#3b82f6,#8b5cf6); --header-entry-glow:rgba(139,92,246,0.55); }
.header-entry-btn.werkstatt { --header-entry-gradient:linear-gradient(135deg,#f59e0b,#f97316); --header-entry-glow:rgba(249,115,22,0.55); }
.header-entry-btn.leitstand { --header-entry-gradient:linear-gradient(135deg,#2E7D32,#2AA8A0); --header-entry-glow:rgba(42,168,160,0.55); }
.header-entry-btn.glowmind  { --header-entry-gradient:linear-gradient(135deg,#8B5CF6,#EC4899,#F43F5E); --header-entry-glow:rgba(236,72,153,0.65); }
.topbar-divider { width:1px; align-self:stretch; margin:6px 4px; background:rgba(255,255,255,0.12); border-radius:1px; }
body.light .topbar-divider { background:rgba(0,0,0,0.12); }

@keyframes headerEntryPulse {
  0%,100% { box-shadow:0 0 0 0 var(--header-entry-glow); }
  50%     { box-shadow:0 0 12px 3px var(--header-entry-glow); }
}
.header-entry-btn:hover, .header-entry-btn:focus-visible {
  animation-play-state:paused;
  box-shadow:0 0 14px 2px var(--header-entry-glow);
  transform:scale(1.04);
}
.header-entry-btn:active { transform:scale(0.98); }

@media (prefers-reduced-motion:reduce) {
  .header-entry-btn { animation:none; }
}

body.light .header-entry-btn {
  background:
    linear-gradient(rgba(255,255,255,0.88),rgba(255,255,255,0.88)) padding-box,
    var(--header-entry-gradient) border-box;
  color:#1a2940;
}

@media (max-width:600px) {
  .header-entry-btn .header-entry-label { display:none; }
  .header-entry-btn { padding:8px 10px; gap:0; }
}

.top-btn {
  padding:6px 13px;
  background:rgba(255,255,255,0.05);
  backdrop-filter:blur(10px);
  border:1px solid rgba(34,197,94,0.14);
  border-radius:9px;
  transform-style:preserve-3d;
  color:var(--text); font-family:'DM Sans',sans-serif;
  font-size:12px; cursor:pointer;
  transition:all .22s cubic-bezier(.34,1.56,.64,1);
  white-space:nowrap;
}
.top-btn:hover {
  background:linear-gradient(135deg,rgba(45,106,79,0.55),rgba(34,197,94,0.18));
  border-color:rgba(34,197,94,0.5); color:#fff;
  box-shadow:0 20px 40px rgba(34,197,94,0.2);
  transform:translateY(-3px) rotateX(5deg);
}
.top-btn:active { transform:translateY(1px); box-shadow:none; }
body.light .top-btn { background:rgba(255,255,255,0.7); border-color:rgba(45,106,79,0.2); color:#1a2940; }
body.light .top-btn:hover { background:rgba(45,106,79,0.12); color:#1a2940; }

/* ── ⚙ Menu (2026-08-18): sammelt Design/Health/Einstellungen/Vollbild/
   Mikrofon-Mute/Anordnen hinter einem Knopf statt sie einzeln in der
   Kopfzeile aufzureihen. Gleiche Farb-/Blur-Sprache wie #topbar selbst. */
.top-menu-wrap { position:relative; }
.top-menu-dropdown {
  position:absolute; top:calc(100% + 8px); right:0; z-index:50;
  display:flex; flex-direction:column; gap:3px;
  min-width:210px; padding:8px;
  background:rgba(3,8,18,0.97);
  backdrop-filter:blur(24px) saturate(180%); -webkit-backdrop-filter:blur(24px) saturate(180%);
  border:1px solid rgba(34,197,94,0.25); border-radius:12px;
  box-shadow:0 16px 44px -16px rgba(0,0,0,.85);
  opacity:0; visibility:hidden; pointer-events:none;
  transform:translateY(-8px) scale(.97); transform-origin:top right;
  transition:opacity .18s ease, transform .18s cubic-bezier(.34,1.56,.64,1), visibility .18s;
}
.top-menu-dropdown.open { opacity:1; visibility:visible; pointer-events:auto; transform:translateY(0) scale(1); }
body.light .top-menu-dropdown { background:rgba(238,242,247,0.98); border-color:rgba(45,106,79,0.25); }
.top-menu-item {
  display:flex; align-items:center; gap:8px; width:100%;
  padding:10px 12px; border-radius:8px; border:none; background:transparent;
  color:var(--text); font-family:'DM Sans',sans-serif; font-size:13px; text-align:left;
  cursor:pointer; white-space:nowrap; min-height:38px;
  transition:background .15s;
}
.top-menu-item:hover { background:rgba(34,197,94,0.14); }
body.light .top-menu-item:hover { background:rgba(45,106,79,0.12); }
@media (max-width:600px) {
  .top-menu-dropdown {
    position:fixed; left:8px; right:8px; top:54px;
    width:auto; min-width:0;
    transform-origin:top center;
  }
}

#mute-btn {
  padding:5px 11px; font-size:13px;
  background:rgba(34,197,94,0.08); border:1px solid rgba(34,197,94,0.25);
  transition:all .2s;
}
#mute-btn.muted {
  background:rgba(239,68,68,0.18); border-color:rgba(239,68,68,0.5);
  color:#f87171; box-shadow:0 0 10px rgba(239,68,68,0.25);
}

/* Model switcher dropdown */
.model-switcher { position:relative; }
.model-btn {
  padding:5px 11px; font-size:11px;
  background:rgba(34,197,94,0.08); border:1px solid rgba(34,197,94,0.25);
  border-radius:9px; color:var(--text); cursor:pointer;
  font-family:'DM Sans',sans-serif; white-space:nowrap;
  display:flex; align-items:center; gap:5px; transition:all .2s;
}
.model-btn:hover { background:rgba(34,197,94,0.18); border-color:rgba(34,197,94,0.5); }
.model-menu {
  position:absolute; top:calc(100% + 6px); left:0;
  background:rgba(5,13,26,0.97); border:1px solid rgba(34,197,94,0.2);
  border-radius:10px; padding:4px; min-width:170px;
  display:none; flex-direction:column; gap:2px; z-index:999;
  box-shadow:0 8px 32px rgba(0,0,0,0.5);
}
.model-menu.open { display:flex; }
.model-opt {
  padding:7px 12px; border-radius:7px; text-align:left;
  background:transparent; border:none; color:var(--text);
  font-size:12px; font-family:'DM Sans',sans-serif; cursor:pointer; white-space:nowrap;
}
.model-opt:hover { background:rgba(34,197,94,0.12); }
.model-opt.active-model { background:rgba(34,197,94,0.15); color:#22c55e; }
body.light .model-btn { background:rgba(45,106,79,0.06); border-color:rgba(45,106,79,0.25); color:#1a2940; }
body.light .model-menu { background:rgba(238,242,247,0.98); border-color:rgba(45,106,79,0.2); }
body.light .model-opt:hover { background:rgba(45,106,79,0.1); }
#mute-btn.muted:hover { background:rgba(239,68,68,0.28); border-color:rgba(239,68,68,0.7); color:#fff; }

/* =====================================================
   MAIN LAYOUT
   ===================================================== */
#layout {
  display:grid;
  grid-template-columns:252px 1fr 278px;
  flex:1; overflow:hidden;
}

/* =====================================================
   LEFT SIDEBAR
   ===================================================== */
#sidebar {
  background:rgba(255,255,255,0.02);
  backdrop-filter:blur(20px) saturate(180%);
  -webkit-backdrop-filter:blur(20px) saturate(180%);
  border-right:1px solid rgba(34,197,94,0.15);
  border-left:2px solid rgba(34,197,94,0.3);
  display:flex; flex-direction:column;
  overflow-y:auto; overflow-x:hidden;
  box-shadow:0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}
body.light #sidebar { background:rgba(255,255,255,0.82); border-right-color:rgba(45,106,79,0.15); border-left-color:rgba(45,106,79,0.3); }

.sidebar-inner { padding:14px; display:flex; flex-direction:column; gap:14px; }

.section-title {
  font-size:9.5px; text-transform:uppercase;
  letter-spacing:1.8px; color:rgba(34,197,94,0.6);
  font-weight:700; padding:0 2px; margin-bottom:6px;
}
body.light .section-title { color:rgba(45,106,79,0.7); }

/* Mini calendar widget (sidebar, replaces the old Kalender quick tile) */
.mini-cal {
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:10px;
  cursor:pointer;
  max-height:260px;
  overflow-y:auto;
  transition:border-color .2s;
}
.mini-cal:hover { border-color:rgba(34,197,94,0.4); }
.mini-cal-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:6px;
}
.mini-cal-title {
  font-size:12px; font-weight:700; color:var(--text); text-transform:capitalize;
}
.mini-cal-nav {
  background:none; border:none; color:var(--text-muted);
  font-size:14px; line-height:1; padding:2px 6px; border-radius:6px; cursor:pointer;
}
.mini-cal-nav:hover { background:rgba(34,197,94,0.15); color:var(--accent); }
.mini-cal-daynames {
  display:grid; grid-template-columns:repeat(7,1fr); margin-bottom:2px;
}
.mini-cal-daynames span { font-size:9px; color:var(--text-muted); text-align:center; }
.mini-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.mini-cal-day {
  position:relative;
  display:flex; align-items:center; justify-content:center;
  height:22px; font-size:11px; color:var(--text);
  border-radius:6px; cursor:pointer;
}
.mini-cal-day:hover { background:rgba(34,197,94,0.15); }
.mini-cal-day.other-month { opacity:0.3; }
.mini-cal-day.today { background:var(--accent); color:#fff; font-weight:700; }
.mini-cal-day-dot {
  position:absolute; bottom:2px; width:4px; height:4px;
  border-radius:50%; background:var(--accent);
}
.mini-cal-day.today .mini-cal-day-dot { background:#fff; }

/* Quick buttons */
.qbtn {
  width:100%; display:flex; align-items:center; gap:9px;
  padding:9px 12px;
  background:rgba(34,197,94,0.05);
  border:1px solid rgba(34,197,94,0.1);
  border-left:3px solid transparent;
  border-radius:12px; color:var(--text);
  font-family:'DM Sans',sans-serif; font-size:12.5px;
  cursor:pointer; text-align:left;
  transition:all .3s cubic-bezier(.34,1.56,.64,1);
  transform-style:preserve-3d;
  margin-bottom:5px; position:relative; overflow:hidden;
}
.qbtn::before {
  content:''; position:absolute; inset:0;
  background:linear-gradient(135deg,rgba(34,197,94,0.1),transparent);
  opacity:0; transition:opacity .2s;
}
.qbtn:hover {
  background:rgba(34,197,94,0.15);
  border-color:rgba(34,197,94,0.4); color:#fff;
  transform:translateY(-3px) rotateX(5deg);
  box-shadow:0 20px 40px rgba(34,197,94,0.2);
}
.qbtn:hover::before { opacity:1; }
.qbtn:active { transform:translateY(-1px) scale(0.98); }
.qbtn.active {
  background:rgba(34,197,94,0.2);
  border-left-color:#22c55e;
  box-shadow:var(--neon-glow);
}
.qbtn .qemoji { font-size:15px; flex-shrink:0; }
.qbtn-biz { border-color:rgba(184,134,11,0.2); background:rgba(184,134,11,0.05); }
.qbtn-biz:hover {
  background:rgba(184,134,11,0.18); border-color:rgba(240,192,64,0.45);
  box-shadow:0 4px 16px rgba(184,134,11,0.2);
}
body.light .qbtn { background:rgba(0,0,0,0.03); border-color:rgba(0,0,0,0.08); color:#1a2940; }
body.light .qbtn:hover { background:rgba(45,106,79,0.1); color:#1a2940; box-shadow:none; }

/* Custom command list */
.cmd-item {
  display:flex; align-items:center; gap:6px;
  padding:7px 10px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.07);
  border-radius:10px; margin-bottom:4px; font-size:12px;
  transition:all .2s;
}
.cmd-item:hover { border-color:rgba(34,197,94,0.22); background:rgba(34,197,94,0.04); }
.cmd-name { flex:1; cursor:pointer; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cmd-name:hover { color:var(--accent); }
.cmd-del { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:13px; padding:2px 4px; border-radius:4px; flex-shrink:0; }
.cmd-del:hover { color:var(--danger); background:rgba(239,68,68,.1); }

/* Memory section in sidebar */
.mem-tags { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:8px; }

.cat-tag {
  padding:2px 8px; border-radius:6px;
  font-size:10px; cursor:pointer; font-weight:600;
  transition:all .2s; backdrop-filter:blur(4px);
}
.cat-tag:hover { opacity:.75; transform:scale(1.06); }
.cat-kunden      { background:rgba(30,58,95,0.6);  color:#60a5fa; border:1px solid rgba(96,165,250,0.2); }
.cat-mitarbeiter { background:rgba(42,30,95,0.6);  color:#a78bfa; border:1px solid rgba(167,139,250,0.2); }
.cat-tarife      { background:rgba(26,53,32,0.6);  color:#4ade80; border:1px solid rgba(74,222,128,0.2); }
.cat-aufgaben    { background:rgba(61,24,0,0.6);   color:#fb923c; border:1px solid rgba(251,146,60,0.2); }
.cat-notizen     { background:rgba(45,45,0,0.6);   color:#fbbf24; border:1px solid rgba(251,191,36,0.2); }
.cat-alle        { background:rgba(255,255,255,0.06); color:var(--text-muted); border:1px solid rgba(255,255,255,0.1); }

.mem-scroll { max-height:180px; overflow-y:auto; }

.mem-entry {
  display:flex; align-items:flex-start; gap:6px;
  padding:7px 9px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.07);
  border-radius:10px; margin-bottom:4px;
  font-size:11px; line-height:1.4; transition:all .2s;
}
.mem-entry:hover { border-color:rgba(34,197,94,0.22); }
.mem-text { flex:1; }
.mem-meta { font-size:10px; color:var(--text-muted); margin-top:2px; }
.mem-del  { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:11px; flex-shrink:0; }
.mem-del:hover { color:var(--danger); }

/* =====================================================
   CHAT AREA
   ===================================================== */
#chat-area { display:flex; flex-direction:column; overflow:hidden; background:transparent; position:relative; }

#messages {
  flex:1; overflow-y:auto;
  padding:20px;
  display:flex; flex-direction:column; gap:16px;
  scroll-behavior:smooth;
  position:relative;
}
#messages::before {
  content:'';
  position:absolute;
  inset:0;
  background-image:url('/public/logo.svg');
  background-repeat:no-repeat;
  background-position:center center;
  background-size:60% auto;
  background-attachment:fixed;
  opacity:0.06;
  pointer-events:none;
  z-index:0;
}
#messages > * { position:relative; z-index:1; }

/* Message bubbles */
.msg { display:flex; gap:10px; max-width:780px; animation:fadein .3s ease; }
.msg.user { flex-direction:row-reverse; align-self:flex-end; }
.msg.asst { align-self:flex-start; }

@keyframes fadein {
  from { opacity:0; transform:translateY(12px) scale(0.98); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

.msg-av {
  width:36px; height:36px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-size:16px; flex-shrink:0; margin-top:2px;
  transition:transform .2s;
}
.msg-av:hover { transform:scale(1.1) rotate(-4deg); }
.msg.user .msg-av {
  background:linear-gradient(135deg,#2d6a4f,#163d2c);
  box-shadow:0 0 14px rgba(34,197,94,0.35);
}
.msg.asst .msg-av {
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(34,197,94,0.16);
  box-shadow:0 0 10px rgba(34,197,94,0.1);
}

.msg-body { max-width:88%; }

.msg-bubble {
  background:rgba(255,255,255,0.06);
  backdrop-filter:blur(18px) saturate(180%);
  -webkit-backdrop-filter:blur(18px) saturate(180%);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:16px;
  padding:12px 16px;
  font-size:13.5px; line-height:1.65; word-break:break-word;
  box-shadow:0 4px 18px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.07);
  transition:box-shadow .2s, transform .2s;
}
.msg-bubble:hover {
  box-shadow:0 8px 28px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.1);
  transform:translateY(-1px);
}
.msg.user .msg-bubble {
  background:rgba(34,197,94,0.1);
  border-color:rgba(34,197,94,0.2);
  border-radius:16px 16px 4px 16px;
  box-shadow:0 4px 18px rgba(34,197,94,0.14), 0 0 0 1px rgba(34,197,94,0.08);
}
.msg.asst .msg-bubble {
  background:rgba(255,255,255,0.03);
  border-color:rgba(255,255,255,0.08);
  border-radius:4px 16px 16px 16px;
  border-left:3px solid rgba(34,197,94,0.6);
}
body.light .msg-bubble { background:rgba(255,255,255,0.72); border-color:rgba(0,0,0,0.08); box-shadow:0 2px 12px rgba(0,0,0,0.08); }
body.light .msg.user .msg-bubble { background:linear-gradient(135deg,rgba(45,106,79,0.12),rgba(34,197,94,0.05)); }
.msg.system-reminder .msg-av { background:rgba(245,158,11,0.15); border-color:rgba(245,158,11,0.35); box-shadow:0 0 10px rgba(245,158,11,0.15); }
.msg.system-reminder .msg-bubble { border-left:3px solid #f59e0b; background:rgba(245,158,11,0.07); border-color:rgba(245,158,11,0.22); }
body.light .msg.system-reminder .msg-bubble { background:rgba(245,158,11,0.08); border-color:rgba(245,158,11,0.3); }

/* Image preview inside chat bubble */
.msg-img-preview {
  max-width:220px; border-radius:10px; margin-bottom:8px;
  border:1px solid rgba(34,197,94,0.25);
  box-shadow:0 4px 16px rgba(0,0,0,0.4); display:block;
}

.msg-meta { display:flex; align-items:center; gap:8px; margin-top:6px; padding:0 2px; }
.msg-time { font-size:10.5px; color:var(--text-muted); }

.fb-row { display:flex; gap:5px; }
.fb-btn {
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:7px; padding:3px 9px;
  cursor:pointer; font-size:13px;
  transition:all .2s; color:var(--text-muted);
  backdrop-filter:blur(8px);
}
.fb-btn:hover {
  background:rgba(255,255,255,0.1);
  transform:scale(1.14) translateY(-2px);
  box-shadow:0 4px 12px rgba(0,0,0,0.3);
}
.fb-btn.active {
  background:linear-gradient(135deg,rgba(45,106,79,0.5),rgba(34,197,94,0.2));
  border-color:rgba(34,197,94,0.4); color:#fff;
  box-shadow:0 0 12px rgba(34,197,94,0.3);
}

/* Typing indicator */
.typing-bubble {
  display:flex; gap:6px; padding:13px 18px;
  background:rgba(255,255,255,0.06);
  backdrop-filter:blur(18px);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:4px 16px 16px 16px;
  width:fit-content;
}
.typing-bubble span {
  width:8px; height:8px; border-radius:50%;
  background:var(--accent);
  animation:bounce .9s infinite, neonPulse 1.8s infinite;
}
.typing-bubble span:nth-child(2) { animation-delay:.2s; }
.typing-bubble span:nth-child(3) { animation-delay:.4s; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

/* =====================================================
   CHAT MINIMIZE + FUTURISTIC HOMEPAGE
   ===================================================== */
.chat-toggle-btn {
  position:absolute; top:10px; left:50%; transform:translateX(-50%);
  z-index:5;
  padding:6px 16px;
  background:rgba(255,255,255,0.04);
  backdrop-filter:blur(16px) saturate(180%);
  -webkit-backdrop-filter:blur(16px) saturate(180%);
  border:1px solid rgba(34,197,94,0.3);
  border-radius:20px;
  color:var(--text); font-family:'DM Sans',sans-serif;
  font-size:11.5px; font-weight:600; cursor:pointer;
  box-shadow:0 4px 16px rgba(0,0,0,0.3), 0 0 0 1px rgba(34,197,94,0.05);
  transition:all .25s cubic-bezier(.34,1.56,.64,1);
}
.chat-toggle-btn:hover {
  background:rgba(34,197,94,0.14); border-color:rgba(34,197,94,0.55);
  box-shadow:0 0 18px rgba(34,197,94,0.3), 0 4px 16px rgba(0,0,0,0.3);
  transform:translateX(-50%) translateY(-2px);
}
body.light .chat-toggle-btn { background:rgba(255,255,255,0.75); color:#1a2940; }

.chat-panel {
  flex:1; min-height:0;
  display:flex; flex-direction:column;
  transition:all .4s cubic-bezier(0.4,0,0.2,1);
  overflow:hidden;
}
.chat-panel.minimized { flex:0 0 0; max-height:0; opacity:0; }

.homepage-view { display:none; }
/* NICHT ÄNDERN — Mikrofon-Icon-Layout, siehe Fix Juli 2026.
   Ursache des wiederholten Bugs: html/body/#chat-area sind überall
   overflow:hidden, und dieser Container zentrierte seinen Inhalt (Begrüßung
   + beide Kachel-Gruppen + Mic-Button) ohne eigenes Overflow-Handling.
   Sobald deren Summenhöhe die verfügbare Höhe übersteigt (z.B. durch neu
   hinzugekommene Kacheln), wurden obere/untere Icons unsichtbar
   abgeschnitten UND waren nicht scrollbar erreichbar — auf Laptop, iPhone
   Safari und PC-Vollbild gleichermaßen, je nach Viewport-Höhe.
   Fix: overflow-y:auto macht den Bereich bei Bedarf scrollbar;
   "safe center" zentriert weiterhin wenn genug Platz ist, richtet aber
   automatisch oben aus statt abzuschneiden, sobald der Inhalt nicht mehr
   hineinpasst (mit Fallback auf Start-Ausrichtung in Browsern ohne
   "safe"-Unterstützung — nie wieder unsichtbares Abschneiden). */
.homepage-view.visible {
  display:flex; flex:1; min-height:0;
  flex-direction:column; align-items:center; justify-content:safe center;
  gap:36px;
  height:100%;
  overflow-y:auto; -webkit-overflow-scrolling:touch;
  animation:fadeIn .4s ease;
  position:relative; z-index:1;
  /* Nur additiver Freiraum am Scroll-Ende (Uren-Knopf soll nicht am Rand
     kleben) — rührt NICHTS an der oben dokumentierten Overflow/Zentrier-
     Logik an. */
  padding-bottom:48px;
}

.home-greeting { text-align:center; }
.home-greeting-text {
  font-size:32px; font-weight:700;
  background:linear-gradient(135deg,#22c55e,#06b6d4);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 0 20px rgba(34,197,94,0.6));
  font-family:'DM Sans',sans-serif;
}
body.light .home-greeting-text { filter:none; }
.home-greeting-datetime { font-size:13px; color:var(--text-muted); margin-top:6px; letter-spacing:.3px; }

/* Homepage tile layout: a single grid holds every tile (grid-auto-flow
   fills cells left-to-right, row by row, so an incomplete last row just
   stays short — no filler cells, no hardcoded row count). The mic is a
   flex sibling BEFORE the grid, not a grid cell itself, so it's always
   centered above the tiles by .homepage-tiles-wrap's own flex centering,
   independent of tile count or row count. */
.homepage-tiles-wrap {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:24px;
}
.home-tiles-group {
  display:grid;
  grid-auto-flow:row;
  grid-template-columns:repeat(3, 140px);
  gap:20px;
  justify-content:center;
}

.home-tile {
  width:140px; height:140px; flex-shrink:0;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(34,197,94,0.2);
  border-radius:20px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  cursor:pointer; text-align:center; padding:8px;
  transform-style:preserve-3d;
  transition:all .3s cubic-bezier(.34,1.56,.64,1);
}
.home-tile:hover {
  transform:translateY(-4px) rotateX(5deg);
  border-color:rgba(34,197,94,0.55);
  box-shadow:0 20px 40px rgba(34,197,94,0.2);
  background:rgba(34,197,94,0.06);
}
.home-tile-icon { font-size:42px; line-height:1; }
.home-tile-name { font-size:13.5px; font-weight:700; color:var(--text); }
.home-tile-status { font-size:10.5px; color:var(--accent); opacity:0.85; }
body.light .home-tile { background:rgba(255,255,255,0.7); }

/* Teil E: Homepage-Kategorien — E4 gilt hier: keine .home-tile wird entfernt
   oder umgeschrieben, nur per Klasse ein-/ausgeblendet (Ebene 1) bzw.
   kurz hervorgehoben (Suche/Sprung-Ziel). */
.home-tile-kat-hidden { display:none !important; }
@keyframes homeTileHighlight {
  0%,100% { box-shadow:none; }
  30%,70% { box-shadow:0 0 0 3px rgba(34,197,94,0.6), 0 0 24px rgba(34,197,94,0.35); }
}
.home-tile-highlight { animation:homeTileHighlight 1.6s ease-in-out; }

/* "Heute"-Streifen — E1: max. 4 Einträge, nur sichtbar wenn nicht leer
   (JS toggelt display:none/''), niemals ein eigener Fehlerzustand. */
.home-heute-strip {
  display:flex; flex-wrap:wrap; gap:8px; justify-content:center;
  max-width:900px;
}
.home-heute-item {
  display:flex; align-items:center; gap:6px;
  padding:8px 14px; min-height:44px; box-sizing:border-box;
  border-radius:20px;
  background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.12);
  font-size:12.5px; color:var(--text-muted); white-space:nowrap;
  cursor:pointer; transition:background .2s, color .2s;
}
.home-heute-item:hover { background:rgba(34,197,94,0.1); color:var(--text); }

/* Kachel-Suche */
.home-tile-search-wrap { position:relative; width:100%; max-width:420px; }
.home-tile-search-input {
  width:100%; box-sizing:border-box; min-height:44px;
  padding:10px 16px; border-radius:22px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.04); color:var(--text);
  font-size:13.5px; font-family:'DM Sans',sans-serif;
}
.home-tile-search-input:focus { outline:none; border-color:rgba(34,197,94,0.5); }
body.light .home-tile-search-input { background:rgba(255,255,255,0.75); color:#1a2940; }
.home-tile-search-results {
  position:absolute; top:calc(100% + 8px); left:0; right:0;
  background:rgba(5,13,26,0.98); border:1px solid rgba(255,255,255,0.14);
  border-radius:14px; padding:6px; z-index:60; max-height:340px; overflow-y:auto;
  box-shadow:0 16px 40px rgba(0,0,0,0.45);
}
body.light .home-tile-search-results { background:rgba(255,255,255,0.98); }
.home-tile-search-result {
  display:flex; align-items:center; gap:10px; padding:10px 12px; min-height:44px; box-sizing:border-box;
  border-radius:9px; cursor:pointer; font-size:13px; color:var(--text);
}
.home-tile-search-result:hover { background:rgba(34,197,94,0.1); }
.home-tile-search-result-kat { margin-left:auto; font-size:10.5px; color:var(--text-muted); white-space:nowrap; }
.home-tile-search-empty { padding:12px; font-size:12.5px; color:var(--text-muted); text-align:center; }

/* Ebene 0: Kategorie-Karten. Akzentfarbe pro Kategorie sparsam über eine
   CSS-Variable (--kat-farbe, von JS pro Karte gesetzt) — nur Rahmen, sonst
   bleibt es dunkel/ruhig wie der Rest der App (E3: "kein Farb-Zirkus"). */
.home-kategorien-grid {
  display:grid; grid-template-columns:repeat(5, minmax(150px, 1fr));
  gap:16px; width:100%; max-width:1100px;
}
.home-kategorie-karte {
  display:flex; flex-direction:column; align-items:center; gap:8px;
  padding:24px 14px; min-height:44px; box-sizing:border-box;
  border-radius:18px;
  background:rgba(255,255,255,0.035);
  border:1px solid color-mix(in srgb, var(--kat-farbe, #666) 35%, transparent);
  border-left:3px solid var(--kat-farbe, rgba(255,255,255,0.3));
  cursor:pointer; transition:transform .2s, background .2s;
}
.home-kategorie-karte:hover {
  background:color-mix(in srgb, var(--kat-farbe, #666) 10%, rgba(255,255,255,0.04));
  transform:translateY(-3px);
}
body.light .home-kategorie-karte { background:rgba(255,255,255,0.7); }
.home-kategorie-karte-icon { font-size:34px; line-height:1; }
.home-kategorie-karte-name { font-size:14px; font-weight:700; color:var(--text); text-align:center; }
.home-kategorie-karte-status { font-size:10.5px; color:var(--text-muted); text-align:center; min-height:14px; }

/* Ebene 1: geöffnete Kategorie */
.home-kategorie-detail { width:100%; display:flex; flex-direction:column; align-items:center; gap:18px; }
.home-breadcrumb {
  display:flex; align-items:center; gap:6px; width:100%; max-width:1100px;
  font-size:13px; color:var(--text-muted);
}
.home-breadcrumb button {
  background:none; border:none; color:var(--text-muted); cursor:pointer;
  font-size:13px; font-family:'DM Sans',sans-serif; padding:6px 10px; min-height:44px;
  border-radius:8px; display:flex; align-items:center; gap:4px;
}
.home-breadcrumb button:hover { background:rgba(255,255,255,0.07); color:var(--text); }
.home-breadcrumb-current { color:var(--kat-farbe, var(--text)); font-weight:700; }

@media (max-width:600px) {
  .home-kategorien-grid { grid-template-columns:repeat(2, 1fr); gap:10px; }
  .home-kategorie-karte { padding:18px 8px; }
  .home-kategorie-karte-icon { font-size:28px; }
  .home-tiles-group { grid-template-columns:repeat(2, 1fr); }
}

/* KI-Zentrale big tile in the right sidebar: same border/radius/glow as
   .home-tile, just full-width instead of a fixed 140x140 square. */
.rp-ai-tile { width:100%; height:auto; min-height:100px; padding:14px; }
.rp-ai-tile.turbo-active {
  border-color:rgba(56,189,248,0.55);
  background:rgba(56,189,248,0.07);
}
.rp-ai-tile.turbo-active:hover {
  border-color:rgba(56,189,248,0.75);
  box-shadow:0 20px 40px rgba(56,189,248,0.2);
  background:rgba(56,189,248,0.1);
}
.rp-ai-tile.turbo-active .home-tile-status { color:#7dd3fc; }
.rp-ai-tile.superturbo-active {
  border-color:rgba(245,158,11,0.55);
  background:linear-gradient(135deg,rgba(245,158,11,0.09),rgba(168,85,247,0.09));
}
.rp-ai-tile.superturbo-active:hover {
  border-color:rgba(245,158,11,0.8);
  box-shadow:0 20px 40px rgba(245,158,11,0.22);
  background:linear-gradient(135deg,rgba(245,158,11,0.13),rgba(168,85,247,0.13));
}
.rp-ai-tile.superturbo-active .home-tile-status { color:#fbbf24; }

#rp-ki-kette-section { padding:10px 12px; }
.ki-row { display:flex; align-items:flex-start; gap:6px; padding:1px 0; }
.ki-row-dot { width:7px;height:7px;border-radius:50%;flex-shrink:0;margin-top:4px; }
.ki-dot-ok { background:#4ade80; }
.ki-dot-warn { background:#f59e0b; }
.ki-dot-fehler { background:#ef4444; }
.ki-dot-leer { background:#6b7280; }
.ki-row-body { flex:1;min-width:0; }
.ki-row-name { font-weight:600; color:var(--text); }
.ki-row-detail { color:var(--text-muted);font-size:10px;line-height:1.4; }
.ki-row-limit { color:var(--text-muted);font-size:9.5px;font-style:italic; }

/* App's grid – small preview cards (not full-size home tiles) */
.apps-card {
  width:100%; height:120px; min-width:0; position:relative;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
  background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08);
  border-radius:12px; cursor:pointer; text-align:center; padding:10px;
  transition:all .2s ease;
}
.apps-card:hover { border-color:rgba(34,197,94,0.5); background:rgba(34,197,94,0.08); transform:translateY(-2px); }
.apps-card-icon { font-size:26px; line-height:1; }
.apps-card-name { font-size:12.5px; font-weight:600; color:var(--text); }
.apps-card-desc { font-size:10.5px; color:var(--text-muted); }
.apps-card-del {
  position:absolute; top:-6px; right:-6px; width:22px; height:22px; border-radius:50%;
  background:var(--red,#ff4d6a); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:11px; cursor:pointer; box-shadow:0 2px 6px rgba(0,0,0,.4); z-index:1;
}
.apps-card-edit {
  position:absolute; top:-6px; left:-6px; width:22px; height:22px; border-radius:50%;
  background:var(--accent,#4b9fff); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:11px; cursor:pointer; box-shadow:0 2px 6px rgba(0,0,0,.4); z-index:1;
}
.apps-card-order { position:absolute; bottom:-6px; left:50%; transform:translateX(-50%); display:flex; gap:2px; }
.apps-card-order button {
  width:20px; height:18px; border-radius:5px; background:rgba(255,255,255,.15); border:none; color:#fff;
  font-size:10px; cursor:pointer; line-height:1; padding:0;
}
body.light .apps-card { background:rgba(255,255,255,0.7); }

.home-mic {
  width:150px; height:150px; flex-shrink:0; border-radius:50%;
  background:#000; border:2px solid rgba(34,197,94,0.5);
  box-shadow:0 0 30px rgba(34,197,94,0.4);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; position:relative; padding:0;
  overflow:hidden;
  transition:box-shadow .3s, border-color .3s;
}
.home-mic:hover { box-shadow:0 0 40px rgba(34,197,94,0.6); }

.home-mic::after {
  content:'';
  position:absolute; top:0; bottom:0; left:0; width:2px;
  background:linear-gradient(180deg, transparent, rgba(34,197,94,0.6), rgba(6,182,212,0.5), transparent);
  animation:micLaserSweep 4s linear infinite;
  pointer-events:none; opacity:0.5;
}
@keyframes micLaserSweep {
  0%   { left:0;    opacity:0; }
  10%  { opacity:0.5; }
  90%  { opacity:0.5; }
  100% { left:100%; opacity:0; }
}
.home-mic.mic-listening::after { display:none; }

@keyframes micListenGlow {
  0%   { box-shadow:0 0 30px rgba(34,197,94,0.4); }
  100% { box-shadow:0 0 55px rgba(34,197,94,0.8); }
}
.home-mic.mic-listening {
  animation:micListenGlow 1.2s ease-in-out infinite alternate;
}

@keyframes micSpeakGlow {
  0%   { box-shadow:0 0 30px rgba(6,182,212,0.4); }
  100% { box-shadow:0 0 55px rgba(6,182,212,0.85); }
}
.home-mic.mic-speaking {
  border-color:rgba(6,182,212,0.6);
  animation:micSpeakGlow 1.2s ease-in-out infinite alternate;
}

.mic-laser {
  display:block;
  width:75%; height:2px;
  background:#22c55e;
  border-radius:2px;
  animation:laserIdle 2s ease-in-out infinite;
}
@keyframes laserIdle {
  0%,100% { opacity:0.5; transform:scaleX(1); box-shadow:0 0 6px #22c55e; }
  50%     { opacity:1;   transform:scaleX(1.05); box-shadow:0 0 20px #22c55e, 0 0 40px #22c55e; }
}
@keyframes laserSpeak {
  0%   { transform:translateY(0) scaleX(1); }
  20%  { transform:translateY(-10px) scaleX(0.7); }
  40%  { transform:translateY(5px) scaleX(1.2); }
  60%  { transform:translateY(-6px) scaleX(0.85); }
  80%  { transform:translateY(8px) scaleX(1.1); }
  100% { transform:translateY(0) scaleX(1); }
}
.home-mic.juno-speaking .mic-laser {
  animation:laserSpeak 0.5s ease-in-out infinite;
  box-shadow:0 0 20px #22c55e, 0 0 40px #22c55e;
}

.mic-eq { display:none; align-items:flex-end; justify-content:center; height:32px; }
.home-mic.mic-listening .mic-laser { display:none; }
.home-mic.mic-listening .mic-eq { display:flex; }
.eq-bar {
  display:inline-block;
  width:4px; height:14px;
  background:#22c55e;
  border-radius:2px;
  box-shadow:0 0 6px #22c55e;
  margin:0 2px;
  animation:eqBar 0.4s ease-in-out infinite alternate;
}
.eq-bar:nth-child(1) { animation-delay:0s;    height:10px; }
.eq-bar:nth-child(2) { animation-delay:0.1s;  height:22px; }
.eq-bar:nth-child(3) { animation-delay:0.2s;  height:30px; }
.eq-bar:nth-child(4) { animation-delay:0.1s;  height:18px; }
.eq-bar:nth-child(5) { animation-delay:0s;    height:12px; }
@keyframes eqBar {
  0%   { height:8px;  opacity:0.6; }
  100% { height:30px; opacity:1; }
}

/* ── Uren Start/Stopp-Knopf (2026-08, v2) ──────────────────────────────
   Geometrisch identisch zu .home-mic (150px/110px Kreis, schwarzer Grund,
   Glow-Rand, Laser-Sweep) — nur Farbe (JUNO-Grün/Rot) und Inhalt (Icon +
   ggf. Timer statt Mikrofon-EQ) unterscheiden sich. .home-mic selbst wird
   nicht angefasst. */
.home-uren-btn {
  width:150px; height:150px; flex-shrink:0; border-radius:50%;
  background:#000; border:2px solid rgba(63,174,99,0.5);
  box-shadow:0 0 30px rgba(63,174,99,0.4);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  cursor:pointer; position:relative; padding:0; overflow:hidden;
  transition:box-shadow .3s, border-color .3s;
  margin:24px auto 0; /* Abstand zu den Kacheln darüber + horizontal zentriert */
}
.home-uren-btn:hover { box-shadow:0 0 40px rgba(63,174,99,0.6); }
.home-uren-btn::after {
  content:''; position:absolute; top:0; bottom:0; left:0; width:2px;
  background:linear-gradient(180deg, transparent, rgba(63,174,99,0.6), transparent);
  animation:urenLaserSweep 4s linear infinite; pointer-events:none; opacity:0.5;
}
@keyframes urenLaserSweep {
  0%   { left:0;    opacity:0; }
  10%  { opacity:0.5; }
  90%  { opacity:0.5; }
  100% { left:100%; opacity:0; }
}
.home-uren-btn-icon { font-size:44px; color:#3FAE63; line-height:1; }
.home-uren-btn-timer { font-family:'IBM Plex Mono',monospace; font-size:22px; font-weight:700; color:#EDEFEC; }
.home-uren-btn.aktief {
  border-color:rgba(192,57,43,0.6); box-shadow:0 0 30px rgba(192,57,43,0.4);
}
.home-uren-btn.aktief:hover { box-shadow:0 0 40px rgba(192,57,43,0.6); }
.home-uren-btn.aktief::after { display:none; } /* Timer soll ruhig/lesbar bleiben, kein Sweep drüber */
.home-uren-btn.aktief .home-uren-btn-icon { font-size:22px; color:#C0392B; }
@media (max-width:768px) {
  .home-uren-btn { width:110px; height:110px; }
  .home-uren-btn-icon { font-size:32px; }
  .home-uren-btn.aktief .home-uren-btn-icon { font-size:17px; }
  .home-uren-btn-timer { font-size:16px; }
}
@media (max-width:480px) {
  .homepage-view.visible { padding-bottom:32px; } /* etwas weniger Luft als Desktop (48px) */
}

/* ── Uren-Locatie-Auswahl-Modal (2026-08) — Klick auf .home-uren-btn im
   Ruhezustand. Desktop: zentriert. Handy (≤480px): Bottom-Sheet. ──────── */
.uren-locatie-modal-backdrop {
  position:fixed; inset:0; background:rgba(0,0,0,.6); backdrop-filter:blur(4px);
  z-index:500; opacity:0; pointer-events:none; transition:opacity .2s;
}
.uren-locatie-modal-backdrop.open { opacity:1; pointer-events:auto; }
.uren-locatie-modal {
  position:fixed; left:50%; top:50%; transform:translate(-50%,-50%) scale(.95);
  width:92vw; max-width:420px; max-height:80vh;
  background:var(--surface-1,#0d1117); border:1px solid var(--border); border-radius:16px;
  z-index:501; display:flex; flex-direction:column; overflow:hidden;
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s;
}
.uren-locatie-modal.open { opacity:1; pointer-events:auto; transform:translate(-50%,-50%) scale(1); }
.ulm-head { display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid var(--border); flex-shrink:0; }
.ulm-title { font-weight:700; font-size:15px; color:var(--text-primary); }
.ulm-close { background:transparent; border:none; color:var(--text-secondary); font-size:18px; cursor:pointer; width:36px; height:36px; }
.ulm-list { overflow-y:auto; flex:1; }
.ulm-item {
  display:flex; align-items:center; gap:10px; width:100%; min-height:60px; padding:0 18px;
  background:none; border:none; border-bottom:1px solid var(--border); color:var(--text-primary);
  font-size:14px; font-family:inherit; cursor:pointer; text-align:left;
}
.ulm-item:last-child { border-bottom:none; }
.ulm-item:hover, .ulm-item:active { background:rgba(63,174,99,.08); }
.ulm-empty { padding:20px 18px; color:var(--text-secondary); font-size:13px; }
.ulm-cancel {
  margin:14px 18px 18px; padding:12px; border-radius:10px; border:1px solid var(--border);
  background:transparent; color:var(--text-secondary); font-size:13px; font-weight:600; cursor:pointer; flex-shrink:0;
}
@media (max-width:480px) {
  .uren-locatie-modal {
    left:0; top:auto; bottom:0; transform:translateY(100%);
    width:100%; max-width:100%; max-height:75vh; border-radius:20px 20px 0 0;
  }
  .uren-locatie-modal.open { transform:translateY(0); }
}

@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* =====================================================
   INPUT AREA
   ===================================================== */
#input-area {
  display:none;
  padding:14px 18px;
  border-top:1px solid rgba(34,197,94,0.15);
  background:rgba(255,255,255,0.02);
  backdrop-filter:blur(20px) saturate(180%);
  -webkit-backdrop-filter:blur(20px) saturate(180%);
  flex-shrink:0;
  box-shadow:0 -8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}
#input-area.visible { display:block; }
body.light #input-area { background:rgba(238,242,247,0.92); border-top-color:rgba(45,106,79,0.15); }

/* Image preview strip above input */
#img-preview-strip {
  display:none; align-items:center; gap:10px;
  margin-bottom:10px; padding:8px 12px;
  background:rgba(34,197,94,0.06);
  border:1px solid rgba(34,197,94,0.2);
  border-radius:11px; animation:fadein .25s ease;
}
#img-preview-strip.show { display:flex; }
#img-preview-thumb {
  width:48px; height:48px; object-fit:cover;
  border-radius:8px; border:1px solid rgba(34,197,94,0.3);
}
#img-preview-name { font-size:12px; color:var(--text-muted); flex:1; }
#img-preview-remove {
  background:none; border:none; color:var(--text-muted);
  cursor:pointer; font-size:16px; padding:2px 6px;
  border-radius:6px; transition:all .2s;
}
#img-preview-remove:hover { color:var(--danger); background:rgba(239,68,68,0.1); }

.input-row { display:flex; align-items:flex-end; gap:8px; }

#chat-input {
  flex:1;
  background:rgba(255,255,255,0.03);
  backdrop-filter:blur(12px);
  border:1px solid rgba(34,197,94,0.2);
  border-radius:16px; padding:12px 16px;
  color:var(--text); font-family:'DM Sans',sans-serif;
  font-size:13.5px; resize:none;
  min-height:48px; max-height:140px;
  outline:none; line-height:1.5;
  transition:border-color .25s, box-shadow .25s;
  box-shadow:inset 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}
#chat-input:focus {
  border-color:#22c55e;
  box-shadow:0 0 20px rgba(34,197,94,0.2), inset 0 2px 8px rgba(0,0,0,0.2);
}
#chat-input::placeholder { color:var(--text-muted); }
body.light #chat-input { background:rgba(255,255,255,0.8); border-color:rgba(45,106,79,0.2); color:#1a2940; box-shadow:0 2px 8px rgba(0,0,0,0.06); }
body.light #chat-input:focus { border-color:rgba(45,106,79,0.45); box-shadow:0 0 0 3px rgba(45,106,79,0.08); }

.ic-btn {
  width:44px; height:44px; border-radius:12px;
  border:1px solid rgba(255,255,255,0.1);
  background:rgba(255,255,255,0.05);
  backdrop-filter:blur(12px); color:var(--text);
  cursor:pointer; font-size:17px;
  display:flex; align-items:center; justify-content:center;
  transition:all .22s cubic-bezier(.34,1.56,.64,1); flex-shrink:0;
  box-shadow:0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
}
.ic-btn:hover {
  background:rgba(45,106,79,0.38); border-color:rgba(34,197,94,0.5);
  box-shadow:0 0 18px rgba(34,197,94,0.3), 0 4px 14px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  transform:translateY(-2px) scale(1.06);
}
.ic-btn:active { transform:translateY(1px) scale(0.96); box-shadow:0 1px 4px rgba(0,0,0,0.3); }
.ic-btn.active {
  background:rgba(34,197,94,0.22); border-color:rgba(34,197,94,0.6);
  animation:neonPulse 1.4s infinite;
}
.ic-btn.send {
  background:linear-gradient(135deg,rgba(45,106,79,0.6),rgba(34,197,94,0.22));
  border-color:rgba(34,197,94,0.4);
  box-shadow:0 0 14px rgba(34,197,94,0.22), 0 4px 12px rgba(0,0,0,0.3);
}
.ic-btn.send:hover {
  background:linear-gradient(135deg,#22c55e,#16a34a); color:#000;
  box-shadow:0 0 28px rgba(34,197,94,0.55), 0 8px 18px rgba(0,0,0,0.3);
}
.ic-btn.tts-on {
  background:linear-gradient(135deg,rgba(45,106,79,0.5),rgba(34,197,94,0.15));
  border-color:rgba(34,197,94,0.4); box-shadow:0 0 12px rgba(34,197,94,0.2);
}
/* ── Mic recording state ── */
.ic-btn.recording {
  background:linear-gradient(135deg,rgba(153,27,27,0.7),rgba(239,68,68,0.35));
  border-color:rgba(239,68,68,0.7);
  color:#fca5a5;
  animation:pulseRing 1s infinite;
}
#rec-timer {
  display:none;
  font-size:11px; font-family:monospace;
  color:#fca5a5; font-weight:600;
  min-width:34px; text-align:center;
  letter-spacing:.5px;
}

/* ── Always-visible Stopp button ── */
.ic-btn.stopp-btn {
  width:auto; padding:0 12px; font-size:11.5px; font-weight:600; letter-spacing:0.02em;
  background:linear-gradient(135deg,rgba(153,27,27,0.55),rgba(239,68,68,0.25));
  border-color:rgba(239,68,68,0.4); color:#fca5a5;
}
.ic-btn.stopp-btn:hover {
  background:linear-gradient(135deg,#b91c1c,#ef4444); color:#fff;
  box-shadow:0 0 18px rgba(239,68,68,0.5);
}
.ic-btn.stopp-btn.stopp-active {
  background:linear-gradient(135deg,#b91c1c,#ef4444); color:#fff;
  box-shadow:0 0 22px rgba(239,68,68,0.6); animation:pulseRing 1s infinite;
}
body.light .ic-btn { background:rgba(255,255,255,0.7); border-color:rgba(45,106,79,0.2); color:#1a2940; box-shadow:0 2px 6px rgba(0,0,0,0.08); }

.vlang {
  background:rgba(255,255,255,0.06); backdrop-filter:blur(12px);
  border:1px solid rgba(255,255,255,0.1); border-radius:10px;
  color:var(--text); padding:5px 8px; font-size:11.5px;
  font-family:'DM Sans',sans-serif; cursor:pointer; outline:none;
  height:44px; box-shadow:0 2px 8px rgba(0,0,0,0.2); transition:all .2s;
}
.vlang:focus { border-color:rgba(34,197,94,0.4); }

/* =====================================================
   RIGHT PANEL
   ===================================================== */
#right-panel {
  background:rgba(255,255,255,0.02);
  backdrop-filter:blur(20px) saturate(180%);
  -webkit-backdrop-filter:blur(20px) saturate(180%);
  border-left:1px solid rgba(34,197,94,0.15);
  overflow-y:auto; display:flex; flex-direction:column; gap:0;
  box-shadow:0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}
body.light #right-panel { background:rgba(255,255,255,0.82); border-left-color:rgba(45,106,79,0.15); }

/* =====================================================
   MOBILE RESPONSIVE (sidebars become slide-in drawers)
   ===================================================== */
.mobile-toggle-btn { display:none; }

#mobile-overlay {
  display:none;
  position:fixed; inset:0;
  background:rgba(0,0,0,0.5);
  z-index:190;
}

@media (max-width:768px) {
  #layout {
    display:flex;
    flex-direction:column;
  }
  #chat-area { width:100%; }

  #sidebar, #right-panel {
    position:fixed;
    top:54px; bottom:0;
    z-index:200;
    transition:transform 0.25s ease;
  }
  #sidebar {
    left:0; width:80vw; max-width:300px;
    transform:translateX(-100%);
  }
  #right-panel {
    right:0; width:80vw; max-width:320px;
    transform:translateX(100%);
  }
  #sidebar.mobile-open { transform:translateX(0); }
  #right-panel.mobile-open { transform:translateX(0); }

  .mobile-toggle-btn { display:flex; }

  #mobile-overlay.show { display:block; }

  body { overflow-x:hidden; }

  /* Topbar: was designed for a wide desktop row (logo + title + subtitles on
     the left/center, ~8 action buttons on the right) — none of that fits a
     390px screen at once. Shrink the title, drop the subtitles, and let the
     left/right button clusters scroll horizontally instead of clipping. */
  #topbar {
    min-height:54px; height:auto;
    padding:8px 10px;
    padding-top:calc(8px + env(safe-area-inset-top));
    flex-wrap:nowrap;
  }
  .juno-name { font-size:20px; }
  .juno-subtitles { display:none; }
  .topbar-left, .topbar-right {
    overflow-x:auto; scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
  }
  .topbar-left::-webkit-scrollbar, .topbar-right::-webkit-scrollbar { display:none; }
  .top-btn { min-height:40px; padding:8px 12px; }
  .model-menu { max-width:calc(100vw - 24px); }

  /* Homepage quick-action tiles: fixed 140px cells overflow a 390px screen
     and get clipped by body's overflow:hidden. Shrink to a fluid 3-column
     grid (still exactly 3 per row, matching desktop); the mic keeps its
     own fixed size (it's a flex sibling of the grid, not a grid cell, so
     it never stretches to fill a cell — see .homepage-tiles-wrap). */
  .homepage-tiles-wrap { gap:16px; padding:0 12px; max-width:100%; }
  .home-tiles-group {
    grid-template-columns:repeat(3, 1fr);
    gap:8px;
    max-width:100%;
    width:100%;
  }
  .home-tile { width:100%; height:auto; aspect-ratio:1; padding:5px; }
  .home-tile-icon { font-size:22px; }
  .home-tile-name { font-size:9.5px; line-height:1.2; }
  .home-tile-status { font-size:8px; }
  .home-mic { width:110px; height:110px; }

  /* Input area: thumb-reachable, safe-area aware */
  #input-area { padding-bottom:calc(14px + env(safe-area-inset-bottom)); }

  /* Modals: full screen instead of a centered floating box */
  .modal-box {
    width:100vw; max-width:100vw;
    height:100dvh; max-height:100dvh;
    border-radius:0; padding:20px;
    padding-bottom:calc(20px + env(safe-area-inset-bottom));
  }
}

.rp-section {
  padding:15px 17px;
  border-bottom:1px solid rgba(255,255,255,0.04);
  transition:background .2s;
}
.rp-section:last-child { border-bottom:none; }
.rp-section:hover { background:rgba(255,255,255,0.015); }
body.light .rp-section { border-bottom-color:rgba(0,0,0,0.06); }

.rp-title {
  font-family:'Playfair Display',serif;
  font-size:13px; font-weight:700;
  background:linear-gradient(135deg,#22c55e,#86efac);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  background-clip:text; margin-bottom:11px;
}
body.light .rp-title { background:linear-gradient(135deg,#16a34a,#2d6a4f); -webkit-background-clip:text; background-clip:text; }

/* =====================================================
   GROK — Header-Button-Badge, Live-Panel (Chat + Aktivitäten), Mobile-FAB
   ===================================================== */
.header-entry-btn.grok { --header-entry-gradient:linear-gradient(135deg,#a855f7,#7c3aed); --header-entry-glow:rgba(168,85,247,0.55); }
.grok-header-badge { display:flex; align-items:center; gap:4px; font-size:9px; font-weight:600; opacity:.85; margin-left:2px; }
@media (max-width:600px) { .grok-header-badge { display:none; } }

.grok-panel-header { display:flex; align-items:center; justify-content:space-between; cursor:pointer; margin-bottom:10px; user-select:none; }
#grok-panel-toggle-arrow { font-size:11px; color:var(--text-muted); transition:transform .2s; }

.grok-mini-chat {
  background:#0d1020; border:1px solid rgba(34,197,94,0.2); border-top:2px solid #22c55e;
  border-radius:10px; padding:10px; margin-bottom:12px; box-shadow:0 4px 14px rgba(0,0,0,0.3);
}
.grok-mini-chat-head { display:flex; align-items:center; gap:6px; font-size:11px; font-weight:700; color:#e2e8f0; margin-bottom:8px; }
.grok-mini-model-badge { font-size:9px; background:rgba(168,85,247,0.16); color:#a855f7; padding:2px 6px; border-radius:8px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:110px; }
.grok-mini-fullscreen { margin-left:auto; font-size:10px; color:#4b9fff; text-decoration:none; font-weight:600; flex-shrink:0; }
.grok-mini-fullscreen:hover { text-decoration:underline; }
.grok-mini-msgs { max-height:170px; min-height:50px; overflow-y:auto; display:flex; flex-direction:column; gap:6px; margin-bottom:8px; }
.grok-mini-empty { font-size:10.5px; color:var(--text-muted); padding:8px 0; text-align:center; }
.grok-mini-msg { font-size:11px; line-height:1.4; padding:6px 8px; border-radius:8px; max-width:92%; word-break:break-word; white-space:pre-wrap; }
.grok-mini-msg.user { align-self:flex-end; background:rgba(168,85,247,0.14); color:#e2e8f0; }
.grok-mini-msg.asst { align-self:flex-start; background:rgba(255,255,255,0.05); color:#e2e8f0; }
.grok-mini-msg-meta { font-size:9px; color:var(--text-muted); margin-top:3px; }
.grok-mini-input-row { display:flex; gap:6px; }
.grok-mini-input-row input { flex:1; min-width:0; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1); color:var(--text); border-radius:8px; padding:7px 9px; font-size:11px; font-family:inherit; }
.grok-mini-input-row input:focus { outline:none; border-color:#a855f7; }
.grok-mini-input-row button { background:#a855f7; border:none; color:#fff; width:32px; flex-shrink:0; border-radius:8px; cursor:pointer; font-size:13px; }
.grok-mini-input-row button:hover { background:#9333ea; }
.grok-mini-input-row button:disabled { opacity:.5; cursor:default; }

.grok-activity-monitor {
  background:#0a0f1a; border:1px solid rgba(34,197,94,0.2); border-top:2px solid #22c55e;
  border-radius:10px; padding:10px; box-shadow:0 4px 14px rgba(0,0,0,0.3);
}
.grok-activity-head { display:flex; align-items:center; justify-content:space-between; font-size:11px; font-weight:700; color:#e2e8f0; margin-bottom:8px; }
.grok-activity-pulse { display:inline-block; width:6px; height:6px; border-radius:50%; background:#22c55e; margin-left:5px; animation:neonPulse 1.8s infinite; }
.grok-activity-pulse.idle { animation:none; background:#4b5563; box-shadow:none; }
.grok-activity-updated { font-size:9px; color:var(--text-muted); font-weight:400; }
.grok-activity-feed { max-height:230px; overflow-y:auto; font-family:'Courier New',monospace; font-size:10px; line-height:1.6; background:#0a0f1a; border-radius:6px; }
.grok-activity-line { white-space:pre-wrap; word-break:break-word; }
.grok-activity-line.normal { color:#4ade80; }
.grok-activity-line.warn   { color:#f0c040; }
.grok-activity-line.error  { color:#ff4d6a; }
.grok-activity-stats { margin-top:8px; padding-top:8px; border-top:1px solid rgba(255,255,255,0.08); font-size:9.5px; color:var(--text-muted); }

#grok-mobile-fab {
  display:none;
  position:fixed; right:16px; bottom:calc(16px + env(safe-area-inset-bottom));
  width:52px; height:52px; border-radius:50%;
  background:linear-gradient(135deg,#a855f7,#7c3aed); border:none;
  color:#fff; font-size:22px; align-items:center; justify-content:center;
  box-shadow:0 6px 20px rgba(168,85,247,0.5); z-index:195; cursor:pointer;
}
@media (max-width:768px) { #grok-mobile-fab { display:flex; } }
@media (max-width:819px) { #btn-vollbild { display:none; } }

/* ── JUNO Orchestrator: Ampel + Header-Badge ───────────────────────
   ("chefwaechter-*" = interne CSS-/ID-Namen, bleiben unverändert.)
   Rot pulsiert dauerhaft (auffälliges "Leuchten"), Gelb nur, solange
   gerade ein Sweep läuft. Grau = noch nicht aktiviert (keine Prüfer-KI
   erreichbar oder Schalter aus) und bleibt bewusst ruhig — kein Alarm. */
@keyframes chefwaechter-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.chefwaechter-ampel-punkt { width:10px; height:10px; border-radius:50%; display:inline-block; flex-shrink:0; }
.chefwaechter-ampel-gruen { background:#22c55e; box-shadow:0 0 6px rgba(34,197,94,.7); }
.chefwaechter-ampel-gelb  { background:#f59e0b; box-shadow:0 0 6px rgba(245,158,11,.7); }
.chefwaechter-ampel-rot   { background:#ef4444; box-shadow:0 0 9px rgba(239,68,68,.95);
  animation: chefwaechter-pulse 1.2s ease-in-out infinite; }
.chefwaechter-ampel-grau  { background:#6b7280; box-shadow:none; }
.chefwaechter-ampel-gelb.sweep-aktiv { animation: chefwaechter-pulse 2.4s ease-in-out infinite; }

/* Header-Badge: auf JEDER Seite neben dem JUNO-Titel, standardmäßig
   unsichtbar — erscheint nur bei Rot (und dezent bei Gelb). Kein eigener
   Netzwerk-Request: gespeist aus demselben Status-Poll wie das Widget. */
#chefwaechter-header-badge {
  display:none; width:9px; height:9px; border-radius:50%; margin-left:7px;
  background:#ef4444; box-shadow:0 0 8px rgba(239,68,68,.95); vertical-align:middle;
  animation: chefwaechter-pulse 1.2s ease-in-out infinite; cursor:pointer;
}
#chefwaechter-header-badge.zeigen { display:inline-block; }
#chefwaechter-header-badge.gelb { background:#f59e0b; box-shadow:0 0 6px rgba(245,158,11,.8); animation:none; }

/* ── Live-Aktivität: wer arbeitet gerade, woran ───────────────────────
   Ersetzt die frühere rohe JSON-Anzeige. Gespeist aus demselben SSE-Kanal
   (/werkstatt/orchester-stream) wie der Werkstatt-Monitor, hier nur in der
   schmalen Sidebar-Variante: eine Zeile pro Agent statt Karten. */
#chefw-live {
  background:rgba(0,0,0,0.25); border-radius:6px; padding:7px 8px; margin:0;
  min-height:38px; max-height:210px; overflow-y:auto;
}
#chefw-live-aufgabe {
  font-size:10px; color:var(--accent); margin-bottom:6px; line-height:1.35;
  display:none; word-break:break-word;
}
#chefw-live-leer { font-size:10.5px; color:var(--text-muted); }
.chefw-agent {
  display:flex; align-items:flex-start; gap:6px; padding:3px 0; font-size:10.5px;
  border-top:1px solid rgba(255,255,255,0.05);
}
.chefw-agent:first-child { border-top:none; }
.chefw-agent-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; margin-top:5px; background:#6b7280; }
.chefw-agent.aktiv  .chefw-agent-dot { background:#4ade80; animation: chefwaechter-pulse 1s ease-in-out infinite; }
.chefw-agent.fertig .chefw-agent-dot { background:#4ade80; }
.chefw-agent.fehler .chefw-agent-dot { background:#ef4444; }
.chefw-agent-body { flex:1; min-width:0; }
.chefw-agent-name { font-weight:600; color:var(--text); }
.chefw-agent-meta { font-size:9px; color:var(--text-muted); }
.chefw-agent-text {
  font-size:9.5px; color:var(--text-muted); line-height:1.4; margin-top:2px;
  max-height:34px; overflow:hidden; white-space:pre-wrap; word-break:break-word;
}
.chefw-agent.fertig .chefw-agent-text, .chefw-agent.fehler .chefw-agent-text { max-height:none; }

/* ── Mini-Chat mit dem Orchestrator ──────────────────────────────────── */
#chefwaechter-chat-verlauf {
  display:none; max-height:190px; overflow-y:auto; margin:7px 0 6px;
  display:flex; flex-direction:column; gap:6px;
}
.chefw-bubble { max-width:88%; border-radius:10px; padding:5px 8px; font-size:10.5px; line-height:1.45; word-break:break-word; }
.chefw-bubble-wrap { display:flex; flex-direction:column; gap:2px; }
.chefw-bubble-wrap.ich { align-items:flex-end; }
.chefw-bubble-wrap.ki  { align-items:flex-start; }
.chefw-bubble.ich { background:var(--accent); color:#fff; border-bottom-right-radius:3px; }
.chefw-bubble.ki  { background:rgba(255,255,255,0.07); color:var(--text); border-bottom-left-radius:3px; }
.chefw-bubble-wer { font-size:8.5px; color:var(--text-muted); padding:0 3px; letter-spacing:.02em; }
.chefw-bubble-system {
  align-self:center; font-size:9px; color:var(--text-muted);
  background:rgba(255,255,255,0.05); border-radius:8px; padding:2px 8px;
}
.chefw-tippt { display:flex; gap:3px; padding:7px 9px; }
.chefw-tippt span {
  width:5px; height:5px; border-radius:50%; background:var(--text-muted);
  animation: chefw-tippt-hupf 1.3s ease-in-out infinite;
}
.chefw-tippt span:nth-child(2) { animation-delay:.18s; }
.chefw-tippt span:nth-child(3) { animation-delay:.36s; }
@keyframes chefw-tippt-hupf { 0%,60%,100%{opacity:.25;transform:translateY(0)} 30%{opacity:1;transform:translateY(-3px)} }
#chefwaechter-chat-eingabe { display:none; gap:5px; align-items:flex-end; }
#chefwaechter-chat-input {
  flex:1; font-size:11px; resize:none; min-height:30px; max-height:80px;
  background:rgba(0,0,0,0.25); border:1px solid rgba(255,255,255,0.12);
  border-radius:8px; color:var(--text); padding:6px 8px; font-family:inherit; line-height:1.4;
}
#chefwaechter-chat-input:focus { outline:none; border-color:var(--accent); }
#chefw-chat-send {
  background:var(--accent); border:none; color:#fff; border-radius:8px;
  width:30px; height:30px; font-size:13px; cursor:pointer; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
}
#chefw-chat-send:disabled { opacity:.4; cursor:default; }

/* Info card */
.info-card {
  background:rgba(255,255,255,0.04);
  backdrop-filter:blur(12px);
  border:1px solid rgba(255,255,255,0.07);
  border-radius:11px; padding:11px 13px;
  font-size:12px; line-height:1.9; margin-bottom:7px;
  box-shadow:0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
  transition:all .22s;
}
.info-card:hover {
  border-color:rgba(34,197,94,0.16);
  box-shadow:0 8px 26px rgba(0,0,0,0.3), 0 0 0 1px rgba(34,197,94,0.06);
  transform:translateY(-1px);
}
.il { font-size:10.5px; color:var(--text-muted); }
.iv { font-weight:600; color:var(--text); }
body.light .info-card { background:rgba(255,255,255,0.65); border-color:rgba(0,0,0,0.07); }

/* DE/EN pill toggle */
.lang-toggle {
  display:flex;
  background:rgba(255,255,255,0.05); backdrop-filter:blur(10px);
  border:1px solid rgba(255,255,255,0.1); border-radius:10px;
  overflow:hidden; flex-shrink:0;
}
.lt-btn {
  padding:5px 13px; background:transparent; border:none;
  color:var(--text-muted); font-size:12.5px; font-weight:600;
  font-family:'DM Sans',sans-serif; cursor:pointer;
  transition:all .2s; white-space:nowrap;
}
.lt-btn:hover:not(.active) { background:rgba(255,255,255,0.08); color:var(--text); }
.lt-btn.active {
  background:linear-gradient(135deg,rgba(45,106,79,0.7),rgba(34,197,94,0.28));
  color:#fff; box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Toggle switch */
.setting-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:7px 0; font-size:12.5px;
}
.toggle {
  width:40px; height:22px;
  background:rgba(255,255,255,0.1); border-radius:11px;
  cursor:pointer; border:1px solid rgba(255,255,255,0.1);
  position:relative; transition:all .3s; flex-shrink:0;
  box-shadow:inset 0 2px 4px rgba(0,0,0,0.3);
}
.toggle::after {
  content:''; width:16px; height:16px;
  background:#fff; border-radius:50%;
  position:absolute; top:2px; left:2px;
  transition:transform .3s cubic-bezier(.34,1.56,.64,1);
  box-shadow:0 2px 4px rgba(0,0,0,0.3);
}
.toggle.on {
  background:linear-gradient(135deg,#2d6a4f,#22c55e);
  border-color:rgba(34,197,94,0.4);
  box-shadow:0 0 14px rgba(34,197,94,0.3), inset 0 2px 4px rgba(0,0,0,0.1);
}
.toggle.on::after { transform:translateX(18px); }

/* Connection items */
.conn-item {
  display:flex; align-items:center; justify-content:space-between;
  padding:9px 11px;
  background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.07);
  border-radius:10px; margin-bottom:5px; font-size:12px; transition:all .2s;
}
.conn-item:hover { border-color:rgba(34,197,94,0.16); background:rgba(34,197,94,0.03); }
.conn-label { font-weight:600; }
.conn-sub { font-size:10.5px; color:var(--text-muted); margin-top:1px; }

.test-btn {
  padding:4px 12px;
  background:linear-gradient(135deg,rgba(45,106,79,0.5),rgba(34,197,94,0.14));
  border:1px solid rgba(34,197,94,0.3); border-radius:7px;
  color:#fff; cursor:pointer; font-size:11px;
  font-family:'DM Sans',sans-serif;
  transition:all .2s; flex-shrink:0;
  box-shadow:0 0 8px rgba(34,197,94,0.14);
}
.test-btn:hover {
  background:linear-gradient(135deg,#22c55e,#16a34a); color:#000;
  box-shadow:0 0 18px rgba(34,197,94,0.42); transform:translateY(-1px);
}
.test-btn:active { transform:translateY(0); }

/* API inputs */
.api-label { font-size:10.5px; color:var(--text-muted); display:block; margin:8px 0 3px; }
.api-inp {
  width:100%; background:rgba(255,255,255,0.05); backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,0.1); border-radius:9px;
  padding:8px 11px; color:var(--text); font-size:12px;
  font-family:'DM Sans',sans-serif; outline:none;
  transition:all .2s; box-shadow:inset 0 2px 6px rgba(0,0,0,0.2);
}
.api-inp:focus { border-color:rgba(34,197,94,0.4); box-shadow:0 0 12px rgba(34,197,94,0.1),inset 0 2px 6px rgba(0,0,0,0.2); }
.api-inp::placeholder { color:var(--text-muted); }

/* Action row */
.act-row { display:flex; gap:5px; margin-top:8px; }

.sm-btn {
  padding:6px 11px; background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.08); border-radius:8px;
  color:var(--text); cursor:pointer; font-size:11.5px;
  transform-style:preserve-3d;
  font-family:'DM Sans',sans-serif; transition:all .3s cubic-bezier(.34,1.56,.64,1); white-space:nowrap;
}
.sm-btn:hover {
  background:rgba(45,106,79,0.28); border-color:rgba(34,197,94,0.4); color:#fff;
  box-shadow:0 20px 40px rgba(34,197,94,0.2); transform:translateY(-3px) rotateX(5deg);
}
.sm-btn:active { transform:translateY(0); }
.sm-btn.danger:hover {
  background:rgba(239,68,68,0.22); border-color:rgba(239,68,68,0.5);
  box-shadow:0 0 12px rgba(239,68,68,0.2);
}
body.light .sm-btn { background:rgba(255,255,255,0.7); border-color:rgba(45,106,79,0.2); color:#1a2940; }
body.light .sm-btn:hover { background:rgba(45,106,79,0.1); box-shadow:none; }

/* =====================================================
   MODALS
   ===================================================== */
.overlay {
  display:none; position:fixed; inset:0;
  background:rgba(0,0,0,.72); backdrop-filter:blur(5px);
  z-index:200; align-items:center; justify-content:center;
}
.overlay.show { display:flex; }

.modal-box {
  background:rgba(3,8,18,0.95);
  backdrop-filter:blur(40px) saturate(180%);
  -webkit-backdrop-filter:blur(40px) saturate(180%);
  border:1px solid rgba(34,197,94,0.2);
  border-radius:20px; padding:26px;
  width:90%; max-width:500px;
  max-height:88vh; overflow-y:auto;
  position:relative;
  box-shadow:0 25px 50px rgba(0,0,0,0.8), 0 0 0 1px rgba(34,197,94,0.1), inset 0 1px 0 rgba(255,255,255,0.07);
  animation:modalIn .3s cubic-bezier(.34,1.56,.64,1);
}
body.light .modal-box { background:rgba(240,244,249,0.97); border-color:rgba(45,106,79,0.15); }

@keyframes modalIn {
  from { opacity:0; transform:scale(0.9) translateY(22px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

.modal-title {
  font-family:'Playfair Display',serif; font-size:19px;
  background:linear-gradient(135deg,#22c55e,#86efac);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  background-clip:text; margin-bottom:15px;
  filter:drop-shadow(0 0 14px rgba(34,197,94,0.45));
}
body.light .modal-title { background:linear-gradient(135deg,#16a34a,#2d6a4f); -webkit-background-clip:text; background-clip:text; filter:none; }

.modal-close {
  position:absolute; top:15px; right:17px;
  background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1);
  border-radius:7px; color:var(--text-muted); font-size:16px;
  cursor:pointer; width:28px; height:28px;
  display:flex; align-items:center; justify-content:center; transition:all .2s;
}
.modal-close:hover { color:var(--text); background:rgba(239,68,68,0.15); border-color:rgba(239,68,68,0.3); }

/* Shared header row for modals whose header carries extra action buttons
   next to the title — keeps the close button in-flow so it never overlaps
   a right-aligned action on narrow screens (see modal-close, which is
   absolutely positioned and only safe for plain single-line titles). */
.modal-header-row {
  display:flex; align-items:center; justify-content:space-between;
  gap:8px 10px; flex-wrap:wrap; margin-bottom:15px;
}
.modal-header-row .modal-title { margin:0; flex:1 1 140px; min-width:0; }
.modal-header-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; margin-left:auto; }
.modal-close.inline { position:static; flex-shrink:0; }

.modal-input {
  width:100%; background:rgba(255,255,255,0.05); backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,0.1); border-radius:10px;
  padding:10px 13px; color:var(--text); font-family:'DM Sans',sans-serif;
  font-size:13px; outline:none; margin-bottom:8px;
  box-shadow:inset 0 2px 6px rgba(0,0,0,0.2); transition:all .2s;
}
.modal-input:focus { border-color:rgba(34,197,94,0.4); box-shadow:0 0 16px rgba(34,197,94,0.1),inset 0 2px 6px rgba(0,0,0,0.2); }

/* ══ AUFGEKLAPPTE AUSWAHLLISTEN, 11.09.2026 ══
   Kris' zweites Bildschirmfoto: die Ortsauswahl im Fahrten-Fenster war auch
   nach color-scheme noch blass.

   Der Grund: die aufgeklappte Liste zeichnet der Browser SELBST, in einem
   eigenen Fenster ausserhalb der Seite. Dorthin reicht weder das
   backdrop-filter noch der rgba-Hintergrund des <select>, und die Schriftfarbe
   des <select> erbt <option> dort nicht zuverlaessig — Chrome nimmt seinen
   eigenen Standard. Deshalb werden option und optgroup hier ausdruecklich
   gesetzt, mit einem DECKENDEN Hintergrund: in diesem Fenster gibt es keine
   Transparenz, ein rgba-Wert wuerde still zu Schwarz.

   Gilt fuer jede Auswahlliste in JUNO auf einmal. */
select option,
select optgroup {
  background-color: #101722;
  color: #e6edf3;
}
select optgroup {
  color: #8aa5bf;
  font-weight: 600;
  font-style: normal;
}
select optgroup option { color: #e6edf3; }

body.light select option,
body.light select optgroup { background-color: #ffffff; color: #1a2940; }
body.light select optgroup { color: #556478; }
body.light select optgroup option { color: #1a2940; }
.modal-input::placeholder { color:var(--text-muted); }
body.light .modal-input { background:rgba(255,255,255,0.8); border-color:rgba(45,106,79,0.2); color:#1a2940; }

/* ── Links Modal ── */
.link-cat-title {
  font-size:10px; font-weight:700; letter-spacing:.8px; text-transform:uppercase;
  color:var(--text-muted); margin:14px 0 6px; padding:0 2px;
}
.link-cat-title:first-child { margin-top:0; }
.link-item {
  display:flex; align-items:center; gap:10px;
  padding:9px 11px; border-radius:10px; cursor:pointer;
  border:1px solid rgba(255,255,255,0.06);
  background:rgba(255,255,255,0.03);
  transform-style:preserve-3d;
  transition:all .3s cubic-bezier(.34,1.56,.64,1); text-decoration:none; color:var(--text);
  margin-bottom:4px;
}
.link-item:hover { background:rgba(34,197,94,0.08); border-color:rgba(34,197,94,0.25); transform:translateY(-3px) rotateX(5deg); box-shadow:0 20px 40px rgba(34,197,94,0.15); }
.link-item.placeholder { opacity:0.55; cursor:pointer; border-style:dashed; }
.link-item.placeholder:hover { opacity:0.85; background:rgba(245,158,11,0.08); border-color:rgba(245,158,11,0.35); }
.link-item.hidden { display:none; }
.link-icon { font-size:16px; flex-shrink:0; width:22px; text-align:center; }
.link-info { flex:1; min-width:0; }
.link-label { font-size:13px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.link-domain { font-size:10.5px; color:var(--text-muted); margin-top:1px; }
.link-placeholder-tag {
  font-size:10px; color:#f59e0b; background:rgba(245,158,11,0.12);
  border:1px solid rgba(245,158,11,0.25); border-radius:5px;
  padding:2px 7px; flex-shrink:0; white-space:nowrap;
}
body.light .link-item { background:rgba(0,0,0,0.03); border-color:rgba(0,0,0,0.08); color:#1a2940; }
body.light .link-item:hover { background:rgba(45,106,79,0.08); }

/* Links edit mode */
.links-edit-toggle {
  padding:5px 11px; font-size:11.5px; flex-shrink:0;
  background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.12);
  border-radius:8px; color:var(--text-muted); cursor:pointer;
  font-family:'DM Sans',sans-serif; transition:all .18s;
}
.links-edit-toggle.active { background:rgba(34,197,94,0.12); border-color:rgba(34,197,94,0.4); color:#22c55e; }
.links-edit-toggle:hover { background:rgba(255,255,255,0.1); color:var(--text); }
.links-modal-header { display:flex; align-items:center; gap:8px; margin-bottom:14px; }
.links-modal-header .modal-title { margin:0; flex:1; }
.link-edit-row {
  display:flex; align-items:center; gap:8px;
  padding:7px 9px; border-radius:9px; margin-bottom:3px;
  border:1px solid rgba(255,255,255,0.08); background:rgba(255,255,255,0.03);
}
.link-edit-btns { display:flex; gap:4px; flex-shrink:0; }
.link-edit-btn, .link-delete-btn {
  background:none; border:1px solid rgba(255,255,255,0.12);
  border-radius:6px; cursor:pointer; font-size:13px;
  padding:3px 7px; transition:all .15s;
}
.link-edit-btn:hover  { background:rgba(34,197,94,0.12); border-color:rgba(34,197,94,0.3); }
.link-delete-btn:hover { background:rgba(239,68,68,0.15); border-color:rgba(239,68,68,0.4); }
.link-edit-form, .link-add-form {
  background:rgba(255,255,255,0.04); border:1px solid rgba(34,197,94,0.18);
  border-radius:10px; padding:10px 12px; margin-bottom:6px;
}
.link-edit-form .modal-input,
.link-add-form  .modal-input { margin-bottom:6px; width:100%; box-sizing:border-box; }
.link-add-btn {
  width:100%; margin-top:4px; padding:8px;
  background:rgba(34,197,94,0.05); border:1px dashed rgba(34,197,94,0.28);
  border-radius:8px; color:var(--accent); cursor:pointer;
  font-size:12px; font-family:'DM Sans',sans-serif; transition:all .18s;
}
.link-add-btn:hover { background:rgba(34,197,94,0.12); border-color:rgba(34,197,94,0.45); }
body.light .link-edit-row { background:rgba(0,0,0,0.03); border-color:rgba(0,0,0,0.08); }
body.light .link-edit-form, body.light .link-add-form { background:rgba(45,106,79,0.05); }
body.light .link-edit-btn, body.light .link-delete-btn { border-color:rgba(0,0,0,0.15); }

.modal-footer { display:flex; gap:8px; margin-top:13px; flex-wrap:wrap; }

.btn-pri {
  padding:10px 22px;
  background:linear-gradient(135deg,rgba(45,106,79,0.8),rgba(34,197,94,0.28));
  border:1px solid rgba(34,197,94,0.4); border-radius:10px; color:#fff;
  cursor:pointer; font-size:13px; font-family:'DM Sans',sans-serif;
  transition:all .3s cubic-bezier(.34,1.56,.64,1);
  transform-style:preserve-3d;
  box-shadow:0 0 16px rgba(34,197,94,0.2), 0 4px 14px rgba(0,0,0,0.3);
}
.btn-pri:hover {
  background:linear-gradient(135deg,#22c55e,#16a34a); color:#000;
  box-shadow:0 20px 40px rgba(34,197,94,0.35), 0 0 28px rgba(34,197,94,0.3);
  transform:translateY(-3px) rotateX(5deg) scale(1.02);
}
.btn-pri:active { transform:translateY(1px) scale(0.99); }

.btn-sec {
  padding:10px 19px; background:rgba(255,255,255,0.05);
  backdrop-filter:blur(8px); border:1px solid rgba(255,255,255,0.1);
  border-radius:10px; color:var(--text); cursor:pointer;
  transform-style:preserve-3d;
  font-size:13px; font-family:'DM Sans',sans-serif; transition:all .3s cubic-bezier(.34,1.56,.64,1);
}
.btn-sec:hover {
  background:rgba(255,255,255,0.1); border-color:rgba(34,197,94,0.3);
  box-shadow:0 20px 40px rgba(34,197,94,0.15);
  transform:translateY(-3px) rotateX(5deg);
}
.btn-sec:active { transform:translateY(0); }

/* Briefing content */
#briefing-body { font-size:13px; line-height:1.85; }
#briefing-body h4 { color:var(--accent); margin:10px 0 4px; }
#briefing-body strong { color:var(--accent); }

/* =====================================================
   TOAST
   ===================================================== */
#toast {
  position:fixed; bottom:80px; right:20px;
  background:rgba(7,14,27,0.94); backdrop-filter:blur(22px);
  border:1px solid rgba(34,197,94,0.3); border-radius:11px;
  padding:10px 17px; font-size:12.5px; color:var(--accent);
  z-index:300; pointer-events:none;
  opacity:0; transform:translateY(12px) scale(0.94);
  transition:all .3s cubic-bezier(.34,1.56,.64,1); max-width:280px;
  box-shadow:0 0 22px rgba(34,197,94,0.2), 0 8px 28px rgba(0,0,0,0.45);
}
#toast.show { opacity:1; transform:translateY(0) scale(1); }

/* =====================================================
   AI STATUS CHIP (lives in the top bar)
   ===================================================== */
.model-fab {
  display:flex; align-items:center; gap:8px;
  padding:12px 20px;
  background:linear-gradient(135deg,#0b1220,#111c2f);
  border:1px solid rgba(34,197,94,0.4); border-radius:30px;
  color:#fff; font-family:'DM Sans',sans-serif; font-size:13px; font-weight:600;
  cursor:pointer; white-space:nowrap;
  box-shadow:0 0 18px rgba(34,197,94,0.22), 0 8px 20px rgba(0,0,0,0.45);
  transition:all .22s cubic-bezier(.34,1.56,.64,1);
}
.model-fab:hover { transform:translateY(-2px) scale(1.03); box-shadow:0 0 32px rgba(34,197,94,0.42), 0 10px 26px rgba(0,0,0,0.5); border-color:rgba(34,197,94,0.65); }
.model-fab:active { transform:translateY(1px) scale(0.98); }
body.light .model-fab { background:linear-gradient(135deg,#0f1b12,#16241a); }
/* Compact sizing for the top-bar placement as the AI status chip.
   Only touches padding/radius/font-size – never border-color/box-shadow/
   animation, so the .loading / .turbo-active states still display correctly. */
.topbar-right .model-fab { padding:6px 13px; border-radius:9px; font-size:12px; }

.model-fab.loading {
  cursor:not-allowed; pointer-events:none;
  border-color:rgba(245,158,11,0.6);
  animation:modelFabPulse 1.1s ease-in-out infinite;
}
@keyframes modelFabPulse {
  0%,100% { box-shadow:0 0 18px rgba(245,158,11,0.35), 0 8px 20px rgba(0,0,0,0.45); border-color:rgba(245,158,11,0.5); }
  50%     { box-shadow:0 0 34px rgba(245,158,11,0.7),  0 8px 20px rgba(0,0,0,0.45); border-color:rgba(245,158,11,0.95); }
}

/* =====================================================
   KI-ZENTRALE — unified AI core chooser (model + Turbo)
   ===================================================== */
.ai-status-chip.turbo-active {
  border-color:rgba(56,189,248,0.6);
  background:linear-gradient(135deg,#0b1220,#0c2033);
  box-shadow:0 0 18px rgba(56,189,248,0.35), 0 8px 20px rgba(0,0,0,0.45);
}
.ai-status-chip.turbo-active:hover {
  box-shadow:0 0 32px rgba(56,189,248,0.5), 0 10px 26px rgba(0,0,0,0.5);
  border-color:rgba(56,189,248,0.85);
}
.ai-status-chip.superturbo-active {
  border-color:rgba(245,158,11,0.65);
  background:linear-gradient(135deg,#1a1206,#241033);
  box-shadow:0 0 18px rgba(245,158,11,0.4), 0 8px 20px rgba(0,0,0,0.45);
}
.ai-status-chip.superturbo-active:hover {
  box-shadow:0 0 32px rgba(245,158,11,0.55), 0 10px 26px rgba(0,0,0,0.5);
  border-color:rgba(245,158,11,0.9);
}

.ai-chooser-overlay {
  display:none; position:fixed; inset:0; z-index:195;
  background:radial-gradient(circle at 50% 20%,rgba(15,30,45,0.96),rgba(2,5,10,0.98));
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  align-items:center; justify-content:center;
  padding:24px 16px;
}
.ai-chooser-overlay.show { display:flex; }
.ai-chooser-panel { width:100%; max-width:1180px; animation:modalIn .32s cubic-bezier(.34,1.56,.64,1); }
.ai-chooser-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:22px; }
.ai-chooser-title {
  font-family:'Playfair Display',serif; font-size:24px; font-weight:700;
  background:linear-gradient(135deg,#22c55e,#86efac,#38bdf8);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
  filter:drop-shadow(0 0 18px rgba(34,197,94,0.4));
}
.ai-chooser-head .modal-close.inline { background:rgba(255,255,255,0.08); }

.ai-core-row { display:flex; gap:16px; overflow-x:auto; padding:6px 4px 14px; scroll-snap-type:x proximity; }
.ai-core-row::-webkit-scrollbar { height:6px; }
.ai-core-row::-webkit-scrollbar-thumb { background:rgba(34,197,94,0.3); border-radius:3px; }

.ai-core-card {
  position:relative; flex:0 0 200px; scroll-snap-align:start;
  padding:20px 16px 16px; border-radius:18px; text-align:left; cursor:pointer;
  color:#fff; font-family:'DM Sans',sans-serif;
  background:rgba(255,255,255,0.045);
  backdrop-filter:blur(18px) saturate(160%); -webkit-backdrop-filter:blur(18px) saturate(160%);
  border:1px solid rgba(255,255,255,0.1);
  transform-style:preserve-3d; perspective:600px;
  transition:transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, border-color .25s;
  box-shadow:0 10px 30px rgba(0,0,0,0.4);
}
.ai-core-card:hover, .ai-core-card:active {
  transform:translateY(-6px) rotateX(6deg) rotateY(-4deg) scale(1.03);
  border-color:rgba(34,197,94,0.5);
  box-shadow:0 20px 45px rgba(0,0,0,0.5), 0 0 26px rgba(34,197,94,0.25);
}
.ai-core-icon { font-size:30px; line-height:1; margin-bottom:10px; filter:drop-shadow(0 0 10px rgba(34,197,94,0.5)); }
.ai-core-name { font-size:16px; font-weight:700; margin-bottom:2px; }
.ai-core-tag {
  display:inline-block; font-size:10px; text-transform:uppercase; letter-spacing:.6px;
  color:#86efac; background:rgba(34,197,94,0.12); border:1px solid rgba(34,197,94,0.3);
  border-radius:6px; padding:2px 7px; margin-bottom:10px;
}
.ai-core-ram { font-size:11px; font-family:monospace; color:var(--text-muted); margin-bottom:6px; }
.ai-core-purpose { font-size:11.5px; color:var(--text-muted); line-height:1.4; min-height:32px; }
.ai-core-info-link {
  display:inline-block; margin-top:8px; padding:0; background:none; border:none;
  color:#7dd3fc; font-size:10.5px; font-family:'DM Sans',sans-serif; cursor:pointer;
}
.ai-core-info-link:hover { text-decoration:underline; }

/* Animated gradient border + soft pulse for the active core */
.ai-core-card.active {
  border:1px solid transparent;
  background:
    linear-gradient(rgba(10,16,12,0.92),rgba(10,16,12,0.92)) padding-box,
    linear-gradient(120deg,#22c55e,#86efac,#38bdf8,#22c55e) border-box;
  background-size:100% 100%, 300% 300%;
  animation:aiCoreGradient 5s linear infinite, aiCorePulse 2.4s ease-in-out infinite;
}
@keyframes aiCoreGradient { 0%{background-position:0 0,0% 50%} 100%{background-position:0 0,300% 50%} }
@keyframes aiCorePulse {
  0%,100% { box-shadow:0 10px 30px rgba(0,0,0,0.4), 0 0 14px rgba(34,197,94,0.35); }
  50%     { box-shadow:0 10px 30px rgba(0,0,0,0.4), 0 0 30px rgba(34,197,94,0.65); }
}

/* Cloud-tier Turbo card — distinct accent */
.ai-core-card.turbo { border-color:rgba(56,189,248,0.35); }
.ai-core-card.turbo .ai-core-tag { color:#7dd3fc; background:rgba(56,189,248,0.12); border-color:rgba(56,189,248,0.3); }
.ai-core-card.turbo:hover { border-color:rgba(56,189,248,0.6); box-shadow:0 20px 45px rgba(0,0,0,0.5), 0 0 26px rgba(56,189,248,0.3); }
.ai-core-card.turbo.active {
  background:
    linear-gradient(rgba(6,14,24,0.92),rgba(6,14,24,0.92)) padding-box,
    linear-gradient(120deg,#38bdf8,#818cf8,#38bdf8) border-box;
  animation:aiCoreGradientBlue 5s linear infinite, aiCorePulseBlue 2.4s ease-in-out infinite;
}
@keyframes aiCoreGradientBlue { 0%{background-position:0 0,0% 50%} 100%{background-position:0 0,300% 50%} }
@keyframes aiCorePulseBlue {
  0%,100% { box-shadow:0 10px 30px rgba(0,0,0,0.4), 0 0 14px rgba(56,189,248,0.35); }
  50%     { box-shadow:0 10px 30px rgba(0,0,0,0.4), 0 0 30px rgba(56,189,248,0.65); }
}
.ai-core-hint { font-size:10px; color:#7dd3fc; margin-top:8px; line-height:1.35; }
.ai-core-hint.gold { color:#fbbf24; }

/* Premium cloud-tier Super-Turbo (Gemini) card — gold/purple accent, distinct from Turbo's blue */
.ai-core-card.superturbo { border-color:rgba(245,158,11,0.4); }
.ai-core-card.superturbo .ai-core-tag { color:#fbbf24; background:rgba(245,158,11,0.14); border-color:rgba(245,158,11,0.35); }
.ai-core-card.superturbo:hover { border-color:rgba(245,158,11,0.7); box-shadow:0 20px 45px rgba(0,0,0,0.5), 0 0 26px rgba(168,85,247,0.3); }
.ai-core-card.superturbo.active {
  background:
    linear-gradient(rgba(20,12,4,0.92),rgba(20,12,4,0.92)) padding-box,
    linear-gradient(120deg,#f59e0b,#a855f7,#f59e0b) border-box;
  animation:aiCoreGradientGold 5s linear infinite, aiCorePulseGold 2.4s ease-in-out infinite;
}
@keyframes aiCoreGradientGold { 0%{background-position:0 0,0% 50%} 100%{background-position:0 0,300% 50%} }
@keyframes aiCorePulseGold {
  0%,100% { box-shadow:0 10px 30px rgba(0,0,0,0.4), 0 0 14px rgba(245,158,11,0.35); }
  50%     { box-shadow:0 10px 30px rgba(0,0,0,0.4), 0 0 30px rgba(245,158,11,0.65); }
}

.ai-core-card.disabled { opacity:0.4; cursor:not-allowed; filter:grayscale(0.5); }
.ai-core-card.disabled:hover, .ai-core-card.disabled:active {
  transform:none; box-shadow:0 10px 30px rgba(0,0,0,0.4); border-color:rgba(56,189,248,0.35);
}
.ai-core-card.superturbo.disabled:hover, .ai-core-card.superturbo.disabled:active {
  border-color:rgba(245,158,11,0.4);
}

@media (max-width:520px) {
  .ai-core-row { gap:12px; }
  .ai-core-card { flex:0 0 74vw; }
  .ai-chooser-title { font-size:19px; }
}

.ai-ram-badge {
  font-size:10px; font-family:monospace; font-weight:600; color:#22c55e;
  background:rgba(34,197,94,0.1); border:1px solid rgba(34,197,94,0.25);
  border-radius:6px; padding:2px 7px;
}

.ai-detail-section { margin-bottom:12px; }
.ai-detail-label {
  font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.6px;
  color:var(--text-muted); margin-bottom:4px;
}
.ai-detail-list { margin:0; padding-left:18px; font-size:12.5px; line-height:1.6; }
.ai-detail-bench { display:flex; flex-wrap:wrap; gap:6px; }
.ai-detail-bench span {
  font-size:11px; font-family:monospace; color:#22c55e;
  background:rgba(34,197,94,0.08); border:1px solid rgba(34,197,94,0.22);
  border-radius:6px; padding:3px 8px;
}

/* =====================================================
   JCP PYRAMIDE – mini view (inside Firma modal)
   ===================================================== */
.firma-pyr-mini { display:flex; flex-direction:column; align-items:center; margin-bottom:16px; }
.firma-pyr-mini-row { display:flex; justify-content:center; }
.firma-pyr-mini-line { width:2px; height:12px; background:rgba(34,197,94,0.35); }
.firma-pyr-mini-box {
  min-width:110px; text-align:center; border-radius:10px;
  padding:7px 12px; font-size:11.5px; font-weight:600; color:#fff;
  box-shadow:0 4px 12px rgba(0,0,0,0.3);
}
.firma-pyr-mini-box.owner { background:linear-gradient(135deg,#14532d,#16a34a); }
.firma-pyr-mini-box.managers { background:linear-gradient(135deg,#16a34a,#22c55e); margin:0 4px; }
.firma-pyr-mini-box.medewerkers { background:rgba(34,197,94,0.28); color:var(--text); border:1px solid rgba(34,197,94,0.35); margin:0 4px; }
.firma-pyr-edit-btn {
  margin-top:10px; padding:7px 16px; font-size:11.5px;
  background:rgba(34,197,94,0.08); border:1px dashed rgba(34,197,94,0.35);
  border-radius:20px; color:var(--accent); cursor:pointer;
  font-family:'DM Sans',sans-serif; transition:all .18s;
}
.firma-pyr-edit-btn:hover { background:rgba(34,197,94,0.16); border-color:rgba(34,197,94,0.55); }

.pyr-tree { display:flex; flex-direction:column; align-items:center; gap:0; }
.pyr-level { display:flex; flex-direction:column; align-items:center; width:100%; }
.pyr-level-title {
  font-size:10px; font-weight:700; letter-spacing:.8px; text-transform:uppercase;
  color:var(--text-muted); margin:4px 0 8px;
}
.pyr-connector { width:2px; height:18px; background:rgba(34,197,94,0.35); }
.pyr-row { display:flex; flex-wrap:wrap; gap:12px; justify-content:center; width:100%; margin-bottom:6px; }

.pyr-card {
  position:relative; border-radius:12px; padding:12px 14px;
  min-width:180px; max-width:220px;
  color:#fff; font-family:'DM Sans',sans-serif;
  box-shadow:0 6px 18px rgba(0,0,0,0.35);
  transform-style:preserve-3d;
  transition:all .3s cubic-bezier(.34,1.56,.64,1);
}
.pyr-card:hover { transform:translateY(-3px) rotateX(5deg); box-shadow:0 20px 40px rgba(34,197,94,0.2); }
.pyr-card.owner {
  background:linear-gradient(135deg,#14532d,#16a34a);
  border:1px solid rgba(34,197,94,0.6);
  min-width:220px;
}
.pyr-card.manager {
  background:linear-gradient(135deg,#16a34a,#22c55e);
  border:1px solid rgba(34,197,94,0.5);
}
.pyr-card.medewerker {
  background:linear-gradient(135deg,rgba(34,197,94,0.35),rgba(34,197,94,0.18));
  border:1px solid rgba(34,197,94,0.35);
  color:var(--text);
}
.pyr-name { font-weight:700; font-size:14px; margin-bottom:2px; }
.pyr-meta { font-size:11px; opacity:0.9; line-height:1.5; }
.pyr-actions { display:flex; gap:6px; margin-top:8px; }
.pyr-actions button {
  background:rgba(255,255,255,0.15); border:1px solid rgba(255,255,255,0.25);
  border-radius:6px; color:inherit; cursor:pointer; font-size:11px; padding:3px 8px;
  transition:all .15s;
}
.pyr-actions button:hover { background:rgba(255,255,255,0.28); }

.pyr-add-btn {
  min-width:120px; padding:10px 14px;
  background:rgba(34,197,94,0.06); border:1px dashed rgba(34,197,94,0.32);
  border-radius:12px; color:var(--accent); cursor:pointer;
  font-size:12px; font-family:'DM Sans',sans-serif; transition:all .18s;
  display:flex; align-items:center; justify-content:center;
}
.pyr-add-btn:hover { background:rgba(34,197,94,0.14); border-color:rgba(34,197,94,0.5); }

.pyr-empty { font-size:12px; color:var(--text-muted); padding:10px; }

body.light .pyr-card.medewerker { color:#1a2940; }

/* =====================================================
   TEAM HUB
   ===================================================== */
.team-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:14px; padding:4px 2px; }

.team-card {
  position:relative; border-radius:16px; padding:16px;
  background:linear-gradient(160deg,rgba(34,197,94,0.09),rgba(255,255,255,0.03));
  border:1px solid rgba(34,197,94,0.18);
  backdrop-filter:blur(14px);
  box-shadow:0 8px 24px rgba(0,0,0,0.35);
  transform-style:preserve-3d;
  cursor:pointer; transition:all .3s cubic-bezier(.34,1.56,.64,1);
  display:flex; flex-direction:column; align-items:center; text-align:center; gap:6px;
}
.team-card:hover {
  transform:translateY(-3px) rotateX(5deg);
  border-color:rgba(34,197,94,0.5);
  box-shadow:0 20px 40px rgba(34,197,94,0.2);
}
.team-card-actions { position:absolute; top:10px; right:10px; display:flex; gap:5px; opacity:0; transition:opacity .18s; }
.team-card:hover .team-card-actions { opacity:1; }
.team-card-actions button {
  background:rgba(5,13,26,0.7); border:1px solid rgba(255,255,255,0.14);
  border-radius:6px; color:var(--text); cursor:pointer; font-size:11px; padding:4px 6px;
}
.team-card-actions button:hover { background:rgba(34,197,94,0.2); border-color:rgba(34,197,94,0.4); }

.team-avatar {
  width:64px; height:64px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:20px; color:#fff;
  background:linear-gradient(135deg,#16a34a,#22c55e);
  border:2px solid rgba(34,197,94,0.45);
  box-shadow:0 0 18px rgba(34,197,94,0.25);
  overflow:hidden; flex-shrink:0;
}
.team-avatar img { width:100%; height:100%; object-fit:cover; }
.team-avatar-lg { width:72px; height:72px; font-size:24px; }

.team-name { font-weight:700; font-size:14.5px; }
.team-functie { font-size:11.5px; color:var(--text-muted); }

.team-badge {
  display:inline-flex; align-items:center; gap:5px;
  font-size:10.5px; font-weight:700; letter-spacing:.3px;
  padding:3px 10px; border-radius:20px; cursor:pointer;
  border:1px solid transparent; text-transform:uppercase;
}
.team-badge-dot { width:6px; height:6px; border-radius:50%; }
.team-badge.actief   { background:rgba(34,197,94,0.14); color:#4ade80; border-color:rgba(34,197,94,0.35); }
.team-badge.actief   .team-badge-dot { background:#22c55e; box-shadow:0 0 8px rgba(34,197,94,0.9); animation:teamPulse 1.6s infinite; }
.team-badge.ziek     { background:rgba(239,68,68,0.14); color:#f87171; border-color:rgba(239,68,68,0.35); }
.team-badge.ziek     .team-badge-dot { background:#ef4444; }
.team-badge.verlof   { background:rgba(245,158,11,0.14); color:#fbbf24; border-color:rgba(245,158,11,0.35); }
.team-badge.verlof   .team-badge-dot { background:#f59e0b; }
.team-badge.gestopt  { background:rgba(148,163,184,0.14); color:#94a3b8; border-color:rgba(148,163,184,0.3); }
.team-badge.gestopt  .team-badge-dot { background:#94a3b8; }

@keyframes teamPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.55;transform:scale(1.5)} }

.team-quick { font-size:11px; color:var(--text-muted); line-height:1.5; }

.team-status-menu {
  position:fixed; z-index:210;
  background:rgba(7,14,27,0.97); border:1px solid rgba(34,197,94,0.25);
  border-radius:10px; padding:5px; box-shadow:0 12px 28px rgba(0,0,0,0.6);
  display:flex; flex-direction:column; gap:2px; min-width:130px;
}
.team-status-menu button {
  background:none; border:none; color:var(--text); text-align:left;
  padding:6px 9px; border-radius:7px; cursor:pointer; font-size:12px;
  font-family:'DM Sans',sans-serif;
}
.team-status-menu button:hover { background:rgba(34,197,94,0.12); }

.team-detail-head { display:flex; align-items:center; gap:14px; margin-bottom:14px; padding-right:20px; }

.team-tabs { display:flex; gap:6px; margin-bottom:14px; border-bottom:1px solid rgba(255,255,255,0.08); }
.team-tab {
  background:none; border:none; padding:9px 4px; margin-bottom:-1px;
  color:var(--text-muted); cursor:pointer; font-size:12.5px; font-family:'DM Sans',sans-serif;
  border-bottom:2px solid transparent; transition:all .18s;
}
.team-tab:hover { color:var(--text); }
.team-tab.active { color:var(--accent); border-bottom-color:var(--accent); }

.team-kv { display:flex; flex-direction:column; gap:2px; font-size:13px; }
.team-kv-row { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border-bottom:1px solid rgba(255,255,255,0.05); }
.team-kv-label { color:var(--text-muted); font-size:11.5px; flex-shrink:0; }
.team-kv-value { text-align:right; font-weight:500; }

.team-lock { display:flex; flex-direction:column; align-items:center; gap:12px; padding:30px 10px; text-align:center; }
.team-lock-icon { font-size:34px; }
.team-lock input { max-width:220px; text-align:center; margin-bottom:0; }

.team-form-section-title {
  font-size:11px; font-weight:700; letter-spacing:.6px; text-transform:uppercase;
  color:var(--accent); margin:16px 0 8px; padding-top:10px; border-top:1px solid rgba(34,197,94,0.15);
}
.team-form-section-title:first-of-type { margin-top:0; padding-top:0; border-top:none; }
.team-form-section-prive { color:#f59e0b; border-top-color:rgba(245,158,11,0.2); }

.team-empty { font-size:12px; color:var(--text-muted); padding:20px; text-align:center; }

body.light .team-card { color:#1a2940; }
body.light .team-quick { color:var(--text-muted); }

/* =====================================================
   LAGERBESTAND
   ===================================================== */
.lager-search {
  width:100%; margin-bottom:12px;
}
.lager-cat-section { margin-bottom:16px; }
.lager-cat-header {
  display:flex; justify-content:space-between; align-items:baseline;
  padding-bottom:5px; margin-bottom:8px;
  border-bottom:1px solid rgba(255,255,255,0.08);
}
.lager-cat-title {
  font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.6px;
  color:var(--text-muted);
}
.lager-cat-total { font-size:11px; color:var(--accent); font-family:monospace; }

.lager-item {
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:10px; margin-bottom:6px;
  border:1px solid rgba(255,255,255,0.08); background:rgba(255,255,255,0.03);
  border-left:4px solid rgba(255,255,255,0.15);
  transform-style:preserve-3d;
  transition:all .3s cubic-bezier(.34,1.56,.64,1);
}
.lager-item:hover { transform:translateY(-3px) rotateX(5deg); box-shadow:0 20px 40px rgba(34,197,94,0.15); }
.lager-item.status-green  { border-left-color:#22c55e; }
.lager-item.status-yellow { border-left-color:#f59e0b; }
.lager-item.status-red    { border-left-color:#ef4444; background:rgba(239,68,68,0.07); }

.lager-item-info { flex:1; min-width:0; }
.lager-item-name { font-weight:600; font-size:13px; }
.lager-item-meta { font-size:11px; color:var(--text-muted); margin-top:1px; }
.lager-item-runway { font-size:11.5px; margin-top:3px; color:var(--text); }
.lager-item-runway.urgent { color:#ef4444; font-weight:600; }

.lager-item-actions { display:flex; gap:4px; flex-shrink:0; }
.lager-item-actions button {
  background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12);
  border-radius:6px; cursor:pointer; font-size:12px; padding:4px 7px; transition:all .15s;
}
.lager-item-actions button:hover { background:rgba(34,197,94,0.14); border-color:rgba(34,197,94,0.4); }

.lager-add-btn {
  width:100%; margin-top:2px; padding:9px;
  background:rgba(34,197,94,0.05); border:1px dashed rgba(34,197,94,0.3);
  border-radius:10px; color:var(--accent); cursor:pointer;
  font-size:12px; font-family:'DM Sans',sans-serif; transition:all .18s;
}
.lager-add-btn:hover { background:rgba(34,197,94,0.13); border-color:rgba(34,197,94,0.5); }

.lager-empty { font-size:11.5px; color:var(--text-muted); padding:6px 2px 10px; }

/* =====================================================
   KALENDER
   ===================================================== */
.cal-modal-box { width:94%; max-width:900px; }

.cal-toolbar {
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:10px; margin-bottom:14px;
}
.cal-view-toggle { display:flex; gap:4px; background:rgba(255,255,255,0.05); border-radius:10px; padding:3px; }
.cal-view-btn {
  background:none; border:none; color:var(--text-muted); cursor:pointer;
  padding:6px 12px; border-radius:8px; font-size:12.5px; font-family:'DM Sans',sans-serif;
  transition:all .15s;
}
.cal-view-btn.active { background:var(--primary); color:#fff; }
.cal-view-btn:hover:not(.active) { color:var(--text); background:rgba(255,255,255,0.06); }

.cal-nav {
  display:flex; align-items:center; gap:8px;
}
.cal-nav-btn {
  background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12);
  color:var(--text); border-radius:8px; width:30px; height:30px; cursor:pointer;
  font-size:14px; display:flex; align-items:center; justify-content:center; transition:all .15s;
}
.cal-nav-btn:hover { background:rgba(34,197,94,0.16); border-color:rgba(34,197,94,0.4); }
.cal-today-btn {
  background:rgba(34,197,94,0.1); border:1px solid rgba(34,197,94,0.3); color:var(--accent);
  border-radius:8px; padding:6px 12px; cursor:pointer; font-size:12px; font-family:'DM Sans',sans-serif;
}
.cal-today-btn:hover { background:rgba(34,197,94,0.2); }
.cal-nav-label { font-size:14.5px; font-weight:600; color:var(--text); min-width:150px; text-align:center; }

.cal-add-btn {
  background:var(--accent); border:none; color:#06210f; font-weight:700;
  border-radius:8px; padding:7px 14px; cursor:pointer; font-size:12.5px;
}
.cal-add-btn:hover { background:var(--accent-d); }

/* Month grid */
.cal-grid { display:grid; grid-template-columns:36px repeat(7,1fr); gap:5px; }
.cal-weeknum-header, .cal-weeknum-cell {
  display:flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:700; color:var(--text-muted);
}
.cal-weekday-header {
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px;
  color:#fff; text-align:center; padding:8px 4px; border-radius:6px 6px 0 0;
  background:#1B4332; border-right:1px solid rgba(255,255,255,0.14);
}
.cal-weekday-header:last-child { border-right:none; }
.cal-weekday-header.weekend { background:#0d2818; }
.cal-weekday-header.today { background:#22c55e; color:#06210f; }
.cal-weekday-header .full { display:none; }
.cal-weekday-header .short { display:inline; }
@media (min-width:640px) {
  .cal-weekday-header .full { display:inline; }
  .cal-weekday-header .short { display:none; }
}
.cal-day-cell {
  min-height:84px; border-radius:9px; padding:6px;
  background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.07);
  cursor:pointer; transition:all .15s; display:flex; flex-direction:column; gap:3px;
  overflow:hidden;
}
.cal-day-cell:hover { background:rgba(34,197,94,0.08); border-color:rgba(34,197,94,0.3); }
.cal-day-cell.other-month { opacity:0.35; }
.cal-day-cell.today { border-color:var(--accent); box-shadow:0 0 0 1px rgba(34,197,94,0.4); }
.cal-day-num { font-size:11.5px; font-weight:600; color:var(--text); }
.cal-day-cell.today .cal-day-num { color:var(--accent); }

.cal-event-chip {
  font-size:10px; padding:2px 5px; border-radius:5px; color:#fff;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer;
  border-left:3px solid rgba(255,255,255,0.5);
}
.cal-event-chip:hover { filter:brightness(1.15); }
.cal-more-chip { font-size:10px; color:var(--text-muted); padding:1px 5px; }

.cal-cat-schoonmaak  { background:rgba(34,197,94,0.28);  border-left-color:#22c55e; color:#dff8e6; }
.cal-cat-vergadering { background:rgba(59,130,246,0.28); border-left-color:#3b82f6; color:#e2ecfe; }
.cal-cat-facturering { background:rgba(245,158,11,0.28); border-left-color:#f59e0b; color:#fef2df; }
.cal-cat-personeel   { background:rgba(168,85,247,0.28); border-left-color:#a855f7; color:#f2e6fe; }
.cal-cat-overig      { background:rgba(107,114,128,0.32); border-left-color:#9ca3af; color:#eceef1; }

.cal-dot { display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:5px; flex-shrink:0; }
.cal-dot.cal-cat-schoonmaak  { background:#22c55e; }
.cal-dot.cal-cat-vergadering { background:#3b82f6; }
.cal-dot.cal-cat-facturering { background:#f59e0b; }
.cal-dot.cal-cat-personeel   { background:#a855f7; }
.cal-dot.cal-cat-overig      { background:#9ca3af; }

/* Week view */
.cal-week-grid { display:grid; grid-template-columns:36px repeat(7,1fr); gap:8px; }
.cal-week-weeknum {
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase;
}
.cal-week-weeknum strong { font-size:14px; color:var(--text); }
.cal-week-col { display:flex; flex-direction:column; gap:6px; min-height:220px; }
.cal-week-col-header {
  text-align:center; padding:8px 4px; border-radius:8px 8px 0 0; cursor:pointer;
  background:#1B4332; border:1px solid rgba(255,255,255,0.14); color:#fff;
}
.cal-week-col-header.weekend { background:#0d2818; }
.cal-week-col-header.today { background:#22c55e; border-color:#22c55e; }
.cal-week-col-day  { font-size:10px; text-transform:uppercase; opacity:.85; }
.cal-week-col-day .full { display:none; }
.cal-week-col-date { font-size:13.5px; font-weight:700; }
.cal-week-col-header.today .cal-week-col-day,
.cal-week-col-header.today .cal-week-col-date { color:#06210f; }
.cal-week-events { display:flex; flex-direction:column; gap:4px; }
@media (min-width:640px) {
  .cal-week-col-day .full { display:inline; }
  .cal-week-col-day .short { display:none; }
}

/* Day view */
.cal-day-view-list { display:flex; flex-direction:column; gap:8px; }
.cal-day-event-row {
  display:flex; align-items:flex-start; gap:10px; padding:10px 12px;
  border-radius:10px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08);
  border-left:4px solid rgba(255,255,255,0.15); cursor:pointer;
}
.cal-day-event-row:hover { background:rgba(34,197,94,0.08); }
.cal-day-event-time { font-size:12px; color:var(--text-muted); font-family:monospace; min-width:88px; }
.cal-day-event-info { flex:1; min-width:0; }
.cal-day-event-title { font-weight:600; font-size:13.5px; color:var(--text); }
.cal-day-event-meta { font-size:11px; color:var(--text-muted); margin-top:2px; }
.cal-day-empty { font-size:12px; color:var(--text-muted); padding:20px; text-align:center; }

@media (max-width:640px) {
  .cal-modal-box { width:97%; padding:16px; }
  .cal-day-cell { min-height:58px; padding:4px; }
  .cal-event-chip { font-size:9px; }
  .cal-grid { grid-template-columns:26px repeat(7,1fr); }
  .cal-week-grid { grid-template-columns:26px repeat(7,minmax(70px,1fr)); overflow-x:auto; }
  .cal-nav-label { min-width:auto; font-size:13px; }
}

/* =====================================================
   VORLAGEN
   ===================================================== */
.vorlage-item {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 11px; border-radius:10px; margin-bottom:6px;
  border:1px solid rgba(255,255,255,0.08); background:rgba(255,255,255,0.03);
}
.vorlage-item:hover { border-color:rgba(34,197,94,0.3); }
.vorlage-item-name {
  flex:1; min-width:0; cursor:pointer; font-size:13px; font-weight:600; color:var(--text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.vorlage-item-name:hover { color:var(--accent); }
.vorlage-item-actions { display:flex; gap:4px; flex-shrink:0; }
.vorlage-item-actions button {
  background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12);
  border-radius:6px; cursor:pointer; font-size:12px; padding:4px 7px; transition:all .15s;
}
.vorlage-item-actions button:hover { background:rgba(34,197,94,0.14); border-color:rgba(34,197,94,0.4); }

.vorlage-interactive {
  background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08);
  border-radius:10px; padding:12px 14px; margin-bottom:4px;
  font-size:13px; line-height:1.6; color:var(--text); white-space:pre-wrap; word-break:break-word;
}
.vorlage-interactive-subject { font-weight:700; margin-bottom:8px; padding-bottom:8px; border-bottom:1px solid rgba(255,255,255,0.08); }
.vorlage-ph {
  display:inline-block; background:rgba(34,197,94,0.22); color:var(--accent);
  border:1px solid rgba(34,197,94,0.45); border-radius:5px; padding:0 5px;
  cursor:pointer; font-weight:600; transition:all .15s;
}
.vorlage-ph:hover { background:rgba(34,197,94,0.38); }
.vorlage-ph.filled { background:rgba(34,197,94,0.08); border-style:dashed; color:var(--text); font-weight:400; }
.vorlage-ph-input {
  display:inline-block; width:140px; max-width:100%;
  background:rgba(255,255,255,0.08); border:1px solid rgba(34,197,94,0.5); border-radius:5px;
  color:var(--text); font:inherit; padding:1px 5px; outline:none;
}
body.light .vorlage-ph { background:rgba(34,197,94,0.16); }
body.light .vorlage-ph.filled { background:rgba(34,197,94,0.08); }

@media (max-width:640px) {
  .vorlage-item-name { font-size:12.5px; }
}

/* =====================================================
   MARKDOWN INSIDE BUBBLES
   ===================================================== */
.msg-bubble h2,.msg-bubble h3,.msg-bubble h4 {
  background:linear-gradient(135deg,#22c55e,#86efac);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  background-clip:text; margin:8px 0 4px; font-family:'Playfair Display',serif;
}
.msg-bubble code {
  background:rgba(34,197,94,0.12); border-radius:5px; padding:1px 6px;
  font-family:'Courier New',monospace; font-size:12px;
  border:1px solid rgba(34,197,94,0.15);
}
.msg-bubble pre {
  background:rgba(0,0,0,0.42); border:1px solid rgba(34,197,94,0.14);
  border-radius:10px; padding:12px; overflow-x:auto;
  font-size:12px; margin:8px 0; white-space:pre-wrap;
  box-shadow:inset 0 2px 8px rgba(0,0,0,0.3);
}
.msg-bubble ul,.msg-bubble ol { padding-left:18px; }
.msg-bubble li { margin:2px 0; }
.msg-bubble table { border-collapse:collapse; width:100%; font-size:12px; margin:8px 0; }
.msg-bubble td,.msg-bubble th { border:1px solid rgba(255,255,255,0.08); padding:5px 9px; }
.msg-bubble th { background:rgba(34,197,94,0.1); color:var(--accent); }
.msg-bubble a { color:var(--accent); }
body.light .msg-bubble code { background:rgba(45,106,79,0.1); }
body.light .msg-bubble pre { background:rgba(0,0,0,0.06); }
body.light .msg-bubble td,.msg-bubble th { border-color:rgba(0,0,0,0.08); }

/* =====================================================
   DIVIDER
   ===================================================== */
.div-line {
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(34,197,94,0.22),transparent);
  margin:4px 0;
}

/* =====================================================
   MEMORY QUICK ADD (SIDEBAR)
   ===================================================== */
.mem-add-row { display:flex; gap:5px; margin-top:6px; }
.mem-add-inp {
  flex:1; background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.08); border-radius:8px;
  padding:6px 9px; color:var(--text); font-size:11.5px;
  font-family:'DM Sans',sans-serif; outline:none;
  transition:all .2s; box-shadow:inset 0 2px 4px rgba(0,0,0,0.2);
}
.mem-add-inp:focus { border-color:rgba(34,197,94,0.4); box-shadow:0 0 8px rgba(34,197,94,0.1),inset 0 2px 4px rgba(0,0,0,0.2); }
.mem-add-inp::placeholder { color:var(--text-muted); }
.mem-cat-sel {
  background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.08);
  border-radius:8px; color:var(--text); padding:5px 6px;
  font-size:11px; font-family:'DM Sans',sans-serif; outline:none;
}

.mem-save-btn {
  background:linear-gradient(135deg,rgba(45,106,79,0.6),rgba(34,197,94,0.2));
  border:1px solid rgba(34,197,94,0.3); border-radius:8px;
  color:#fff; cursor:pointer; padding:6px 11px; font-size:13px;
  transition:all .2s; box-shadow:0 0 8px rgba(34,197,94,0.14);
}
.mem-save-btn:hover {
  background:linear-gradient(135deg,#22c55e,#16a34a); color:#000;
  box-shadow:0 0 18px rgba(34,197,94,0.42); transform:scale(1.05);
}

/* =====================================================
   EXPORT BUTTONS
   ===================================================== */
.full-btn {
  width:100%; padding:9px;
  background:linear-gradient(135deg,rgba(45,106,79,0.5),rgba(34,197,94,0.18));
  border:1px solid rgba(34,197,94,0.3); border-radius:10px;
  color:#fff; cursor:pointer; font-size:12px;
  font-family:'DM Sans',sans-serif; transition:all .22s; margin-top:5px;
  box-shadow:0 0 12px rgba(34,197,94,0.14);
}
.full-btn:hover {
  background:linear-gradient(135deg,#22c55e,#16a34a); color:#000;
  box-shadow:0 0 26px rgba(34,197,94,0.44); transform:translateY(-2px) scale(1.01);
}
.full-btn:active { transform:translateY(0) scale(0.99); }

/* =====================================================
   EXPORT DROPDOWN
   ===================================================== */
.export-wrap { position:relative; }
.export-menu {
  display:none; position:absolute; top:calc(100% + 8px); right:0;
  background:rgba(7,14,27,0.96); backdrop-filter:blur(28px);
  border:1px solid rgba(34,197,94,0.14); border-radius:13px;
  box-shadow:0 18px 52px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.03);
  min-width:190px; z-index:50; overflow:hidden; animation:fadein .2s ease;
}
.export-menu.show { display:block; }
.export-opt {
  display:flex; align-items:center; gap:9px; padding:10px 15px;
  font-size:12.5px; color:var(--text); cursor:pointer; background:none;
  border:none; width:100%; text-align:left;
  font-family:'DM Sans',sans-serif; transition:all .15s;
}
.export-opt:hover { background:rgba(34,197,94,0.08); color:var(--accent); padding-left:20px; }
.export-opt + .export-opt { border-top:1px solid rgba(255,255,255,0.04); }

/* =====================================================
   MIC LEVEL BAR
   ===================================================== */
#mic-level-wrap { display:none; align-items:center; gap:6px; padding:4px 10px; margin:0 4px; }
#mic-level-wrap.show { display:flex; }
#mic-level-bar { width:80px; height:6px; border-radius:3px; background:rgba(255,255,255,0.08); overflow:hidden; }
#mic-level-fill {
  height:100%; width:0%; border-radius:3px;
  background:linear-gradient(90deg,var(--accent),#86efac);
  transition:width .08s linear; box-shadow:0 0 6px rgba(34,197,94,0.55);
}

/* =====================================================
   MIC ERROR BANNER
   ===================================================== */
#mic-error-banner {
  position:fixed; top:54px; left:0; right:0;
  background:rgba(127,29,29,0.92); backdrop-filter:blur(12px);
  color:#fca5a5; padding:8px 16px; font-size:12.5px; z-index:100;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  border-bottom:1px solid rgba(239,68,68,0.3);
}
#mic-error-banner .mic-err-btn {
  background:rgba(220,38,38,0.8); border:none; color:#fff;
  padding:4px 10px; border-radius:7px; cursor:pointer;
  font-size:12px; font-family:'DM Sans',sans-serif; white-space:nowrap;
}

/* =====================================================
   CONNECTION WATCHDOG BANNER
   ===================================================== */
#connection-banner {
  display:none; position:fixed; top:54px; left:0; right:0;
  backdrop-filter:blur(12px); padding:8px 16px; font-size:12.5px;
  font-family:'DM Sans',sans-serif; font-weight:600; text-align:center;
  z-index:101; border-bottom:1px solid transparent;
  transition:background .3s, color .3s, border-color .3s;
}
#connection-banner.amber {
  background:rgba(120,73,10,0.92); color:#fcd34d; border-bottom-color:rgba(245,158,11,0.35);
}
#connection-banner.red {
  background:rgba(127,29,29,0.92); color:#fca5a5; border-bottom-color:rgba(239,68,68,0.35);
}
#connection-banner.green {
  background:rgba(20,83,45,0.92); color:#86efac; border-bottom-color:rgba(34,197,94,0.35);
}

/* =====================================================
   SETTINGS MODAL
   ===================================================== */
.set-field { margin-bottom:10px; }
.set-label {
  font-size:10.5px; color:var(--text-muted);
  display:flex; align-items:center; justify-content:space-between; margin-bottom:3px;
}
.set-inp {
  width:100%; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1);
  border-radius:9px; padding:7px 11px; color:var(--text); font-size:12px;
  font-family:'DM Sans',sans-serif; outline:none; transition:all .2s;
  box-shadow:inset 0 2px 6px rgba(0,0,0,0.2);
}
.set-inp:focus { border-color:rgba(34,197,94,0.4); box-shadow:0 0 12px rgba(34,197,94,0.1),inset 0 2px 6px rgba(0,0,0,0.2); }
.set-inp[readonly] { opacity:.5; cursor:not-allowed; }
.set-inp[readonly]:focus { border-color:rgba(255,255,255,0.1); box-shadow:inset 0 2px 6px rgba(0,0,0,0.2); }
.set-edit-btn { background:none; border:none; color:var(--accent); font-size:11px; cursor:pointer; padding:0; text-decoration:underline; }

/* =====================================================
   MEMORY DAY LIST (right panel)
   ===================================================== */
#tages-summary .mem-entry { cursor:pointer; }
#tages-summary .mem-entry:hover { border-color:rgba(34,197,94,0.32); background:rgba(34,197,94,0.04); }

/* =====================================================
   RIGHT PANEL ACTION GRID
   ===================================================== */
.rp-btn-grid { display:grid; grid-template-columns:1fr 1fr; gap:5px; margin-top:6px; }
.rp-btn-grid .sm-btn { text-align:center; justify-content:center; }

/* =====================================================
   LOGIN OVERLAY (FIX 5)
   ===================================================== */
/* BUGFIX 26.07.: display:flex stand hier fest — das Overlay war dadurch IMMER
   sichtbar (die ID-Regel schlaegt die generische .overlay-Regel), obwohl der
   JS-Code es ueber die Klasse .show steuert. Folge: Login war serverseitig
   laengst erfolgreich (POST /auth/login 200), aber das Login-Fenster blieb
   fuer immer ueber der App liegen. Jetzt: unsichtbar per Default, sichtbar
   nur mit .show — exakt wie zeigeLogin()/doLogin() es erwarten. */
#login-overlay {
  position:fixed; inset:0; z-index:9999;
  background:rgba(5,13,26,0.97);
  display:none; align-items:center; justify-content:center;
  backdrop-filter:blur(12px);
}
#login-overlay.show { display:flex; }
#login-overlay.hidden { display:none; }
.login-box {
  background:rgba(255,255,255,0.07);
  border:1px solid rgba(34,197,94,0.25);
  border-radius:18px;
  padding:40px 44px;
  width:360px;
  text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,0.8);
}
.login-box h2 {
  font-family:'Playfair Display',serif;
  color:var(--accent);
  margin:12px 0 4px;
  font-size:22px;
}
.login-box p { color:var(--text-muted); font-size:13px; margin-bottom:24px; }
.login-inp {
  width:100%;
  padding:12px 16px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(34,197,94,0.3);
  border-radius:10px;
  color:var(--text);
  font-size:15px;
  margin-bottom:12px;
  outline:none;
}
.login-inp:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(34,197,94,0.15); }
.login-btn {
  width:100%;
  padding:12px;
  background:linear-gradient(135deg,var(--primary),var(--accent-d));
  color:#fff;
  border:none;
  border-radius:10px;
  font-size:15px;
  font-weight:600;
  cursor:pointer;
  transition:opacity .2s;
}
.login-btn:hover { opacity:.88; }
.lm-choice {
  padding:9px 12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(34,197,94,0.18);
  border-radius:10px; margin-bottom:7px;
  cursor:pointer; font-size:12.5px;
  transition:all .18s; line-height:1.4;
}
.lm-choice:hover { background:rgba(34,197,94,0.1); border-color:rgba(34,197,94,0.45); }
.lm-word-chip {
  display:inline-block; padding:5px 11px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(34,197,94,0.2);
  border-radius:7px; cursor:pointer;
  font-size:12.5px; transition:all .16s;
}
.lm-word-chip:hover { background:rgba(239,68,68,0.15); border-color:rgba(239,68,68,0.5); color:#ef4444; }
.login-divider {
  display:flex; align-items:center; gap:8px; margin:12px 0;
}
.login-divider::before,.login-divider::after {
  content:''; flex:1; height:1px; background:rgba(34,197,94,0.2);
}
.login-divider span { color:var(--text-muted); font-size:11px; white-space:nowrap; }
.voice-login-btn {
  width:100%; padding:12px;
  background:linear-gradient(135deg,#1e3a5f,#2563eb);
  color:#fff; border:none; border-radius:10px;
  font-size:15px; font-weight:600; cursor:pointer;
  transition:opacity .2s, transform .1s;
  position:relative; overflow:hidden;
}
.voice-login-btn:hover { opacity:.88; }
.voice-login-btn:active { transform:scale(.97); }
.voice-login-btn.listening {
  animation:voicePulse 1.2s ease-in-out infinite;
}
@keyframes voicePulse {
  0%,100% { box-shadow:0 0 0 0 rgba(37,99,235,0.5); }
  50%      { box-shadow:0 0 0 10px rgba(37,99,235,0); }
}
#voice-login-status {
  font-size:12px; margin-top:10px;
  min-height:18px; text-align:center;
  transition:color .2s;
}
.login-attempts {
  font-size:10.5px; color:var(--text-muted);
  margin-top:6px; text-align:center;
}

/* ── To-Do ── */
.todo-item {
  display:flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:8px;
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.07);
  transition:opacity .2s;
}
.todo-item.done { opacity:0.45; order:1; }
.todo-item input[type=checkbox] { width:16px; height:16px; accent-color:var(--accent); cursor:pointer; flex-shrink:0; }
.todo-item .todo-text { flex:1; font-size:13px; color:var(--text); word-break:break-word; }
.todo-item.done .todo-text { text-decoration:line-through; color:var(--text-muted); }
.todo-del { background:none; border:none; color:var(--text-muted); font-size:15px; cursor:pointer; padding:0 2px; line-height:1; }
.todo-del:hover { color:#ef4444; }

/* ── Finanzen ── */
.fin-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:12px; }
.fin-toolbar select.modal-input { width:auto; min-width:180px; margin-bottom:0; }
.fin-badge { font-size:11px; padding:3px 11px; border-radius:20px; font-weight:600; white-space:nowrap; }
.fin-badge.open   { background:rgba(34,197,94,0.15); color:#22c55e; border:1px solid rgba(34,197,94,0.3); }
.fin-badge.closed { background:rgba(245,158,11,0.15); color:#f59e0b; border:1px solid rgba(245,158,11,0.3); }

/* Shared "this value was set/edited by hand, not derived from real data"
   convention — used by Perioden (Teil 0), Fixkosten (Teil 1), Lohn-
   korrekturen (Teil 2) and Szenario delta cards (Teil 5) alike, so a manual
   assumption always looks the same regardless of which part it's in. */
.manual-badge {
  display:inline-flex; align-items:center; gap:4px;
  font-size:10px; font-weight:700; padding:2px 8px; border-radius:10px;
  background:rgba(245,158,11,0.15); color:#f59e0b; border:1px solid rgba(245,158,11,0.35);
  white-space:nowrap;
}
.manual-value { color:#f59e0b !important; }
.manual-row   { background:rgba(245,158,11,0.06); border-left:2px solid #f59e0b; }
.fin-view-toggle, .fin-lang-toggle {
  background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.12);
  border-radius:8px; color:var(--text-muted); cursor:pointer;
  padding:6px 12px; font-size:11.5px; font-family:'DM Sans',sans-serif; transition:all .18s;
}
.fin-view-toggle:hover, .fin-lang-toggle:hover { background:rgba(34,197,94,0.1); color:var(--text); }
.fin-inline-form { display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding:10px; background:rgba(255,255,255,0.03); border:1px solid rgba(34,197,94,0.15); border-radius:10px; margin:8px 0; }
.fin-inline-form input, .fin-inline-form select { flex:1; min-width:110px; margin-bottom:0 !important; }
.fin-section { margin:18px 0; }
.fin-section-title { font-size:13.5px; font-weight:600; margin-bottom:8px; display:flex; align-items:center; gap:6px; }
.fin-section-title .fin-total { margin-left:auto; font-family:monospace; font-size:12px; color:var(--accent); }

/* Fixkosten (Teil 1) — every row is tappable, mirrors .link-item's hover lift */
.fin-fixkosten-row {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 11px; border-radius:9px; cursor:pointer; margin-bottom:4px;
  border:1px solid rgba(255,255,255,0.06); background:rgba(255,255,255,0.03);
  transition:all .18s;
}
.fin-fixkosten-row:hover { background:rgba(34,197,94,0.06); border-color:rgba(34,197,94,0.25); }
.fin-fixkosten-row .fk-name { font-size:12.5px; }
.fin-fixkosten-row .fk-interval { font-size:10.5px; color:var(--text-muted); }
.fin-fixkosten-row .fk-value { font-family:monospace; font-size:12.5px; white-space:nowrap; }
.fin-table-wrap { overflow-x:auto; }
.fin-table { width:100%; border-collapse:collapse; font-size:12px; }
.fin-table th { text-align:left; font-size:10.5px; color:var(--text-muted); font-weight:500; padding:5px 8px; border-bottom:1px solid rgba(255,255,255,0.08); white-space:nowrap; }
.fin-table td { padding:6px 8px; border-bottom:1px solid rgba(255,255,255,0.05); vertical-align:middle; }
.fin-table tr:hover td { background:rgba(34,197,94,0.05); }
.fin-table td.num { font-family:monospace; text-align:right; white-space:nowrap; }
.fin-src { font-size:11px; opacity:0.75; margin-right:3px; }
.fin-row-actions { white-space:nowrap; }
.fin-row-actions button { background:none; border:none; cursor:pointer; font-size:13px; opacity:0.65; padding:2px 4px; }
.fin-row-actions button:hover { opacity:1; }
.fin-cat-dot { width:10px; height:10px; border-radius:50%; display:inline-block; flex-shrink:0; }
.fin-cat-header { display:flex; align-items:center; gap:8px; cursor:pointer; padding:8px 6px; border-radius:8px; user-select:none; }
.fin-cat-header:hover { background:rgba(255,255,255,0.04); }
.fin-cat-name { font-size:12.5px; font-weight:600; }
.fin-cat-count { font-size:10.5px; color:var(--text-muted); }
.fin-cat-sub { margin-left:auto; font-size:11.5px; font-family:monospace; color:var(--text-muted); }
.fin-cat-chev { font-size:11px; opacity:0.6; transition:transform .2s; width:12px; text-align:center; }
.fin-cat-header.collapsed .fin-cat-chev { transform:rotate(-90deg); }
.fin-cat-body.collapsed { display:none; }
.fin-ergebnis { text-align:center; padding:22px; border-radius:14px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); margin-top:12px; }
.fin-ergebnis-label { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.6px; }
.fin-ergebnis-value { font-size:34px; font-weight:700; font-family:monospace; margin-top:4px; }
.fin-ergebnis-value.pos { color:#22c55e; }
.fin-ergebnis-value.neg { color:#ef4444; }
.fin-simple-rows { display:flex; flex-direction:column; gap:6px; font-size:13px; margin-bottom:10px; }
.fin-simple-rows .row { display:flex; justify-content:space-between; }
.fin-simple-rows .row .v { font-family:monospace; }
.fin-detail-grid { display:grid; grid-template-columns:1fr auto; gap:7px 20px; font-size:12.5px; margin-top:8px; }
.fin-detail-grid .k { color:var(--text-muted); }
.fin-detail-grid .v { font-family:monospace; text-align:right; }
.fin-detail-grid .sep { grid-column:1/-1; border-top:1px solid rgba(255,255,255,0.08); margin:4px 0; }
.fin-empty { font-size:11.5px; color:var(--text-muted); padding:8px 4px; }
/* Kalkulation (Finanzkreislauf / Echte Lohnkosten / Offerte-Rechner) —
   reines CSS, keine Library. Jede Zahl kommt fertig gerechnet vom Server. */
.kalk-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.kalk-tab {
  font-size:12px; padding:6px 12px; border-radius:9px; cursor:pointer;
  border:1px solid rgba(255,255,255,0.08); background:rgba(255,255,255,0.03);
  color:var(--text-muted); transition:all .18s;
}
.kalk-tab:hover { background:rgba(34,197,94,0.06); }
.kalk-tab.active { background:rgba(34,197,94,0.14); border-color:rgba(34,197,94,0.4); color:var(--accent); font-weight:600; }
.kalk-hint { font-size:11px; color:var(--text-muted); background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.07); border-radius:9px; padding:8px 10px; margin-bottom:10px; line-height:1.5; }
.kalk-warn { font-size:11.5px; border-radius:9px; padding:8px 10px; margin-bottom:10px; line-height:1.5; }
.kalk-warn.amber { background:rgba(245,158,11,0.12); border:1px solid rgba(245,158,11,0.4); color:#f59e0b; }
.kalk-warn.red   { background:rgba(239,68,68,0.12);  border:1px solid rgba(239,68,68,0.45); color:#ef4444; }
.kalk-bar { display:flex; width:100%; height:26px; border-radius:8px; overflow:hidden; border:1px solid rgba(255,255,255,0.08); margin:6px 0 10px; }
.kalk-bar-seg { height:100%; }
.kalk-legend { display:flex; flex-wrap:wrap; gap:5px 14px; font-size:11px; color:var(--text-muted); margin-bottom:12px; }
.kalk-legend span.dot { width:9px; height:9px; border-radius:2px; display:inline-block; margin-right:5px; }
.kalk-mein-loon { text-align:center; padding:20px; border-radius:14px; margin:14px 0; background:rgba(34,197,94,0.10); border:1px solid rgba(34,197,94,0.45); }
.kalk-mein-loon .lbl { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.6px; }
.kalk-mein-loon .val { font-size:34px; font-weight:700; font-family:monospace; margin-top:4px; color:#22c55e; }
.kalk-mein-loon .sub { font-size:11.5px; color:var(--text-muted); margin-top:3px; }
.kalk-ma-row {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:9px 11px; border-radius:9px; cursor:pointer; margin-bottom:4px;
  border:1px solid rgba(255,255,255,0.06); background:rgba(255,255,255,0.03); transition:all .18s;
}
.kalk-ma-row:hover { background:rgba(34,197,94,0.06); border-color:rgba(34,197,94,0.25); }
.kalk-ma-row .nm { font-size:12.5px; font-weight:600; }
.kalk-ma-row .mv { margin-left:auto; font-family:monospace; font-size:12.5px; white-space:nowrap; }
.kalk-badge { font-size:10px; padding:2px 7px; border-radius:20px; border:1px solid rgba(255,255,255,0.12); color:var(--text-muted); cursor:help; }
.kalk-badge.flex { background:rgba(245,158,11,0.14); border-color:rgba(245,158,11,0.4); color:#f59e0b; }
.kalk-badge.vast { background:rgba(34,197,94,0.12); border-color:rgba(34,197,94,0.35); color:#22c55e; }
.kalk-detail { padding:4px 8px 12px; }
.kalk-detail.collapsed { display:none; }
body.light .kalk-tab { background:rgba(255,255,255,0.7); border-color:rgba(45,106,79,0.2); color:#1a2940; }
body.light .kalk-hint, body.light .kalk-ma-row { background:rgba(0,0,0,0.03); border-color:rgba(0,0,0,0.08); }
body.light .fin-table th, body.light .fin-table td { border-color:rgba(0,0,0,0.08); }
body.light .fin-ergebnis { background:rgba(255,255,255,0.6); border-color:rgba(0,0,0,0.08); }
body.light .fin-inline-form { background:rgba(0,0,0,0.03); }
body.light .fin-detail-grid .sep { border-color:rgba(0,0,0,0.08); }
/* ── Geld-In/Out Donut ── */
.fin-donut-wrap { display:flex; flex-wrap:wrap; align-items:center; gap:24px; }
.fin-donut-svg  { flex:0 0 200px; width:200px; height:200px; }
.fin-donut-legend { flex:1; min-width:160px; display:flex; flex-direction:column; gap:10px; }
.fin-donut-legend-row { display:flex; align-items:center; gap:10px; font-size:13px; }
.fin-donut-legend-dot { width:14px; height:14px; border-radius:3px; flex:0 0 14px; }
.fin-donut-legend-lbl { color:var(--text-muted); flex:1; }
.fin-donut-legend-val { font-family:monospace; font-size:13px; font-weight:600; }
.fin-donut-legend-sub { font-size:11px; color:var(--text-muted); margin-top:1px; }
/* ── Perioden-Bericht Modal ── */
.bericht-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.65); z-index:3000; display:none; align-items:center; justify-content:center; }
.bericht-overlay.show { display:flex; }
.bericht-box { background:var(--surface-2); border:1px solid var(--border); border-radius:18px; padding:28px 32px; max-width:680px; width:95vw; max-height:85vh; overflow-y:auto; }
.bericht-titel { font-size:18px; font-weight:700; margin-bottom:4px; }
.bericht-sub   { font-size:12px; color:var(--text-muted); margin-bottom:20px; }
.bericht-blok  { margin-bottom:16px; }
.bericht-blok-titel { font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-muted); margin-bottom:8px; }
.bericht-zeile { display:flex; justify-content:space-between; align-items:center; padding:5px 0; border-bottom:1px solid rgba(255,255,255,0.04); font-size:13px; }
.bericht-zeile:last-child { border-bottom:none; }
.bericht-zeile .lbl { color:var(--text-muted); }
.bericht-zeile .val { font-family:monospace; font-weight:600; }
.bericht-zeile .val.pos { color:#22c55e; }
.bericht-zeile .val.neg { color:#ef4444; }
.bericht-ergebnis { text-align:center; padding:18px; border-radius:12px; margin:16px 0; }
.bericht-ergebnis.pos { background:rgba(34,197,94,0.08); border:1px solid rgba(34,197,94,0.2); }
.bericht-ergebnis.neg { background:rgba(239,68,68,0.08); border:1px solid rgba(239,68,68,0.2); }
.bericht-ergebnis .lbl { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; }
.bericht-ergebnis .val { font-size:32px; font-weight:700; font-family:monospace; }
body.light .bericht-box { background:#fff; }
body.light .bericht-zeile { border-color:rgba(0,0,0,0.06); }

/* ═══════════════════════════════════════════════════════════════════════
   HANDY-ANSICHT  (2026-09-02)

   Nur Darstellung. Kein Knopf verschwindet, keine Funktion ändert sich —
   was hier passiert, ist ausschliesslich Groesse, Abstand und Umbruch.

   Ausgangslage, gemessen auf einem 390-px-Bildschirm:
     - Die Kopfzeile brauchte 612 px, verfuegbar waren 370. Der rechte Block
       endete bei 681 px, also weit ausserhalb des Bildschirms. Weil <body>
       seitwaerts abschneidet, waren "Systeme", die KI-Auswahl, das Menue und
       das rechte Panel auf dem Handy schlicht nicht erreichbar.
     - Die vorhandene Regel .topbar-right{overflow-x:auto} lief ins Leere:
       daneben stand flex-shrink:0, also wurde der Block nie schmaler als
       sein Inhalt und hatte folglich nie etwas zu scrollen.
     - Die Begruessung lag unter dem schwebenden Knopf "Chat oeffnen" —
       Schrift auf Schrift.
     - 81 Bedienelemente waren niedriger als 40 px (Richtwert fuer den
       Daumen sind 44 px).
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width:768px) {

  /* Eine gemeinsame Hoehe fuer Kopfzeile und die beiden Schubladen. Vorher
     stand hier fest top:54px, die Leiste war aber 57 px hoch — die Schubladen
     lagen also drei Pixel unter der Kante. */
  :root { --juno-kopf-h: calc(56px + env(safe-area-inset-top)); }

  /* KEIN overflow hier. #topbar hat backdrop-filter und ist damit der
     Bezugsrahmen fuer jedes position:fixed-Kind — das Aufklappmenue haengt
     als Nachfahre drin. Mit overflow:hidden wurde es auf die 56 px der
     Leiste beschnitten: der Kasten war zwar da, gezeichnet wurde nur der
     oberste Streifen, und jeder Tipp auf "Einstellungen" landete beim
     Mikrofon darunter. */
  #topbar {
    height:var(--juno-kopf-h);
    min-height:var(--juno-kopf-h);
    padding:env(safe-area-inset-top) 8px 0 8px;
    gap:6px;
    overflow:visible;
  }
  #sidebar, #right-panel { top:var(--juno-kopf-h); }

  /* Die drei Bloecke duerfen schrumpfen. Das ist der eigentliche Schalter:
     ohne min-width:0 ignoriert Flexbox jedes Ueberlauf-Verhalten. */
  .topbar-left, .topbar-center, .topbar-right {
    min-width:0;
    flex-shrink:1;
  }

  /* Auch hier kein overflow: der rechte Block liegt zwischen dem Menue und
     seinem Bezugsrahmen und wuerde es genauso beschneiden. Gescrollt wird
     nicht mehr — die Knoepfe passen jetzt ohnehin. */
  .topbar-right {
    overflow:visible;
    gap:6px;
  }
  .topbar-right > * { flex-shrink:0; }

  /* Der Titel ist Zierde, die Knoepfe sind Werkzeug — auf dem Handy gewinnt
     das Werkzeug. Die Begruessung direkt darunter sagt ohnehin, wo man ist. */
  .topbar-center { display:none; }

  /* Mikrofon-Status: auf 74 px gekappt stand dort nur noch "Zu" — ein
     halbes Wort sagt weniger als gar keines. Der Text weicht, der farbige
     Punkt bleibt (gruen = hoert zu, grau = aus) und bekommt ein Mikrofon
     dazu. Ausgeschrieben steht der Zustand weiterhin im Menue unter
     "🎙 AN / 🔇 AUS". Angetippt wird hier ohnehin nichts. */
  #topbar .status-pill {
    max-width:none; gap:6px;
    padding:8px 10px; min-height:44px;
    white-space:nowrap;
  }
  #topbar #wake-txt { display:none; }
  #topbar .status-pill::after { content:'\1F399'; font-size:14px; line-height:1; }

  /* "⚙ Menu" — das Zahnrad allein ist eindeutig, das Wort kostet 26 px. */
  #top-menu-btn { font-size:0; min-width:44px; justify-content:center; }
  #top-menu-btn::before { content:'⚙'; font-size:17px; }

  /* "Systeme": das Wort kostet 70 px, die pulsierende Statuskugel bleibt und
     traegt die Bedeutung weiter. #topbar davor, weil die Regel sonst gegen
     den <style>-Block in der Seite verliert. */
  #topbar .sysp-trigger {
    font-size:0; gap:5px; padding:8px 11px;
    min-width:44px; justify-content:center;
  }
  #topbar .sysp-trigger::after { content:'\229E'; font-size:15px; line-height:1; }
  #topbar .sysp-trigger .tri-dot { width:7px; height:7px; }

  .model-fab, #model-fab {
    font-size:11px; padding:8px 9px;
    max-width:92px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
  }
  #topbar .topbar-divider { margin:6px 0; }

  /* Daumenmass: alles, was angetippt wird, mindestens 44 px hoch. */
  #topbar .top-btn,
  #topbar button,
  .top-menu-item,
  .mobile-toggle-btn {
    min-height:44px;
  }
  #menu-button, #mobile-rightpanel-toggle { min-width:44px; justify-content:center; }
  .top-menu-item { padding:11px 14px; font-size:13.5px; }

  /* ── Startseite ─────────────────────────────────────────────────────
     "Chat oeffnen" schwebt absolut auf top:10px. Auf dem Desktop ist
     darueber Luft, auf dem Handy begann die Begruessung an derselben
     Stelle. Der Inhalt bekommt jetzt eine eigene Spur darunter. */
  .homepage-view.visible {
    padding-top:46px;
    gap:22px;
  }
  .chat-toggle-btn {
    min-height:34px; padding:8px 18px; font-size:12px;
    top:calc(6px + env(safe-area-inset-top));
  }

  /* Begruessung skaliert mit dem Bildschirm statt bei festen 32 px zu
     bleiben — bei langen Namen brach sie sonst dreizeilig um. */
  .home-greeting-text { font-size:clamp(21px, 6.6vw, 30px); line-height:1.15; }
  .home-greeting-datetime { font-size:12px; }

  /* Kacheln: 9,5-px-Beschriftung war auf Armlaenge nicht mehr lesbar. */
  .home-tile { padding:7px; border-radius:15px; }
  .home-tile-icon { font-size:25px; }
  .home-tile-name { font-size:11px; line-height:1.25; }
  .home-tile-status { font-size:9px; }
  .home-tiles-group { gap:10px; }
  .homepage-tiles-wrap { gap:20px; padding:0 14px; }

  /* Suchfeld und Zeiterfassung mit Daumenmass */
  .home-suche input, #home-suche-input { min-height:46px; font-size:15px; }

  /* ── Eingabezeile ───────────────────────────────────────────────────
     Die Zeile sitzt am unteren Rand, also dort, wo der Daumen liegt. */
  .input-row { gap:6px; }
  #input-area .ic-btn { min-width:44px; min-height:44px; font-size:17px; }
  #chat-input {
    font-size:16px;            /* unter 16px zoomt iOS beim Antippen hinein */
    min-height:44px; padding:11px 12px;
  }
  #stopp-btn { min-height:44px; }

  /* ── Ueberlagerungen ────────────────────────────────────────────────
     Aufklappmenues und Dialoge sollen nie breiter als der Bildschirm sein. */
  .top-menu-dropdown {
    position:fixed; left:8px; right:8px; top:var(--juno-kopf-h);
    width:auto; max-width:none; max-height:70vh; overflow-y:auto;
  }
  .overlay .set-field, .overlay input, .overlay select, .overlay textarea {
    max-width:100%;
  }

  /* Dekorative Leuchtkugeln ragten ueber den rechten Rand hinaus. Sie sind
     Hintergrund, kein Inhalt — sie duerfen keine Breite erzeugen. */
  .orb { pointer-events:none; }
}

/* Sehr schmale Geraete (iPhone SE, kleine Androiden) */
@media (max-width:400px) {
  .home-tile-name { font-size:10px; }
  /* Auf 360 px fehlten 14 px. Die Modellanzeige gibt sie her, sie kuerzt
     mit Auslassungspunkten statt zu ueberlaufen. */
  #topbar { gap:4px; }
  .topbar-right { gap:4px; }
  #topbar .model-fab, #topbar #model-fab { max-width:66px; padding:8px 7px; }
  #topbar .status-pill { padding:8px 8px; }
}

/* ── Briefing-Karten (04.09.2026) ─────────────────────────────────────
   JUNO meldet sich vor und nach einem Einsatz. Die Karte hebt sich
   dezent vom normalen Chatverlauf ab, ohne wie eine Warnung zu wirken. */
.msg.briefing-karte .msg-bubble {
  border-left: 3px solid #3b82f6;
  background: rgba(59, 130, 246, .07);
}
.msg.briefing-karte .msg-bubble ul { margin: 0; }
.bf-detail.hidden { display: none; }
