/* Schnattila 6.1 — "Liquid Glass" Design-System
   Dunkles, tiefes Ambient-Gradient im Hintergrund, darüber schwebende
   halbtransparente Glas-Panels mit Blur, feinen Rändern und weichen
   Schatten. Kleinere, konsistente Eckenradien statt großer runder Karten. */

:root {
  --bg-0: #0a0e17;
  --bg-1: #0f1420;
  --glass-fill: rgba(255, 255, 255, 0.06);
  --glass-fill-strong: rgba(255, 255, 255, 0.10);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.20);
  --text-primary: #f5f7fa;
  --text-secondary: #b8c0cc;
  --text-muted: #7c8494;

  --accent-blue: #5b9dff;
  --accent-blue-2: #3b7ff0;
  --accent-green: #34d399;
  --accent-green-2: #10b981;
  --accent-red: #fb7185;
  --accent-red-2: #ef4444;
  --accent-amber: #fbbf24;
  --accent-amber-2: #f59e0b;
  --accent-purple: #a78bfa;
  --accent-cyan: #22d3ee;
  --accent-teal: #2dd4bf;
  --accent-teal-2: #0f9c8c;

  --r-xs: 5px;
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 12px;

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-lift: 0 16px 48px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --scrim: rgba(4, 6, 12, 0.6);
}

/* ---------- Heller Modus ---------- */
/* Dieselben Bausteine (Glas-Panels, Karten, Buttons) sind komplett über diese Variablen
   gebaut - ein helles Set reicht, um den Großteil der App mitzuziehen, ohne einzelne
   Komponenten anfassen zu müssen. */
:root[data-theme="light"] {
  --bg-0: #eef1f7;
  --bg-1: #e2e7f0;
  /* Anders als im Dunkel-Modus (dünner WEISSER Tint auf dunklem Grund) brauchen Glas-Panels
     hier einen überwiegend WEISSEN, recht blickdichten Fill - sonst schimmert z.B. der dunkle
     Modal-Scrim dahinter durch und alles wirkt trotz "hellem Modus" weiterhin dunkel. */
  --glass-fill: rgba(255, 255, 255, 0.55);
  --glass-fill-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(30, 41, 59, 0.10);
  --glass-border-strong: rgba(30, 41, 59, 0.16);
  --text-primary: #1a2030;
  --text-secondary: #4c5567;
  --text-muted: #838da0;

  --shadow-glass: 0 8px 32px rgba(30, 41, 59, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --shadow-lift: 0 16px 48px rgba(30, 41, 59, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --scrim: rgba(30, 41, 59, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  background: var(--bg-0);
  /* Pinch-/Doppeltipp-Zoom unterbinden (zusätzlich zur viewport-Meta in head.php,
     die z.B. iOS Safari nicht immer vollständig respektiert) - normales
     Scrollen bleibt über pan-x/pan-y erlaubt. */
  touch-action: pan-x pan-y;
}

body {
  background:
    radial-gradient(ellipse 900px 600px at 15% -5%, rgba(91, 157, 255, 0.22), transparent 60%),
    radial-gradient(ellipse 800px 700px at 110% 10%, rgba(167, 139, 250, 0.18), transparent 55%),
    radial-gradient(ellipse 700px 600px at 50% 110%, rgba(52, 211, 153, 0.13), transparent 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
}

a { color: var(--accent-blue); text-decoration: none; }

/* ---------- Glas-Grundbausteine ---------- */

.glass {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow-glass);
}

.glass-strong {
  background: var(--glass-fill-strong);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-lg);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  box-shadow: var(--shadow-lift);
}

.page {
  max-width: 760px;
  margin: 0 auto;
  /* Unten Platz für die fixe Footer-Leiste + den FAB-Button, PLUS die Home-Indicator-Zone
     (env(safe-area-inset-bottom)) - sonst verschwindet auf Geräten mit großer Safe-Area (z.B.
     neuere iPhones) der letzte Eintrag hinter Footer/FAB. */
  padding: 14px 14px calc(140px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 640px) { .page { padding: 20px 20px calc(140px + env(safe-area-inset-bottom, 0px)); } }

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  text-align: center;
  animation: pop-in 0.5s var(--ease-spring);
}

.auth-card h1 { font-size: 1.4rem; margin: 4px 0 2px; letter-spacing: -0.02em; }
.auth-card .tagline { color: var(--text-secondary); font-size: 0.85rem; margin: 0 0 20px; }
.auth-logo { font-size: 2.6rem; margin-bottom: 6px; }

/* ---------- Formulare ---------- */

.field { text-align: left; margin-bottom: 12px; }
.field label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em; }

input[type=text], input[type=password], input[type=number], input[type=email], input[type=date], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  /* Mind. 16px, sonst zoomt iOS Safari beim Fokussieren automatisch rein (siehe
     viewport-Meta in head.php für die zusätzliche manuelle Zoom-Sperre). */
  font-size: 16px;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.08);
}
::placeholder { color: var(--text-muted); }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); margin: 4px 0 14px; }
.checkbox-row input { accent-color: var(--accent-amber); width: 16px; height: 16px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--r-sm);
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  color: white;
  transition: transform 0.15s var(--ease-spring), filter 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }
/* Flache Vollfarben statt Glanz-Verläufen + bunter Leucht-Schatten - wirkt ruhiger/
   erwachsener als die gradientenlastige "App-Baukasten"-Optik. */
.btn-primary, .btn-success, .btn-danger, .btn-amber, .btn-purple { box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.btn-primary { background: var(--accent-blue-2); }
.btn-success { background: var(--accent-green-2); }
.btn-danger  { background: var(--accent-red-2); }
.btn-amber   { background: var(--accent-amber-2); color: #201400; }
.btn-purple  { background: var(--accent-teal-2); }
.btn-ghost { background: var(--glass-fill); border: 1px solid var(--glass-border); color: var(--text-primary); box-shadow: none; }
.btn-ghost:hover { background: var(--glass-fill-strong); }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; border-radius: var(--r-xs); }
.btn-icon { padding: 9px; border-radius: 999px; width: 38px; height: 38px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Header ---------- */

/* Volle Bildschirmbreite, oben fest angedockt - klassische native Top-Bar statt einer
   schwebenden Glas-Karte mit Rundungen und Rand ringsum. */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  background: var(--bg-1);
  border-bottom: 1px solid var(--glass-border);
  padding-top: env(safe-area-inset-top, 0px);
}
.app-header-bar {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
@media (min-width: 640px) { .app-header-bar { padding: 10px 20px; } }
.hdr-icon-btn {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: var(--r-xs);
  background: transparent; border: 1px solid var(--glass-border);
  color: var(--text-primary); font-size: 1.02rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s var(--ease-out), transform 0.15s var(--ease-spring);
}
.hdr-icon-btn:hover { background: var(--glass-fill-strong); }
.hdr-icon-btn:active { transform: scale(0.94); }
.app-header-center { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.hh-name-block { text-align: center; cursor: pointer; }
.hh-name { font-weight: 700; font-size: 1.04rem; letter-spacing: -0.01em; }
.join-code { font-size: 0.68rem; color: var(--text-secondary); background: rgba(255,255,255,0.06); border-radius: 999px; padding: 2px 10px; margin-top: 3px; display: inline-block; }
.join-code strong { color: var(--text-primary); letter-spacing: 0.08em; }

/* Sitzt jetzt oben auf der Startseite bzw. dem Aufgaben-Tab (Urlaub) statt im Header - kleiner
   Abstand nach oben reicht, da .tab-nav-wrap darüber schon einen eigenen Abstand mitbringt. */
.member-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 12px; }
.member-card {
  flex: 0 1 auto;
  min-width: 118px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  text-align: center;
  position: relative;
}
.member-card.wg-just-updated { animation: member-card-pulse 0.9s var(--ease-out); }
@keyframes member-card-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,0.55); }
  40%  { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.member-name { font-size: 0.86rem; font-weight: 700; margin-bottom: 4px; }
.member-you { font-size: 0.72rem; color: var(--accent-blue); font-weight: 400; }
.member-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.stat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--glass-fill); border: 1px solid var(--glass-border);
  border-radius: var(--r-xs); padding: 3px 9px;
  font-size: 0.82rem; font-weight: 800; white-space: nowrap;
}
.stat-star { color: var(--accent-green); }
.stat-coupon { color: var(--accent-amber); }

/* ---------- Tabs ---------- */

.tab-nav-wrap {
  position: relative;
  z-index: 55;
  margin-bottom: 12px;
}
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
}
.tab-btn {
  flex: 1 1 auto;
  min-width: 92px;
  padding: 12px 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { background: var(--glass-fill-strong); color: var(--text-primary); }

/* Schmale Bildschirme: alle Tab-Labels passen nicht nebeneinander in eine Zeile -
   statt hässlich in eine zweite, halbleere Zeile umzubrechen, wird die Leiste
   horizontal scrollbar (wie eine native Tab-Bar). Nur noch die Emojis zeigen (Text
   ausgeblendet) - so passen meist alle Tabs in eine Zeile, und falls doch nicht,
   ist ein angeschnittenes Icon am Rand ein deutlicherer Scroll-Hinweis als Text. */
@media (max-width: 639px) {
  .tab-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tab-nav::-webkit-scrollbar { display: none; }
  .tab-btn { flex: 0 0 auto; min-width: 0; padding: 10px 16px; font-size: 1.15rem; }
  .tab-btn-text { display: none; }
}

.more-menu {
  position: absolute; top: calc(100% + 6px); right: 6px; z-index: 50;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--glass-fill-strong); border: 1px solid var(--glass-border);
  border-radius: var(--r-sm); padding: 6px; min-width: 160px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out), visibility 0.18s;
}
.more-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.more-menu button {
  border: none; background: transparent; color: var(--text-secondary);
  text-align: left; padding: 10px 12px; border-radius: var(--r-xs);
  font-size: 0.86rem; font-weight: 700; cursor: pointer;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.more-menu button:hover { background: var(--glass-fill); color: var(--text-primary); }
.tab-content { display: none; animation: fade-slide-in 0.32s var(--ease-spring); }
.tab-content.active { display: block; }
@keyframes fade-slide-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- Champion-Karte (du selbst auf Platz 1) ---------- */
@keyframes wg-champ-rotate { to { transform: rotate(1turn); } }
@keyframes wg-champ-glow {
  0%,100% { box-shadow: 0 0 10px rgba(251,191,36,0.35), 0 0 18px rgba(59,130,246,0.25); }
  50%     { box-shadow: 0 0 16px rgba(251,191,36,0.6), 0 0 30px rgba(59,130,246,0.45); }
}
@keyframes wg-champ-sparkle { 0%,100% { opacity:0; transform: scale(0.4) rotate(0deg); } 50% { opacity:1; transform: scale(1) rotate(180deg); } }
.wg-champion-card {
  background:
    linear-gradient(#0b1220, #0b1220) padding-box,
    conic-gradient(from 0deg, #fbbf24, #fde68a, #3b82f6, #60a5fa, #fbbf24) border-box;
  border: 2px solid transparent;
  overflow: hidden; isolation: isolate;
  animation: wg-champ-glow 2.6s ease-in-out infinite;
}
.wg-champion-card::before {
  content: ""; position: absolute; z-index: -1; top: 50%; left: 50%;
  width: 230%; height: 230%; transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, transparent 0deg, rgba(251,191,36,0.0) 40deg, rgba(251,191,36,0.45) 70deg, rgba(96,165,250,0.45) 110deg, rgba(59,130,246,0.0) 150deg, transparent 360deg);
  animation: wg-champ-rotate 6s linear infinite; pointer-events: none;
}
.wg-champion-card > * { position: relative; z-index: 2; }
.wg-champion-card .wg-spark { position:absolute; z-index:3; font-size:0.72rem; line-height:1; filter: drop-shadow(0 0 3px rgba(253,230,138,0.9)); pointer-events:none; }
.wg-champion-card .wg-spark-1 { top:6px; right:9px; animation: wg-champ-sparkle 1.9s ease-in-out infinite; }
.wg-champion-card .wg-spark-2 { top:6px; left:9px; animation: wg-champ-sparkle 2.4s ease-in-out 0.5s infinite; }
.wg-champion-card .wg-spark-3 { bottom:7px; right:13px; animation: wg-champ-sparkle 2.1s ease-in-out 1.1s infinite; }

/* ---------- Karten / Listen ---------- */

.card { padding: 16px; margin-bottom: 12px; animation: card-in 0.4s var(--ease-out) backwards; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.card h3 { margin: 0 0 14px; font-size: 1rem; letter-spacing: -0.01em; text-align: center; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 18px 0 8px;
  text-align: center;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--glass-border);
  margin-bottom: 7px;
  transition: background 0.15s var(--ease-out);
  animation: row-in 0.35s var(--ease-out) backwards;
}
.list-row:hover { background: rgba(255,255,255,0.06); }
.settlement-row { cursor: pointer; }
.settlement-row:active { transform: scale(0.985); }

/* ---------- Quick-Ausgleich / Persönlicher Ausgleich (Wischkarussell, Startseite) ---------- */
.settle-swipe-head { display: flex; align-items: center; justify-content: center; gap: 10px; position: relative; margin-bottom: 2px; }
.settle-swipe-title { font-size: 1.05rem; font-weight: 700; text-align: center; }
.settle-swipe-dots { display: flex; gap: 6px; position: absolute; right: 0; }
.settle-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--glass-border); cursor: pointer; transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out); }
.settle-dot.active { background: var(--accent-blue); transform: scale(1.3); }
.settle-swipe-viewport { overflow: hidden; }
.settle-swipe-track { display: flex; width: 200%; transition: transform 0.32s var(--ease-out); }
.settle-swipe-panel { flex: 0 0 50%; min-width: 0; }
.settle-swipe-panel:first-child { padding-right: 4px; }
.settle-swipe-panel:last-child { padding-left: 4px; }
.list-row:nth-child(1) { animation-delay: 0.02s; }
.list-row:nth-child(2) { animation-delay: 0.05s; }
.list-row:nth-child(3) { animation-delay: 0.08s; }
.list-row:nth-child(4) { animation-delay: 0.11s; }
.list-row:nth-child(n+5) { animation-delay: 0.14s; }
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Aufgaben-Zeile (mobil-optimiert, Muster aus 6.0) ---------- */

.task-item {
  padding: 12px 13px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--text-muted);
  margin-bottom: 8px;
  text-align: left;
  animation: task-item-in 0.4s var(--ease-out) backwards;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.task-item:active { transform: scale(0.985); }
@keyframes task-item-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.task-item:nth-child(1) { animation-delay: 0.02s; }
.task-item:nth-child(2) { animation-delay: 0.06s; }
.task-item:nth-child(3) { animation-delay: 0.10s; }
.task-item:nth-child(4) { animation-delay: 0.14s; }
.task-item:nth-child(5) { animation-delay: 0.18s; }
.task-item:nth-child(n+6) { animation-delay: 0.22s; }
.task-item.faellig { border-left-color: var(--wg-col-faellig, var(--accent-red)); }
.task-item.bedarf { border-left-color: var(--wg-col-daily, var(--accent-green)); }
.task-item.nicht_faellig { border-left-color: var(--wg-col-nichtfaellig, var(--text-muted)); opacity: 0.9; }

/* Überfällig (ab 2 Tagen): roter Glow + edler Glanz-Sweep, damit man sie sofort sieht */
.task-item.overdue {
  position: relative;
  overflow: hidden;
  border-color: var(--wg-col-faellig, var(--accent-red));
  box-shadow: 0 0 16px color-mix(in srgb, var(--wg-col-faellig, var(--accent-red)) 35%, transparent);
}
.task-item.overdue::after {
  content: "";
  position: absolute; top: 0; left: 0; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.22), transparent);
  animation: wg-task-sheen 3.4s ease-in-out infinite;
  pointer-events: none; z-index: 1;
}
.task-item.overdue > * { position: relative; z-index: 2; }
@keyframes wg-task-sheen {
  0% { transform: translateX(-160%) skewX(-18deg); }
  55%, 100% { transform: translateX(340%) skewX(-18deg); }
}
/* Ab 7 Tagen zusätzlich animierter Regenbogen-Hintergrund */
.task-item.overdue-hot {
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--wg-col-faellig, var(--accent-red)) 22%, transparent),
    color-mix(in srgb, var(--accent-amber) 20%, transparent),
    color-mix(in srgb, var(--wg-col-faellig, var(--accent-red)) 22%, transparent));
  background-size: 200% 200%;
  animation: rainbow-bg 3.5s ease infinite;
}
@keyframes rainbow-bg { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-info { flex: 1 1 auto; min-width: 0; }
.task-title { font-size: 0.95rem; font-weight: 700; line-height: 1.3; }
.task-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 3px; }
.task-overdue-badge { color: var(--accent-red); font-weight: 700; }

.task-points { display: flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
.task-points-val { font-weight: 700; font-size: 0.92rem; color: var(--accent-amber); }
.task-flame {
  font-weight: 700; font-size: 0.72rem; color: #fff7ed;
  background: rgba(0,0,0,0.25); border: 1px solid var(--accent-amber-2);
  padding: 2px 8px; border-radius: 999px;
}

/* Immer sichtbarer, rechts ausgerichteter Split-Button "Erledigt | ▼" */
.task-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.task-erledigt-split {
  display: flex; height: 36px; width: 62%; min-width: 155px;
  border-radius: var(--r-sm); overflow: hidden;
}
.task-erledigt-split .btn-erledigt {
  flex: 1; border: none; color: white; font-weight: 700; font-size: 0.85rem; cursor: pointer;
  background: var(--accent-green-2);
}
.task-erledigt-split .btn-chevron {
  border: none; color: white; padding: 0 13px; cursor: pointer;
  background: color-mix(in srgb, var(--accent-green-2) 82%, black); border-left: 1px solid rgba(255,255,255,0.25);
  font-size: 0.8rem;
}
.task-item.faellig .btn-erledigt {
  background: var(--wg-col-faellig, var(--accent-red));
}
.task-item.faellig .btn-chevron { background: color-mix(in srgb, var(--wg-col-faellig, var(--accent-red)) 80%, black); }

/* Nicht fällig: grauer "Optionen"-Button (kein direktes Erledigen) */
.btn-optionen {
  height: 36px; width: 62%; min-width: 155px;
  border-radius: var(--r-sm); cursor: pointer;
  background: var(--glass-fill); border: 1px solid var(--glass-border);
  color: var(--text-secondary); font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s var(--ease-out);
}
.btn-optionen:hover { background: var(--glass-fill-strong); }

.task-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-spring);
}
.task-expand.open { max-height: 900px; }
.task-expand-inner { padding: 12px 0 2px; display: flex; flex-direction: column; gap: 8px; text-align: left; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border); }

.bien-row {
  background: linear-gradient(120deg, rgba(251,191,36,0.16), rgba(255,255,255,0.04));
  border-color: rgba(251,191,36,0.3);
}

/* ---------- Finanz-Verlauf-Zeile ---------- */

.fin-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 11px 13px; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.035); border: 1px solid var(--glass-border);
  margin-bottom: 7px;
  animation: row-in 0.35s var(--ease-out) backwards;
}
.fin-row:nth-child(1) { animation-delay: 0.02s; }
.fin-row:nth-child(2) { animation-delay: 0.05s; }
.fin-row:nth-child(3) { animation-delay: 0.08s; }
.fin-row:nth-child(4) { animation-delay: 0.11s; }
.fin-row:nth-child(n+5) { animation-delay: 0.14s; }
.fin-row-main { flex: 1; min-width: 0; }
.fin-title { font-weight: 600; font-size: 0.98rem; margin: 3px 0; line-height: 1.3; }
.fin-row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.fin-row-actions .btn-icon { width: 32px; height: 32px; padding: 0; }

/* ---------- Wisch-zum-Löschen (iOS-Stil) ---------- */
/* .swipe-row umschließt .swipe-content (der sichtbare Inhalt) und .swipe-actions (die Aktionen).
   Die Aktionsleiste liegt NICHT hinter dem Inhalt, sondern direkt rechts daneben (left:100%,
   also außerhalb des sichtbaren Bereichs) und wird beim Wischen zusammen mit dem Inhalt nach
   links hereingeschoben. So blitzen die Buttons bei der Einblend-Animation nicht kurz auf. */
.swipe-row { position: relative; overflow: hidden; border-radius: var(--r-sm); margin-bottom: 7px; }
.swipe-row .fin-row { margin-bottom: 0; }
.swipe-actions {
  position: absolute; top: 0; left: 100%; bottom: 0; display: flex; z-index: 0;
}
/* Gespiegelt zu .swipe-actions - liegt VOR (links neben) dem Inhalt statt danach, wird durch
   Wischen nach RECHTS aufgedeckt (siehe wgInitSwipeRows in app.js). Nur bei mit einer Aufgabe
   verknüpften To-Dos vorhanden ("Erweitert" - Kosten/Team/für jemand anderes erledigen). */
.swipe-actions-left {
  position: absolute; top: 0; right: 100%; bottom: 0; display: flex; z-index: 0;
}
.swipe-delete-btn, .swipe-edit-btn, .swipe-advanced-btn {
  color: #fff; border: none; padding: 0 20px;
  font-weight: 600; font-size: 0.85rem; white-space: nowrap; cursor: pointer;
}
.swipe-edit-btn { background: #566b84; }   /* gedämpftes Stahlblau statt knalligem Blau */
.swipe-delete-btn { background: #b0574f; } /* gedämpftes Rot statt knalligem Rot */
.swipe-advanced-btn { background: #2f7d72; } /* gedämpftes Petrol, unterscheidbar von Bearbeiten/Löschen */
.swipe-content {
  position: relative; z-index: 1; touch-action: pan-y;
  background: var(--bg-1);
}

/* To-Do-Zeile ist einzeilig (kein Datum/Titel/Betrag-Stapel wie bei Finanzen/Verlauf) ->
   im Gegensatz zu .fin-row vertikal zentrieren statt oben ausrichten. */
.todo-row { align-items: center; }
.todo-title { font-size: 0.95rem; font-weight: 700; }
.todo-note { font-size: 0.85rem; font-weight: 400; font-style: italic; color: var(--text-secondary); margin-top: 2px; }
/* Überfällig-Hinweis bei fälligen Aufgaben auf der Startseite: eigene Zeile, deutlich kleiner
   und weniger fett als der Titel darüber (statt wie vorher gleich groß/fett in derselben Zeile). */
.todo-overdue-note { font-size: 0.76rem; font-weight: 500; color: var(--accent-red); margin-top: 2px; }

/* Die zusammengeführte Startseiten-Liste mischt drei Arten von Zeilen - rein über die
   Helligkeit unterschieden (keine zusätzlichen Farben/Texte, das lenkt nur ab): automatisch
   fällig gewordene Aufgaben stechen am hellsten hervor, mit einer Aufgabe verknüpfte
   To-Dos sind der normale Grundton, frei getippte Einträge (kein Punkte-/Aufgaben-Bezug)
   treten am meisten in den Hintergrund. */
.todo-row-auto { filter: brightness(1.18); }
.todo-row-free { filter: brightness(0.8); }

/* Tages-Zwischenüberschrift in der Urlaubsplanung-Kalenderansicht (Heute/Morgen/Übermorgen/
   Wochentag) - bewusst kleiner/linksbündig statt wie .section-title, damit sie sich als
   Gliederung INNERHALB der Liste anfühlt statt wie ein neuer Tab-Abschnitt. */
.todo-day-heading {
  font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); margin: 16px 2px 6px;
}
.todo-day-heading:first-child { margin-top: 2px; }

/* Datum-Schnellauswahl-Chips (Heute/Morgen/Übermorgen/Wochentage) beim Anlegen/Bearbeiten
   eines Urlaubsplanung-Eintrags - horizontal scrollbare Reihe statt eines nackten Datumsfelds. */
.date-chip-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.date-chip-row::-webkit-scrollbar { display: none; }
.date-chip {
  flex: 0 0 auto; padding: 8px 13px; border-radius: 999px; white-space: nowrap;
  background: var(--glass-fill); border: 1px solid var(--glass-border); color: var(--text-primary);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
.date-chip.active { background: var(--accent-blue-2); border-color: var(--accent-blue-2); color: #fff; }

/* Kategorie-Kacheln beim Ausgabe-Eintragen - anders als die Datum-Chips umbrechend statt
   scrollend (üblicherweise nur eine Handvoll eigene Kategorien, alle sollen auf einen Blick
   sichtbar sein statt sich hinter Scrollen zu verstecken). Bewusst größer/kräftiger als die
   Datum-Chips, damit die Auswahl beim Eintragen einer Ausgabe präsenter wirkt. */
.category-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.category-chip {
  padding: 10px 16px; border-radius: 999px;
  background: var(--glass-fill); border: 1.5px solid var(--glass-border-strong); color: var(--text-primary);
  font-size: 0.88rem; font-weight: 700; cursor: pointer;
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out), transform 0.1s var(--ease-out);
}
.category-chip.active { background: var(--accent-amber-2); border-color: var(--accent-amber-2); color: #1a1206; }
.category-chip:active { transform: scale(0.96); }

.todo-check { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; margin-left: 10px; }
.todo-check-mark {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--glass-border-strong);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
.todo-check-mark::after {
  content: "✓"; color: white; font-size: 0.8rem; font-weight: 700;
  opacity: 0; transform: scale(0.4); transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-spring);
}
/* Erledigt: Zeile bleibt sichtbar, wird aber durchgestrichen + gedämpft (Haken im grünen Kreis).
   BEWUSST keine opacity/transparenz auf dem Inhalt - sonst würden die dahinterliegenden
   Wisch-Buttons durchschimmern. Der Inhalt bleibt vollständig deckend, nur die Textfarbe geht
   zurück. */
.todo-done .todo-check-mark { background: var(--accent-green); border-color: var(--accent-green); }
.todo-done .todo-check-mark::after { opacity: 1; transform: scale(1); }
.todo-done .todo-title { text-decoration: line-through; color: var(--text-secondary); font-weight: 400; }
.todo-done .todo-note { text-decoration: line-through; }
.todo-done .task-points { opacity: 0.45; }

/* ---------- Aufteilungs-Regler (reich: Zahlenfeld + Slider + Live-€) ---------- */

.split-widget { display: flex; flex-direction: column; gap: 14px; }
.split-toggle {
  display: flex; gap: 4px; padding: 3px; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
}
.split-toggle-btn {
  flex: 1; border: none; background: transparent; color: var(--text-muted);
  padding: 8px; border-radius: var(--r-xs); font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.split-toggle-btn.active { background: var(--accent-blue-2); color: white; }

.split-row { display: flex; flex-direction: column; gap: 5px; transition: opacity 0.2s var(--ease-out); }
.split-row.excluded { opacity: 0.45; }
.split-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.85rem; }
.split-name {
  display: flex; align-items: center; gap: 7px; font-weight: 600; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.split-include { flex-shrink: 0; accent-color: var(--accent-blue); width: 15px; height: 15px; }
.split-input-wrap { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
/* "input." vorangestellt, damit die Spezifität die globale input[type=number]{width:100%}-Regel
   schlägt (sonst gewinnt die trotz späterer Reihenfolge im Stylesheet wegen des Attribut-
   Selektors) - sonst bläht sich dieses Feld auf und drängt den Namen daneben fast komplett weg. */
input.split-num {
  width: 48px; padding: 5px 6px; text-align: right; font-size: 0.82rem;
  color: var(--accent-green); background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border); border-radius: var(--r-xs);
}
.split-num:disabled, .split-range:disabled { cursor: not-allowed; }
.split-unit { color: var(--text-muted); width: 12px; display: inline-block; text-align: center; }
.split-range { width: 100%; accent-color: var(--accent-blue); height: 4px; }
.split-euro { font-size: 0.72rem; color: var(--text-muted); text-align: right; }
.split-even-btn { margin-top: 2px; font-size: 0.8rem; }

/* ---------- Shop ---------- */

.shop-item { padding: 14px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.shop-item .name { font-size: 0.9rem; font-weight: 600; }
.shop-item .cost { font-size: 0.8rem; color: var(--accent-amber); font-weight: 700; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; background: var(--scrim);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; animation: fade-in 0.2s var(--ease-out); }
/* Flex-Spalte statt einem einzigen scrollenden Block: nur .body scrollt bei langem Inhalt,
   Icon/Titel oben und die Buttons unten bleiben immer sichtbar (kein Runterscrollen zum
   Schließen nötig). */
.modal-box {
  width: 100%; max-width: 400px; padding: 24px;
  animation: pop-in 0.32s var(--ease-spring);
  /* dvh statt vh: vh bezieht auf iOS die Fläche hinter der Adressleiste mit ein und kann so höher
     als sichtbar werden - dvh folgt dem tatsächlich sichtbaren Bereich, damit auch lange
     Bestätigungs-Dialoge nicht unten aus dem Bild ragen. */
  max-height: 86dvh;
  display: flex; flex-direction: column;
  overflow-x: hidden; touch-action: pan-y;
}
.modal-box.modal-lg { max-width: 500px; }
.modal-box .icon { flex: 0 0 auto; font-size: 2.2rem; text-align: center; margin-bottom: 8px; }
.modal-box h3 { flex: 0 0 auto; margin: 0 0 8px; text-align: center; font-size: 1.05rem; }
.modal-box .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.5; text-align: center; }

/* Formular-Popups (Neuer Eintrag/Bearbeiten/Einstellungen/...) sind auf dem Handy Vollbild-Sheets
   statt einer kleinen zentrierten Karte - die war v.a. bei geöffneter Bildschirmtastatur viel zu
   knapp. Reine Bestätigungs-Dialoge OHNE Eingabefeld (z.B. "Wirklich löschen?") brauchen das
   nicht (keine Tastatur, kein Platzproblem) und bleiben deshalb die kleine Karte - :has() prüft,
   ob überhaupt ein Eingabefeld irgendwo im Popup steckt, statt das an jeder Aufruf-Stelle im JS
   einzeln markieren zu müssen. Höhe = --wg-vvh (visualViewport.height per JS, folgt dem sichtbaren
   Bereich inkl. Tastatur), Fallback 100dvh. Das Backdrop bleibt schlicht oben verankert (inset:0)
   - eine frühere Version hat es zusätzlich per visualViewport.offsetTop nach unten verschoben,
   was auf neueren iPhones dazu führte, dass Popups beim Scrollen aus dem Bild rutschten. */
@media (max-width: 640px) {
  .modal-backdrop.open:has(input, textarea, select) {
    padding: 0; align-items: stretch; justify-content: stretch;
    height: var(--wg-vvh, 100dvh);
  }
  .modal-backdrop.open:has(input, textarea, select) .modal-box {
    width: 100%; max-width: 100%; height: 100%; max-height: 100%;
    border-radius: 0;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    animation: sheet-slide-up 0.28s var(--ease-out);
  }
  .modal-backdrop.open:has(input, textarea, select) .modal-box.modal-lg { max-width: 100%; }
}
@keyframes sheet-slide-up {
  from { transform: translateY(28px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
/* Schließen/Abbrechen: klein und dezent-rot statt gleich groß wie die Haupt-Aktion. */
.modal-actions .btn-cancel { flex: 0 0 auto; padding: 9px 16px; font-size: 0.82rem; }
.btn-cancel {
  background: rgba(239,68,68,0.14); border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5; box-shadow: none;
}
.btn-cancel:hover { background: rgba(239,68,68,0.22); }
/* Hell-Modus: die helle Rot-Schrift wäre auf hellem Grund kaum lesbar -> kräftigeres Rot +
   etwas deckenderer Hintergrund, damit der Text klar zu sehen bleibt. */
:root[data-theme="light"] .btn-cancel {
  background: rgba(220,38,38,0.10); border-color: rgba(220,38,38,0.35);
  color: #b91c1c;
}
:root[data-theme="light"] .btn-cancel:hover { background: rgba(220,38,38,0.18); }
@keyframes pop-in { from { opacity: 0; transform: scale(0.92) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-h2 { flex: 0 0 auto; text-align: center; margin: 0 0 16px; font-size: 1.3rem; }

/* Live-Vorschläge (Einkaufskatalog, Aufgaben-Matching) sitzen im normalen Formularfluss (EIN
   Scroll-Bereich = das Modal-.body selbst, kein verschachtelter Mini-Scroll-Kasten) - das
   Eingabefeld wird beim Aktualisieren der Liste per JS aktiv sichtbar gehalten (siehe
   scrollIntoView in tab_einkauf.php/tab_todo.php), statt es per position:absolute künstlich
   an Ort und Stelle zu fixieren. */
.wg-suggest-dropdown:not(:empty) { margin: 8px 0; }

/* ---------- Einstellungen-Modal ---------- */
/* .modal-box ist eine Flex-Spalte (siehe oben) - Titel/Tabs bleiben oben fix, das jeweils
   sichtbare Panel scrollt für sich, der "Schließen"-Button unten bleibt immer sichtbar. */

.settings-tabs { flex: 0 0 auto; display: flex; gap: 6px; margin-bottom: 18px; }
.settings-tab {
  flex: 1; border: none; padding: 11px 8px; border-radius: var(--r-sm);
  background: var(--glass-fill); color: var(--text-secondary); font-weight: 700; font-size: 0.86rem; cursor: pointer;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.settings-tab.active { background: var(--accent-blue-2); color: white; }
.settings-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; text-align: left; }
.fld-label { display: block; font-weight: 700; font-size: 0.8rem; margin-bottom: 6px; color: var(--text-secondary); }
.hint { color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; margin: 0 0 10px; }
.hint.mt-0 { margin-top: 0; }
.sub-box { background: rgba(0,0,0,0.25); border: 1px solid var(--glass-border); border-radius: var(--r-sm); padding: 14px; margin-top: 12px; }
.btn-link { background: none; border: none; color: var(--text-muted); text-decoration: underline; cursor: pointer; font-size: 0.75rem; padding: 8px 0 0; display: block; width: 100%; }

.acc-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: var(--glass-fill); color: var(--text-primary); border: 1px solid var(--glass-border);
  padding: 14px; border-radius: var(--r-sm); font-weight: 700; cursor: pointer; font-size: 0.9rem; margin-top: 10px;
}
.acc-body { background: rgba(0,0,0,0.25); border: 1px solid var(--glass-border); border-top: none; border-radius: 0 0 var(--r-sm) var(--r-sm); padding: 14px; }

/* Detaillierte Abrechnung (Finanzen) */
.bd-body { font-size: 0.85rem; }
.bd-sub { font-weight: 700; color: var(--text-secondary); margin: 12px 0 4px; font-size: 0.8rem; }
.bd-sub:first-child { margin-top: 0; }
.bd-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 3px 0; }
.bd-row .bd-t { flex: 1; min-width: 0; color: var(--text-primary); }
.bd-row .bd-v { flex: 0 0 auto; font-weight: 600; white-space: nowrap; }
.bd-payer { font-weight: 700; color: var(--accent-blue); margin: 8px 0 2px; font-size: 0.82rem; }
.bd-subtotal { border-top: 1px dashed var(--glass-border); margin-top: 4px; padding-top: 6px; color: var(--text-secondary); font-weight: 700; }
.bd-total { border-top: 2px solid var(--glass-border-strong); margin-top: 8px; padding-top: 8px; font-weight: 800; font-size: 0.95rem; color: var(--text-primary); }
.color-row { display: flex; justify-content: space-between; align-items: center; color: var(--text-secondary); font-size: 0.92rem; padding: 8px 0; cursor: pointer; }
.color-row input[type=color] { width: 48px; height: 34px; border: none; background: none; cursor: pointer; padding: 0; }
.theme-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.theme-row .btn { flex: 1; min-width: 90px; }
.mode-btn.active { background: var(--accent-blue-2); color: white; border-color: transparent; }
.danger-box { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.4); border-radius: var(--r-sm); padding: 16px; }
.danger-title { margin: 0 0 10px; color: var(--accent-red); font-weight: 700; font-size: 0.92rem; }
.badge-count { background: var(--accent-blue-2); color: white; border-radius: 999px; padding: 1px 9px; font-size: 0.72rem; }
.req-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.mb-8 { margin-bottom: 8px; } .mb-10 { margin-bottom: 10px; } .mb-14 { margin-bottom: 14px; }

/* Schlichter An/Aus-Schalter (Toggle) */
.wg-switch { position: relative; flex: 0 0 auto; display: inline-block; width: 48px; height: 28px; cursor: pointer; }
.wg-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.wg-switch-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--glass-border-strong); transition: background 0.2s var(--ease-out);
}
.wg-switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.35); transition: transform 0.2s var(--ease-spring);
}
.wg-switch input:checked + .wg-switch-track { background: var(--accent-green-2); }
.wg-switch input:checked + .wg-switch-track::after { transform: translateX(20px); }

.tutorial-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; text-align: left; color: var(--text-secondary); font-size: 0.92rem; line-height: 1.55; white-space: pre-wrap; }

/* ---------- Verwalten-Menü ---------- */

.verw-chooser { display: flex; flex-direction: column; gap: 14px; }
.verw-h2 { text-align: center; margin: 0 0 4px; font-size: 1.3rem; }
.verw-choice {
  background: var(--glass-fill); border: 1px solid var(--glass-border); color: var(--text-primary);
  padding: 24px; border-radius: var(--r-md); font-weight: 700; font-size: 1.1rem; cursor: pointer;
  transition: background 0.15s var(--ease-out), transform 0.15s var(--ease-spring);
}
.verw-choice:hover { background: var(--glass-fill-strong); }
.verw-choice:active { transform: scale(0.98); }

.manage-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.035); border: 1px solid var(--glass-border); margin-bottom: 8px;
}
.mr-title { flex: 1 1 100%; }
.manage-row-nums { display: flex; align-items: center; gap: 6px; }
.manage-row-nums input { width: 64px; }
.mr-hint { font-size: 0.72rem; color: var(--text-muted); }
.manage-row-actions { display: flex; gap: 6px; margin-left: auto; }

/* Schwierigkeits-Auswahl beim Aufgaben-Anlegen: 1 (grün, leicht) bis 5 (rot, aufwendig) -
   dezent abgeblendet, bis eine Stufe aktiv (getippt, vorgeschlagen oder angeklickt) ist. */
.points-picker { display: flex; gap: 8px; }
.points-btn {
  flex: 1; border: none; padding: 12px 0; border-radius: var(--r-sm);
  color: white; font-weight: 700; cursor: pointer; opacity: 0.35;
  transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-spring);
}
.points-btn:active { transform: scale(0.95); }
.points-btn.active { opacity: 1; }
.points-btn.points-1 { background: #22c55e; }
.points-btn.points-2 { background: #84cc16; }
.points-btn.points-3 { background: #eab308; }
.points-btn.points-4 { background: #f97316; }
.points-btn.points-5 { background: #ef4444; }

/* ---------- Admin-Seite (mobil-optimiert, gestapelt) ---------- */

.admin-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.admin-field label { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); }
.admin-field input, .admin-field select { width: 100%; }

.admin-task-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; margin-bottom: 8px;
  background: rgba(255,255,255,0.035); border: 1px solid var(--glass-border); border-radius: var(--r-sm);
}
.admin-task-row > input { width: 100%; }
.admin-task-nums { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-task-nums label { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--text-muted); }
.admin-task-nums input { width: 58px; }
.admin-task-nums .btn { margin-left: auto; }

/* ---------- Footer-Leiste ---------- */
/* Eine durchgehende, dezente Glass-Leiste über die volle Breite (statt einzeln schwebender
   Pillen) - Höhe passt sich automatisch an den Buttoninhalt an. */

/* Mittlere Grid-Spalte bleibt IMMER leer - reserviert den Platz für den mittig
   schwebenden FAB, damit die Footer-Buttons nie unter ihm verschwinden. */
.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr 92px 1fr; align-items: center; gap: 8px;
  padding: 6px 14px calc(6px + env(safe-area-inset-bottom, 0px));
  border-radius: 0; border-left: none; border-right: none; border-bottom: none;
  /* "bottom:0; position:fixed" wird auf iOS/Android bei jeder Änderung der Layout-Viewport-Höhe
     neu eingeordnet - u.a. wenn die Browser-Adressleiste ein-/ausblendet, was genau dann passiert,
     wenn eine DOM-Höhenänderung (Fragment-Refresh, Accordion aufklappen) den Scroll-Bereich
     verändert. Ohne eigenen Compositor-Layer malt der Browser die Leiste dabei manchmal einen
     Frame zu spät neu -> sichtbares kurzes "Hochziehen" in den Bildschirm. translateZ(0) zwingt
     die Leiste auf einen eigenen GPU-Layer, der die Adressleisten-Animation sauber mitmacht statt
     hinterherzuhinken - Standardfix für dieses iOS-Verhalten bei fixed-bottom-Leisten.
  */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.footer-bar > .footer-bar-btn:first-child { grid-column: 1; justify-self: start; }
.footer-bar-right { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; min-width: 0; }

.footer-bar-btn {
  padding: 6px 13px; border-radius: 999px; font-size: 0.75rem; text-decoration: none;
  white-space: nowrap;
  opacity: 0.75; transition: opacity 0.2s var(--ease-out), transform 0.15s var(--ease-spring);
}
.footer-bar-btn:hover, .footer-bar-btn:active { opacity: 1; }

/* Schmale Bildschirme: nur die Icons zeigen, damit die Buttons sicher neben dem
   mittigen FAB Platz haben (statt sich mit ihm zu überlappen). */
@media (max-width: 639px) {
  .footer-bar-btn-text { display: none; }
  .footer-bar-btn { padding: 8px 10px; font-size: 0.9rem; }
}

.footer-feedback-btn {
  background: rgba(185,28,28,0.9);
}
.footer-changelog-btn {
  background: rgba(31,41,55,0.9); color: #9ca3af; border: 1px solid #4b5563;
}
.footer-admin-btn {
  background: var(--accent-teal-2);
}

/* ---------- Schnellzugriff-FAB (Fächer-Menü) ---------- */

.fab-backdrop {
  position: fixed; inset: 0; z-index: 79; background: var(--scrim);
  opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease-out);
}
.fab-backdrop.open { opacity: 1; pointer-events: auto; }

/* Sitzt zur Hälfte in der Footer-Leiste eingelassen (wie ein angehobener FAB in einer
   Bottom-Nav) - der Versatz entspricht ungefähr der halben Button-Höhe. */
.fab-wrap { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 80; }

.fab-main {
  width: 76px; height: 76px; border-radius: 50%; border: none;
  background: var(--accent-blue-2);
  color: white; font-size: 42px; font-weight: 500; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  position: relative; z-index: 2;
  transition: transform 0.3s var(--ease-spring);
}
.fab-wrap.open .fab-main { transform: rotate(45deg); }

/* pointer-events:none auf dem Container selbst (nicht nur auf den einzelnen .fab-action-
   Kindern!) ist wichtig: sonst blockiert diese unsichtbare Box - auch im geschlossenen
   Zustand - Klicks auf Buttons, die zufällig darunter liegen (z.B. "Erledigt" am Ende
   der Aufgabenliste, direkt über dem Footer). Geöffnete .fab-action-Buttons schalten ihr
   eigenes pointer-events wieder auf "auto". */
.fab-actions {
  position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 14px;
  pointer-events: none;
}
.fab-action {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--glass-border-strong); border-radius: 999px;
  background: var(--glass-fill-strong); backdrop-filter: blur(14px);
  color: var(--text-primary); padding: 13px 22px 13px 17px;
  font-size: 0.98rem; font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  opacity: 0; transform: translateY(16px) scale(0.6);
  pointer-events: none;
  transition: transform 0.3s var(--ease-spring), opacity 0.2s var(--ease-out);
}
.fab-action-icon { font-size: 1.3rem; }
.fab-wrap.open .fab-action { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.fab-wrap.open .fab-action:nth-child(1) { transition-delay: 0.01s; }
.fab-wrap.open .fab-action:nth-child(2) { transition-delay: 0.05s; }
.fab-wrap.open .fab-action:nth-child(3) { transition-delay: 0.09s; }
.fab-wrap.open .fab-action:nth-child(4) { transition-delay: 0.13s; }

/* ---------- Splash ---------- */

#wg-splash {
  position: fixed; inset: 0; background: var(--bg-0); z-index: 999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}
#wg-splash svg circle { stroke-dasharray: 220; stroke-dashoffset: 220; animation: splash-draw 0.9s var(--ease-out) forwards; }
@keyframes splash-draw { to { stroke-dashoffset: 0; } }

/* ---------- Erledigt-Animation (Konfetti + Haken) ---------- */

.confetti-piece {
  position: fixed; top: -5vh; left: 0; z-index: 200;
  animation: confetti-fall linear forwards;
  will-change: transform, opacity;
}
.confetti-piece.shape-circle { border-radius: 50%; }
.confetti-piece.shape-square { border-radius: 2px; }
.confetti-piece.shape-streamer { border-radius: 2px; }
@keyframes confetti-fall {
  0%   { transform: translate(0, -10vh) translateX(0) rotate(0deg) rotateX(0deg); opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translate(calc(var(--drift) * 0.6), 45vh) translateX(var(--drift)) rotate(var(--spin)) rotateX(180deg); }
  100% { transform: translate(var(--drift), 105vh) translateX(var(--drift)) rotate(calc(var(--spin) * 2)) rotateX(360deg); opacity: 0; }
}

.check-overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 201; pointer-events: none;
}
.check-overlay .glow-ring {
  position: absolute; width: 90px; height: 90px; border-radius: 50%;
  border: 3px solid var(--accent-green); opacity: 0;
  animation: glow-ring-pulse 0.7s var(--ease-out) forwards;
}
.check-overlay .glow-ring.ring-2 { animation-delay: 0.12s; }
@keyframes glow-ring-pulse {
  0%   { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2.4); opacity: 0; }
}
.check-overlay .flash {
  position: absolute; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(52,211,153,0.35), transparent 70%);
  opacity: 0; animation: flash-fade 0.6s var(--ease-out) forwards;
}
@keyframes flash-fade { 0% { opacity: 1; transform: scale(0.4); } 100% { opacity: 0; transform: scale(1.3); } }
.check-overlay svg {
  width: 96px; height: 96px; position: relative;
  animation: check-bounce-in 0.45s var(--ease-spring) forwards;
  transform: scale(0.3);
}
@keyframes check-bounce-in { to { transform: scale(1); } }
.check-overlay circle {
  stroke: var(--accent-green); stroke-width: 4; fill: none;
  stroke-dasharray: 300; stroke-dashoffset: 300;
  animation: check-circle 0.45s var(--ease-out) 0.1s forwards;
  filter: drop-shadow(0 0 6px rgba(52,211,153,0.6));
}
.check-overlay path {
  stroke: var(--accent-green); stroke-width: 5.5; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: check-mark 0.3s var(--ease-out) 0.4s forwards;
}
@keyframes check-circle { to { stroke-dashoffset: 0; } }
@keyframes check-mark { to { stroke-dashoffset: 0; } }

.check-overlay .points-pop {
  position: absolute; top: 62%; font-weight: 800; font-size: 1.3rem; color: var(--accent-amber);
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
  opacity: 0; white-space: nowrap;
  animation: points-pop-up 0.8s var(--ease-out) 0.25s forwards;
}
@keyframes points-pop-up {
  0%   { opacity: 0; transform: translateY(6px) scale(0.8); }
  30%  { opacity: 1; transform: translateY(-6px) scale(1.08); }
  100% { opacity: 0; transform: translateY(-34px) scale(1); }
}

/* ---------- Einkaufswagen-Variante der Erledigt-Animation (Einkaufsliste) ----------
   Identischer Konfetti/Glanz-Rahmen wie .check-overlay oben (siehe playDoneAnimation mit
   variant='cart') - nur die Mitte zeigt statt des Hakens einen Einkaufswagen mit kurzem
   Glitzern, statt separat noch eine eigene Flug-Animation zu bauen. */
.check-overlay .cart-done-icon {
  position: relative; font-size: 64px; line-height: 1;
  animation: check-bounce-in 0.45s var(--ease-spring) forwards;
  transform: scale(0.3);
  filter: drop-shadow(0 0 10px rgba(52,211,153,0.55));
}
.check-overlay .cart-sparkle {
  position: absolute; font-size: 20px; opacity: 0;
  animation: cart-sparkle-pop 0.6s var(--ease-out) 0.35s forwards;
}
.check-overlay .cart-sparkle.s1 { top: -8px; right: -14px; }
.check-overlay .cart-sparkle.s2 { bottom: -2px; left: -16px; animation-delay: 0.45s; }
@keyframes cart-sparkle-pop {
  0%   { opacity: 0; transform: scale(0.4) rotate(0deg); }
  40%  { opacity: 1; transform: scale(1.15) rotate(15deg); }
  100% { opacity: 0; transform: scale(0.8) rotate(25deg) translateY(-6px); }
}

/* Abgehakte Einkaufsliste-Einträge zeigen im Haken-Kreis 🛒 statt ✓ - passt zur
   Einkaufswagen-Animation und unterscheidet die Liste optisch von normalen To-Dos. */
.todo-done .einkauf-check .todo-check-mark::after { content: "🛒"; font-size: 0.72rem; }

/* ---------- Podium ---------- */

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 10px 0 6px; }
.podium-step { text-align: center; padding: 12px 10px; border-radius: var(--r-md); background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border); }
.podium-step.gold { order: 2; padding-top: 20px; border-color: rgba(251,191,36,0.4); }
.podium-step.silver { order: 1; }
.podium-step.bronze { order: 3; }
.podium-medal { font-size: 1.6rem; }

/* ---------- Kategorien-Kuchendiagramm ---------- */

.donut-wrap { position: relative; display: flex; justify-content: center; margin: 10px 0 4px; }
.donut-svg { display: block; overflow: visible; }
.donut-group {
  transform-origin: 80px 80px;
  transform: rotate(-90deg);
  animation: donut-in 0.8s var(--ease-spring) forwards;
}
@keyframes donut-in {
  from { opacity: 0; transform: rotate(-90deg) scale(0.72); }
  to   { opacity: 1; transform: rotate(-90deg) scale(1); }
}
.donut-slice { transition: stroke-width 0.15s var(--ease-out); }
.donut-sheen { opacity: 0.55; pointer-events: none; }
.donut-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.donut-center-val { font-size: 1.05rem; font-weight: 700; }
.donut-center-label { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }
.donut-legend { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.donut-legend-row { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.donut-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-name { flex: 1; }
.donut-legend-val { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }

/* ---------- Diverses ---------- */

.empty-hint { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 24px 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  padding: 12px 18px; border-radius: var(--r-sm); z-index: 300;
  animation: toast-in 0.3s var(--ease-spring);
  max-width: 90vw; text-align: center; font-size: 0.85rem;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Sanfter Übergang vor automatischem Reload (neue Version/neue Daten) ---------- */

.reload-veil {
  position: fixed; inset: 0; z-index: 500; background: var(--bg-0);
  opacity: 0; transition: opacity 0.22s var(--ease-out); pointer-events: none;
}
.reload-veil.visible { opacity: 1; }

/* ---------- Pull-to-Refresh ---------- */

.ptr-indicator {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, -60px);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--glass-fill-strong); border: 1px solid var(--glass-border-strong);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  display: flex; align-items: center; justify-content: center;
  z-index: 150; pointer-events: none; opacity: 0;
  box-shadow: var(--shadow-glass);
}
.ptr-indicator.visible { opacity: 1; }
/* Während des Ziehens per Finger OHNE Transition (sonst hinkt die Anzeige spürbar hinterher) -
   erst beim Loslassen/Zurückschnappen wird sie wieder weich animiert. */
.ptr-indicator.snap-back { transition: transform 0.25s var(--ease-out), opacity 0.25s var(--ease-out); }
.ptr-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid var(--glass-border-strong); border-top-color: var(--accent-blue);
  transition: transform 0.2s var(--ease-out);
}
.ptr-indicator.ready .ptr-spinner { transform: rotate(180deg); }
.ptr-indicator.loading .ptr-spinner { animation: ptr-spin 0.7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ---------- Live-Tour (Erstnutzer-Einführung mit Spotlight) ----------
   Vier Scrim-Stücke (oben/unten/links/rechts um das Zielelement herum) statt einem
   Vollbild-Overlay - so bleibt genau der erklärte Button scharf und unverdeckt sichtbar
   (mit Leucht-Ring), während alles andere abgedunkelt und weichgezeichnet ist. Ein
   unsichtbarer Vollbild-"Catcher" unter der Beschriftungskarte sorgt dafür, dass ein Tipp
   IRGENDWO im Bild zum nächsten Schritt weitergeht (nicht automatisch nach Zeit). */
.tour-scrim-piece {
  position: fixed; z-index: 88;
  background: rgba(5,7,14,0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: all 0.35s var(--ease-out);
  pointer-events: none;
}
.tour-highlight-ring {
  position: fixed; z-index: 89;
  border-radius: var(--r-md);
  box-shadow: 0 0 0 3px var(--accent-blue), 0 0 26px 6px rgba(91,157,255,0.6);
  transition: all 0.35s var(--ease-out);
  pointer-events: none;
  opacity: 0;
}
.tour-tap-catcher { position: fixed; inset: 0; z-index: 90; cursor: pointer; background: transparent; }
.tour-caption {
  position: fixed; left: 50%; transform: translateX(-50%);
  z-index: 91;
  padding: 16px 18px;
  text-align: center;
  animation: pop-in 0.3s var(--ease-spring);
}
.tour-caption-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.tour-caption-text { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.tour-caption-progress { display: flex; justify-content: center; gap: 5px; margin: 10px 0; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--glass-border-strong); transition: background 0.2s var(--ease-out); }
.tour-dot.active { background: var(--accent-blue); }
.tour-caption-hint { font-size: 0.74rem; color: var(--accent-blue); font-weight: 600; }
.tour-skip-btn { margin-top: 10px; }

/* Kompakte Demo-Zeile innerhalb der Beschriftungskarte, zeigt die Wisch-Geste einmal
   automatisch vor (nicht interaktiv, pointer-events aus - reine Vorführung). */
.tour-demo-row { position: relative; overflow: hidden; border-radius: var(--r-sm); margin: 10px 0; pointer-events: none; }
.tour-demo-row .swipe-content { padding: 11px 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
