/* ============================================================
   Löwenherz PWA — Design System & Styles (Journal Design)
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  /* Hintergrund-Stufen */
  --bg-page:      #f5efe3;
  --bg-paper:     #faf6ed;
  --bg-card:      #eee7d8;
  --bg-inset:     rgba(120,100,70,0.05);
  --bg-hover:     rgba(120,100,70,0.08);

  /* Text-Hierarchie */
  --text-primary:   #2c2418;
  --text-body:      #4a3f30;
  --text-secondary: #8a7d6a;
  --text-muted:     #b0a590;
  --text-faint:     #ccc2b0;

  /* Divider */
  --divider: rgba(120,100,70,0.10);

  /* SMALL-Buchstaben-Farben */
  --color-S:        #c4793a;
  --color-S-bg:     rgba(196,121,58,0.09);
  --color-S-border: rgba(196,121,58,0.12);

  --color-M:        #4a9e8e;
  --color-M-bg:     rgba(74,158,142,0.09);
  --color-M-border: rgba(74,158,142,0.12);

  --color-A:        #9e6d94;
  --color-A-bg:     rgba(158,109,148,0.09);
  --color-A-border: rgba(158,109,148,0.12);

  --color-L1:       #b8922e;
  --color-L1-bg:    rgba(184,146,46,0.09);
  --color-L1-border: rgba(184,146,46,0.12);

  --color-L2:       #be5a5a;
  --color-L2-bg:    rgba(190,90,90,0.09);
  --color-L2-border: rgba(190,90,90,0.12);

  /* Akzent & Glow */
  --gold:       #b8922e;
  --gold-warm:  #d4a843;
  --gold-glow:  rgba(212,168,67,0.35);

  /* Radius */
  --radius:    14px;
  --radius-sm: 10px;

  /* Fonts */
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-sheet: 200ms ease-out;

  /* Animation Timing */
  --anim-fast: 150ms;
  --anim-normal: 250ms;
  --anim-slow: 350ms;
  --anim-stagger: 60ms;
  --ease-out: cubic-bezier(0.25, 0, 0.25, 1);

  /* Safe areas */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  /* Legacy compat */
  --accent-gold: var(--gold);
  --accent-amber: var(--gold-warm);
  --crisis-red: #DC2626;
  --bg-overlay: rgba(0, 0, 0, 0.45);
}

/* ---- Reflexion Dark Mode Variables ---- */
.reflexion-mode {
  --ref-bg:        #1a1714;
  --ref-card:      #242019;
  --ref-text:      #f5ead6;
  --ref-secondary: #b8a88a;
  --ref-muted:     #7a6f5e;
  --ref-faint:     #4a4236;
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-body);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, textarea, button, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: var(--gold); text-decoration: none; }
a:active { opacity: 0.7; }

/* ---- App Shell ---- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

#app-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ---- Header ---- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  padding-top: calc(12px + var(--safe-top));
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-page);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-title {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--text-secondary);
  transition: font-size 0.2s ease;
}

/* Prominent header on dashboard */
.header-title.prominent {
  font-size: 23px;
  font-weight: 600;
}

.header-info-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  opacity: 0.4;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1;
  flex-shrink: 0;
  min-width: 30px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.header-info-btn:active {
  opacity: 0.8;
}

.header-info-btn.hidden {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-crisis {
  font-size: 20px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.header-settings {
  font-size: 18px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: calc(28px + var(--safe-bottom));
  border-top: 1px solid var(--divider);
  background: var(--bg-page);
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 100;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 18px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  flex: 1;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
}

.nav-tab.active {
  color: var(--text-primary);
}

.nav-tab::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
}

.nav-tab.active::before {
  background: var(--gold);
}

/* ---- Badge Dot ---- */
.badge-dot {
  position: absolute;
  top: -3px;
  right: -8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-warm);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.badge-dot.visible {
  opacity: 1;
}

/* ---- Milestone Toast ---- */
.milestone-toast {
  position: absolute;
  bottom: 68px;
  left: 5%;
  right: 5%;
  z-index: 400;
  background: var(--bg-paper);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  cursor: pointer;
}
.milestone-toast-special {
  background: rgba(212, 168, 67, 0.12);
  border: 1px solid rgba(212, 168, 67, 0.25);
}
.milestone-toast-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.milestone-toast-quatschi {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  color: var(--gold-warm);
  margin-bottom: 6px;
  line-height: 1.4;
}
.milestone-toast-cta {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(64px + var(--safe-bottom));
  overflow-y: auto;
}

.screen {
  display: none;
  animation: fadeIn 200ms ease;
}

.screen.active {
  display: block;
}

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

/* ---- Dashboard Fade-Up Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quatschi-hero   { animation: fadeUp 0.7s ease-out; }
.stats-row       { animation: fadeUp 0.7s ease-out 0.1s both; }
.small-section   { animation: fadeUp 0.7s ease-out 0.2s both; }
.balance-section { animation: fadeUp 0.7s ease-out 0.25s both; }
.gundula-row     { animation: fadeUp 0.7s ease-out 0.35s both; }
.week-block      { animation: fadeUp 0.7s ease-out 0.45s both; }
.mantra-anchor   { animation: fadeUp 0.7s ease-out 0.55s both; }

/* ---- Landing Page ---- */
.landing-screen {
  padding: 40px 24px;
  padding-top: calc(40px + var(--safe-top));
  text-align: center;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.landing-lion { font-size: 64px; margin-bottom: 24px; }
.landing-title { font-family: var(--font-serif); font-size: 24px; font-weight: 400; margin-bottom: 8px; color: var(--text-primary); }
.landing-subtitle { color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }

.landing-steps { text-align: left; margin: 0 auto; max-width: 300px; }
.landing-step { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.step-number {
  background: var(--gold);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.step-text { padding-top: 3px; line-height: 1.5; }

.landing-toggle {
  margin-top: 24px;
  background: none; border: none;
  color: var(--gold);
  font-size: 14px; font-weight: 500;
  cursor: pointer; min-height: 44px; padding: 8px 16px;
}

/* ---- Onboarding ---- */
.onboarding-screen {
  padding: 40px 24px;
  padding-top: calc(40px + var(--safe-top));
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
}
.onboarding-welcome { font-family: var(--font-serif); font-size: 28px; font-weight: 400; margin-bottom: 32px; text-align: center; color: var(--text-primary); }
.onboarding-label { color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.onboarding-input {
  width: 100%; padding: 14px 16px;
  background: var(--bg-paper); border: 1px solid var(--divider);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 16px; outline: none;
  transition: border-color var(--transition-fast);
}
.onboarding-input:focus { border-color: var(--gold); }
.onboarding-input::placeholder { color: var(--text-muted); }

.onboarding-reminder-title { font-family: var(--font-serif); font-size: 20px; margin-bottom: 8px; text-align: center; color: var(--text-primary); }
.onboarding-reminder-hint { color: var(--text-secondary); font-size: 12px; text-align: center; margin-bottom: 28px; }

.reminder-slot {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-paper); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 12px;
}
.reminder-left { display: flex; align-items: center; gap: 12px; }
.reminder-label { font-weight: 500; }
.reminder-time {
  background: var(--bg-card); border: 1px solid var(--divider);
  border-radius: 6px; padding: 6px 10px; color: var(--text-primary);
  font-size: 14px; min-height: 36px;
}

/* Toggle Switch */
.toggle { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-card); border-radius: 14px;
  cursor: pointer; transition: background var(--transition-fast);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 22px; height: 22px; border-radius: 50%;
  background: white; left: 3px; top: 3px;
  transition: transform var(--transition-fast);
}
.toggle input:checked + .toggle-slider { background: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Buttons */
.btn-primary {
  width: 100%; padding: 16px;
  background: var(--gold); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600; cursor: pointer;
  min-height: 52px;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  width: 100%; padding: 14px;
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--divider); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  min-height: 48px; transition: opacity var(--transition-fast);
}
.btn-secondary:active { opacity: 0.7; }

.btn-danger {
  width: 100%; padding: 14px;
  background: transparent; color: var(--crisis-red);
  border: 1px solid var(--crisis-red); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; min-height: 48px;
}
.btn-danger:active { background: rgba(220, 38, 38, 0.08); }

/* ---- Dashboard ---- */
.dashboard-screen {
  padding: 0 24px 20px;
}

/* Quatschi Hero */
.quatschi-hero {
  padding: 16px 0 0;
}

.quatschi-tag {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.quatschi-tag::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 1.5px;
  background: var(--text-faint);
  flex-shrink: 0;
}

.quatschi-text {
  font-family: var(--font-serif);
  font-size: 24px;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.4;
}

.quatschi-divider {
  width: 100%;
  height: 1px;
  background: var(--divider);
  margin-top: 20px;
}

/* Stats Row */
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 18px;
  padding-bottom: 20px;
}

.stats-left .stats-number {
  font-family: var(--font-serif);
  font-size: 38px;
  color: var(--text-primary);
  line-height: 1;
}
.stats-left .stats-label {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stats-right {
  text-align: right;
}
.stats-right .stats-value {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-body);
  line-height: 1;
}
.stats-right .stats-value-suffix {
  font-size: 14px;
  color: var(--text-muted);
}
.stats-right .stats-label {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* SMALL Buttons — 5er Grid */
.small-section {
  margin-bottom: 6px;
}

.small-buttons {
  display: flex;
  gap: 7px;
}

.small-btn {
  flex: 1;
  height: 72px;
  border-radius: var(--radius);
  background: var(--bg-paper);
  border: 1.5px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
  padding: 0;
}

.small-btn:active {
  transform: scale(0.93);
}

.btn-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  transition: transform 0.3s ease;
}

.small-btn.tapped .btn-dot {
  transform: scale(1.3);
}

.small-btn-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Balance Bar — horizontal 5-segment */
.balance-section {
  margin-bottom: 18px;
}

.balance-bar {
  display: flex;
  gap: 5px;
  padding: 0 2px;
}

.balance-segment {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--bg-card);
  overflow: hidden;
}

.balance-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
  min-width: 4%;
}

/* Gundula Bar */
.gundula-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.8s ease;
  margin-bottom: 20px;
}

.gundula-emoji {
  font-size: 22px;
  transition: transform 0.6s ease;
  flex-shrink: 0;
}

.gundula-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  vertical-align: middle;
  transition: transform 0.6s ease, opacity 0.3s ease;
}

.gundula-text {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}

.gundula-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.6s ease;
}

/* Gundula States */
.gundula-row.tense     { background: rgba(190,90,90,0.06); }
.gundula-row.wachsam   { background: rgba(184,146,46,0.06); }
.gundula-row.ruhig     { background: rgba(74,158,142,0.05); }
.gundula-row.entspannt { background: rgba(74,158,142,0.08); }

.gundula-row.tense .gundula-emoji { transform: scale(0.85) rotate(-5deg); }
.gundula-row.entspannt .gundula-emoji { transform: scale(1.1); }

.gundula-row.tense .gundula-icon { transform: scale(0.85); }
.gundula-row.entspannt .gundula-icon { transform: scale(1.1); }

.gundula-info-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  opacity: 0.4;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1;
  flex-shrink: 0;
  min-width: 30px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.gundula-info-btn:active {
  opacity: 0.8;
}

/* Info Sheet (Gundula) */
.info-sheet-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.info-sheet-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.info-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  padding: 8px 24px calc(24px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 201;
  max-height: 75vh;
  overflow-y: auto;
  max-width: 480px;
  margin: 0 auto;
}

.info-sheet-overlay.active .info-sheet {
  transform: translateY(0);
}

.info-sheet-grip {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--divider);
  margin: 0 auto 16px;
}

.info-sheet h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-primary);
  margin: 0 0 14px;
}

.info-sheet p {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.info-sheet .info-subtitle {
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.info-states {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.info-state {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-body);
}

.info-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.info-sheet-close {
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gold-warm);
  color: #1a1714;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.info-sheet-close:active {
  opacity: 0.9;
}

/* Week Circles */
.week-block {
  margin-bottom: 12px;
}

.week-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.week-circles {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.week-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.week-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: default;
}

/* Stufe 1: Nichts gemacht */
.week-circle.empty {
  background: var(--bg-paper);
  border: 1.5px solid var(--bg-card);
  color: var(--text-muted);
}

/* Hat nur SMALL-Punkte, keine Reflexion */
.week-circle.dot-points {
  background: rgba(212,168,67,0.10);
  border: 1.5px solid rgba(212,168,67,0.20);
}

/* Stufe 2: Nur Morgen oder nur Abend */
.week-circle.dot-half {
  background: rgba(200, 168, 78, 0.15);
  border: 1.5px solid rgba(200, 168, 78, 0.30);
  font-size: 16px;
  line-height: 1;
}

/* Stufe 3: Beides erledigt */
.week-circle.dot-both {
  background: var(--gold-warm);
  color: #fff;
  border: 1.5px solid var(--gold-warm);
  box-shadow: 0 0 8px rgba(212,168,67,0.25);
  font-size: 15px;
  font-weight: 700;
}

/* Heutiger Tag: gestrichelter Rand */
.week-circle.today {
  border-style: dashed;
  border-color: var(--text-secondary);
}
.week-circle.today.dot-both {
  border-color: var(--gold-warm);
}

.week-day-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
}

/* Mantra */
.mantra-anchor {
  text-align: center;
  padding-top: 14px;
}

.mantra-line {
  width: 24px;
  height: 1.5px;
  background: var(--text-faint);
  margin: 0 auto 10px;
}

.mantra-text {
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---- Tap Toast ---- */
.tap-toast {
  padding: 7px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-paper);
  border: 1px solid var(--divider);
  box-shadow: 0 4px 16px rgba(80,60,30,0.14);
  white-space: nowrap;
  text-align: center;
  margin: 0 auto 8px;
  max-width: 280px;
  cursor: pointer;
}

/* ---- Bottom Sheet ---- */
.sheet-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 200; opacity: 0;
  transition: opacity var(--transition-sheet);
  pointer-events: none;
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }

.sheet-container {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 480px;
  background: var(--bg-paper);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px calc(24px + var(--safe-bottom));
  z-index: 201;
  transition: transform var(--transition-sheet);
}
.sheet-overlay.open + .sheet-container,
.sheet-container.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-grip {
  width: 40px; height: 4px;
  background: var(--text-faint);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.sheet-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-align: center;
}

.sheet-option {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: none; border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: 15px;
  cursor: pointer; margin-bottom: 8px; min-height: 48px;
  transition: background var(--transition-fast);
}
.sheet-option:active { background: var(--bg-hover); }

.sheet-option-emoji {
  font-size: 20px; width: 28px;
  text-align: center; flex-shrink: 0;
}

/* ---- Reflection ---- */
.reflection-screen {
  padding: 0 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  text-align: center;
}

.reflection-screen > * {
  width: 100%;
}

.reflection-screen.reflection-landing {
  align-items: stretch;
  text-align: left;
}

.reflexion-mode {
  background: linear-gradient(0deg, rgba(50, 36, 20, 0.5) 0%, var(--ref-bg) 55%);
  color: var(--ref-text);
  transition: background 1s ease;
}

/* Progress Dots */
.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 0 8px;
  width: 100%;
}

.progress-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.3s ease;
}

.progress-dot.active {
  background: var(--gold-warm);
}

.reflexion-mode .app-header {
  background: var(--ref-bg);
}

.reflexion-mode .header-title {
  color: var(--ref-secondary);
}

.reflexion-mode .header-crisis,
.reflexion-mode .header-settings {
  color: var(--ref-muted);
}

.reflexion-mode .bottom-nav {
  background: var(--ref-bg);
  border-top-color: var(--ref-faint);
}

.reflexion-mode .nav-tab {
  color: var(--ref-muted);
}

.reflexion-mode .nav-tab.active {
  color: var(--ref-text);
}

/* Reflexion Mood Gradients */
.reflexion-mode[data-mood="drowned"] {
  background: linear-gradient(180deg, #1e2030 0%, #1a1714 55%);
}
.reflexion-mode[data-mood="tough"] {
  background: linear-gradient(180deg, #22232e 0%, #1a1714 55%);
}
.reflexion-mode[data-mood="okay"] {
  background: linear-gradient(180deg, #1e221c 0%, #1a1714 55%);
}
.reflexion-mode[data-mood="good"] {
  background: linear-gradient(180deg, #28221a 0%, #1a1714 55%);
}
.reflexion-mode[data-mood="lion"] {
  background: linear-gradient(180deg, #302518 0%, #1a1714 55%);
}

.reflection-title {
  font-family: var(--font-sans);
  font-size: 14px;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.reflexion-mode .reflection-title {
  color: var(--ref-secondary);
}

.reflection-last {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 20px;
}

.reflexion-mode .reflection-last {
  background: var(--ref-card);
}

.reflection-last-header { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.reflexion-mode .reflection-last-header { color: var(--ref-muted); }

.reflection-last-mood { font-size: 14px; display: flex; align-items: center; gap: 8px; }

.reflection-emoji-row { display: flex; justify-content: space-between; margin-bottom: 24px; }
.reflection-day-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reflection-day-label { font-family: var(--font-sans); font-size: 11px; font-weight: 500; color: var(--text-faint); }
.reflexion-mode .reflection-day-label { color: var(--ref-muted); }
.reflection-emoji-day {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.reflexion-mode .reflection-emoji-day { background: var(--ref-card); }

/* Mood Select — Circle Buttons */
.mood-list {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.mood-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--ref-faint);
  background: var(--ref-card);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.mood-btn:active {
  transform: scale(1.08);
}

.mood-btn.selected {
  transform: scale(1.18);
  border-color: var(--gold-warm);
  box-shadow: 0 0 20px rgba(212,168,67,0.2);
}

/* Legacy mood-option kept for helped/gratitude steps */
.mood-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--bg-card);
  border: 2px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; min-height: 52px;
  transition: all var(--transition-fast); font-size: 15px;
}

.reflexion-mode .mood-option {
  background: var(--ref-card);
  color: var(--ref-text);
}

.mood-option:active { transform: scale(0.98); }
.mood-option.selected { border-color: var(--gold-warm); background: rgba(212,168,67,0.08); }
.reflexion-mode .mood-option.selected { border-color: var(--gold-warm); background: rgba(212,168,67,0.12); }
.mood-emoji { font-size: 24px; width: 32px; text-align: center; flex-shrink: 0; }

/* Helped toggles */
.helped-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.helped-btn {
  padding: 10px 16px; background: var(--bg-card);
  border: 2px solid transparent; border-radius: var(--radius-sm);
  color: var(--text-body); font-size: 14px; font-weight: 500;
  cursor: pointer; min-height: 44px;
  transition: all var(--transition-fast);
}
.reflexion-mode .helped-btn { background: var(--ref-card); color: var(--ref-text); }
.helped-btn:active { transform: scale(0.97); }
.helped-btn.selected { border-color: var(--gold-warm); background: rgba(212,168,67,0.08); }
.reflexion-mode .helped-btn.selected { border-color: var(--gold-warm); background: rgba(212,168,67,0.12); }

.helped-divider { display: flex; gap: 10px; margin-bottom: 24px; }
.helped-alt {
  flex: 1; padding: 10px; background: var(--bg-card);
  border: 1.5px solid var(--divider); border-radius: var(--radius-sm);
  color: var(--text-body); font-size: 13px;
  cursor: pointer; min-height: 44px; text-align: center;
  transition: all var(--transition-fast);
}
.reflexion-mode .helped-alt { background: var(--ref-card); color: var(--ref-secondary); border-color: var(--ref-faint); }
.helped-alt.selected { border-color: var(--gold-warm); color: var(--text-primary); background: rgba(212,168,67,0.08); }
.reflexion-mode .helped-alt.selected { color: var(--ref-text); background: rgba(212,168,67,0.12); }

/* Gratitude */
.gratitude-input {
  width: 100%; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--divider);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 15px; outline: none; margin-bottom: 20px;
}
.reflexion-mode .gratitude-input {
  background: var(--ref-card); border-color: var(--ref-faint);
  color: var(--ref-text);
}
.gratitude-input:focus { border-color: var(--gold); }
.gratitude-input::placeholder { color: var(--text-muted); }
.reflexion-mode .gratitude-input::placeholder { color: var(--ref-muted); }

.gratitude-buttons { display: flex; gap: 12px; }
.gratitude-buttons .btn-secondary { flex: 1; }
.gratitude-buttons .btn-primary { flex: 1; }

.reflexion-mode .btn-primary { background: var(--gold-warm); color: #1a1714; }
.reflexion-mode .btn-secondary { border-color: var(--ref-faint); color: var(--ref-muted); }

/* Reflection Question */
.ref-question {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--ref-secondary);
  text-align: center;
  line-height: 1.4;
  margin-bottom: 28px;
}

/* Reflection End / Quote */
.reflection-end {
  text-align: center;
  padding: 40px 20px;
}

.ref-quote-block {
  text-align: center;
  min-height: 90px;
  transition: opacity 0.5s ease;
  margin-bottom: 24px;
}

.ref-quotemark {
  font-family: var(--font-serif);
  font-size: 44px;
  color: var(--ref-faint);
  line-height: 1;
}

.ref-quote-text {
  font-family: var(--font-serif);
  font-size: 20px;
  font-style: italic;
  color: var(--ref-text);
  line-height: 1.55;
  transition: opacity 0.5s ease;
}

/* Goodnight */
.goodnight {
  text-align: center;
  padding-top: 40px;
}

.goodnight-line {
  width: 28px;
  height: 1.5px;
  background: var(--ref-faint);
  margin: 0 auto 10px;
}

.goodnight-text {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  color: var(--ref-muted);
}

/* Reflexion Hub Cards */
.ref-hub-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-bottom: 20px;
}

.ref-hub-card {
  border-radius: var(--radius);
  padding: 20px;
  transition: opacity 0.3s ease;
}

.ref-hub-card.inactive {
  opacity: 0.45;
}

.ref-hub-card.done {
  opacity: 0.7;
}

.ref-card-morning {
  background: rgba(60, 45, 20, 0.4);
}

.ref-card-evening {
  background: rgba(30, 35, 50, 0.4);
}

.ref-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ref-card-icon {
  font-size: 18px;
}

.ref-card-title {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ref-text);
}

.ref-card-sub {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ref-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}

.ref-card-sub.done-quatschi {
  font-style: italic;
  color: var(--ref-secondary);
  margin-bottom: 4px;
}

.ref-card-points {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ref-muted);
}

.ref-card-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gold-warm);
  color: #1a1714;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.ref-card-btn:active {
  opacity: 0.9;
}

/* Points Feedback (after completion) */
.points-feedback {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--gold-warm);
  text-align: center;
  animation: pointsFade 2.5s ease forwards;
}

@keyframes pointsFade {
  0% { opacity: 0; transform: translateY(10px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* Morning Flow Gradient */
.reflexion-mode[data-mood="morning"] {
  background: linear-gradient(180deg, rgba(80, 60, 20, 0.6) 0%, var(--ref-bg) 60%);
}

/* Intention Chips */
.intention-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.intention-chip {
  padding: 10px 18px;
  background: var(--ref-card);
  border: 1.5px solid var(--ref-faint);
  border-radius: 24px;
  color: var(--ref-text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.intention-chip:active {
  transform: scale(0.96);
}

.intention-chip.selected {
  background: var(--gold-warm);
  color: #1a1714;
  border-color: var(--gold-warm);
}

.intention-chip-custom {
  border-style: dashed;
}

.intention-chip-custom.selected {
  border-style: solid;
}

/* Custom input for "Eigene..." chip */
.intention-custom-wrap {
  width: 100%;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.intention-custom-wrap.visible {
  max-height: 70px;
  opacity: 1;
  margin-bottom: 20px;
}

.intention-custom-wrap.hidden {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.intention-custom-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--ref-card);
  border: 1.5px solid var(--gold-warm);
  border-radius: var(--radius-sm);
  color: var(--ref-text);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
}

.intention-custom-input::placeholder {
  color: var(--ref-muted);
}

.intention-custom-input:focus {
  border-color: var(--gold-warm);
  box-shadow: 0 0 12px rgba(212,168,67,0.15);
}

/* Morning Visualization (Screen 2) */
.morning-viz {
  text-align: center;
  margin-bottom: 24px;
}

.morning-sun {
  font-size: 28px;
  margin-bottom: 20px;
}

.morning-custom-label {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--gold-warm);
  margin-bottom: 14px;
}

.morning-wenn-dann {
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
  color: var(--ref-text);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

/* Quatschi Nudge (Dashboard morning) */
.quatschi-nudge {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quatschi-nudge-arrow {
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Flow title for reflection steps */
.flow-title {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text-primary);
}

.reflexion-mode .flow-title {
  color: var(--ref-text);
}

.flow-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.reflexion-mode .flow-subtitle {
  color: var(--ref-muted);
}

/* ---- History ---- */
.history-screen {
  padding: 0 24px 20px;
}

/* === Hero "Dein Weg" === */
.history-hero {
  text-align: center;
  padding: 24px 0 28px;
}

.history-hero-number {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 400;
  color: var(--gold-warm);
  line-height: 1.1;
}

.history-hero-label {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-body);
  margin-top: 2px;
}

.history-hero-detail {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.history-hero-empty-title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.history-hero-empty-sub {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.history-hero-cta {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-warm);
  text-decoration: none;
  cursor: pointer;
}

/* === Diese Woche (große Card) === */
.history-week {
  background: var(--bg-paper);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.history-week-current {
  padding: 20px;
  margin-bottom: 16px;
}

.history-week-header {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.history-dots-large {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.history-week-summary {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 10px;
}

.history-quatschi {
  text-align: center;
  padding-top: 8px;
}

.history-quatschi-tag {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: block;
  margin-bottom: 4px;
}

.history-quatschi-text {
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  color: var(--gold-warm);
}

/* === Vorwochen (kompakte Cards) === */
.history-week-past {
  padding: 14px 16px;
}

.history-week-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.history-week-header-row .history-week-header {
  margin-bottom: 0;
}

.history-week-header-summary {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
}

.history-dots {
  display: flex;
  justify-content: space-between;
}

.history-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* History dots — smaller, no emoji, half-fill for single reflection */
.history-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: all 0.3s ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.history-dot.empty {
  background: var(--bg-card);
  border: 1.5px solid var(--bg-card);
}

.history-dot.dot-points {
  background: rgba(212,168,67,0.10);
  border: 1.5px solid rgba(212,168,67,0.20);
}

/* Half-fill: nur Morgen → obere Hälfte amber */
.history-dot.dot-half.dot-morning-half {
  background: linear-gradient(to bottom, rgba(200,168,78,0.35) 50%, var(--bg-card) 50%);
  border: 1.5px solid rgba(200,168,78,0.30);
}

/* Half-fill: nur Abend → untere Hälfte amber */
.history-dot.dot-half.dot-evening-half {
  background: linear-gradient(to bottom, var(--bg-card) 50%, rgba(200,168,78,0.35) 50%);
  border: 1.5px solid rgba(200,168,78,0.30);
}

/* Beides erledigt → voll amber */
.history-dot.dot-both {
  background: var(--gold-warm);
  border: 1.5px solid var(--gold-warm);
  box-shadow: 0 0 8px rgba(212,168,67,0.2);
}

.history-dot.today {
  border-style: dashed;
  border-color: var(--text-secondary);
}
.history-dot.today.dot-both {
  border-color: var(--gold-warm);
}

.history-dot.future {
  opacity: 0.2;
}

.history-dot-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
}

/* ---- Feed Cards ---- */

.feed-container {
  margin-top: 8px;
}

.feed-card {
  background: var(--bg-paper);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(120, 100, 70, 0.06);
}

.feed-card-header {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.feed-card-stats {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 6px;
}

.feed-card-emojis {
  font-size: 14px;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.feed-card-topletter {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* Quatschi in feed cards */
.feed-quatschi {
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.04);
}

.feed-quatschi-tag {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: block;
  margin-bottom: 4px;
}

.feed-quatschi-text {
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  color: var(--gold-warm);
  display: block;
  line-height: 1.5;
}

/* Gundula in feed cards */
.feed-gundula {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.4;
}

/* Pause card */
.feed-pause-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-body);
  margin-bottom: 12px;
}

/* Milestone card — gold tint */
.feed-milestone {
  background: rgba(212, 168, 67, 0.08);
  border: 1px solid rgba(212, 168, 67, 0.15);
}

.feed-milestone-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.feed-milestone-name {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feed-milestone-date {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Stage direction (K10, E6) */
.feed-stage-direction {
  font-family: var(--font-sans);
  font-size: 13px;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Empty feed */
.feed-empty {
  text-align: center;
  padding: 28px 20px;
}

.feed-empty-text {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.feed-empty-cta {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-warm);
  text-decoration: none;
  cursor: pointer;
}

/* Month collapse */
.feed-month-collapse {
  margin-bottom: 12px;
}

.feed-month-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-paper);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(120, 100, 70, 0.06);
}

.feed-month-chevron {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.feed-month-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-month-label {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.feed-month-stats {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
}

.feed-month-points {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--gold-warm);
  font-weight: 600;
}

.feed-month-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
  padding: 0 4px;
}

.feed-month-collapse.open .feed-month-content {
  padding-top: 12px;
}

/* ---- Detail Popup ---- */
.detail-popup-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.detail-popup {
  background: var(--bg-paper);
  border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 340px;
  animation: fadeIn 150ms ease;
}

.detail-popup-date { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.detail-popup-section { margin-bottom: 14px; }
.detail-popup-section-title { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.detail-popup-item { font-size: 14px; padding: 4px 0; display: flex; align-items: center; gap: 6px; }
.detail-popup-mood { font-size: 22px; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.detail-popup-gratitude { font-style: italic; color: var(--text-secondary); font-size: 14px; }
.detail-popup-close { margin-top: 16px; }

/* ---- Settings ---- */
.settings-screen { padding: 0 24px 20px; padding-top: var(--safe-top); }
.settings-back {
  background: none; border: none; color: var(--gold);
  font-size: 14px; font-weight: 500; cursor: pointer;
  min-height: 44px; min-width: 44px;
  display: flex; align-items: center; padding: 8px 0; margin-bottom: 8px;
}
.settings-title { font-family: var(--font-serif); font-size: 22px; margin-bottom: 24px; color: var(--text-primary); }
.settings-section { margin-bottom: 24px; }
.settings-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.settings-card { background: var(--bg-paper); border-radius: var(--radius); padding: 16px; }
.settings-input {
  width: 100%; padding: 12px 14px;
  background: var(--bg-card); border: 1px solid var(--divider);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 15px; outline: none;
}
.settings-input:focus { border-color: var(--gold); }
.settings-hint { font-size: 12px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }
.settings-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--divider);
  cursor: pointer; min-height: 44px;
}
.settings-link:last-child { border-bottom: none; }
.settings-link-text { font-size: 15px; }
.settings-link-arrow { color: var(--text-secondary); font-size: 14px; }

.settings-about { margin-top: 16px; text-align: center; color: var(--text-secondary); font-size: 12px; line-height: 1.8; }
.settings-disclaimer {
  font-size: 12px; color: var(--text-secondary); line-height: 1.6;
  padding: 16px; background: var(--bg-card); border-radius: var(--radius);
}

.reminder-slot-managed { margin-bottom: 8px; }
.reminder-slot-managed:last-child { margin-bottom: 0; }
.reminder-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ---- Legal Pages (Impressum / Datenschutz) ---- */
.legal-page {
  position: fixed;
  inset: 0;
  background: var(--bg-page);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.legal-page.active {
  transform: translateX(0);
}

.legal-page .app-header {
  background: var(--bg-page);
  padding: 12px 24px;
  padding-top: calc(12px + var(--safe-top));
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.legal-back {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px 0;
  touch-action: manipulation;
}

.legal-back:active {
  opacity: 0.6;
}

.legal-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.legal-content h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--text-primary);
  margin: 0 0 16px;
}

.legal-content h3 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 8px;
}

.legal-content p {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.legal-content a {
  color: var(--gold-warm);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.legal-meta {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  margin-bottom: 20px !important;
}

.legal-notice {
  background: rgba(190, 90, 90, 0.06);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 20px;
}

.legal-notice p {
  margin: 0;
  font-size: 13px;
}

/* ---- Crisis Modal ---- */
.crisis-overlay {
  position: fixed; inset: 0; background: var(--bg-overlay);
  z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.crisis-modal {
  background: var(--bg-paper); border-radius: var(--radius);
  padding: 28px 24px; width: 100%; max-width: 360px;
  animation: fadeIn 150ms ease;
}
.crisis-title { font-family: var(--font-serif); font-size: 20px; text-align: center; margin-bottom: 20px; color: var(--text-primary); }
.crisis-section { margin-bottom: 16px; }
.crisis-section-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.crisis-phone {
  display: flex; font-size: 18px; font-weight: 600;
  color: var(--gold); padding: 6px 0; min-height: 44px; align-items: center;
}
.crisis-footer {
  font-size: 13px; color: var(--text-secondary); font-style: italic;
  text-align: center; margin: 16px 0 20px; line-height: 1.5;
}
.crisis-close { width: 100%; }

/* ---- Confirmation Dialog ---- */
.confirm-overlay {
  position: fixed; inset: 0; background: var(--bg-overlay);
  z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.confirm-dialog {
  background: var(--bg-paper); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 320px;
  text-align: center; animation: fadeIn 150ms ease;
}
.confirm-text { font-size: 15px; margin-bottom: 20px; line-height: 1.5; }
.confirm-buttons { display: flex; gap: 12px; }
.confirm-buttons .btn-secondary,
.confirm-buttons .btn-danger { flex: 1; }

/* ---- Utilities ---- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

::-webkit-scrollbar { width: 0; background: transparent; }

/* ---- Push Soft-Ask Overlay ---- */
.push-soft-ask-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: linear-gradient(180deg, #1a1714 0%, #242019 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  opacity: 0;
  transition: opacity 300ms ease;
}
.push-soft-ask-overlay.active { opacity: 1; }

.push-soft-ask-content {
  text-align: center;
  max-width: 340px;
  width: 100%;
}

.push-soft-ask-icon {
  font-size: 32px;
  margin-bottom: 20px;
  opacity: 0.85;
}

.push-soft-ask-title {
  font-family: var(--font-serif);
  font-size: 24px;
  color: #f5ead6;
  margin-bottom: 16px;
  font-weight: 400;
}

.push-soft-ask-text {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: #b8a88a;
  margin-bottom: 32px;
}

.push-soft-ask-accept {
  width: 100%;
  margin-bottom: 16px;
}

.push-soft-ask-later {
  background: none;
  border: none;
  color: #7a6f5e;
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  min-height: 44px;
}
.push-soft-ask-later:active { opacity: 0.6; }

/* ---- Push Settings Section ---- */
.push-settings-divider {
  height: 1px;
  background: var(--divider);
  margin: 8px 0 16px;
}

.push-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  min-height: 44px;
}

.push-setting-labels {
  flex: 1;
  min-width: 0;
}

.push-setting-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.push-setting-sublabel {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.push-setting-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  min-height: 44px;
}

.push-setting-time .reminder-time {
  width: auto;
}

.push-settings-disabled .push-setting-row,
.push-settings-disabled .push-setting-time {
  opacity: 0.4;
  pointer-events: none;
}

.push-blocked-hint {
  font-size: 12px;
  color: var(--crisis-red);
  margin-top: 8px;
  line-height: 1.5;
}

/* --- Coach-Mark Tooltip --- */
.coach-mark {
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
.coach-mark.active {
  opacity: 1;
  pointer-events: auto;
}
.coach-mark-bubble {
  position: relative;
  background: #fff;
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.5;
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(80, 60, 30, 0.18);
  max-width: 250px;
  text-align: center;
  cursor: pointer;
  border: 1.5px solid rgba(200, 168, 78, 0.25);
  -webkit-tap-highlight-color: transparent;
}
.coach-mark-bubble:active {
  transform: scale(0.97);
}
.coach-mark-icon {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
  color: var(--gold-warm);
}
.coach-mark-arrow {
  position: absolute;
  top: -6px;
  left: 18px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  border-top: 1.5px solid rgba(200, 168, 78, 0.25);
  border-left: 1.5px solid rgba(200, 168, 78, 0.25);
}

/* ============================================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================================ */

/* --- Entrance: fadeUp --- */
.fade-up {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--anim-slow) var(--ease-out),
              transform var(--anim-slow) var(--ease-out);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Entrance: popIn (for chips/emojis) --- */
.pop-in {
  opacity: 0;
  transform: scale(0.7);
  transition: opacity var(--anim-normal) var(--ease-out),
              transform var(--anim-normal) var(--ease-out);
}
.pop-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* --- SMALL letter fadeUp with scale --- */
.fade-up-scale {
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  transition: opacity var(--anim-normal) var(--ease-out),
              transform var(--anim-normal) var(--ease-out);
}
.fade-up-scale.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* --- Gundula entrance (slow, subtle scale) --- */
.fade-in-scale {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 400ms var(--ease-out),
              transform 400ms var(--ease-out);
}
.fade-in-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* --- Tab content crossfade --- */
#main-content {
  transition: opacity var(--anim-fast) ease;
}
#main-content.tab-fade-out {
  opacity: 0;
}

/* --- Reflexion step transition --- */
.step-enter {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity var(--anim-normal) var(--ease-out),
              transform var(--anim-normal) var(--ease-out);
}
.step-enter.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Chip tap pulse --- */
.chip-pulse {
  animation: chipPulse var(--anim-fast) var(--ease-out);
}
@keyframes chipPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* --- Gundula breathe (3 cycles, then stop) --- */
@keyframes gundulaBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
.gundula-breathe {
  animation: gundulaBreathe 4000ms ease-in-out 3;
}

/* --- Fade-in only (no transform) --- */
.fade-in {
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
}
.fade-in.visible {
  opacity: 1;
}

/* --- Progress dot active transition --- */
.progress-dot {
  transition: transform var(--anim-normal) var(--ease-out),
              background var(--anim-normal) var(--ease-out);
}
.progress-dot.active {
  transform: scale(1.15);
}

/* --- Selection transitions for chips --- */
.mood-btn,
.intention-chip,
.helped-btn,
.helped-alt {
  transition: transform var(--anim-fast) var(--ease-out),
              background var(--anim-fast) ease,
              border-color var(--anim-fast) ease,
              box-shadow var(--anim-fast) ease;
}

/* --- Schließen-Button check animation --- */
@keyframes checkPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- SMALL-Tap Erfolgs-Animationen --- */

/* Gold-Glow auf dem Dot nach Tap */
.dot-success {
  animation: dotGlow 600ms var(--ease-out);
}
@keyframes dotGlow {
  0% { box-shadow: 0 0 0 0 rgba(200, 168, 78, 0); }
  40% { box-shadow: 0 0 0 8px rgba(200, 168, 78, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(200, 168, 78, 0); }
}

/* Checkmark-Overlay im Dot */
.dot-check {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  animation: checkPop 400ms var(--ease-out) forwards;
  pointer-events: none;
}

.btn-dot {
  position: relative;
}

/* Stats-Zähler Bump */
.stats-bump {
  animation: statsBump 300ms var(--ease-out);
}
@keyframes statsBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* Completion-Screen Checkmark */
.completion-check {
  display: inline-block;
  animation: checkPop 500ms var(--ease-out);
}

/* ---- prefers-reduced-motion: disable all animations ---- */
@media (prefers-reduced-motion: reduce) {
  .fade-up, .fade-up-scale, .fade-in-scale, .pop-in, .fade-in, .step-enter {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  #main-content {
    transition: none !important;
  }
  .chip-pulse {
    animation: none !important;
  }
  .gundula-breathe, .dot-success, .stats-bump, .completion-check {
    animation: none !important;
  }
  .dot-check {
    animation: none !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }
  .progress-dot {
    transition: none !important;
  }
  .mood-btn, .intention-chip, .helped-btn, .helped-alt {
    transition: none !important;
  }
}
