/* ============================================
   style.css – Das Aussehen unserer App
   ============================================ */

/* --- "Tokens": zentrale Werte. Hier einmal ändern = überall geändert. --- */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #e6e9ef;
  --border-hover: #cfd5df;
  --text: #1a2230;
  --text-muted: #6b7686;
  --accent: #3b6ef5;
  --accent-hover: #2c57d6;
  --accent-soft: #eaf0ff;
  --on-accent: #ffffff;
  --error: #ef4444;
  --error-hover: #dc2626;

  /* Abstände (immer Vielfache von 4px – sorgt für ein ruhiges Bild) */
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;

  --radius: 14px;
  --radius-s: 9px;
  --schatten: 0 2px 8px rgba(20, 30, 50, 0.06);
  --schatten-hover: 0 6px 20px rgba(20, 30, 50, 0.10);
}

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

body {
  /* Outfit ist die neue Schrift; system-ui ist der Notfall-Ersatz. */
  font-family: "Outfit", system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  padding-bottom: 48px;
}

/* --- Kopfzeile --- */
.kopf {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--s3) var(--s5);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
}

/* Rechte Navigation in der Kopfzeile. */
.kopf-nav {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

/* Graue Text-Links (Tutorial / Anmelden / Registrieren). */
.kopf-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-s);
  transition: color 150ms, background 150ms;
}

.kopf-link:hover {
  color: var(--text);
  background: var(--bg);
}

/* Der Trennstrich zwischen den Links. */
.kopf-trenner {
  color: var(--border-hover);
  font-size: 0.85rem;
}

/* --- Registrieren / Anmelden (Demo) --- */

/* Anmelden/Registrieren-Karten schmaler und zentriert halten. */
#view-registrieren .karte,
#view-bestaetigen .karte,
#view-anmelden .karte {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* Auffälliger, aber freundlicher Demo-Hinweis. */
.demo-hinweis {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.85rem;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  margin-bottom: var(--s5);
}

/* "Schon ein Konto? Anmelden" unter dem Formular. */
.auth-wechsel {
  margin-top: var(--s5);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Ziele --- */

#ziele-liste {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.ziel-karte {
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: var(--s4);
}

.ziel-kopf {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s2);
}

.ziel-kopf strong {
  font-size: 1.05rem;
}

.ziel-zeit {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ziel-balken-bg {
  width: 100%;
  height: 12px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.ziel-balken {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 400ms ease;
}

.ziel-balken.erreicht {
  background: #16a34a;
}

.ziel-status {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Erreichtes Ziel: grüner Rahmen + auffälliger Hype-Spruch. */
.ziel-karte.ziel-fertig {
  border-color: #16a34a;
  background: #f0fdf4;
}

.ziel-karte.ziel-fertig .ziel-status {
  color: #15803d;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Limit überschritten: roter Rahmen + Warnung. */
.ziel-karte.ziel-warn {
  border-color: #dc2626;
  background: #fef2f2;
}

.ziel-karte.ziel-warn .ziel-status {
  color: #b91c1c;
  font-weight: 700;
}

.ziel-balken.warn {
  background: #dc2626;
}

/* ===== Code-Leiste (Daten mit Freunden teilen) ===== */
#code-leiste {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  font-size: 0.8rem;
  color: #9ca3af;
}

.code-link {
  background: none;
  border: none;
  padding: 2px 4px;
  color: #9ca3af;
  font-size: 0.8rem;
  cursor: pointer;
}

.code-link:hover {
  color: #4b5563;
}

#code-wert {
  color: #6b7280;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.code-strich {
  color: #d1d5db;
}

/* Einlöse-Fenster */
.code-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.45);
  padding: 16px;
}

.code-box {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.code-box h3 {
  margin: 0 0 8px;
}

.code-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  margin-top: 6px;
  cursor: pointer;
}

.code-radio input {
  width: auto;
  margin: 0;
}

.code-aktionen {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.code-btn {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  font-size: 0.9rem;
}

.code-btn-haupt {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* Roter "Ja, trennen"-Knopf im Trennen-Fenster. */
.code-btn-gefahr {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  font-weight: 600;
}
.code-btn-gefahr:hover { background: #b91c1c; border-color: #b91c1c; }

/* Etwas kompakteres Fenster fürs Trennen. */
.code-box-klein { max-width: 380px; }

/* "Verbindung trennen" dezent rötlich hervorheben. */
.code-link-getrennt { color: #dc2626; }

/* Kleine Hinweis-Blase (Demo-Sync zwischen Fenstern) */
#code-toast {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 80;
  background: #111827;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* ============================================
   ZAHNRAD-MENÜ (Design umstellen)
   ============================================ */
.theme-wrap {
  position: relative;
  display: inline-flex;
}

#btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  color: var(--text-muted);
}

#btn-theme svg { transition: transform 450ms ease; }
#btn-theme:hover { color: var(--accent); background: var(--bg); }
#btn-theme:hover svg { transform: rotate(120deg); }

.theme-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  box-shadow: var(--schatten-hover);
  padding: 6px;
  display: block;
  z-index: 40;
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
}

.theme-opt {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  margin: 1px 0;
  border-radius: 7px;
  cursor: pointer;
}

.theme-opt:hover:not([disabled]) { background: var(--bg); }
.theme-opt.aktiv { background: var(--accent-soft); font-weight: 600; }
.theme-opt[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Farbiger Punkt als Symbol (Edelsteine + Color-Kategorie). */
.swatch {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: -2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.theme-menu-titel {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 6px 10px 2px;
}

.theme-trenner {
  border: none;
  border-top: 1px solid var(--border);
  margin: 5px 2px;
}

.theme-opt .bald {
  font-size: 0.66rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
}

/* ============================================
   DUNKLE DESIGNS – umschaltbar über das Zahnrad.
   Jedes Design setzt NUR seine Farb-Tokens. Alle
   gemeinsamen Anpassungen laufen über body.theme-dunkel.
   ============================================ */

/* ---- Dark Mode (Volt) ---- */
body.theme-dark {
  --bg: #0E1013;
  --surface: #181B20;
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: #C6FF3A;
  --text: #E7E9EC;
  --text-muted: #8A9099;
  --accent: #C6FF3A;
  --accent-hover: #B4EE28;
  --accent-soft: #20260F;
  --on-accent: #0E1013;
  --schatten: 0 2px 10px rgba(0, 0, 0, 0.45);
  --schatten-hover: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* ---- Galaxy (Weltraum-Violett) ---- */
body.theme-galaxy {
  --bg: #0B0717;
  --surface: #171029;
  --border: rgba(179, 136, 255, 0.16);
  --border-hover: #B388FF;
  --text: #ECE8FB;
  --text-muted: #9C93C7;
  --accent: #B388FF;
  --accent-hover: #C9A9FF;
  --accent-soft: #1E1640;
  --on-accent: #0B0717;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.5);
  --schatten-hover: 0 8px 26px rgba(80, 40, 160, 0.45);
}

/* ---- Unterwasser (Tiefsee-Türkis) ---- */
body.theme-meer {
  --bg: #041820;
  --surface: #0A2A36;
  --border: rgba(90, 210, 230, 0.16);
  --border-hover: #2BD4D4;
  --text: #DFF6FB;
  --text-muted: #84A8B6;
  --accent: #2BD4D4;
  --accent-hover: #5EE6E6;
  --accent-soft: #0C313D;
  --on-accent: #041820;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.5);
  --schatten-hover: 0 8px 26px rgba(0, 90, 110, 0.45);
}

/* ---- Magma (Feurig) ---- */
body.theme-magma {
  --bg: #150805;
  --surface: #24110A;
  --border: rgba(255, 130, 60, 0.18);
  --border-hover: #FF6A2B;
  --text: #FFEDE2;
  --text-muted: #B98C78;
  --accent: #FF6A2B;
  --accent-hover: #FF854F;
  --accent-soft: #341509;
  --on-accent: #150805;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.5);
  --schatten-hover: 0 8px 26px rgba(150, 50, 10, 0.5);
}

/* ---- Wald (Pflanzen-Grün) ---- */
body.theme-wald {
  --bg: #0A140F;
  --surface: #122019;
  --border: rgba(120, 210, 130, 0.16);
  --border-hover: #4ADE80;
  --text: #E7F4EA;
  --text-muted: #8FAE97;
  --accent: #4ADE80;
  --accent-hover: #6EE79A;
  --accent-soft: #14271B;
  --on-accent: #0A140F;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.45);
  --schatten-hover: 0 8px 26px rgba(0, 80, 30, 0.45);
}

/* ---- Gewitter (Sturm, dunkle Wolken + Blitze) ---- */
body.theme-gewitter {
  --bg: #0c1118;
  --surface: rgba(20, 28, 40, 0.62);
  --border: rgba(150, 180, 255, 0.16);
  --border-hover: #82b9ff;
  --text: #e6ecf5;
  --text-muted: #93a0b5;
  --accent: #82b9ff;
  --accent-hover: #a9d2ff;
  --accent-soft: #16202e;
  --on-accent: #0c1118;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.5);
  --schatten-hover: 0 8px 26px rgba(20, 40, 90, 0.5);
}

/* ---- Holz ---- */
body.theme-holz {
  --bg: #2a1c10;
  --surface: rgba(58, 38, 20, 0.6);
  --border: rgba(210, 170, 120, 0.2);
  --border-hover: #e0a45a;
  --text: #f3e6d4;
  --text-muted: #c2a888;
  --accent: #e0a45a;
  --accent-hover: #ecb877;
  --accent-soft: #3a2613;
  --on-accent: #2a1c10;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.45);
  --schatten-hover: 0 8px 26px rgba(60, 35, 10, 0.5);
}

/* ---- Stein ---- */
body.theme-stein {
  --bg: #2b2e33;
  --surface: rgba(58, 62, 68, 0.62);
  --border: rgba(200, 208, 220, 0.18);
  --border-hover: #8fb4d6;
  --text: #eef0f3;
  --text-muted: #aab0ba;
  --accent: #8fb4d6;
  --accent-hover: #aecbe6;
  --accent-soft: #2f343b;
  --on-accent: #1b1e22;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.45);
  --schatten-hover: 0 8px 26px rgba(0, 0, 0, 0.5);
}

/* ---- Eis ---- */
body.theme-eis {
  --bg: #0a1822;
  --surface: rgba(18, 32, 42, 0.62);
  --border: rgba(150, 210, 240, 0.16);
  --border-hover: #7fd4f0;
  --text: #eaf4fb;
  --text-muted: #9fb6c4;
  --accent: #7fd4f0;
  --accent-hover: #a6e4f6;
  --accent-soft: #102634;
  --on-accent: #0a1822;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.45);
  --schatten-hover: 0 8px 26px rgba(0, 60, 90, 0.45);
}

/* ---- Sakura ---- */
body.theme-sakura {
  --bg: #1c0d16;
  --surface: rgba(48, 24, 38, 0.62);
  --border: rgba(255, 180, 210, 0.16);
  --border-hover: #ff9ec4;
  --text: #fbe9f1;
  --text-muted: #cfa8ba;
  --accent: #ff9ec4;
  --accent-hover: #ffbcd6;
  --accent-soft: #2e1320;
  --on-accent: #1c0d16;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.45);
  --schatten-hover: 0 8px 26px rgba(90, 20, 50, 0.45);
}

/* ---- Neon / Synthwave ---- */
body.theme-neon {
  --bg: #07030f;
  --surface: rgba(22, 10, 40, 0.62);
  --border: rgba(255, 80, 220, 0.18);
  --border-hover: #ff4fd8;
  --text: #f4e9ff;
  --text-muted: #b49ad0;
  --accent: #34e1ff;
  --accent-hover: #74ecff;
  --accent-soft: #18102e;
  --on-accent: #07030f;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.55);
  --schatten-hover: 0 8px 26px rgba(120, 20, 140, 0.5);
}

/* ---- Carbon ---- */
body.theme-carbon {
  --bg: #16181b;
  --surface: rgba(30, 33, 37, 0.82);
  --border: rgba(200, 210, 220, 0.14);
  --border-hover: #ff4d3d;
  --text: #eef0f2;
  --text-muted: #aab0b8;
  --accent: #ff4d3d;
  --accent-hover: #ff6e60;
  --accent-soft: #2a1714;
  --on-accent: #ffffff;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.5);
  --schatten-hover: 0 8px 26px rgba(0, 0, 0, 0.6);
}

/* ---- Matrix ---- */
body.theme-matrix {
  --bg: #020703;
  --surface: rgba(6, 18, 8, 0.72);
  --border: rgba(0, 255, 100, 0.18);
  --border-hover: #2fff7a;
  --text: #d6ffe2;
  --text-muted: #7fbf95;
  --accent: #2fff7a;
  --accent-hover: #6dffa6;
  --accent-soft: #04200f;
  --on-accent: #021006;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.6);
  --schatten-hover: 0 8px 26px rgba(0, 80, 30, 0.5);
}

/* ---- Sonnenuntergang ---- */
body.theme-sunset {
  --bg: #1a1136;
  --surface: rgba(40, 22, 40, 0.6);
  --border: rgba(255, 180, 140, 0.18);
  --border-hover: #ffb86b;
  --text: #fdeede;
  --text-muted: #d6b59c;
  --accent: #ffb86b;
  --accent-hover: #ffcf95;
  --accent-soft: #2e1a2a;
  --on-accent: #1a1136;
  --schatten: 0 2px 12px rgba(0, 0, 0, 0.45);
  --schatten-hover: 0 8px 26px rgba(120, 50, 30, 0.45);
}

/* ---- Wüste ---- */
body.theme-wueste {
  --bg: #2a1c10; --surface: rgba(48, 32, 18, 0.6); --border: rgba(230, 190, 130, 0.18);
  --border-hover: #e6b46e; --text: #f6e8d4; --text-muted: #c8ad8c;
  --accent: #e6b46e; --accent-hover: #f0c98a; --accent-soft: #3a2613; --on-accent: #2a1c10;
  --schatten: 0 2px 12px rgba(0,0,0,0.45); --schatten-hover: 0 8px 26px rgba(70,45,15,0.5);
}

/* ---- Feuerwerk ---- */
body.theme-feuerwerk {
  --bg: #06070f; --surface: rgba(18, 22, 40, 0.6); --border: rgba(255, 150, 170, 0.18);
  --border-hover: #ff6d8a; --text: #eef0fb; --text-muted: #9aa0bd;
  --accent: #ff6d8a; --accent-hover: #ff90a8; --accent-soft: #20111a; --on-accent: #ffffff;
  --schatten: 0 2px 12px rgba(0,0,0,0.5); --schatten-hover: 0 8px 26px rgba(120,20,60,0.5);
}

/* ---- Berg ---- */
body.theme-berg {
  --bg: #1a2b3a; --surface: rgba(26, 42, 58, 0.6); --border: rgba(180, 210, 235, 0.18);
  --border-hover: #8fc2e6; --text: #e8f1fa; --text-muted: #a6bccd;
  --accent: #8fc2e6; --accent-hover: #b1d6ef; --accent-soft: #16283a; --on-accent: #1a2b3a;
  --schatten: 0 2px 12px rgba(0,0,0,0.45); --schatten-hover: 0 8px 26px rgba(20,50,80,0.45);
}

/* ---- Kreidetafel ---- */
body.theme-kreide {
  --bg: #15271d; --surface: rgba(22, 40, 30, 0.7); --border: rgba(232, 234, 208, 0.18);
  --border-hover: #f2d98a; --text: #f1f3e2; --text-muted: #b4bba6;
  --accent: #f2d98a; --accent-hover: #f7e7ad; --accent-soft: #20301f; --on-accent: #15271d;
  --schatten: 0 2px 12px rgba(0,0,0,0.45); --schatten-hover: 0 8px 26px rgba(0,30,15,0.45);
}

/* ---- Schachbrett ---- */
body.theme-schach {
  --bg: #181b20; --surface: rgba(28, 32, 38, 0.78); --border: rgba(220, 220, 210, 0.16);
  --border-hover: #d9c79a; --text: #eef0f2; --text-muted: #aab0b8;
  --accent: #d9c79a; --accent-hover: #e8dab5; --accent-soft: #2a2620; --on-accent: #181b20;
  --schatten: 0 2px 12px rgba(0,0,0,0.5); --schatten-hover: 0 8px 26px rgba(0,0,0,0.55);
}

/* ---- Rubin ---- */
body.theme-rubin {
  --bg: #28060e; --surface: rgba(58, 18, 28, 0.62); --border: rgba(255, 120, 150, 0.2);
  --border-hover: #ff5d7a; --text: #fbe6ea; --text-muted: #cf9aa5;
  --accent: #ff5d7a; --accent-hover: #ff859a; --accent-soft: #3a1018; --on-accent: #28060e;
  --schatten: 0 2px 12px rgba(0,0,0,0.5); --schatten-hover: 0 8px 26px rgba(110,10,30,0.5);
}

/* ---- Saphir ---- */
body.theme-saphir {
  --bg: #06112a; --surface: rgba(18, 34, 66, 0.62); --border: rgba(120, 170, 255, 0.2);
  --border-hover: #5d93ff; --text: #e4ecfb; --text-muted: #9aabcf;
  --accent: #5d93ff; --accent-hover: #84b0ff; --accent-soft: #101f3a; --on-accent: #06112a;
  --schatten: 0 2px 12px rgba(0,0,0,0.5); --schatten-hover: 0 8px 26px rgba(10,30,110,0.5);
}

/* ---- Smaragd ---- */
body.theme-smaragd {
  --bg: #042414; --surface: rgba(14, 46, 30, 0.62); --border: rgba(110, 230, 160, 0.2);
  --border-hover: #3fe089; --text: #e3f7ea; --text-muted: #92c0a4;
  --accent: #3fe089; --accent-hover: #6dedaa; --accent-soft: #0c2b1a; --on-accent: #042414;
  --schatten: 0 2px 12px rgba(0,0,0,0.5); --schatten-hover: 0 8px 26px rgba(0,80,40,0.5);
}

/* ---- Gold ---- */
body.theme-gold {
  --bg: #2a1f06; --surface: rgba(48, 38, 12, 0.6); --border: rgba(240, 210, 120, 0.2);
  --border-hover: #f0c651; --text: #f7eed4; --text-muted: #cdb682;
  --accent: #f0c651; --accent-hover: #f6d77a; --accent-soft: #332608; --on-accent: #2a1f06;
  --schatten: 0 2px 12px rgba(0,0,0,0.5); --schatten-hover: 0 8px 26px rgba(90,65,10,0.5);
}

/* ---- Silber ---- */
body.theme-silber {
  --bg: #24272b; --surface: rgba(40, 44, 50, 0.66); --border: rgba(220, 228, 238, 0.18);
  --border-hover: #c8d2de; --text: #f1f3f6; --text-muted: #aeb6c0;
  --accent: #c8d2de; --accent-hover: #dde4ec; --accent-soft: #2f343b; --on-accent: #1b1e22;
  --schatten: 0 2px 12px rgba(0,0,0,0.5); --schatten-hover: 0 8px 26px rgba(0,0,0,0.55);
}

/* ============================================
   Color – wie Dark Mode, aber das "Schwarze" (Hintergrund, Flächen)
   ist in der jeweiligen Farbe getönt. Kein Spezial-Hintergrund,
   daher sehr leichtgewichtig.
   ============================================ */
body.theme-rot {
  --bg:#190a0a; --surface:#271212; --border:rgba(255,150,150,0.12); --border-hover:#ff6b6b;
  --text:#f7e7e7; --text-muted:#c6a0a0; --accent:#ff6b6b; --accent-hover:#ff8a8a; --accent-soft:#3a1818; --on-accent:#ffffff;
  --schatten:0 2px 10px rgba(0,0,0,0.5); --schatten-hover:0 8px 24px rgba(60,0,0,0.55);
}
body.theme-orange {
  --bg:#1a1206; --surface:#281c0c; --border:rgba(255,180,110,0.12); --border-hover:#ff9d3f;
  --text:#f7ecdc; --text-muted:#c8ac88; --accent:#ff9d3f; --accent-hover:#ffb56b; --accent-soft:#3a2810; --on-accent:#1a1206;
  --schatten:0 2px 10px rgba(0,0,0,0.5); --schatten-hover:0 8px 24px rgba(60,30,0,0.55);
}
body.theme-gelb {
  --bg:#1a1706; --surface:#28230c; --border:rgba(255,225,120,0.12); --border-hover:#ffd23f;
  --text:#f7f1da; --text-muted:#c8bf8c; --accent:#ffd23f; --accent-hover:#ffe070; --accent-soft:#3a3210; --on-accent:#1a1500;
  --schatten:0 2px 10px rgba(0,0,0,0.5); --schatten-hover:0 8px 24px rgba(55,45,0,0.55);
}
body.theme-gruen {
  --bg:#081a0f; --surface:#0e2818; --border:rgba(120,235,160,0.13); --border-hover:#4ade80;
  --text:#e6f6ec; --text-muted:#96bfa4; --accent:#4ade80; --accent-hover:#6dffa0; --accent-soft:#143a23; --on-accent:#06210f;
  --schatten:0 2px 10px rgba(0,0,0,0.5); --schatten-hover:0 8px 24px rgba(0,50,20,0.55);
}
body.theme-tuerkis {
  --bg:#061a18; --surface:#0c2826; --border:rgba(110,230,215,0.13); --border-hover:#2dd4bf;
  --text:#e3f6f3; --text-muted:#92c0bb; --accent:#2dd4bf; --accent-hover:#5ee6d4; --accent-soft:#103a36; --on-accent:#052420;
  --schatten:0 2px 10px rgba(0,0,0,0.5); --schatten-hover:0 8px 24px rgba(0,50,45,0.55);
}
body.theme-blau {
  --bg:#08111f; --surface:#0e1c30; --border:rgba(130,175,255,0.13); --border-hover:#5d9dff;
  --text:#e6edf8; --text-muted:#9aacc6; --accent:#5d9dff; --accent-hover:#84b6ff; --accent-soft:#142a44; --on-accent:#ffffff;
  --schatten:0 2px 10px rgba(0,0,0,0.5); --schatten-hover:0 8px 24px rgba(0,20,70,0.55);
}
body.theme-violett {
  --bg:#120a22; --surface:#1c1234; --border:rgba(180,150,255,0.14); --border-hover:#a78bfa;
  --text:#ece6f8; --text-muted:#a99dc6; --accent:#a78bfa; --accent-hover:#c4b5fd; --accent-soft:#281a4a; --on-accent:#120a22;
  --schatten:0 2px 10px rgba(0,0,0,0.5); --schatten-hover:0 8px 24px rgba(40,10,90,0.55);
}
body.theme-pink {
  --bg:#1c0a14; --surface:#2a1020; --border:rgba(255,150,200,0.13); --border-hover:#ff6fb5;
  --text:#f7e6f0; --text-muted:#c69cb4; --accent:#ff6fb5; --accent-hover:#ff95ca; --accent-soft:#3a182c; --on-accent:#2a0e1c;
  --schatten:0 2px 10px rgba(0,0,0,0.5); --schatten-hover:0 8px 24px rgba(70,0,40,0.55);
}

/* ============================================
   Gemeinsame Anpassungen für ALLE dunklen Designs
   ============================================ */

/* Code-Leiste + Einlöse-Fenster passen sich an. */
body.theme-dunkel #code-leiste {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--schatten-hover);
}
body.theme-dunkel .code-box { background: var(--surface); color: var(--text); }
body.theme-dunkel .code-btn { background: var(--bg); border-color: var(--border); color: var(--text); }
body.theme-dunkel #code-wert { color: var(--accent); }
body.theme-dunkel .code-link { color: var(--text-muted); }

/* Demo-Hinweis dezent dunkel. */
body.theme-dunkel .demo-hinweis {
  background: var(--accent-soft);
  border-color: var(--border);
  color: var(--text-muted);
}

/* Ziele: erreicht / über Limit dunkel getönt. */
body.theme-dunkel .ziel-karte.ziel-fertig { background: rgba(34, 197, 94, 0.12); border-color: #1f7a4d; }
body.theme-dunkel .ziel-karte.ziel-fertig .ziel-status { color: #4ade80; }
body.theme-dunkel .ziel-karte.ziel-warn { background: rgba(220, 38, 38, 0.12); border-color: #b03030; }
body.theme-dunkel .ziel-karte.ziel-warn .ziel-status { color: #f87171; }

/* Kondensierte, sportliche Schrift. */
body.theme-dunkel .hero-titel,
body.theme-dunkel .karte h2,
body.theme-dunkel .kachel-titel,
body.theme-dunkel .tag-name {
  font-family: "Barlow Condensed", "Outfit", sans-serif;
  letter-spacing: 0.5px;
}
body.theme-dunkel .hero-titel {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 2.4rem;
}
body.theme-dunkel .hero-untertitel { color: var(--accent); font-weight: 500; }
body.theme-dunkel .kachel-titel { font-size: 1.14rem; font-weight: 600; }

/* Kachel-Icon: Akzent-Tönung mit dezentem Rahmen. */
body.theme-dunkel .kachel-icon {
  background: var(--accent-soft);
  border: 1px solid var(--border-hover);
}
body.theme-dunkel .kachel:hover { box-shadow: var(--schatten-hover); }

/* Markierte Design-Option im Menü. */
body.theme-dunkel .theme-opt.aktiv {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--border-hover);
}

/* Emoji nur im Light Mode, Linien-Icon in den dunklen Designs. */
body.theme-dunkel .kachel-icon .kachel-emoji { display: none; }
body.theme-dunkel .kachel-icon .kachel-line { display: inline-block; }

/* Kleines graues Label "special ui" im Menü. */
.theme-special-label { text-transform: none; font-size: 0.66rem; }

/* ============================================
   SPECIAL-UI: animierte Hintergründe
   Ein fixer Layer hinter dem Inhalt; reines CSS,
   keine Bilder. Nur in den Special-Designs sichtbar.
   ============================================ */
#bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
#bg-fx::before,
#bg-fx::after { content: ""; position: absolute; inset: 0; }

/* Karten leicht durchscheinend (Glas-Optik) über dem Effekt. */
body.theme-galaxy { --surface: rgba(26, 18, 46, 0.66); }
body.theme-magma  { --surface: rgba(40, 19, 11, 0.64); }
body.theme-meer   { --surface: rgba(9, 38, 50, 0.62); }
body.theme-wald   { --surface: rgba(17, 32, 24, 0.64); }

body.theme-special .karte,
body.theme-special .kachel,
body.theme-special .ziel-karte,
body.theme-special .tag-gruppe,
body.theme-special .kopf,
body.theme-special #code-leiste {
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

/* Auf kleinen Bildschirmen ist der Glas-Blur am teuersten -> leichter. */
@media (max-width: 640px) {
  body.theme-special .karte,
  body.theme-special .kachel,
  body.theme-special .ziel-karte,
  body.theme-special .tag-gruppe,
  body.theme-special .kopf,
  body.theme-special #code-leiste {
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }
}

/* Texte ohne eigene Karte (Hero, "Was möchtest du tun?") auf der Textur lesbar machen. */
body.theme-special .hero-titel,
body.theme-special .hero-untertitel,
body.theme-special .hero-text,
body.theme-special .begruessung,
body.theme-special .zurueck {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.55);
}

/* ---- Galaxy: Nebel + Sterne ---- */
body.theme-galaxy #bg-fx {
  background:
    radial-gradient(900px 650px at 18% 28%, rgba(124, 58, 200, 0.38), transparent 60%),
    radial-gradient(760px 560px at 82% 72%, rgba(206, 64, 168, 0.30), transparent 60%),
    radial-gradient(680px 560px at 62% 16%, rgba(44, 96, 224, 0.32), transparent 60%),
    #07040f;
}
body.theme-galaxy #bg-fx::before {
  background-image:
    radial-gradient(1.4px 1.4px at 20px 30px, #fff, transparent),
    radial-gradient(1.4px 1.4px at 120px 90px, #d9e6ff, transparent),
    radial-gradient(1.2px 1.2px at 70px 160px, #fff, transparent),
    radial-gradient(1.6px 1.6px at 170px 50px, #ffe9ff, transparent),
    radial-gradient(1.2px 1.2px at 40px 120px, #cfe7ff, transparent);
  background-size: 200px 200px;
  animation: fxDrift 70s linear infinite;
  opacity: 0.85;
}
body.theme-galaxy #bg-fx::after {
  background-image:
    radial-gradient(2px 2px at 60% 35%, #fff, transparent),
    radial-gradient(2px 2px at 25% 70%, #fff, transparent),
    radial-gradient(1.8px 1.8px at 80% 60%, #e9d9ff, transparent);
  background-size: 320px 320px;
  animation: fxTwinkle 4.5s ease-in-out infinite alternate;
}
@keyframes fxDrift { from { transform: translateY(-100px); } to { transform: translateY(100px); } }
@keyframes fxTwinkle { from { opacity: 0.25; } to { opacity: 0.9; } }

/* ---- Magma: glühende Lava + Funken ---- */
body.theme-magma #bg-fx {
  background:
    radial-gradient(720px 520px at 28% 118%, rgba(255, 92, 22, 0.55), transparent 60%),
    radial-gradient(620px 480px at 76% 126%, rgba(230, 40, 12, 0.50), transparent 55%),
    radial-gradient(520px 420px at 52% 138%, rgba(255, 168, 40, 0.42), transparent 60%),
    #140503;
  animation: fxGlow 8s ease-in-out infinite alternate;
}
body.theme-magma #bg-fx::after {
  background-image:
    radial-gradient(2px 2px at 20% 90%, rgba(255, 190, 90, 0.9), transparent),
    radial-gradient(2px 2px at 55% 95%, rgba(255, 140, 50, 0.9), transparent),
    radial-gradient(1.6px 1.6px at 80% 85%, rgba(255, 210, 120, 0.9), transparent);
  background-size: 240px 280px;
  animation: fxEmber 12s linear infinite;
}
@keyframes fxGlow { from { opacity: 0.8; } to { opacity: 1; } }
@keyframes fxEmber { from { transform: translateY(0); opacity: 0.7; } to { transform: translateY(-280px); opacity: 0; } }

/* ---- Unterwasser: Lichtstrahlen + Blasen ---- */
body.theme-meer #bg-fx {
  background: linear-gradient(180deg, #0c4254 0%, #062a37 55%, #03161f 100%);
}
body.theme-meer #bg-fx::before {
  inset: -25%;
  background: repeating-linear-gradient(115deg, rgba(160, 240, 255, 0.06) 0 28px, transparent 28px 96px);
  animation: fxRays 16s linear infinite;
}
body.theme-meer #bg-fx::after {
  background-image:
    radial-gradient(3px 3px at 15% 92%, rgba(200, 250, 255, 0.5), transparent),
    radial-gradient(2px 2px at 45% 96%, rgba(200, 250, 255, 0.45), transparent),
    radial-gradient(2.4px 2.4px at 78% 90%, rgba(200, 250, 255, 0.5), transparent);
  background-size: 260px 320px;
  animation: fxBubbles 17s linear infinite;
}
@keyframes fxRays { from { transform: translateX(-90px); } to { transform: translateX(90px); } }
@keyframes fxBubbles { from { transform: translateY(0); opacity: 0.55; } to { transform: translateY(-320px); opacity: 0; } }

/* ---- Wald: Sonnenflecken + fallende Blätter ---- */
body.theme-wald #bg-fx {
  background:
    radial-gradient(820px 520px at 30% 8%, rgba(140, 230, 130, 0.20), transparent 60%),
    radial-gradient(700px 520px at 76% 18%, rgba(210, 245, 120, 0.15), transparent 60%),
    linear-gradient(180deg, #0e2017 0%, #0a140f 100%);
}
body.theme-wald #bg-fx::before {
  inset: -20%;
  background-image:
    radial-gradient(70px 70px at 22% 30%, rgba(180, 255, 150, 0.10), transparent 70%),
    radial-gradient(90px 90px at 68% 48%, rgba(150, 230, 130, 0.09), transparent 70%),
    radial-gradient(60px 60px at 85% 25%, rgba(200, 255, 160, 0.08), transparent 70%);
  animation: fxDapple 11s ease-in-out infinite alternate;
}
body.theme-wald #bg-fx::after {
  background-image:
    radial-gradient(3px 5px at 25% 0%, rgba(130, 205, 95, 0.5), transparent),
    radial-gradient(3px 5px at 65% 0%, rgba(160, 220, 110, 0.45), transparent);
  background-size: 280px 340px;
  animation: fxLeaves 20s linear infinite;
}
@keyframes fxDapple { from { transform: translate(0, 0); opacity: 0.7; } to { transform: translate(24px, 12px); opacity: 1; } }
@keyframes fxLeaves { from { transform: translateY(-40px) rotate(0); opacity: 0.6; } to { transform: translateY(340px) rotate(40deg); opacity: 0; } }

/* Injizierte Textur-SVGs füllen den Layer. */
/* Statische Textur einmal auf die GPU laden (translateZ) -> kein Neuzeichnen bei Scroll/Interaktion. */
#bg-fx .fx-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transform: translateZ(0); backface-visibility: hidden; }

/* Cinematische Vignette + sanftes Oberlicht über jeder Special-Textur. */
.fx-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(135% 115% at 50% 30%, transparent 42%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 22%);
}

/* Sanfte Bewegungen der Textur-Ebenen. */
.fx-spin { animation: fxSpin 160s linear infinite; transform-origin: 400px 300px; }
.fx-rise { animation: fxRise 30s linear infinite; }
/* Magma: gefilterte Lava einmal als GPU-Textur backen, damit Bewegung + Opacity-Puls
   den teuren Displacement-Filter NICHT pro Frame neu berechnen. */
body.theme-magma .fx-rise { will-change: transform; transform: translateZ(0); }
.fx-sway { animation: fxSway 24s ease-in-out infinite alternate; }
.fx-stars { animation: fxTwinkle 4s ease-in-out infinite alternate; }
.fx-rays-w { animation: fxRayPulse 7s ease-in-out infinite alternate; }
.fx-pollen { animation: fxFloat 15s linear infinite; }

/* Gewitter: Blitze zucken kurz auf. */
.fx-blitz, .fx-blitz2, .fx-flash { opacity: 0; }
.fx-blitz { animation: fxBlitz 6s ease-out infinite; }
.fx-blitz2 { animation: fxBlitz 7.5s ease-out infinite 2.5s; }
.fx-flash { animation: fxFlash 6s ease-out infinite; }
@keyframes fxBlitz {
  0%, 88%, 100% { opacity: 0; }
  89% { opacity: 0.9; }
  91% { opacity: 0.15; }
  93% { opacity: 0.85; }
  96% { opacity: 0; }
}
@keyframes fxFlash {
  0%, 88%, 100% { opacity: 0; }
  89% { opacity: 0.18; }
  91% { opacity: 0.04; }
  93% { opacity: 0.16; }
  96% { opacity: 0; }
}

/* Eis: fallender Schnee (über der Textur). */
body.theme-eis #bg-fx::after {
  inset: -280px -40px;
  background-image:
    radial-gradient(2px 2px at 20% 10%, #ffffff, transparent),
    radial-gradient(2px 2px at 62% 32%, #ffffff, transparent),
    radial-gradient(1.6px 1.6px at 82% 60%, #e8f6ff, transparent),
    radial-gradient(2px 2px at 40% 80%, #ffffff, transparent);
  background-size: 220px 260px;
  animation: fxSnow 8s linear infinite;
  will-change: transform;
}
/* GPU-Drift (translate3d) statt background-position -> kein Vollbild-Repaint pro Frame. */
@keyframes fxSnow { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(16px, 260px, 0); } }

/* Sakura: schwebende Blütenblätter. */
body.theme-sakura #bg-fx::after {
  inset: -320px -90px;
  background-image:
    radial-gradient(4px 3px at 18% 8%, rgba(255, 182, 210, 0.9), transparent),
    radial-gradient(3px 4px at 58% 30%, rgba(255, 160, 200, 0.85), transparent),
    radial-gradient(3px 3px at 84% 62%, rgba(255, 200, 222, 0.85), transparent),
    radial-gradient(4px 3px at 38% 82%, rgba(255, 170, 205, 0.9), transparent);
  background-size: 240px 300px;
  animation: fxPetals 12s linear infinite;
  will-change: transform;
}
@keyframes fxPetals { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(70px, 300px, 0); } }

/* Matrix: grüne Code-Regen-Streifen. */
.fx-rain { animation: fxRainDrop 2.8s linear infinite; }
.fx-rain2 { animation: fxRainDrop 4s linear infinite; }
.fx-rain3 { animation: fxRainDrop 3.4s linear infinite; }
@keyframes fxRainDrop { from { transform: translateY(-340px); } to { transform: translateY(620px); } }

/* Galaxy: Nebel statisch (Drehung kostete zu viel Leistung – die teuren
   Rausch-Filter mussten sonst jeden Frame neu gerechnet werden). Die
   Sterne funkeln weiter (Opacity ist günstig). */
.fx-spin { animation: none !important; transform-origin: 400px 300px; }

/* Neon: leichtes Schimmern des Gitters. */
.fx-grid { animation: fxGridShift 3.5s ease-in-out infinite alternate; }
@keyframes fxGridShift { from { transform: translateY(0); } to { transform: translateY(14px); } }

/* Eis: die Risse zeichnen sich beim Öffnen, sind also nicht schon da. */
.fx-crack {
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: fxCrackGrow 4.5s ease-out forwards;
}
@keyframes fxCrackGrow { to { stroke-dashoffset: 0; } }

/* Feuerwerk: Bursts strahlen auf, Sterne funkeln, Funken rieseln (nur Transform/Opacity). */
.fx-fw1, .fx-fw2, .fx-fw3, .fx-fw4, .fx-fw5, .fx-fw6, .fx-fw7 {
  transform-box: fill-box;
  transform-origin: center;
}
.fx-fw1 { animation: fwBurst 3.2s ease-out 0s infinite backwards; }
.fx-fw2 { animation: fwBurst 3.6s ease-out 0.7s infinite backwards; }
.fx-fw3 { animation: fwBurst 2.9s ease-out 1.5s infinite backwards; }
.fx-fw4 { animation: fwBurst 3.4s ease-out 2.2s infinite backwards; }
.fx-fw5 { animation: fwBurst 3.1s ease-out 1.1s infinite backwards; }
.fx-fw6 { animation: fwBurst 3.8s ease-out 2.8s infinite backwards; }
.fx-fw7 { animation: fwBurst 3.3s ease-out 0.4s infinite backwards; }
@keyframes fwBurst {
  0%, 26% { transform: scale(0.05); opacity: 0; }
  30% { transform: scale(0.25); opacity: 1; }
  72% { transform: scale(1); opacity: 0.95; }
  100% { transform: scale(1.35); opacity: 0; }
}
/* Aufsteigende Raketen (synchron zur jeweiligen Burst-Zeit). */
.fx-rocket1 { animation: fwRocket 3.2s ease-out 0s infinite backwards; }
.fx-rocket2 { animation: fwRocket 3.6s ease-out 0.7s infinite backwards; }
.fx-rocket3 { animation: fwRocket 2.9s ease-out 1.5s infinite backwards; }
.fx-rocket4 { animation: fwRocket 3.4s ease-out 2.2s infinite backwards; }
.fx-rocket5 { animation: fwRocket 3.1s ease-out 1.1s infinite backwards; }
.fx-rocket6 { animation: fwRocket 3.8s ease-out 2.8s infinite backwards; }
.fx-rocket7 { animation: fwRocket 3.3s ease-out 0.4s infinite backwards; }
@keyframes fwRocket {
  0% { transform: translateY(420px); opacity: 0; }
  5% { opacity: 1; }
  24% { transform: translateY(0); opacity: 1; }
  29% { opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
/* Edelstein-Glanzstern: pulsiert und dreht sich leicht. */
.fx-glint {
  transform-box: fill-box;
  transform-origin: center;
  animation: glintPulse 2.4s ease-in-out infinite;
}
@keyframes glintPulse {
  0%, 100% { transform: scale(0.7) rotate(0deg); opacity: 0.35; }
  50% { transform: scale(1.15) rotate(45deg); opacity: 0.95; }
}
.fx-twinkle  { animation: fwTwinkle 2.6s ease-in-out infinite alternate; }
.fx-twinkle2 { animation: fwTwinkle 3.4s ease-in-out infinite alternate; animation-delay: 0.8s; }
@keyframes fwTwinkle { from { opacity: 0.3; } to { opacity: 1; } }
.fx-spark { animation: fwSpark 4s ease-in infinite; }
.fx-spark2 { animation: fwSpark 4.6s ease-in infinite; animation-delay: 1.4s; }
@keyframes fwSpark {
  0% { transform: translateY(-10px); opacity: 0; }
  25% { opacity: 0.85; }
  100% { transform: translateY(130px); opacity: 0; }
}

/* Beim Ziehen (Trainingsplan/Ernährung) Hintergrund-Animationen anhalten,
   damit das Ziehen flüssig bleibt (kein Neuberechnen des Glas-Blurs pro Frame). */
body.zieht #bg-fx,
body.zieht #bg-fx *,
body.zieht #bg-fx::before,
body.zieht #bg-fx::after {
  animation-play-state: paused !important;
}

@keyframes fxSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fxRise { from { transform: translateY(0); } to { transform: translateY(-170px); } }
@keyframes fxSway { from { transform: translateX(-46px); } to { transform: translateX(46px); } }
@keyframes fxRayPulse { from { opacity: 0.45; } to { opacity: 1; } }
@keyframes fxFloat { from { transform: translateY(40px); opacity: 0.5; } to { transform: translateY(-280px); opacity: 0; } }

/* Wer Animationen reduziert haben will, bekommt sie ruhig. */
@media (prefers-reduced-motion: reduce) {
  #bg-fx, #bg-fx *, #bg-fx::before, #bg-fx::after { animation: none !important; }
  .fx-crack { stroke-dashoffset: 0 !important; }
}

/* Tagessumme der Kalorien (Ernährung). */
.ern-summe {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--s4);
}

/* --- KI-Trainingstipps --- */

#tipps-neu {
  margin-bottom: var(--s4);
}

#tipps-liste {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

/* Eine einzelne Tipp-Karte. */
.tipp-karte {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-s);
  background: var(--bg);
}

.tipp-icon {
  flex-shrink: 0;
  font-size: 1.4rem;
  line-height: 1.2;
}

.tipp-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

/* Text-Link-Button (z. B. zum Wechseln zwischen An-/Abmelden). */
.link-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.logo {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  letter-spacing: -0.01em;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--s8) var(--s5) var(--s6);
}

/* ============================================
   VIEW-SYSTEM (mehrere Bildschirme)
   ============================================ */
.view {
  display: none;
}

.view.aktiv {
  display: block;
  animation: einblenden 200ms ease; /* sanftes Erscheinen */
}

@keyframes einblenden {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Sanfte Animationen abschalten, wenn der Nutzer das so eingestellt hat. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- Startseite: Hero (Name + Anleitung), schlicht & zentriert --- */
.hero {
  text-align: center;
  margin-bottom: var(--s6);
  padding: var(--s4) 0;
}

.hero-titel {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-untertitel {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--s3);
}

/* Anleitungstext in normalem Grau, zentriert in der Mitte. */
.hero-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 auto; /* zentriert den Textblock waagerecht */
}

/* --- Startseite: Begrüßung über den Kacheln --- */
.begruessung {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--s5);
}

.kacheln {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

@media (max-width: 420px) {
  .kacheln { grid-template-columns: 1fr; }
}

.kachel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5);
  cursor: pointer;
  text-align: left;
  min-height: 132px;
  box-shadow: var(--schatten);
  transition: border-color 150ms, box-shadow 200ms, transform 120ms;
  font-family: inherit;
}

.kachel:hover {
  border-color: var(--accent);
  box-shadow: var(--schatten-hover);
  transform: translateY(-3px);
}

.kachel:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.kachel:disabled:hover {
  border-color: var(--border);
  box-shadow: var(--schatten);
  transform: none;
}

/* Das Icon bekommt einen runden, farbigen Hintergrund. */
.kachel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent-soft);
  font-size: 1.4rem;
  color: var(--accent);
}

/* Kachel-Icons: Emoji im Light Mode, Linien-Icon in dunklen Designs.
   Standardmäßig (hell) ist das Linien-Icon ausgeblendet. */
.kachel-icon .kachel-line {
  display: none;
  width: 24px;
  height: 24px;
}

.kachel-titel {
  font-weight: 600;
  font-size: 1.02rem;
}

.kachel-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Zurück-Knopf --- */
.zurueck {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: var(--s4);
  padding: var(--s2) 0;
}

.zurueck:hover { color: var(--accent-hover); }

/* --- Karte (weißer Kasten) --- */
.karte {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s6);
  box-shadow: var(--schatten);
}

.karte h2 {
  margin-bottom: var(--s5);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Folgt eine Karte direkt auf eine andere, etwas Abstand dazwischen. */
.karte + .karte {
  margin-top: var(--s5);
}

/* Hinweis "noch keine Übungen". */
#plan-leer {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Checkbox-Zeile (z. B. "pro Seite"). */
.check-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  margin-top: 6px;
}

.check-zeile input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* "pro Seite" neben dem Sätze-Feld: auf gleiche Höhe wie das Eingabefeld
   bringen. Das leere Label sorgt für die Ausrichtung. */
.feld-check {
  justify-content: flex-end;
}

.leer-label {
  visibility: hidden;
}

.feld-check .check-zeile {
  margin-top: 0;
  padding: 11px 0;
}

/* --- Schönere Übungen im Plan --- */

/* Nummer-Badge links (Position im Tag). */
.ue-nummer {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.ue-name {
  font-size: 1.02rem;
  font-weight: 600;
}

/* Detail-Chips als Pillen. */
.ue-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.ue-chip {
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Sätze hervorheben. */
.ue-chip.ue-saetze {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 600;
}

/* "pro Seite" als grünes Badge. */
.ue-chip.ue-seite {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

/* Eine Tag-Gruppe (Kachel + aufklappbarer Inhalt).
   Links ein farbiger Streifen in der Tagesfarbe (--tag-farbe von JS). */
.tag-gruppe {
  border: 1px solid var(--border);
  border-left: 4px solid var(--tag-farbe, var(--border));
  border-radius: var(--radius);
  margin-bottom: var(--s3);
  overflow: hidden;
  box-shadow: var(--schatten);
  transition: box-shadow 200ms ease, transform 150ms ease;
}

.tag-gruppe:hover {
  box-shadow: var(--schatten-hover);
  transform: translateY(-1px);
}

/* Die anklickbare Tag-Kachel (Kopf). */
.tag-kachel {
  display: flex;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  padding: var(--s4);
  background: var(--surface);
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 150ms;
}

.tag-kachel:hover {
  background: var(--bg);
}

/* Farbiges Wochentag-Badge (Mo, Di, ...). */
.tag-badge {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

/* Name + Anzahl untereinander. */
.tag-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tag-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.tag-anzahl {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Der Pfeil dreht sich, wenn die Kachel offen ist. */
.tag-pfeil {
  color: var(--text-muted);
  transition: transform 200ms ease;
}

.tag-gruppe.offen .tag-pfeil {
  transform: rotate(180deg);
}

/* Der aufklappbare Inhalt: standardmäßig zu.
   Leicht getönter Hintergrund, damit die weißen Übungen sich abheben. */
.tag-inhalt {
  display: none;
  padding: var(--s3) var(--s4) var(--s4);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.tag-gruppe.offen .tag-inhalt {
  display: block;
}

/* Kurze Aufklapp-Animation – nur beim Klick (Klasse gerade-auf). */
.tag-gruppe.gerade-auf .tag-inhalt {
  animation: aufklappen 250ms ease;
}

@keyframes aufklappen {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Letzter Eintrag im aufgeklappten Tag braucht unten keinen Abstand. */
.tag-inhalt .plan-eintrag:last-child {
  margin-bottom: 0;
}

/* Aktionen rechts im Eintrag (Pfeile + Löschen). */
.eintrag-aktionen {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.pfeil-reihe {
  display: flex;
  gap: 4px;
}

/* Kleiner quadratischer Pfeil-Knopf (↑ / ↓). */
.pfeil {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}

.pfeil:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Der ganze Eintrag ist greifbar. */
.plan-eintrag {
  cursor: grab;
  background: var(--surface);
  transition: opacity 150ms, border-color 150ms, box-shadow 200ms, transform 150ms;
  touch-action: none; /* damit das Ziehen auch auf dem Handy klappt */
}

/* Beim Drüberfahren leicht anheben und hervorheben. */
.plan-eintrag:hover {
  border-color: var(--border-hover);
  box-shadow: var(--schatten);
  transform: translateY(-1px);
}

.plan-eintrag:active {
  cursor: grabbing;
}

/* Das Original bleibt während des Ziehens als blasser Platzhalter. */
.plan-eintrag.platzhalter {
  opacity: 0.3;
}

/* Die schwebende Kopie, die mit der Maus mitzieht.
   Die Drehung (rotate) setzt die Physik in plan.js per JavaScript –
   hier gibt es deshalb KEINE feste Animation. */
.geist {
  position: fixed;
  z-index: 500;
  margin: 0;
  list-style: none;
  pointer-events: none; /* damit wir das Element DARUNTER finden */
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-s);
  box-shadow: 0 16px 32px rgba(20, 30, 50, 0.28);
}

/* Einfüge-Linie oben bzw. unten (zeigt, wo der Eintrag landet).
   box-shadow statt border = kein Verrutschen des Layouts. */
.plan-eintrag.drop-oben {
  box-shadow: inset 0 3px 0 0 var(--accent);
}

.plan-eintrag.drop-unten {
  box-shadow: inset 0 -3px 0 0 var(--accent);
}

/* Kurzes Aufleuchten des gerade verschobenen Eintrags. */
.plan-eintrag.gerade-bewegt {
  animation: aufleuchten 0.7s ease;
}

@keyframes aufleuchten {
  0% { background: var(--accent-soft); border-color: var(--accent); }
  100% { background: transparent; border-color: var(--border); }
}

/* ============================================
   FORMULAR
   ============================================ */
form {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

/* Ein einzelnes Feld (Label + Eingabe untereinander). */
.feld {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Eine Reihe mit zwei Feldern nebeneinander. */
.feld-reihe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

/* Auf schmalen Handys: Felder untereinander statt nebeneinander. */
@media (max-width: 460px) {
  .feld-reihe { grid-template-columns: 1fr; }
}

label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 150ms, box-shadow 150ms;
}

input:hover,
select:hover { border-color: var(--border-hover); }

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 110, 245, 0.15);
}

/* Der große Speichern-Knopf. */
button[type="submit"] {
  margin-top: var(--s2);
  padding: 13px;
  border: none;
  border-radius: var(--radius-s);
  background: var(--accent);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, transform 100ms;
}

button[type="submit"]:hover { background: var(--accent-hover); }
button[type="submit"]:active { transform: scale(0.99); }

/* ============================================
   LISTE DER AKTIVITÄTEN
   ============================================ */
ul { list-style: none; }

/* Kleiner Hinweis über den Personen-Kacheln. */
.hinweis-klein {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--s4);
}

/* Liste der Personen-Karten (untereinander). */
.personen-liste {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

/* Eine Personen-Karte: Avatar links, Name+Info Mitte, Pfeil rechts. */
.person-karte {
  display: flex;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s4);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: var(--schatten);
  transition: border-color 150ms, box-shadow 200ms, transform 120ms;
}

.person-karte:hover {
  border-color: var(--accent);
  box-shadow: var(--schatten-hover);
  transform: translateY(-2px);
}

/* Runder Avatar mit der Initiale in der Personenfarbe. */
.person-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Name + Anzahl untereinander. */
.person-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.person-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.person-anzahl {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Der Pfeil rechts. */
.person-chevron {
  flex-shrink: 0;
  font-size: 1.6rem;
  color: var(--text-muted);
  line-height: 1;
}

/* Überschrift im Personen-Detail. */
#person-titel {
  margin-bottom: var(--s5);
  font-size: 1.3rem;
  font-weight: 600;
}

/* Ein Listeneintrag: Icon links, Infos in der Mitte, Löschen rechts. */
li {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  margin-bottom: var(--s3);
  transition: border-color 150ms;
}

li:hover { border-color: var(--border-hover); }

/* Das Sport-Icon in einem runden, farbigen Kästchen. */
.eintrag-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 1.3rem;
}

/* Der mittlere Info-Block (Inhalte untereinander). */
.eintrag-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Kopfzeile: Sportart + Namens-Abzeichen. */
.eintrag-kopf {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

.eintrag-kopf strong {
  font-weight: 600;
  font-size: 1rem;
}

/* Der Name als kleines Abzeichen. */
.eintrag-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.eintrag-datum {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Die kleinen Detail-Chips (Dauer, km, kcal, ...). */
.eintrag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 0.78rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
}

.eintrag-notiz {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.bearbeiten {
  flex-shrink: 0;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: var(--radius-s);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.bearbeiten:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.loeschen {
  flex-shrink: 0;
  background: var(--surface);
  color: var(--error);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: var(--radius-s);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}

.loeschen:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

#leer-hinweis {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============================================
   STATISTIK-BEREICH
   ============================================ */

/* Die Leiste mit den drei Auswahlmenüs (nebeneinander). */
.stat-steuerung {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--s4);
  margin-bottom: var(--s5);
}

/* Auf schmalen Handys untereinander stapeln. */
@media (max-width: 560px) {
  .stat-steuerung { grid-template-columns: 1fr; }
}

/* Der Kasten um das Diagramm – gibt ihm eine feste Höhe. */
.diagramm-box {
  position: relative;
  height: 300px;
  width: 100%;
}

#stat-leer-hinweis {
  margin-top: var(--s4);
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============================================
   TUTORIAL-TOUR (Spotlight + Tooltip)
   ============================================ */

/* Das "Spotlight": ein Rahmen ums Element. Der riesige box-shadow
   dunkelt ALLES außerhalb des Rahmens ab → das Element wird beleuchtet. */
.tour-spotlight {
  position: fixed;
  border-radius: var(--radius);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.74);
  border: 3px solid rgba(255, 255, 255, 0.95);
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 220ms ease, left 320ms cubic-bezier(0.4, 0, 0.2, 1),
              top 320ms cubic-bezier(0.4, 0, 0.2, 1),
              width 320ms cubic-bezier(0.4, 0, 0.2, 1),
              height 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* "leer" = nur Verdunkelung, kein sichtbarer Rahmen (Text-Schritte). */
.tour-spotlight.leer {
  border-color: transparent;
}

/* Unsichtbarer Klick-Blocker: fängt alle Klicks ab. Nur Klicks auf das
   beleuchtete Element (per JavaScript geprüft) führen weiter. */
.tour-blocker {
  position: fixed;
  inset: 0;
  z-index: 999;
}

/* Die Text-Leiste – Position wird per JavaScript gesetzt (left/top),
   damit sie ausweichen und verschoben werden kann. */
.tour-box {
  position: fixed;
  left: 0;
  top: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border-radius: 16px;
  padding: var(--s6) var(--s5) var(--s4);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
  z-index: 1001;
  overflow: hidden;
  cursor: grab; /* Greif-Symbol: man kann die Leiste packen */
  user-select: none; /* beim Ziehen wird kein Text markiert */
  transition: left 320ms cubic-bezier(0.4, 0, 0.2, 1),
              top 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Während des Ziehens: keine Übergangs-Verzögerung, anderer Cursor. */
.tour-box.zieht {
  transition: none;
  cursor: grabbing;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.42);
}

/* Kleiner Greif-Strich oben – signalisiert "verschiebbar". */
.tour-greif {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-hover);
  margin: 0 auto var(--s4);
}

/* Fortschrittsbalken ganz oben in der Leiste. */
.tour-balken-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--border);
}

.tour-balken {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: width 320ms ease;
}

.tour-titel {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: var(--s2);
  padding-right: 24px;
}

.tour-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: var(--s4);
}

/* Sanftes Einblenden des Inhalts bei jedem Schritt. */
.tour-inhalt.ein {
  animation: tour-ein 320ms ease;
}

@keyframes tour-ein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tour-fuss {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.tour-zaehler {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tour-btn {
  padding: 8px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms;
}

.tour-btn:hover {
  background: var(--bg);
}

.tour-btn-haupt {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.tour-btn-haupt:hover {
  background: var(--accent-hover);
}

.tour-schliessen {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 150ms, color 150ms;
}

.tour-schliessen:hover {
  background: var(--bg);
  color: var(--text);
}

/* "Tutorial beenden" – dezenter Link unter den Knöpfen. */
.tour-beenden {
  display: block;
  margin: var(--s4) auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.tour-beenden:hover {
  color: var(--text);
}

/* ============================================================
   Trainings-Coach – Chat (clean, theme-aware)
   ============================================================ */
.coach-kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}
.coach-avatar {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 50%;
  background: var(--accent-soft, rgba(0, 0, 0, 0.06));
  box-shadow: inset 0 0 0 1px var(--border, rgba(0, 0, 0, 0.08));
}
.coach-titel h2 { margin: 0; line-height: 1.15; }
.coach-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted, #888);
}
.coach-punkt {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.ki-verlauf {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 360px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 12px 4px;
  scroll-behavior: smooth;
}
.ki-msg {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 16px;
  line-height: 1.5;
  white-space: pre-wrap;     /* Absätze/Zeilenumbrüche anzeigen */
  overflow-wrap: anywhere;
  animation: kiPop 220ms ease;
}
@keyframes kiPop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ki-ich {
  align-self: flex-end;
  background: var(--accent);
  color: var(--on-accent, #ffffff);
  border-bottom-right-radius: 5px;
}
.ki-coach {
  align-self: flex-start;
  background: var(--accent-soft, rgba(0, 0, 0, 0.06));
  color: var(--text);
  border-bottom-left-radius: 5px;
}

/* "Coach schreibt …" – drei animierte Punkte */
.ki-tippt { display: inline-flex; gap: 5px; align-items: center; }
.ki-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted, #999);
  animation: kiDot 1.2s infinite ease-in-out;
}
.ki-dot:nth-child(2) { animation-delay: 0.18s; }
.ki-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes kiDot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Vorschlags-Chips */
.coach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}
.coach-chip {
  font: inherit;
  font-size: 0.82rem;
  padding: 8px 14px;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border, #ddd);
  background: var(--surface, #fff);
  color: var(--text);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 80ms ease;
}
.coach-chip:hover { border-color: var(--accent); color: var(--accent); }
.coach-chip:active { transform: scale(0.96); }

/* Eingabezeile */
.ki-eingabe {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.ki-eingabe textarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 140px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border, #ccc);
  background: var(--surface, #ffffff);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.ki-eingabe textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(0, 0, 0, 0.08));
}
.coach-send {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: var(--on-accent, #ffffff);
  cursor: pointer;
  transition: background 150ms ease, transform 80ms ease;
}
.coach-send:hover { background: var(--accent-hover, var(--accent)); }
.coach-send:active { transform: scale(0.94); }

@media (prefers-reduced-motion: reduce) {
  .ki-msg, .ki-dot, .coach-chip, .coach-send { animation: none !important; transition: none !important; }
}

/* Verbundene Konten: bei FREMDEN Eintraegen Bearbeiten/Loeschen ausblenden. */
.fremder-eintrag .bearbeiten,
.fremder-eintrag .loeschen { display: none !important; }
