/* ════════════════════════════════════════════════════════════════════════════
   ESSENSPLANER – Design System v2
   Inspiriert von iOS 26 Liquid Glass · Linear 2025 · Things 3 · Apple Notes
   ──────────────────────────────────────────────────────────────────────────
   Token-Diet: 6 Radii · 3 Shadows · 4er-Spacing · iOS-Type-Scale
   Hairline-Borders statt Drop-Shadows · Capsule-Buttons · Floating Tab-Bar
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─────────────────────────────────────────────────────── */
:root {
  /* Spacing – striktes 4er System */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px;  --sp-8: 32px;  --sp-12: 48px;

  /* Border-Radii – 6 Stufen total */
  --r-xs: 8px;       /* Tags, Chips, kleine Icons */
  --r-sm: 12px;      /* Inputs, kleine Cards */
  --r-md: 16px;      /* Standard-Cards, Buttons */
  --r-lg: 20px;      /* Hero-Cards, Bottom-Sheets */
  --r-xl: 24px;      /* Modal-Top, Lightbox */
  --r-pill: 999px;   /* Capsule-Buttons, Pills, Nav-Pills */

  /* Typography – iOS-Type-Scale */
  --fs-cap:     11px;
  --fs-foot:    13px;
  --fs-body:    15px;
  --fs-callout: 16px;
  --fs-head:    17px;
  --fs-t3:      20px;
  --fs-t2:      22px;
  --fs-t1:      28px;

  /* Font-Weights – reduziert, kein 900 mehr */
  --fw-reg:   500;
  --fw-med:   600;
  --fw-bold:  700;
  --fw-heavy: 800;

  /* Letter-Spacing */
  --ls-tight: -0.02em;
  --ls-snug:  -0.01em;
  --ls-wide:   0.06em;

  /* Shadows – subtle */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.18);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.22);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.32);
  --shadow-xl:  0 16px 60px rgba(0,0,0,0.45);
  --ring:       inset 0 0 0 1px rgba(255,255,255,0.08);

  /* Z-Index */
  --z-base:    1;
  --z-sticky:  50;
  --z-nav:     100;
  --z-modal:   200;
  --z-popover: 300;
  --z-toast:   400;

  /* Theme-Vars (werden von theme.js überschrieben) */
  --blue: #0284C7;
  --blue-rgb: 2,132,199;
  --blue-light: #38BDF8;
  --teal: #0D9488;
  --teal-light: #2DD4BF;
  --bg: #080C14;
  --card: #1B1B1E;
  --card2: #232326;
  --text: #F0F6FF;
  --text-muted: rgba(255,255,255,0.55);
  --text-accent: #F0F6FF;
  --border: rgba(255,255,255,0.10);
  --shadow: var(--shadow-md);
  --header-glow: rgba(2,132,199,0.18);
  --modal-bg: #1B1B1E;
  --input-bg: rgba(255,255,255,0.06);
  --nav-bg: rgba(20,20,22,0.72);
  --cell-bg: rgba(255,255,255,0.05);
  --cell-border: rgba(255,255,255,0.08);
  --cell-glow: rgba(56,189,248,0.20);
  --cell-add: rgba(255,255,255,0.40);
  --card-tint: rgba(255,255,255,0.04);
  --card-border-tint: rgba(255,255,255,0.08);
  --bg-tint: rgba(56,189,248,0.04);
  --cell-glow-rgb: 56,189,248;
  --header-bg: linear-gradient(160deg, #0F172A 0%, #1E3A5F 45%, #0F2D40 100%);
  --page-bg: #080C14;
  --btn-grad: var(--blue);

  /* Semantic */
  --danger: #F87171;
  --danger-bg: rgba(248,113,113,0.12);
  --success: #34D399;
}

/* ─── RESET & BASE ──────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  height: 100%;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--page-bg);
  color: var(--text);
  overflow-x: hidden;
  touch-action: pan-x pan-y;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: var(--fw-reg);
  font-size: var(--fs-body);
  line-height: 1.4;
}
#app {
  height: 100vh;
  flex-direction: column;
  width: 100%;
  display: flex;
}
#calendarPage, #statsPage, #shopPage, #profilePage {
  background: var(--page-bg);
  flex: 1;
  min-height: 0;
  width: 100%;
}
.stats-body, .profile-body { background: var(--page-bg); }

/* Calendar-Page: kein Scroll — Cards flexen auf verfügbare Höhe.
   #app ist height:100vh + flex column. Page flext im verbleibenden Raum
   nach Bottom-Nav, der eigene flex-Block sorgt für Cards-Stretch. */
#calendarPage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#calendarPage .header { flex-shrink: 0; }
.calendar-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: var(--sp-3) var(--sp-4) var(--sp-3);
}
.calendar-grid {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.week-row {
  flex: 1;
  min-height: 56px;
}
button { font-family: inherit; }

/* ─── LOGIN / REGISTER – Premium Liquid-Glass Welcome ───────────────────── */
/* Konzept: Dunkler Hero-Background mit zwei Radial-Glows in Akzentfarbe,
   schwebende Glass-Card matching dem App-Header-Stil, Gradient-Text Title,
   moderne Filled-Inputs mit Focus-Glow, Primary-CTA als Akzent-Pill mit Glow. */
/* ─── LOGIN / REGISTER – Aurora Glass v2 ──────────────────────────────── */
/* Theme-aware: nutzt --page-bg falls vom Design-Picker gesetzt, sonst Dark-Default */
#loginScreen,
#registerScreen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 22px;
  position: relative;
  overflow: hidden;
  background: var(--page-bg, #050811);
  color: var(--text, #fff);
}
/* Aurora-Blobs – langsam wandernde Farbverläufe als Premium-Background */
.login-aurora {
  position: absolute; inset: 0;
  pointer-events: none;
  filter: blur(60px) saturate(140%);
  z-index: 0;
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
  mix-blend-mode: screen;
}
.aurora-blob--1 {
  width: 480px; height: 480px;
  top: -180px; left: -140px;
  background: radial-gradient(circle, rgba(var(--blue-rgb), 0.85) 0%, transparent 70%);
  animation: auroraDrift1 22s ease-in-out infinite alternate;
}
.aurora-blob--2,
.aurora-blob--3 {
  display: none;
}
@keyframes auroraDrift1 {
  0%   { transform: translate(0,0)      scale(1);   }
  100% { transform: translate(80px,40px) scale(1.15); }
}
@keyframes auroraDrift2 {
  0%   { transform: translate(0,0)        scale(1);   }
  100% { transform: translate(-60px,-80px) scale(1.10); }
}
@keyframes auroraDrift3 {
  0%   { transform: translate(0,0)       scale(1);   }
  100% { transform: translate(40px,-50px) scale(1.20); }
}
/* Subtile Noise-Overlay für filmic grain */
.login-noise {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.login-content {
  position: relative; z-index: 2;
  width: 100%;
  max-width: 380px;
  display: flex; flex-direction: column;
  align-items: center;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
/* App-Icon (PNG) im Login/Register-Header – mit Glow + Float */
.login-app-icon {
  display: block;
  width: 82px; height: 82px;
  margin: 0 auto 18px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow:
    0 22px 44px -14px rgba(var(--blue-rgb), 0.55),
    0 0 0 1px rgba(255,255,255,0.10),
    0 0 60px -6px rgba(var(--blue-rgb), 0.40);
  animation: loginIconFloat 6s ease-in-out infinite;
}
@keyframes loginIconFloat {
  0%, 100% { transform: translateY(0)    rotate(-1.2deg); }
  50%      { transform: translateY(-6px) rotate(1.2deg); }
}
.login-title {
  font-size: 34px;
  font-weight: var(--fw-heavy);
  letter-spacing: -0.028em;
  line-height: 1.05;
  margin: 0 0 8px;
  background: linear-gradient(180deg,
    #FFFFFF 0%,
    rgba(255,255,255,0.70) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.login-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.62);
  font-weight: var(--fw-med);
  letter-spacing: 0.005em;
  margin: 0;
}

.login-card {
  width: 100%;
  background:
    radial-gradient(circle at 10% -10%, rgba(var(--blue-rgb), 0.10) 0%, transparent 55%),
    linear-gradient(150deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 26px;
  padding: 22px 20px;
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  box-shadow:
    0 30px 60px -24px rgba(0,0,0,0.65),
    0 6px 18px -6px rgba(0,0,0,0.40),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.20);
}

/* Input mit Icon im Field-Wrap */
.login-field {
  position: relative;
  margin-bottom: 10px;
}
.login-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  color: rgba(255,255,255,0.55);
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.25s;
}
.login-field-icon svg { width: 18px; height: 18px; }
.login-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: var(--fw-bold);
  letter-spacing: -0.005em;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 1px 2px rgba(0,0,0,0.25);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.login-input::placeholder { color: rgba(255,255,255,0.38); font-weight: var(--fw-med); }
.login-input:focus {
  border-color: color-mix(in srgb, var(--blue) 70%, white);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 0 0 3px rgba(var(--blue-rgb), 0.22),
    0 4px 14px rgba(var(--blue-rgb), 0.22);
}
.login-field:focus-within .login-field-icon { color: rgba(255,255,255,0.85); }

.login-error {
  display: none;
  color: #FCA5A5;
  font-size: 12.5px;
  font-weight: var(--fw-bold);
  text-align: center;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(248,113,113,0.10);
  border: 1px solid rgba(248,113,113,0.25);
  margin: 4px 0 14px;
}

.login-btn {
  width: 100%;
  padding: 15px 18px;
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(var(--blue-rgb), 0.45);
  background:
    radial-gradient(circle at 30% 15%, rgba(255,255,255,0.30) 0%, transparent 55%),
    linear-gradient(150deg,
      color-mix(in srgb, var(--blue) 85%, white) 0%,
      var(--blue) 55%,
      color-mix(in srgb, var(--blue) 80%, black) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: var(--fw-heavy);
  letter-spacing: 0.005em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 14px 32px -10px rgba(var(--blue-rgb), 0.70),
    0 0 0 1px rgba(255,255,255,0.06);
  transition:
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s,
    filter 0.18s;
}
.login-btn .login-btn-arrow {
  width: 18px; height: 18px;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.login-btn:hover .login-btn-arrow { transform: translateX(4px); }
.login-btn:active {
  transform: scale(0.97);
  filter: brightness(0.96);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 6px 16px -6px rgba(var(--blue-rgb), 0.50);
}

.login-divider {
  text-align: center;
  margin: 18px 0 14px;
  position: relative;
  display: flex; align-items: center; gap: 12px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.login-divider span {
  color: rgba(255,255,255,0.38);
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-register-btn {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  color: rgba(255,255,255,0.92);
  font-family: inherit;
  font-size: 14px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.005em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 1px 2px rgba(0,0,0,0.20);
  transition: background 0.20s, border-color 0.20s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.login-register-btn:active {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.26);
  transform: scale(0.97);
}

.login-footer {
  margin: 22px 0 0;
  font-size: 11px;
  color: rgba(255,255,255,0.32);
  font-weight: var(--fw-bold);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-align: center;
}

/* Back-Button für Register-Screen — schwebt links über der Content-Card */
.login-back {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  left: 18px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 4px 14px -4px rgba(0,0,0,0.45);
  transition: background 0.20s, border-color 0.20s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.login-back svg { width: 20px; height: 20px; }
.login-back:active {
  transform: scale(0.92);
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.28);
}

/* Section-Label im Register-Card (z.B. „Dein Avatar") */
.login-section-label {
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 10px 2px 10px;
}

/* Avatar-Grid: 4-Spalten, Glass-Items mit Tap-Feedback */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.avatar-item {
  cursor: pointer;
  padding: 6px;
  border-radius: 14px;
  border: 1.5px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition:
    background 0.20s,
    border-color 0.20s,
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.20s;
}
.avatar-item svg { width: 100%; height: auto; max-width: 40px; }
.avatar-item:hover {
  border-color: rgba(255,255,255,0.20);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
}
.avatar-item:active { transform: scale(0.94); }
/* Ausgewählter Avatar: Akzent-Glow */
.avatar-item.selected,
.avatar-item[data-selected="true"] {
  border-color: color-mix(in srgb, var(--blue) 70%, white);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--blue) 22%, transparent),
      color-mix(in srgb, var(--blue) 8%, transparent));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 0 0 3px rgba(var(--blue-rgb), 0.18),
    0 4px 14px rgba(var(--blue-rgb), 0.32);
}

/* Floating Design-Picker-Button unten links im Login/Register */
.login-theme-btn {
  position: absolute;
  left: max(20px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 3;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.18) 0%, transparent 60%),
    linear-gradient(150deg,
      rgba(var(--blue-rgb), 0.32) 0%,
      rgba(255,255,255,0.06) 100%);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    0 8px 24px -8px rgba(0,0,0,0.55),
    0 0 0 1px rgba(var(--blue-rgb), 0.20),
    0 0 24px -8px rgba(var(--blue-rgb), 0.55);
  transition:
    background 0.25s,
    border-color 0.25s,
    transform 0.20s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s;
}
.login-theme-btn svg { width: 22px; height: 22px; }
.login-theme-btn:hover {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.22) 0%, transparent 60%),
    linear-gradient(150deg,
      rgba(var(--blue-rgb), 0.42) 0%,
      rgba(255,255,255,0.08) 100%);
}
.login-theme-btn:active {
  transform: scale(0.92);
  border-color: rgba(255,255,255,0.30);
}
.back-btn {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-pill);
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-6);
  backdrop-filter: blur(12px);
  transition: background 0.15s;
}
.back-btn:active { background: rgba(255,255,255,0.18); }

/* (Avatar-Item-Definition steht weiter unten in der Login/Register-Sektion mit
   Glass-Materialität – die alte transparente Variante hier wurde entfernt um
   Cascade-Konflikt zu vermeiden.) */

/* ─── PREMIUM LIQUID-GLASS HEADER (für alle Pages) ──────────────────────── */
/* Alle Header (Kalender, Einkauf, Profil, Statistik) als schwebende Glass-Cards. */
.header,
.shop-header,
.profile-header,
.stats-header {
  margin: max(10px, env(safe-area-inset-top)) 12px 8px;
  padding: 16px 18px 18px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 15% -20%, rgba(var(--cell-glow-rgb), 0.18) 0%, transparent 55%),
    linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    0 24px 48px -20px rgba(0,0,0,0.45),
    0 4px 12px -4px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.12);
  position: sticky;
  top: max(10px, env(safe-area-inset-top));
  z-index: 100;
  isolation: isolate;
}

/* Gradient-Text-Helper für alle Hero-Titles in den Glass-Cards */
.hero-gradient-text {
  background: linear-gradient(180deg,
    var(--text) 0%,
    color-mix(in srgb, var(--text) 78%, transparent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -0.03em;
}

/* Shared Hero-Layout (Caption + Title + Stat). Wird in shop-/profile-/stats-header
   verwendet — analog zum Calendar-Header. */
.hero-caption {
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.5;
  white-space: nowrap;
}
.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
}
.hero-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.hero-title {
  font-size: 26px;
  font-weight: var(--fw-heavy);
  letter-spacing: -0.025em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-stat {
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--text);
  opacity: 0.55;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

/* Generischer Header-Action-Button (Pill mit Icon + Label).
   Wie .header-today-btn, aber neutral (kein Akzent-Tint) — für Aktionen
   wie "Zurück" auf der Stats-Page. */
.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px 0 9px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.header-action-btn:active {
  background: rgba(var(--cell-glow-rgb), 0.20);
  border-color: rgba(var(--cell-glow-rgb), 0.35);
  transform: scale(0.96);
}
.header-action-btn svg { opacity: 0.85; }

/* Top-Row: Dynamische Context-Caption links, Date-Picker rechts */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: 10px;
  min-height: 22px;
}
.header-user,
.user-avatar,
.user-name,
.user-sub { display: none; }

/* Dynamic Context-Caption — wechselt je nach Wochen-Position (current/past/future).
   Wird über JS gesetzt: 'Diese Woche' / 'Letzte Woche' / 'In 2 Wochen' / etc. */
.week-context {
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.5;
  transition: color 0.25s ease, opacity 0.25s ease;
  white-space: nowrap;
}
.week-context.current {
  color: var(--text-accent);
  opacity: 0.95;
}
.week-context.past {
  color: var(--text);
  opacity: 0.32;
}
.week-context.future {
  color: var(--text);
  opacity: 0.65;
}

.header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}
.icon-btn {
  height: 32px;
  min-width: 32px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  transition: background 0.15s, transform 0.15s;
}
.icon-btn:active {
  background: rgba(var(--cell-glow-rgb), 0.20);
  transform: scale(0.94);
}

/* Today als sekundäre Header-Action (rechts neben Date-Picker).
   Selbe Maße wie .icon-btn, aber mit Akzent-Tint damit sie sich klar als
   „aktive Rückkehr-Action" abhebt. */
.header-today-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  padding: 0;
  border-radius: var(--r-pill);
  background: rgba(var(--cell-glow-rgb), 0.18);
  border: 1px solid rgba(var(--cell-glow-rgb), 0.32);
  color: var(--text-accent);
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.header-today-btn[style*="flex"],
.header-today-btn[data-visible="true"] { display: inline-flex; }
.header-today-btn:active {
  background: rgba(var(--cell-glow-rgb), 0.32);
  border-color: rgba(var(--cell-glow-rgb), 0.50);
  transform: scale(0.94);
}
.header-today-btn svg { opacity: 0.90; }
.icon-btn.flash { animation: flashPulse 0.35s ease; }
@keyframes flashPulse {
  0%   { background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06)); }
  35%  { background: rgba(var(--cell-glow-rgb), 0.55); box-shadow: 0 0 18px rgba(var(--cell-glow-rgb), 0.55); }
  100% { background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06)); }
}

/* Hero-Row: Title-Block (Title + Stat) links, Joined-Stepper (mit optionalem
   Today-Button in der Mitte) rechts. CSS-`order` arrangiert HTML zu:
   title-block | ‹ | [Heute] | › */
.month-nav {
  display: flex;
  align-items: center;
  gap: 0;
}
.month-title-block {
  order: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  margin-right: var(--sp-3);
}
.month-title {
  font-size: 28px;
  font-weight: var(--fw-heavy);
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-align: left;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Subtle gradient-text für Premium-Wirkung */
  background: linear-gradient(180deg,
    var(--text) 0%,
    color-mix(in srgb, var(--text) 78%, transparent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* Spring-Animation beim Wochenwechsel */
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.month-title.fading {
  opacity: 0;
  transform: translateX(-8px);
}
.month-stat {
  font-size: 11px;
  font-weight: var(--fw-med);
  color: var(--text);
  opacity: 0.50;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

/* Joined-Glass-Stepper — Wochen-Pfeile als zusammenhängende Pill.
   Stärker: 40×38px (statt 36×32), SVG-Chevrons mit stroke-width 2.6,
   stärkere Border-Glow-Akzentfarbe für klares Touch-Feedback. */
.month-btn {
  width: 40px;
  height: 38px;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.07));
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.12s, border-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
}
.month-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  opacity: 0.92;
  transition: transform 0.15s;
}
.month-btn:first-of-type {
  order: 2;
  border-radius: var(--r-pill) 0 0 var(--r-pill);
  border-right: none;
}
.month-btn:last-of-type {
  order: 3;
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
}
.month-btn:active {
  background: rgba(var(--cell-glow-rgb), 0.30);
  border-color: rgba(var(--cell-glow-rgb), 0.45);
  transform: scale(0.93);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 0 12px rgba(var(--cell-glow-rgb), 0.20);
}
.month-btn:first-of-type:active svg { transform: translateX(-1px); }
.month-btn:last-of-type:active  svg { transform: translateX(1px); }
.month-btn.flash { animation: flashPulse 0.35s ease; }

/* Mini-Day-Indicator-Strip — 7 Dots, einer pro Tag der Woche.
   Gefüllt = Mahlzeit eingetragen, Akzent + Halo = heute, leer = noch nichts. */
.week-dots {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 14px;
  padding: 0 2px;
}
.week-dots .dot {
  flex: 1;
  max-width: 28px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.10);
  transition: background 0.2s, box-shadow 0.2s;
}
.week-dots .dot.filled {
  background: rgba(255,255,255,0.55);
}
/* Heute (noch nichts eingetragen) → Theme-Akzentfarbe mit Glow.
   Heute + eingetragen → weiß (User-Wunsch: weiß signalisiert „hier ist was"). */
.week-dots .dot.today {
  background: var(--blue);
  box-shadow: 0 0 10px rgba(var(--cell-glow-rgb), 0.65);
}
.week-dots .dot.today.filled {
  background: #fff;
  box-shadow: 0 0 8px rgba(var(--cell-glow-rgb), 0.40);
}

/* ─── CALENDAR / WEEK GRID ──────────────────────────────────────────────── */
/* .calendar-wrap, .calendar-grid und .week-row Layout-Properties siehe oben
   (im Scroll-Fix-Block). Hier nur Card-Styling für die Tag-Cards: */

.week-row {
  display: flex; align-items: stretch;
  background: var(--cell-bg);
  border-radius: var(--r-md);
  border: 1px solid var(--cell-border);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s, background 0.18s;
}
.week-row:active { transform: scale(0.985); }
.week-row.today {
  background: rgba(var(--cell-glow-rgb), 0.10);
  border-color: rgba(var(--cell-glow-rgb), 0.40);
}
.week-row.weekend .week-day-info { background: rgba(255,255,255,0.03); }

.week-day-info {
  width: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; flex-shrink: 0;
  border-right: 1px solid var(--cell-border);
  padding: var(--sp-2) 0;
}
.week-day-name {
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: var(--text);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}
.week-day-num {
  font-size: var(--fs-t3);
  font-weight: var(--fw-heavy);
  color: var(--text);
  line-height: 1;
  letter-spacing: var(--ls-tight);
}
.week-day-num.is-today {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--btn-grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-callout);
  box-shadow: 0 4px 12px rgba(var(--cell-glow-rgb), 0.35);
}

.week-content {
  flex: 1;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3);
  min-width: 0;
  position: relative;
}
.week-color-strip {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
}
.week-content.has-img { padding: 0; }
.week-meal-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.week-content.has-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.45) 50%, rgba(0,0,0,0.05) 100%);
  z-index: 2;
}
.week-text { flex: 1; min-width: 0; z-index: 3; position: relative; }
.week-content.has-img .week-text { padding: var(--sp-3); }
.week-meal-name {
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  color: var(--text);
  letter-spacing: var(--ls-snug);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.week-content.has-img .week-meal-name {
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.week-meal-notes {
  font-size: var(--fs-foot);
  font-weight: var(--fw-med);
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.week-content.has-img .week-meal-notes {
  color: rgba(255,255,255,0.78);
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
}
.week-add-icon {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--text); opacity: 0.22;
  font-weight: 300;
}

.note-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: var(--r-pill);
  background: var(--blue);
  z-index: 4;
  box-shadow: 0 0 6px var(--blue);
}

/* ─── BOTTOM NAV – Floating Liquid-Glass Pill ───────────────────────────── */
/* Konzept: Bottom-Nav schwebt als Glass-Pill am unteren Rand — dieselbe
   Materialität wie die Header-Cards (Radial-Glow von unten, Backdrop-Blur,
   Inner-Highlight, Drop-Shadow). Edge-to-edge wird durch Margins ersetzt. */
.bottom-nav {
  margin: 6px 12px max(10px, env(safe-area-inset-bottom));
  padding: 6px;
  display: flex;
  gap: 4px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 120%, rgba(var(--cell-glow-rgb), 0.18) 0%, transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    0 -8px 32px -16px rgba(0,0,0,0.45),
    0 24px 48px -20px rgba(0,0,0,0.30),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.12);
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: var(--z-nav);
}
/* Tab-Items als horizontale Capsules. Inaktive: nur Icon (Label collapsed).
   Aktiv: Tab expandiert (flex grows), Label morpht von max-width 0 zu sichtbar,
   Akzent-Background fadet ein. Alles mit Spring-Easing für iOS-typisches Feel. */
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 6px;
  border-radius: var(--r-pill);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text);
  opacity: 0.45;
  font-family: inherit;
  font-size: 12px;
  font-weight: var(--fw-heavy);
  letter-spacing: -0.005em;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
  /* Smoother Spring-Transitions: flex-grow animiert die Tab-Breite, padding
     die Innen-Abstände, Background/Glow die Akzent-Fülle. Alle mit Apple-
     Spring-Easing (subtle overshoot, smooth settle). */
  transition:
    flex-grow   0.50s cubic-bezier(0.34, 1.56, 0.64, 1),
    padding     0.50s cubic-bezier(0.34, 1.56, 0.64, 1),
    background  0.45s cubic-bezier(0.32, 0.72, 0, 1),
    color       0.30s cubic-bezier(0.32, 0.72, 0, 1),
    opacity     0.30s cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow  0.45s cubic-bezier(0.32, 0.72, 0, 1),
    transform   0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-item:active {
  transform: scale(0.93);
  transition: transform 0.10s cubic-bezier(0.4, 0, 0.6, 1);
}

/* Aktiver Tab — Filled Akzent-Pill mit Glow, aber nur leichte Expansion (1.25x).
   Glow + Farbe deutlich, Größe bleibt nah an den inaktiven Tabs. */
.nav-item.active {
  flex-grow: 1.25;
  opacity: 1;
  padding: 10px 12px 10px 10px;
  background:
    linear-gradient(135deg,
      rgba(var(--cell-glow-rgb), 0.42),
      rgba(var(--cell-glow-rgb), 0.22));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.10),
    0 6px 18px -6px rgba(var(--cell-glow-rgb), 0.50),
    0 0 0 1px rgba(var(--cell-glow-rgb), 0.28);
}
.nav-item.active:active {
  transform: scale(0.96);
}

/* Icon-Wrap */
.nav-item .nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

/* Notification-Badge: leuchtender Dot rechts oben am Icon wenn etwas Neues vorliegt.
   Wird via JS via .has-badge auf .nav-item gesetzt. Aktive Tabs zeigen keinen
   Badge (man ist ja gerade da). Hell aufgemixte Akzentfarbe + starker Multi-Layer-Glow
   + subtiler Pulse damit der Punkt sofort ins Auge fällt. */
.nav-badge {
  position: absolute;
  top: -2px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  /* Voll-leuchtende Akzentfarbe (matched die aktive Profil-Pille) +
     radial weißer Hot-Spot oben links für plastische Tiefe */
  background:
    radial-gradient(circle at 30% 25%, #ffffff 0%, transparent 55%),
    var(--blue);
  /* Filter brightness pusht alles nochmal über Standard hinaus */
  filter: brightness(1.35) saturate(1.4);
  box-shadow:
    /* Nav-Background-Ring – Trennkante */
    0 0 0 2px var(--nav-bg),
    /* Direkt-Halo in voller Akzent-Sättigung */
    0 0 0 3px rgba(var(--blue-rgb), 0.85),
    /* Mehrere Outer-Glow-Layer in Akzentfarbe – „neon"-Effekt */
    0 0 10px 2px rgba(var(--blue-rgb), 1.00),
    0 0 20px 4px rgba(var(--blue-rgb), 0.90),
    0 0 32px 6px rgba(var(--blue-rgb), 0.55);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.nav-item.has-badge .nav-badge {
  opacity: 1;
  transform: scale(1);
  animation: navBadgePulse 1.8s ease-in-out infinite;
}
.nav-item.active .nav-badge {
  opacity: 0;
  transform: scale(0);
  animation: none;
}
@keyframes navBadgePulse {
  0%, 100% {
    box-shadow:
      0 0 0 2px var(--nav-bg),
      0 0 0 3px rgba(var(--blue-rgb), 0.85),
      0 0 10px 2px rgba(var(--blue-rgb), 1.00),
      0 0 20px 4px rgba(var(--blue-rgb), 0.90),
      0 0 32px 6px rgba(var(--blue-rgb), 0.55);
  }
  50% {
    box-shadow:
      0 0 0 2px var(--nav-bg),
      0 0 0 4px rgba(var(--blue-rgb), 1.00),
      0 0 14px 3px rgba(var(--blue-rgb), 1.00),
      0 0 28px 6px rgba(var(--blue-rgb), 1.00),
      0 0 44px 10px rgba(var(--blue-rgb), 0.70);
  }
}
.nav-svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-item.active .nav-svg {
  transform: scale(1.0);
}

/* Label-Morph: collapse via max-width auf 0 für inaktive Tabs.
   Beim aktiv-werden expandiert max-width auf den natürlichen Wert mit Spring. */
.nav-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  margin-left: 0;
  transition:
    max-width   0.50s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity     0.30s cubic-bezier(0.32, 0.72, 0, 1) 0.05s,
    margin-left 0.50s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-item.active .nav-label {
  max-width: 80px;
  opacity: 1;
  margin-left: 7px;
}

/* ─── MODAL (Meal Editor) – Bottom Sheet ────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: var(--z-modal);
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32,0.72,0,1);
  box-shadow: 0 -12px 60px rgba(0,0,0,0.5);
  border: 1px solid var(--card-border-tint);
  border-bottom: none;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-top {
  background: var(--card);
  padding: var(--sp-2) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--card-border-tint);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  position: sticky; top: 0; z-index: 5;
}
.modal-handle {
  width: 36px; height: 5px;
  background: rgba(255,255,255,0.22);
  border-radius: var(--r-pill);
  margin: var(--sp-1) auto var(--sp-4);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-size: var(--fs-t2);
  font-weight: var(--fw-heavy);
  color: var(--text);
  letter-spacing: var(--ls-tight);
}
.modal-date {
  font-size: var(--fs-foot);
  color: var(--text-muted);
  font-weight: var(--fw-med);
  margin-top: 2px;
}
.modal-close {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: var(--r-pill);
  width: 32px; height: 32px;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.modal-close:active { background: rgba(255,255,255,0.16); }

.meal-image-loading {
  display: none;
  align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-6);
  background: var(--cell-bg);
  border-radius: var(--r-md);
  margin: var(--sp-4) var(--sp-5) 0;
  color: var(--text-muted);
  font-size: var(--fs-foot);
  font-weight: var(--fw-med);
}
.meal-image-preview {
  display: none;
  width: calc(100% - var(--sp-5) * 2);
  margin: var(--sp-4) var(--sp-5) 0;
  border-radius: var(--r-md);
  max-height: 200px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.form-body { padding: var(--sp-4) var(--sp-5) var(--sp-6); }
.form-label {
  font-size: var(--fs-cap);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin: var(--sp-4) 0 var(--sp-2);
  display: block;
}
.form-label:first-child { margin-top: 0; }
.form-input,
.form-textarea {
  width: 100%;
  padding: 14px var(--sp-4);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-med);
  outline: none;
  transition: background 0.2s, border-color 0.2s;
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}
.form-input:focus,
.form-textarea:focus {
  background: rgba(255,255,255,0.08);
  border-color: var(--blue);
}
.form-textarea { min-height: 80px; resize: vertical; }

/* Autocomplete dropdown */
.autocomplete-wrap { position: relative; }
/* Glass-Dropdown unter dem Shop-Input – matched dem Shop-Add-Row-Look */
.autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 10;
  display: none;
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  box-shadow:
    0 14px 32px -10px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 1px 3px rgba(0,0,0,0.25);
  overscroll-behavior: contain;
}
.autocomplete-list.show { display: block; }
.autocomplete-item {
  padding: 11px 14px;
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  transition: background 0.18s;
}
.autocomplete-item + .autocomplete-item {
  border-top: 1px solid rgba(255,255,255,0.06);
}
.autocomplete-item:first-child {
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}
.autocomplete-item:last-child {
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}
.autocomplete-item:hover,
.autocomplete-item:active {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));
}
.autocomplete-emoji { opacity: 0.7; }
.shop-ac-thumb {
  width: 36px; height: 36px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Color Picker (Meal) */
.color-picker-row {
  display: flex; align-items: center; gap: var(--sp-3);
}
.color-presets {
  flex: 1;
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
}
.color-dot {
  width: 30px; height: 30px;
  border-radius: var(--r-pill);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.color-dot.selected {
  border-color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.color-custom-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.color-custom-label {
  font-size: 9px;
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}
.color-custom-input {
  width: 38px; height: 38px;
  border: 2px solid var(--card-border-tint);
  border-radius: var(--r-pill);
  cursor: pointer;
  padding: 0;
  background: none;
}
.color-preview-bar {
  height: 4px;
  border-radius: var(--r-pill);
  margin: var(--sp-3) 0 0;
  transition: background 0.2s;
}

/* Buttons */
.save-btn {
  width: 100%;
  margin-top: var(--sp-6);
  padding: 14px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  cursor: pointer;
  letter-spacing: var(--ls-snug);
  transition: transform 0.15s, opacity 0.15s, background 0.15s;
  box-shadow: 0 8px 20px -8px rgba(var(--blue-rgb), 0.5),
              inset 0 1px 0 rgba(255,255,255,0.18);
}
.save-btn:active { transform: scale(0.97); opacity: 0.92; }

.delete-btn {
  width: 100%;
  margin-top: var(--sp-3);
  padding: 12px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(248,113,113,0.35);
  background: transparent;
  color: var(--danger);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: background 0.15s;
}
.delete-btn:active { background: var(--danger-bg); }

/* ─── CONFIRM MODAL ─────────────────────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0;
  z-index: var(--z-popover);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
  padding: var(--sp-5);
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }
.confirm-box {
  background: var(--card);
  border: 1px solid var(--card-border-tint);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  width: 100%;
  max-width: 340px;
  text-align: center;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  box-shadow: var(--shadow-xl);
}
.confirm-overlay.open .confirm-box { transform: scale(1); }
.confirm-icon { font-size: 40px; margin-bottom: var(--sp-3); }
.confirm-title {
  font-size: var(--fs-head);
  font-weight: var(--fw-heavy);
  color: var(--text);
  letter-spacing: var(--ls-snug);
  margin-bottom: var(--sp-2);
}
.confirm-sub {
  font-size: var(--fs-foot);
  color: var(--text-muted);
  font-weight: var(--fw-med);
  margin-bottom: var(--sp-5);
}
.confirm-yes {
  width: 100%;
  padding: 13px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--danger);
  color: #fff;
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  cursor: pointer;
  margin-bottom: var(--sp-2);
  transition: opacity 0.15s, transform 0.15s;
}
.confirm-yes:active { transform: scale(0.97); opacity: 0.92; }
.confirm-no {
  width: 100%;
  padding: 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--card-border-tint);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: background 0.15s;
}
.confirm-no:active { background: rgba(255,255,255,0.06); }

/* ─── DATE PICKER ───────────────────────────────────────────────────────── */
.dp-year-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.dp-year-btn {
  background: var(--cell-bg);
  border: 1px solid var(--cell-border);
}
.dp-year-label {
  font-size: var(--fs-t2);
  font-weight: var(--fw-heavy);
  color: var(--text);
  letter-spacing: var(--ls-tight);
}
.dp-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}
.dp-month-btn {
  background: var(--cell-bg);
  border: 1px solid var(--cell-border);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-2);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.dp-month-btn:active { transform: scale(0.96); }
.dp-month-btn.current {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
}

/* ─── STATS PAGE ────────────────────────────────────────────────────────── */
#statsPage { display: none; flex-direction: column; min-height: 100vh; }
/* .stats-header übernimmt den shared Liquid-Glass-Stil (siehe oben).
   Inhalt: hero-caption + hero-row + header-action-btn (Zurück-Pill). */
.stats-body {
  padding: var(--sp-4);
  padding-bottom: 80px; /* Platz unter dem letzten Card für die Bottom-Nav */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.stats-card {
  background: var(--card-tint);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  margin-bottom: var(--sp-3);
  border: 1px solid var(--card-border-tint);
}
.stats-card-title {
  font-size: var(--fs-cap);
  font-weight: var(--fw-heavy);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-bottom: var(--sp-3);
}
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border-tint);
}
.stat-row:last-child { border-bottom: none; }
.stat-meal {
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  color: var(--text);
  letter-spacing: var(--ls-snug);
}
.stat-count {
  font-size: var(--fs-foot);
  font-weight: var(--fw-bold);
  color: var(--text);
  background: rgba(255,255,255,0.06);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

/* ─── PROFILE PAGE ──────────────────────────────────────────────────────── */
#profilePage { display: none; flex-direction: column; min-height: 100vh; }
/* .profile-header übernimmt den shared Liquid-Glass-Stil.
   Avatar wird kompakter (52px) als Eyebrow zum Hero-Title. */
.profile-avatar-big {
  width: 52px;
  height: 52px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, rgba(255,255,255,0.20), rgba(255,255,255,0.06));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.16);
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar-big svg { width: 44px; height: 44px; }
.profile-name {
  /* Aliased to .hero-title now — alte Klasse bleibt für JS-Selectors */
}
.profile-body {
  padding: var(--sp-5) var(--sp-4) var(--sp-6);
  flex: 1;
}
.profile-card {
  background: var(--card-tint);
  border: 1px solid var(--card-border-tint);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
  overflow: hidden;
}
.profile-item {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--card-border-tint);
}
.profile-item:last-child { border-bottom: none; }
.profile-item:active { background: rgba(255,255,255,0.04); }
.profile-item-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: rgba(var(--cell-glow-rgb), 0.14);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-item-label {
  flex: 1;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  color: var(--text);
  letter-spacing: var(--ls-snug);
}
.profile-item-arrow {
  font-size: 22px;
  color: var(--text-muted);
  font-weight: var(--fw-med);
  line-height: 1;
}

.logout-btn {
  width: 100%;
  margin-top: var(--sp-3);
  padding: 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(248,113,113,0.30);
  background: rgba(248,113,113,0.06);
  color: var(--danger);
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  cursor: pointer;
  letter-spacing: var(--ls-snug);
  transition: background 0.15s;
}
.logout-btn:active { background: rgba(248,113,113,0.14); }

/* ─── SHOPPING LIST – Liquid-Glass Header + V1-Body ─────────────────────── */
/* Header übernimmt den shared Liquid-Glass-Stil (hero-caption + hero-title +
   hero-stat). Body (Folder-Bar, Items, Add-Btn) bleibt im V1-Look. */
#shopPage { display: none; flex-direction: column; min-height: 100vh; }
.shop-body { padding: 16px 24px; flex: 1; overflow-y: auto; }

.shop-add-row {
  display: flex; gap: 0; margin-bottom: 12px;
  align-items: stretch;
}
/* autocomplete-wrap ist flex-child der add-row; muss selbst flex sein,
   damit das input drin den ganzen Wrap füllt — sonst klafft eine Lücke
   zwischen Input-Right-Edge und Add-Button. */
.shop-add-row .autocomplete-wrap {
  display: flex !important;
  flex-direction: column;
}
.shop-input {
  width: 100%;
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border-radius: 13px 0 0 13px;
  border: 1px solid rgba(255,255,255,0.16);
  border-right: none;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--text); outline: none;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 1px 3px rgba(0,0,0,0.30);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.shop-input::placeholder {
  color: var(--text-muted); opacity: 0.75; font-weight: 700;
}
.shop-input:focus {
  /* Border/Background-Wechsel bleibt – Outer-Glow kommt von .shop-add-row:focus-within */
  border-color: color-mix(in srgb, var(--blue) 70%, white);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12);
}
/* Focus-Within: der gesamte Compound (Input + Mic + Plus) bekommt einen
   gemeinsamen Outer-Glow + Akzent-Borders, statt nur das Input. */
.shop-add-row {
  border-radius: 13px;
  transition: box-shadow 0.22s ease;
}
.shop-add-row:focus-within {
  box-shadow:
    0 0 0 3px rgba(var(--blue-rgb), 0.18),
    0 4px 14px rgba(var(--blue-rgb), 0.22);
}
.shop-add-row:focus-within .shop-mic-btn {
  border-color: color-mix(in srgb, var(--blue) 70%, white);
  background: rgba(var(--cell-glow-rgb), 0.16);
}
.shop-add-row:focus-within .shop-add-btn {
  border-color: color-mix(in srgb, var(--blue) 70%, white);
  border-left-color: color-mix(in srgb, var(--blue) 50%, white);
  background: rgba(var(--cell-glow-rgb), 0.26);
}
/* Mic + Plus bilden eine zusammenhängende Action-Group rechts vom Input
   (compound pill). Beide haben Akzent-Tint, nur unterschiedliche Intensität:
   Mic = sekundäre Action (etwas dimmer), Plus = primäre Action (voll). */
.shop-mic-btn {
  width: 42px; height: 42px;
  border-radius: 0;
  border: 1px solid rgba(var(--cell-glow-rgb), 0.28);
  border-right: none; /* Trenner zwischen Mic und Plus kommt von Plus:border-left */
  background: rgba(var(--cell-glow-rgb), 0.10);
  color: color-mix(in srgb, var(--blue) 80%, white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 1px 2px rgba(0,0,0,0.20);
  transition: background 0.2s, color 0.2s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.shop-mic-btn svg { width: 17px; height: 17px; }
.shop-mic-btn:hover {
  background: rgba(var(--cell-glow-rgb), 0.16);
}
.shop-mic-btn:active { transform: scale(0.92); }

.shop-add-btn {
  width: 48px; height: 42px;
  border-radius: 0 13px 13px 0;
  border: 1px solid rgba(var(--cell-glow-rgb), 0.32);
  border-left: 1px solid rgba(var(--cell-glow-rgb), 0.22); /* feine Trennlinie zum Mic */
  background: rgba(var(--cell-glow-rgb), 0.20);
  color: var(--text-accent); font-size: 24px; font-weight: 400; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 1px 3px rgba(0,0,0,0.25);
  transition: background 0.2s, border-color 0.2s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.shop-add-btn:active {
  background: rgba(var(--cell-glow-rgb), 0.34);
  border-color: rgba(var(--cell-glow-rgb), 0.50);
  transform: scale(0.94);
}

.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 16px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: opacity 0.2s;
}
.shop-item.done { opacity: 0.45; }
.shop-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.8px solid rgba(var(--blue-rgb), 0.55);
  background: rgba(255,255,255,0.04);
  flex-shrink: 0; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  color: #fff; font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.shop-item.done .shop-check {
  background: rgba(var(--blue-rgb), 0.65);
  border-color: rgba(var(--blue-rgb), 0.75);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.20),
    0 0 8px rgba(var(--blue-rgb), 0.25);
}
.shop-item-img-wrap {
  position: relative;
  width: 48px; height: 48px; border-radius: 10px;
  overflow: hidden; flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.10);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s, border-color 0.18s;
}
.shop-item-img-wrap:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
}
/* Kamera-Hint: erscheint nur wenn das innere <img> noch hidden ist (= kein Foto da) */
.shop-item-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: center / 18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
  opacity: 1;
  transition: opacity 0.18s;
}
/* Bild geladen: Hint ausblenden + Border weg */
.shop-item-img-wrap:has(.shop-item-img[style*="display: block"])::after,
.shop-item-img-wrap.has-img::after {
  opacity: 0;
}
.shop-item-img-wrap:has(.shop-item-img[style*="display: block"]),
.shop-item-img-wrap.has-img {
  border-style: solid;
  border-color: transparent;
  background: none;
  cursor: zoom-in;
}
/* Upload-State: Spinner */
.shop-item-img-wrap.uploading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2;
}
.shop-item-img-wrap.uploading::after {
  /* Override: zeigen wir Spinner statt Camera-Hint */
  background:
    conic-gradient(from 0deg, rgba(255,255,255,0.10), rgba(255,255,255,0.85));
  border-radius: 50%;
  width: 22px; height: 22px;
  inset: auto; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: shopImgSpin 0.8s linear infinite;
  -webkit-mask: radial-gradient(circle at center, transparent 6px, #000 7px);
          mask: radial-gradient(circle at center, transparent 6px, #000 7px);
  opacity: 1 !important;
  z-index: 3;
}
@keyframes shopImgSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.shop-item-img {
  width: 48px; height: 48px; object-fit: contain;
  display: none; border-radius: 10px;
  position: relative; z-index: 1;
}
.shop-item-text {
  flex: 1; font-size: 15px; font-weight: 700; color: var(--text);
  text-decoration: none;
}
.shop-item.done .shop-item-text { text-decoration: line-through; color: var(--text-muted); }
.shop-delete {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(239,68,68,0.1); color: #F87171;
  font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.2s;
}
.shop-delete:active { background: rgba(239,68,68,0.25); }

/* Section-Card: alle Items eines Folders in einem gemeinsamen Container,
   dezent in der Folder-Color umrandet (iOS-Listen-Stil). */
.shop-folder-section {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 6px 10px 10px;
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 6px;
  /* border-color, background, box-shadow werden inline pro Folder gesetzt */
}
.shop-folder-section:first-child { margin-top: 0; }
.shop-folder-section-header {
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 4px 4px;
  opacity: 0.85;
  /* color wird inline gesetzt mit der Folder-Color */
}
/* Items innerhalb einer Section: keine eigene Border (die kommt vom Container) */
.shop-item.shop-item--in-section {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.shop-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text); opacity: 0.55; font-size: 15px; font-weight: 700;
}
.shop-empty-icon { font-size: 40px; margin-bottom: 12px; }

/* Shop-Header-Actions: Container für Live-Dot + Action-Buttons rechts */
.shop-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Glass-Icon-Button im Shop-Header (Voice, Hide-Done) */
.shop-header-btn {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 1px 2px rgba(0,0,0,0.20);
  transition:
    background 0.20s,
    border-color 0.20s,
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.22s;
}

/* Live-Status-Dot so klein wie ein typografischer Bullet-Point (•) –
   sitzt vor dem hero-stat-Text als unaufdringlicher Indikator.
   Doppel-Klasse für höhere Specificity, damit base-`.live-status-dot`
   weiter unten im File die Werte nicht überschreibt. */
.live-status-dot.live-status-dot--inline {
  width: 5px;
  height: 5px;
  margin: 0 6px 1px 0;
  vertical-align: middle;
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  border-radius: 50%;
  box-shadow: none;
}
.live-status-dot.live-status-dot--inline::after  { display: none; }
.live-status-dot.live-status-dot--inline::before { display: none; }
/* Hero-Stat als flexbox damit der Dot sauber vor dem Text sitzt */
.hero-stat {
  display: flex;
  align-items: center;
  gap: 0;
}
.shop-header-btn svg { width: 17px; height: 17px; }
.shop-header-btn:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border-color: rgba(255,255,255,0.20);
}
.shop-header-btn:active { transform: scale(0.92); }

/* Hide-Done-Toggle: bei aria-pressed=true wechselt Icon-Sichtbarkeit */
#shopHideDoneBtn .icon-eye-off { display: none; }
#shopHideDoneBtn[aria-pressed="true"] .icon-eye    { display: none; }
#shopHideDoneBtn[aria-pressed="true"] .icon-eye-off { display: block; }
/* Aktiver Zustand: Theme-Akzent */
#shopHideDoneBtn[aria-pressed="true"] {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20) 0%, transparent 60%),
    linear-gradient(150deg,
      color-mix(in srgb, var(--blue) 35%, transparent),
      color-mix(in srgb, var(--blue) 18%, transparent));
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
  color: var(--text-accent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 0 0 1px color-mix(in srgb, var(--blue) 25%, transparent),
    0 4px 12px rgba(var(--blue-rgb), 0.28);
}

/* Voice-Recording: pulsierender Ring während Aufnahme */
#shopVoiceBtn.recording {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.25) 0%, transparent 60%),
    linear-gradient(150deg,
      rgba(248, 113, 113, 0.50),
      rgba(248, 113, 113, 0.22));
  border-color: rgba(248, 113, 113, 0.65);
  color: #fff;
  animation: voiceRecPulse 1.2s ease-in-out infinite;
}
@keyframes voiceRecPulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.22),
      0 0 0 0 rgba(248, 113, 113, 0.60),
      0 4px 14px rgba(248, 113, 113, 0.40);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.30),
      0 0 0 8px rgba(248, 113, 113, 0.00),
      0 6px 18px rgba(248, 113, 113, 0.55);
  }
}

/* Live-Status-Indicator im Shop-Header (rechts) – iOS-Activity-Style.
   Pulse-Ring ist ein eigenes Pseudo-Element damit der Glow groß werden
   kann ohne den Dot zu verzerren. */
.live-status-dot {
  position: relative;
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255,255,255,0.30);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.25);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.live-status-dot::before,
.live-status-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
/* Innerer Highlight für Tiefe */
.live-status-dot::before {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55), transparent 60%);
}
/* Online: Theme-Akzent, kräftiger pulsierender Ring */
.live-status-dot[data-state="online"] {
  background: color-mix(in srgb, var(--blue) 90%, white);
  box-shadow:
    inset 0 0 0 1.5px rgba(255,255,255,0.40),
    0 0 8px rgba(var(--blue-rgb), 0.55);
}
.live-status-dot[data-state="online"]::after {
  /* Pulsierender Outer-Ring */
  box-shadow: 0 0 0 0 rgba(var(--blue-rgb), 0.70);
  animation: liveDotPulseRing 1.6s cubic-bezier(0.32, 0.72, 0, 1) infinite;
}
/* Offline: grau, statisch */
.live-status-dot[data-state="offline"] {
  background: rgba(160,160,160,0.65);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.20);
}
.live-status-dot[data-state="offline"]::after { animation: none; box-shadow: none; }
/* Loading: dim, atmender Opacity */
.live-status-dot[data-state="loading"] {
  background: rgba(255,255,255,0.28);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.20);
  animation: liveDotBreathe 1.4s ease-in-out infinite;
}
.live-status-dot[data-state="loading"]::after { animation: none; box-shadow: none; }
@keyframes liveDotPulseRing {
  0%   { box-shadow: 0 0 0 0   rgba(var(--blue-rgb), 0.75); opacity: 1; }
  70%  { box-shadow: 0 0 0 14px rgba(var(--blue-rgb), 0.00); opacity: 0; }
  100% { box-shadow: 0 0 0 0   rgba(var(--blue-rgb), 0.00); opacity: 0; }
}
@keyframes liveDotBreathe {
  0%,100% { opacity: 0.5; }
  50%     { opacity: 1; }
}

/* ─── SHOP FOLDERS – Variante A: Color-Dot + Counter-Badge (Liquid-Glass) ─── */
.shop-folder-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 1; /* explizit unter dem sticky Header (z-index:100) */
  isolation: isolate; /* Pseudo-Elements (::before/::after mit z-index:2)
                         im eigenen Stacking-Context halten */
}
/* Edge-Fade als Scroll-Affordance — nur sichtbar wenn überlauf vorhanden.
   Die at-start/at-end Klassen werden per JS gesetzt. */
.shop-folder-wrap::before,
.shop-folder-wrap::after {
  content: '';
  position: absolute; top: 0; bottom: 8px;
  width: 28px; pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.shop-folder-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg) 10%, transparent 100%);
}
.shop-folder-wrap::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg) 10%, transparent 100%);
}
.shop-folder-wrap.has-overflow-left::before { opacity: 1; }
.shop-folder-wrap.has-overflow-right::after { opacity: 1; }

.shop-folder-bar {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
  padding: 10px 24px 14px;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  cursor: grab;
  /* Sichtbare Scrollbar – auf Desktop greifbar, auf Mobile irrelevant */
  scrollbar-width: auto;
  scrollbar-color: rgba(255,255,255,0.30) transparent;
}
.shop-folder-bar.dragging { cursor: grabbing; scroll-behavior: auto; }
.shop-folder-bar::-webkit-scrollbar { height: 8px; }
.shop-folder-bar::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  margin: 0 24px;
}
.shop-folder-bar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.30);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.shop-folder-bar::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.45);
  background-clip: padding-box;
}

.shop-folder-tab {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 10px 18px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 13px; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 1px 2px rgba(0,0,0,0.20);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.shop-folder-tab:active { transform: scale(0.96); }

.shop-folder-tab.active {
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--blue) 22%, transparent),
      color-mix(in srgb, var(--blue) 10%, transparent));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 0 1px color-mix(in srgb, var(--blue) 25%, transparent),
    0 4px 14px rgba(var(--blue-rgb),0.28);
}

.folder-tab-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.25),
    0 0 6px rgba(0,0,0,0.30);
}
.shop-folder-tab.active .folder-tab-dot {
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.35),
    0 0 8px rgba(255,255,255,0.18);
}

.folder-tab-name {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}
.shop-folder-tab.active .folder-tab-name { font-weight: 800; }

.folder-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: 999px;
  font-size: 11px; font-weight: 800;
  line-height: 1;
  color: var(--text);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.10);
  margin-left: 2px;
}
.shop-folder-tab.active .folder-tab-count {
  background: color-mix(in srgb, var(--blue) 30%, rgba(255,255,255,0.10));
  border-color: color-mix(in srgb, var(--blue) 40%, transparent);
  color: #fff;
}

.shop-folder-add {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  color: var(--text); font-size: 20px; font-weight: 400;
  cursor: pointer; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.shop-folder-add:hover {
  border-style: solid;
  border-color: rgba(255,255,255,0.22);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}
.shop-folder-add:active { transform: scale(0.92); }
.folder-color-dot {
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.10);
  transition:
    transform 0.20s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.20s,
    box-shadow 0.20s;
  flex-shrink: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.20),
    0 2px 6px rgba(0,0,0,0.30);
}
.folder-color-dot.selected {
  border-color: var(--text);
  transform: scale(1.18);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.35),
    0 0 0 3px rgba(var(--blue-rgb), 0.25),
    0 4px 14px rgba(var(--blue-rgb), 0.35);
}
.folder-color-dot:active { transform: scale(0.92); }

/* ─── FOLDER-MODAL – Glass-Design ──────────────────────────────────────── */
.folder-modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  align-items: center; justify-content: center;
  padding: 20px;
}
.folder-modal-card {
  width: min(360px, 100%);
  background:
    radial-gradient(circle at 15% -10%, rgba(var(--blue-rgb), 0.12) 0%, transparent 55%),
    linear-gradient(150deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 24px;
  padding: 22px 20px;
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.65),
    0 6px 18px -6px rgba(0,0,0,0.40),
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 -1px 0 rgba(0,0,0,0.18);
  color: var(--text);
}
.folder-modal-title {
  font-size: 18px;
  font-weight: var(--fw-heavy);
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.folder-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: var(--fw-bold);
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 1px 2px rgba(0,0,0,0.25);
  transition: border-color 0.22s, background 0.22s, box-shadow 0.22s;
  margin-bottom: 16px;
}
.folder-modal-input::placeholder { color: var(--text-muted); opacity: 0.70; font-weight: var(--fw-med); }
.folder-modal-input:focus {
  border-color: color-mix(in srgb, var(--blue) 70%, white);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 0 0 3px rgba(var(--blue-rgb), 0.20),
    0 3px 12px rgba(var(--blue-rgb), 0.22);
}
.folder-modal-section-label {
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.folder-modal-presets {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.folder-modal-custom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}
.folder-modal-color-input {
  width: 34px; height: 34px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  background: none;
  -webkit-appearance: none;
}
.folder-modal-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.folder-modal-color-input::-webkit-color-swatch { border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; }
.folder-modal-color-hex {
  font-family: 'SF Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
}
.folder-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.folder-modal-delete {
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid rgba(248,113,113,0.30);
  background:
    linear-gradient(180deg, rgba(248,113,113,0.14), rgba(248,113,113,0.06));
  color: #F87171;
  cursor: pointer;
  display: none; /* nur im Edit-Modus sichtbar — JS toggelt */
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 1px 3px rgba(0,0,0,0.25);
  transition: background 0.20s, border-color 0.20s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.folder-modal-delete svg { width: 18px; height: 18px; }
.folder-modal-delete:hover {
  background:
    linear-gradient(180deg, rgba(248,113,113,0.22), rgba(248,113,113,0.10));
  border-color: rgba(248,113,113,0.50);
}
.folder-modal-delete:active { transform: scale(0.92); }
.folder-modal-cancel,
.folder-modal-save {
  flex: 1;
  padding: 12px;
  border-radius: 13px;
  font-family: inherit;
  font-size: 14px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: background 0.20s, border-color 0.20s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.folder-modal-cancel {
  border: 1px solid rgba(255,255,255,0.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 1px 2px rgba(0,0,0,0.20);
}
.folder-modal-cancel:active { transform: scale(0.97); background: rgba(255,255,255,0.10); }
.folder-modal-save {
  border: 1px solid rgba(var(--blue-rgb), 0.45);
  background:
    radial-gradient(circle at 30% 15%, rgba(255,255,255,0.30) 0%, transparent 55%),
    linear-gradient(150deg,
      color-mix(in srgb, var(--blue) 85%, white) 0%,
      var(--blue) 55%,
      color-mix(in srgb, var(--blue) 80%, black) 100%);
  color: #fff;
  font-weight: var(--fw-heavy);
  letter-spacing: 0.005em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 8px 22px -8px rgba(var(--blue-rgb), 0.60);
}
.folder-modal-save:active { transform: scale(0.97); filter: brightness(0.96); }

/* ─── DESIGN PICKER ─────────────────────────────────────────────────────── */
.design-overlay {
  position: fixed; inset: 0;
  z-index: var(--z-popover);
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.design-overlay.open { opacity: 1; pointer-events: all; }
.design-box {
  background: var(--card);
  border: 1px solid var(--card-border-tint);
  border-bottom: none;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-width: 520px;
  padding: var(--sp-3) var(--sp-5) calc(var(--sp-8) + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32,0.72,0,1);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 -12px 60px rgba(0,0,0,0.5);
}
.design-overlay.open .design-box { transform: translateY(0); }
.design-box-top {
  position: sticky; top: calc(var(--sp-3) * -1);
  margin: calc(var(--sp-3) * -1) calc(var(--sp-5) * -1) 0;
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  background: var(--card);
  z-index: 10;
  border-bottom: 1px solid var(--card-border-tint);
}
.design-handle {
  width: 36px; height: 5px;
  background: rgba(255,255,255,0.22);
  border-radius: var(--r-pill);
  margin: var(--sp-1) auto var(--sp-3);
}
.design-header {
  display: flex; align-items: center; justify-content: space-between;
}
.design-title {
  font-size: var(--fs-t2);
  font-weight: var(--fw-heavy);
  color: var(--text);
  letter-spacing: var(--ls-tight);
}
.design-close {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: var(--r-pill);
  width: 32px; height: 32px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.design-close:active { background: rgba(255,255,255,0.16); }

.design-section { margin: var(--sp-5) 0 var(--sp-3); }
.design-section-title {
  font-size: var(--fs-head);
  font-weight: var(--fw-heavy);
  color: var(--text);
  letter-spacing: var(--ls-snug);
}
.design-section-sub {
  font-size: var(--fs-foot);
  font-weight: var(--fw-med);
  color: var(--text-muted);
  margin-top: 2px;
}

.design-profiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-1) 0 var(--sp-2);
}
.design-card {
  border-radius: var(--r-md);
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid transparent;
  transition: border-color 0.18s, transform 0.18s;
  position: relative;
  overflow: hidden;
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
}
.design-card:active { transform: scale(0.97); }
.design-card.active {
  border-color: var(--blue);
  background: rgba(var(--blue-rgb), 0.08);
}
.design-card-preview {
  border-radius: var(--r-xs);
  overflow: hidden;
  margin-bottom: var(--sp-2);
}
.design-card-header {
  height: 28px;
}
.design-card-body {
  padding: 6px 8px 8px;
  display: flex; flex-direction: column; gap: 3px;
  min-height: 36px;
}
.design-card-dot { width: 6px; height: 6px; border-radius: var(--r-pill); }
.design-card-line { height: 2px; border-radius: 2px; width: 75%; }
.design-card-line.short { width: 45%; }
.design-card-nav { height: 8px; }
.design-card-label {
  font-size: var(--fs-foot);
  font-weight: var(--fw-bold);
  color: var(--text);
  text-align: center;
  letter-spacing: var(--ls-snug);
}
.design-card-check {
  color: var(--blue);
  font-weight: var(--fw-heavy);
}
.design-card-delete {
  position: absolute;
  top: var(--sp-1); right: var(--sp-1);
  width: 22px; height: 22px;
  border: none;
  border-radius: var(--r-pill);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.design-card:hover .design-card-delete,
.design-card.active .design-card-delete { opacity: 1; }

.design-custom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.design-custom-btn {
  background: var(--cell-bg);
  border: 1px solid var(--cell-border);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-2);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  transition: background 0.15s, transform 0.15s;
}
.design-custom-btn:active { transform: scale(0.96); background: rgba(255,255,255,0.08); }
.design-custom-icon { font-size: 18px; }
.design-custom-dot {
  width: 22px; height: 22px;
  border-radius: var(--r-pill);
  border: 2px solid;
  display: flex; align-items: center; justify-content: center;
}
.design-custom-dot-plus { font-size: 12px; font-weight: var(--fw-bold); }
.design-custom-label {
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--text);
  letter-spacing: var(--ls-snug);
}

.design-save-btn {
  width: 100%;
  margin-top: var(--sp-5);
  padding: 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--card-border-tint);
  background: var(--cell-bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  cursor: pointer;
  letter-spacing: var(--ls-snug);
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  transition: background 0.15s, transform 0.15s;
}
.design-save-btn:active { background: rgba(255,255,255,0.08); transform: scale(0.98); }
.design-save-icon { font-size: 16px; }

/* ─── COLOR PICKER (CP) ─────────────────────────────────────────────────── */
.cp-overlay {
  position: fixed; inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.cp-overlay.open { opacity: 1; pointer-events: all; }
.cp-box {
  background: var(--card);
  border: 1px solid var(--card-border-tint);
  border-bottom: none;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-width: 500px;
  padding: var(--sp-3) var(--sp-5) calc(var(--sp-6) + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32,0.72,0,1);
  max-height: 92vh;
  overflow-y: auto;
}
.cp-overlay.open .cp-box { transform: translateY(0); }
.cp-handle {
  width: 36px; height: 5px;
  background: rgba(255,255,255,0.22);
  border-radius: var(--r-pill);
  margin: var(--sp-1) auto var(--sp-3);
}
.cp-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.cp-title {
  font-size: var(--fs-t3);
  font-weight: var(--fw-heavy);
  color: var(--text);
  letter-spacing: var(--ls-tight);
}
.cp-close {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: var(--r-pill);
  width: 32px; height: 32px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.cp-close:active { background: rgba(255,255,255,0.16); }
.cp-recent-row {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  padding: var(--sp-3);
  background: var(--cell-bg);
  border-radius: var(--r-sm);
}
.cp-recent-label {
  font-size: var(--fs-cap);
  font-weight: var(--fw-heavy);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}
.cp-recent-colors { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.cp-recent-dot {
  width: 22px; height: 22px;
  border-radius: var(--r-pill);
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.10);
  transition: transform 0.15s, border-color 0.15s;
}
.cp-recent-dot:active {
  transform: scale(1.15);
  border-color: rgba(255,255,255,0.5);
}
.cp-recent-empty {
  font-size: var(--fs-cap);
  color: var(--text-muted);
  font-style: italic;
  font-weight: var(--fw-med);
}
.cp-slider-section { display: flex; flex-direction: column; gap: var(--sp-3); }
.cp-slider-row {}
.cp-slider-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.cp-slider-label {
  font-size: var(--fs-cap);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}
.cp-slider-val {
  font-size: var(--fs-cap);
  font-weight: var(--fw-heavy);
  color: var(--text);
}
.cp-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.10);
  border-radius: var(--r-pill);
  height: 4px;
  outline: none;
}
.cp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: var(--r-pill);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.cp-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  margin: var(--sp-3) 0 var(--sp-3);
}
.cp-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.1s;
}
.cp-cell:active { transform: scale(0.9); }
.cp-bottom {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.cp-preview {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--card-border-tint);
  background: var(--blue);
  flex-shrink: 0;
}
.cp-hex {
  flex: 1;
  padding: 12px var(--sp-3);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  outline: none;
  letter-spacing: 1px;
}
.cp-hex:focus { border-color: var(--blue); }
.cp-apply {
  padding: 12px var(--sp-5);
  border-radius: var(--r-pill);
  border: none;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  cursor: pointer;
  letter-spacing: var(--ls-snug);
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 6px 16px -6px rgba(var(--blue-rgb), 0.5);
}
.cp-apply:active { transform: scale(0.96); opacity: 0.92; }

/* Save Profile Modal */
.save-profile-overlay {
  position: fixed; inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
  padding: var(--sp-5);
}
.save-profile-overlay.open { opacity: 1; pointer-events: all; }
.save-profile-box {
  background: var(--card);
  border: 1px solid var(--card-border-tint);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  width: 100%;
  max-width: 320px;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  box-shadow: var(--shadow-xl);
}
.save-profile-overlay.open .save-profile-box { transform: scale(1); }
.save-profile-title {
  font-size: var(--fs-head);
  font-weight: var(--fw-heavy);
  color: var(--text);
  letter-spacing: var(--ls-snug);
  margin-bottom: var(--sp-3);
  text-align: center;
}
.save-profile-input {
  width: 100%;
  padding: 12px var(--sp-4);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-med);
  outline: none;
  margin-bottom: var(--sp-4);
  transition: border-color 0.2s;
}
.save-profile-input:focus { border-color: var(--blue); }
.save-profile-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
.save-profile-cancel {
  padding: 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--card-border-tint);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  cursor: pointer;
}
.save-profile-save {
  padding: 12px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  cursor: pointer;
  letter-spacing: var(--ls-snug);
}

/* ─── TOAST ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(40px) scale(0.92);
  background: rgba(28,28,30,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  color: #fff;
  padding: 12px var(--sp-5);
  border-radius: var(--r-pill);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
  z-index: var(--z-toast);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.32,0.72,0,1);
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* ─── LIGHTBOX ──────────────────────────────────────────────────────────── */
.img-lightbox {
  position: fixed; inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--sp-5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.img-lightbox.open { opacity: 1; pointer-events: all; }
.img-lightbox-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: var(--sp-4);
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(12px);
  transition: background 0.15s, transform 0.15s;
}
.img-lightbox-close:active {
  background: rgba(255,255,255,0.22);
  transform: scale(0.94);
}
.img-lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--r-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  object-fit: contain;
  transform: scale(0.92);
  transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
}
.img-lightbox.open .img-lightbox-img { transform: scale(1); }
.img-lightbox-label {
  color: #fff;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  margin-top: var(--sp-4);
  text-align: center;
  letter-spacing: var(--ls-snug);
}

/* ─── FOLDER MODAL (Inline) ─────────────────────────────────────────────── */
#folderModal { z-index: var(--z-popover) !important; }
.folder-color-dot {
  width: 28px; height: 28px;
  border-radius: var(--r-pill);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.folder-color-dot.selected {
  border-color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── SHOP-PHOTO-SHEET (Long-Press auf Produktbild → Ersetzen / Entfernen) ─ */
.shop-photo-sheet {
  position: fixed; inset: 0;
  z-index: 9200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.shop-photo-sheet.open {
  pointer-events: auto;
  opacity: 1;
}
.shop-photo-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}
.shop-photo-sheet-card {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  width: min(360px, calc(100% - 40px));
  padding: 14px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% -10%, rgba(var(--blue-rgb), 0.10) 0%, transparent 55%),
    linear-gradient(150deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.16);
  color: var(--text);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.shop-photo-sheet.open .shop-photo-sheet-card { transform: translateX(-50%) translateY(0); }
.shop-photo-sheet-title {
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  text-align: center;
  padding: 6px 6px 12px;
}
.shop-photo-sheet-title span { color: var(--text); text-transform: none; letter-spacing: 0; }
.shop-photo-sheet-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  text-align: left;
  transition: background 0.20s, border-color 0.20s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.shop-photo-sheet-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.shop-photo-sheet-btn:active {
  transform: scale(0.98);
  background: rgba(255,255,255,0.10);
}
.shop-photo-sheet-btn--danger {
  color: #F87171;
  border-color: rgba(248,113,113,0.28);
  background: linear-gradient(180deg, rgba(248,113,113,0.12), rgba(248,113,113,0.05));
}
.shop-photo-sheet-btn--danger:active {
  background: rgba(248,113,113,0.22);
}
.shop-photo-sheet-cancel {
  display: block;
  width: 100%;
  padding: 13px;
  margin-top: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: background 0.20s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.shop-photo-sheet-cancel:active { transform: scale(0.98); background: rgba(255,255,255,0.08); }

/* ─── VOICE-MODAL – Spracheingabe für Shop-Items ──────────────────────── */
.voice-modal {
  position: fixed; inset: 0;
  z-index: 9300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.voice-modal.open { pointer-events: auto; opacity: 1; }
.voice-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.voice-modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -45%);
  width: min(380px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 22px 20px 18px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 15% -10%, rgba(var(--blue-rgb), 0.14) 0%, transparent 55%),
    linear-gradient(150deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.16);
  color: var(--text);
  display: flex; flex-direction: column; align-items: center;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.voice-modal.open .voice-modal-card { transform: translate(-50%, -50%); }
.voice-modal-close-x {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 20px; font-weight: var(--fw-bold); line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.voice-modal-close-x:active { transform: scale(0.92); background: rgba(255,255,255,0.12); }
.voice-modal-title {
  font-size: 16px;
  font-weight: var(--fw-heavy);
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  align-self: flex-start;
}
.voice-modal-mic {
  width: 92px; height: 92px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20) 0%, transparent 60%),
    linear-gradient(150deg,
      color-mix(in srgb, var(--blue) 35%, transparent),
      color-mix(in srgb, var(--blue) 15%, transparent));
  color: var(--text-accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  margin: 4px 0 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 12px 28px -10px rgba(var(--blue-rgb), 0.45);
  transition: transform 0.20s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
}
.voice-modal-mic svg { width: 36px; height: 36px; }
.voice-modal-mic:hover { transform: scale(1.04); }
.voice-modal-mic:active { transform: scale(0.96); }

/* Recording-State: roter Pulse */
.voice-modal-mic.recording {
  border-color: rgba(248, 113, 113, 0.60);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.28) 0%, transparent 60%),
    linear-gradient(150deg, rgba(248,113,113,0.45), rgba(248,113,113,0.20));
  color: #fff;
  animation: voiceModalMicPulse 1.4s ease-in-out infinite;
}
@keyframes voiceModalMicPulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.25),
      0 0 0 0 rgba(248, 113, 113, 0.55),
      0 14px 30px -10px rgba(248, 113, 113, 0.45);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.30),
      0 0 0 14px rgba(248, 113, 113, 0.00),
      0 18px 38px -10px rgba(248, 113, 113, 0.60);
  }
}

.voice-modal-status {
  font-size: 13px;
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 14px;
  min-height: 18px;
}

.voice-modal-results {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 14px;
}
.voice-modal-results:empty { display: none; }
.voice-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  transition: background 0.20s, opacity 0.20s, border-color 0.20s;
}
.voice-result-item.added {
  opacity: 0.55;
  border-color: color-mix(in srgb, var(--blue) 50%, transparent);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--blue) 14%, transparent),
    color-mix(in srgb, var(--blue) 6%, transparent));
}
.voice-result-text {
  flex: 1;
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--text);
  word-break: break-word;
}
.voice-result-item.added .voice-result-text { text-decoration: line-through; opacity: 0.75; }
.voice-result-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(var(--cell-glow-rgb), 0.32);
  background: rgba(var(--cell-glow-rgb), 0.18);
  color: var(--text-accent);
  font-size: 20px; font-weight: 400; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.18s, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.voice-result-btn:active { transform: scale(0.92); background: rgba(var(--cell-glow-rgb), 0.32); }
.voice-result-btn:disabled {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.10);
  color: color-mix(in srgb, var(--blue) 70%, white);
  cursor: default;
}
.voice-result-discard {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(248, 113, 113, 0.10);
  color: #F87171;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.18s;
}
.voice-result-discard:active { background: rgba(248, 113, 113, 0.25); }

.voice-modal-done {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(var(--blue-rgb), 0.45);
  background:
    radial-gradient(circle at 30% 15%, rgba(255,255,255,0.30) 0%, transparent 55%),
    linear-gradient(150deg,
      color-mix(in srgb, var(--blue) 85%, white) 0%,
      var(--blue) 55%,
      color-mix(in srgb, var(--blue) 80%, black) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 14px; font-weight: var(--fw-heavy);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 8px 22px -8px rgba(var(--blue-rgb), 0.55);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s;
}
.voice-modal-done:active { transform: scale(0.97); filter: brightness(0.96); }
