/* ============================================================
   Vellaphine · Design
   Feminin, weich, elegant.
   Cormorant Garamond (Display Italic) + Inter (Body)
   ============================================================ */

:root {
  /* Cream-Hintergrund mit zartem Rosé-Stich */
  --bg:           #fbf4f0;
  --bg-soft:      #f5e8e3;
  --surface:      #fffafa;
  --surface-2:    #fbeae5;
  --surface-3:    #f4dad3;
  --border:       #ead0c8;
  --border-soft:  #f4e2db;

  /* Tinten */
  --ink:          #3a2530;
  --ink-soft:     #6f4858;
  --ink-muted:    #a08491;

  /* Hauptfarben - Mauve, Rosé, Plum */
  --primary:      #8c4a64;       /* tiefes Mauve-Plum */
  --primary-deep: #6b3349;
  --primary-ink:  #fffafa;
  --accent:       #c98a9b;       /* Dusty Rose */
  --accent-soft:  #e8b8c1;
  --gold:         #d4a574;       /* warmes Champagner-Gold */
  --rose:         #e87a92;       /* lebendiges Rosa für Akzente */

  /* Statusfarben */
  --success:      #7a9b7e;
  --error:        #b85c5c;

  /* Body-Gradients (Hintergrund-Schimmer) */
  --bg-glow-1:    rgba(232, 184, 193, 0.35);
  --bg-glow-2:    rgba(212, 165, 116, 0.18);
  --bg-glow-3:    rgba(232, 122, 146, 0.06);

  /* Glas-Effekt (semi-transparente Karten) */
  --glass-card:   rgba(255, 250, 250, 0.88);
  --glass-card-strong: rgba(255, 250, 250, 0.94);
  --glass-bar:    rgba(255, 250, 250, 0.78);
  --cal-cell-bg:  rgba(245, 232, 227, 0.5);
  --flash-error-bg: #f5dfdf;
  --flash-error-border: #e2bcbc;
  --flash-success-bg: #eaf2e8;
  --flash-success-border: #c5dec3;
  --danger-bg:    #f6e0e0;
  --danger-border:#e8c0c0;

  /* Schatten - weich und feminin */
  --shadow-xs: 0 1px 3px rgba(140, 74, 100, 0.06);
  --shadow-sm: 0 2px 8px rgba(140, 74, 100, 0.08);
  --shadow:    0 12px 32px -16px rgba(140, 74, 100, 0.22);
  --shadow-lg: 0 28px 56px -24px rgba(140, 74, 100, 0.28);

  /* Radii - sanft gerundet */
  --radius-sm: 8px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Typografie */
  --font-serif:  'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-script: 'Cormorant Garamond', Georgia, serif;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ============================================================
   DARK MODE
   Tiefes Plum / Wine mit warmen Rosé-Akzenten
   ============================================================ */
[data-theme="dark"] {
  --bg:           #1a1118;
  --bg-soft:      #241820;
  --surface:      #2a1d24;
  --surface-2:    #34232c;
  --surface-3:    #3f2c36;
  --border:       #4a3340;
  --border-soft:  #3a2630;

  --ink:          #f5e6ec;
  --ink-soft:     #d8b8c4;
  --ink-muted:    #9a7a87;

  --primary:      #d49ba9;       /* helleres Mauve im Dunkeln */
  --primary-deep: #b97a8d;
  --primary-ink:  #1a1118;
  --accent:       #c98a9b;
  --accent-soft:  #8e5a6a;
  --gold:         #e8be8b;
  --rose:         #f08aa0;

  --success:      #8fb293;
  --error:        #d88080;

  /* Sanfte Glow-Töne im Dunkelmodus */
  --bg-glow-1:    rgba(232, 122, 146, 0.10);
  --bg-glow-2:    rgba(212, 165, 116, 0.08);
  --bg-glow-3:    rgba(140, 74, 100, 0.12);

  /* Glaskarten dunkler */
  --glass-card:        rgba(42, 29, 36, 0.78);
  --glass-card-strong: rgba(42, 29, 36, 0.88);
  --glass-bar:         rgba(26, 17, 24, 0.72);
  --cal-cell-bg:       rgba(58, 38, 48, 0.45);
  --flash-error-bg:    #3d1f25;
  --flash-error-border:#5a2e36;
  --flash-success-bg:  #1f2e22;
  --flash-success-border: #355543;
  --danger-bg:         #3d1f25;
  --danger-border:     #5a2e36;

  /* Schatten im Dunkeln dezenter */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow:    0 12px 32px -16px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 28px 56px -24px rgba(0, 0, 0, 0.65);
}

/* ============================================================
   AKZENT-PALETTEN
   Default ist 'rose' (= :root). Andere via [data-accent="..."].
   Tausche werden nur Akzent-spezifische Variablen — Background,
   Surface, Glass etc. bleiben aus :root bzw. [data-theme="dark"].
   ============================================================ */

/* ROSE (Default Light) */
[data-accent="rose"] {
  --primary:      #8c4a64;
  --primary-deep: #6b3349;
  --accent:       #c98a9b;
  --accent-soft:  #e8b8c1;
  --rose:         #e87a92;
  --gold:         #d4a574;
  --bg-glow-1:    rgba(232, 184, 193, 0.35);
  --bg-glow-2:    rgba(212, 165, 116, 0.18);
  --bg-glow-3:    rgba(232, 122, 146, 0.06);
}

/* VIOLET / Lavendel (Light) */
[data-accent="violet"] {
  --primary:      #6b4a8c;
  --primary-deep: #4a2f6b;
  --accent:       #a08ac9;
  --accent-soft:  #ccb8e8;
  --rose:         #9072c4;
  --gold:         #c8a868;
  --bg-glow-1:    rgba(180, 160, 220, 0.30);
  --bg-glow-2:    rgba(200, 168, 104, 0.15);
  --bg-glow-3:    rgba(144, 114, 196, 0.08);
}

/* AMBER / Honig (Light) */
[data-accent="amber"] {
  --primary:      #8c6e3a;
  --primary-deep: #6b4f1f;
  --accent:       #d4a574;
  --accent-soft:  #ecd2a8;
  --rose:         #e09a4a;
  --gold:         #f0c870;
  --bg-glow-1:    rgba(232, 200, 130, 0.30);
  --bg-glow-2:    rgba(212, 165, 116, 0.20);
  --bg-glow-3:    rgba(224, 154, 74, 0.08);
}

/* TEAL / Salbei (Light) */
[data-accent="teal"] {
  --primary:      #3a7e7a;
  --primary-deep: #225f5b;
  --accent:       #74c4be;
  --accent-soft:  #b8e0dc;
  --rose:         #5cb0ab;
  --gold:         #d4b574;
  --bg-glow-1:    rgba(140, 200, 195, 0.25);
  --bg-glow-2:    rgba(212, 181, 116, 0.15);
  --bg-glow-3:    rgba(92, 176, 171, 0.08);
}

/* DARK MODE × Akzente */
[data-theme="dark"][data-accent="rose"] {
  --primary:      #d49ba9;
  --primary-deep: #b97a8d;
  --accent:       #c98a9b;
  --accent-soft:  #8e5a6a;
  --rose:         #f08aa0;
  --gold:         #e8be8b;
  --bg-glow-1:    rgba(232, 122, 146, 0.10);
  --bg-glow-2:    rgba(212, 165, 116, 0.08);
  --bg-glow-3:    rgba(140, 74, 100, 0.12);
}
[data-theme="dark"][data-accent="violet"] {
  --primary:      #c8a8e8;
  --primary-deep: #a888d0;
  --accent:       #b095d4;
  --accent-soft:  #6e548c;
  --rose:         #d4b0f0;
  --gold:         #d8be90;
  --bg-glow-1:    rgba(200, 168, 232, 0.12);
  --bg-glow-2:    rgba(212, 190, 144, 0.08);
  --bg-glow-3:    rgba(176, 149, 212, 0.14);
}
[data-theme="dark"][data-accent="amber"] {
  --primary:      #e8be8b;
  --primary-deep: #d4a574;
  --accent:       #d4a574;
  --accent-soft:  #aa7e3a;
  --rose:         #f0c870;
  --gold:         #ffdca0;
  --bg-glow-1:    rgba(232, 190, 139, 0.14);
  --bg-glow-2:    rgba(212, 165, 116, 0.10);
  --bg-glow-3:    rgba(240, 200, 112, 0.12);
}
[data-theme="dark"][data-accent="teal"] {
  --primary:      #8ed4ce;
  --primary-deep: #74c4be;
  --accent:       #6cb4ae;
  --accent-soft:  #3a8a84;
  --rose:         #a4ddd8;
  --gold:         #d4be90;
  --bg-glow-1:    rgba(142, 212, 206, 0.12);
  --bg-glow-2:    rgba(212, 190, 144, 0.08);
  --bg-glow-3:    rgba(108, 180, 174, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}
html { width: 100%; }
body { position: relative; width: 100%; }

body {
  background-image:
    radial-gradient(at 12% 8%, var(--bg-glow-1) 0%, transparent 45%),
    radial-gradient(at 88% 92%, var(--bg-glow-2) 0%, transparent 50%),
    radial-gradient(at 50% 50%, var(--bg-glow-3) 0%, transparent 60%);
  background-attachment: fixed;
  transition: background-color 0.3s, color 0.3s;
}

/* ============================================================
   Animierter Hintergrund-Layer (Canvas)
   ============================================================ */
#vellaphine-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

/* Alle Inhalte über dem Hintergrund */
body > *:not(#vellaphine-bg) {
  position: relative;
  z-index: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover {
  color: var(--rose);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ============================================================
   Topbar / Header
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--glass-bar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--rose) 50%, var(--primary) 100%);
  position: relative;
  transform: translateY(6px);
  box-shadow: 0 2px 8px rgba(232, 122, 146, 0.4);
}
.brand-mark::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  filter: blur(2px);
}
.brand-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: 28px;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--primary) 0%, var(--rose) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s;
  flex-shrink: 0;
}
.mode-toggle:hover {
  color: var(--primary);
  border-color: var(--accent);
  transform: rotate(15deg);
}
.mode-toggle .icon-sun,
.mode-toggle .icon-moon,
.mode-toggle .icon-auto { display: none; }

[data-color-mode="light"] .mode-toggle .icon-sun { display: block; }
[data-color-mode="dark"] .mode-toggle .icon-moon { display: block; }
[data-color-mode="auto"] .mode-toggle .icon-auto { display: block; }

/* Fallback wenn data-color-mode nicht gesetzt: orientiert sich am data-theme */
[data-theme="light"]:not([data-color-mode]) .mode-toggle .icon-moon { display: block; }
[data-theme="dark"]:not([data-color-mode]) .mode-toggle .icon-sun { display: block; }

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14.5px;
}
/* Desktop-Variante: in der Topbar inline */
.topnav-desktop {
  flex: 1;
  justify-content: flex-end;
  margin-right: 4px;
}
/* Mobile-Variante: standardmäßig versteckt */
.topnav-mobile {
  display: none;
}
.topnav a {
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  font-weight: 500;
}
.topnav a:hover {
  color: var(--primary);
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.user-chip {
  font-size: 13px;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border-radius: 999px;
  color: var(--primary-deep);
  font-weight: 500;
  border: 1px solid var(--border-soft);
}
.logout {
  font-size: 13px;
  color: var(--ink-muted) !important;
}

/* Mobile-Hamburger */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.menu-toggle:hover { background: var(--surface-2); }
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  position: relative;
  transition: transform 0.2s;
}
.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
}
.menu-toggle span::before { top: -7px; }
.menu-toggle span::after { top: 7px; }

/* ============================================================
   Flash Messages
   ============================================================ */
.flash-stack {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.flash {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14.5px;
  border: 1px solid;
  box-shadow: var(--shadow-sm);
  animation: flash-in 0.4s ease-out;
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.flash-success {
  background: var(--flash-success-bg);
  border-color: var(--flash-success-border);
  color: var(--success);
}
.flash-error {
  background: var(--flash-error-bg);
  border-color: var(--flash-error-border);
  color: var(--error);
}

/* ============================================================
   Layout
   ============================================================ */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 8px;
  font-weight: 600;
}
.eyebrow a { color: var(--ink-muted); }
.page-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 5.5vw, 56px);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--ink);
}
.title-month {
  font-style: italic;
}
.title-year {
  color: var(--rose);
  font-style: italic;
  font-weight: 400;
  margin-left: 4px;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.18s, background 0.18s;
  text-decoration: none;
  letter-spacing: 0.01em;
  min-height: 44px; /* Touch-Target */
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: var(--primary-ink);
  box-shadow: 0 4px 14px rgba(140, 74, 100, 0.28);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(140, 74, 100, 0.38);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--surface);
  color: var(--ink-soft);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--primary);
  border-color: var(--accent);
}

/* ============================================================
   Passwort-Feld mit Auge
   ============================================================ */
.pw-field {
  position: relative;
}
.pw-field input.pw-input,
.pw-field input[type=password],
.pw-field input[type=text] {
  padding-right: 50px;
}
.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}
.pw-toggle:hover {
  color: var(--primary);
  background: var(--surface-2);
}
.pw-toggle .pw-eye-off { display: none; }
.pw-toggle.is-shown .pw-eye { display: none; }
.pw-toggle.is-shown .pw-eye-off { display: block; }


.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass-card-strong);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 60%;
  height: 80%;
  background: radial-gradient(circle, rgba(232, 184, 193, 0.4) 0%, transparent 70%);
  pointer-events: none;
}
.auth-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: 42px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  color: var(--primary-deep);
  position: relative;
}
.auth-sub {
  color: var(--ink-soft);
  margin: 0 0 32px;
  font-size: 15px;
  position: relative;
}
.auth-tagline {
  color: var(--ink-muted);
  font-size: 13px;
  font-style: italic;
  margin: 0 0 28px;
  position: relative;
  letter-spacing: 0.02em;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.auth-form input,
.stack input,
.row-form input,
.notes-area,
select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  min-height: 44px;
}
.auth-form input:focus,
.stack input:focus,
.row-form input:focus,
.notes-area:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(232, 184, 193, 0.3);
}
.auth-form .btn { margin-top: 12px; }
.auth-foot {
  margin-top: 28px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-muted);
  position: relative;
}
.hint {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: normal;
}

/* ============================================================
   Kalender
   ============================================================ */
.user-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.user-switcher select {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  min-width: 140px;
}

.month-nav {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.nav-btn {
  min-width: 48px;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 18px;
  color: var(--ink-soft);
  border: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  border-right: 1px solid var(--border-soft);
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn:last-child { border-right: none; }
.nav-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
  text-decoration: none;
}
.nav-today {
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  font-family: var(--font-serif);
  font-style: italic;
}

.calendar {
  background: var(--glass-card);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.cal-wd {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  padding: 10px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  background: var(--cal-cell-bg);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.18s, border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
}
.cal-cell:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
  background: var(--surface);
}
.cal-cell-empty {
  background: transparent;
  pointer-events: none;
  border: none;
}
.cal-day {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}
.cal-cell.is-today {
  background: linear-gradient(135deg, var(--primary) 0%, var(--rose) 100%);
  border-color: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 8px 20px -8px rgba(140, 74, 100, 0.5);
}
.cal-cell.is-today .cal-day { color: var(--primary-ink); font-style: italic; }
.cal-cell.is-today .cal-pill {
  background: rgba(255, 255, 255, 0.25);
  color: var(--primary-ink);
  border-color: rgba(255, 255, 255, 0.3);
}
.cal-cell.has-entry:not(.is-today) {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border-color: var(--accent-soft);
}
.cal-cell.has-entry:not(.is-today)::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 8px rgba(232, 122, 146, 0.6);
}
.cal-pill {
  font-size: 10px;
  padding: 3px 9px;
  background: var(--rose);
  color: var(--primary-ink);
  border-radius: 999px;
  align-self: flex-start;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  text-transform: lowercase;
}
.cal-foot {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink-muted);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 17px;
}
.cal-hint {
  font-size: 13px;
  font-family: var(--font-sans);
  font-style: normal;
  color: var(--ink-muted);
}

/* ============================================================
   Kalender · Zyklus-Anzeige
   ============================================================ */
.cal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
}
.cal-cycle {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  font-family: var(--font-sans);
  line-height: 1.4;
}
.cal-cell.is-today .cal-cycle {
  background: rgba(255, 255, 255, 0.25);
  color: var(--primary-ink);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Periode-Markierung — siehe Block weiter unten (mit Flow-Verlauf) */

/* ============================================================
   Kalender · Zyklusphasen (farbliche Hintergründe)
   Reihenfolge wichtig: spezifischere Klassen (is-period, is-today)
   überschreiben die Phasenfarben.
   ============================================================ */
.cal-cell.phase-follicular {
  background: linear-gradient(135deg, rgba(150, 200, 175, 0.18) 0%, rgba(150, 200, 175, 0.08) 100%);
  border-color: rgba(150, 200, 175, 0.35);
}
.cal-cell.phase-fertile {
  background: linear-gradient(135deg, rgba(245, 200, 130, 0.22) 0%, rgba(245, 200, 130, 0.10) 100%);
  border-color: rgba(245, 200, 130, 0.45);
}
.cal-cell.phase-ovulation {
  background: linear-gradient(135deg, rgba(255, 170, 70, 0.32) 0%, rgba(255, 170, 70, 0.16) 100%);
  border-color: rgba(255, 170, 70, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 170, 70, 0.25);
}
.cal-cell.phase-luteal {
  background: linear-gradient(135deg, rgba(180, 160, 220, 0.18) 0%, rgba(180, 160, 220, 0.08) 100%);
  border-color: rgba(180, 160, 220, 0.32);
}

[data-theme="dark"] .cal-cell.phase-follicular {
  background: linear-gradient(135deg, rgba(120, 200, 160, 0.16) 0%, rgba(120, 200, 160, 0.06) 100%);
  border-color: rgba(120, 200, 160, 0.30);
}
[data-theme="dark"] .cal-cell.phase-fertile {
  background: linear-gradient(135deg, rgba(245, 180, 110, 0.20) 0%, rgba(245, 180, 110, 0.08) 100%);
  border-color: rgba(245, 180, 110, 0.40);
}
[data-theme="dark"] .cal-cell.phase-ovulation {
  background: linear-gradient(135deg, rgba(255, 175, 75, 0.32) 0%, rgba(255, 175, 75, 0.14) 100%);
  border-color: rgba(255, 175, 75, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 175, 75, 0.30);
}
[data-theme="dark"] .cal-cell.phase-luteal {
  background: linear-gradient(135deg, rgba(180, 160, 230, 0.20) 0%, rgba(180, 160, 230, 0.08) 100%);
  border-color: rgba(180, 160, 230, 0.30);
}

/* Periode überschreibt die Phasen-Färbung mit kräftigem Rot, skaliert mit Flow */
.cal-cell.is-period,
.cal-cell.is-period.phase-menstrual {
  --flow: 0.7;
  background: linear-gradient(
    135deg,
    rgba(214, 61, 94, calc(var(--flow) * 0.55)) 0%,
    rgba(176, 32, 70, calc(var(--flow) * 0.40)) 60%,
    rgba(140, 20, 56, calc(var(--flow) * 0.28)) 100%
  );
  border: 2px solid rgba(214, 61, 94, calc(var(--flow) * 0.85));
  box-shadow: 0 0 0 1px rgba(214, 61, 94, calc(var(--flow) * 0.25)) inset,
              0 4px 14px -6px rgba(214, 61, 94, calc(var(--flow) * 0.6));
}
.cal-cell.is-period .cal-day {
  color: #ffffff;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(80, 10, 30, 0.5);
}
.cal-cell.is-period .cal-cycle {
  background: rgba(255, 255, 255, 0.92);
  color: #8a1d35;
  border-color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

/* Heute + Periode: Border heller, sonst Flow-Style behalten */
.cal-cell.is-today.is-period {
  background: linear-gradient(
    135deg,
    rgba(232, 80, 110, calc(var(--flow) * 0.85)) 0%,
    rgba(200, 40, 80, calc(var(--flow) * 0.70)) 60%,
    rgba(160, 28, 60, calc(var(--flow) * 0.55)) 100%
  );
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25) inset,
              0 8px 22px -8px rgba(214, 61, 94, calc(var(--flow) * 0.8));
}

[data-theme="dark"] .cal-cell.is-period,
[data-theme="dark"] .cal-cell.is-period.phase-menstrual {
  background: linear-gradient(
    135deg,
    rgba(232, 80, 110, calc(var(--flow) * 0.55)) 0%,
    rgba(200, 50, 84, calc(var(--flow) * 0.40)) 60%,
    rgba(160, 32, 64, calc(var(--flow) * 0.28)) 100%
  );
  border-color: rgba(232, 90, 120, calc(var(--flow) * 0.85));
  box-shadow: 0 0 0 1px rgba(232, 90, 120, calc(var(--flow) * 0.30)) inset,
              0 4px 16px -6px rgba(232, 90, 120, calc(var(--flow) * 0.7));
}
[data-theme="dark"] .cal-cell.is-period .cal-cycle {
  background: rgba(255, 255, 255, 0.85);
  color: #6b1428;
}

/* Periodentag-Marker (Tropfen): mit Flow skaliert + Glow */
.cal-period-mark {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(8px + var(--flow, 0.7) * 4px);
  height: calc(11px + var(--flow, 0.7) * 5px);
  background: linear-gradient(180deg, #f06080 0%, #c01838 50%, #8a1028 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 0 calc(4px + var(--flow, 0.7) * 8px) rgba(214, 61, 94, calc(var(--flow, 0.7) * 0.8)),
              inset 0 1px 2px rgba(255, 255, 255, 0.4);
}
.cal-cell.is-today.is-period .cal-period-mark {
  background: linear-gradient(180deg, #ffffff 0%, #ffd0dc 100%);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

/* Eisprung-Symbol */
.cal-ovulation-mark {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  background: radial-gradient(circle, #ffc875 0%, #f5a020 100%);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 170, 70, 0.6),
              0 0 0 1.5px rgba(255, 200, 100, 0.5);
}
.cal-ovulation-mark::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px;
  right: -2px; bottom: -2px;
  border-radius: 50%;
  border: 1px solid rgba(255, 170, 70, 0.4);
  animation: pulse-ov 2.4s ease-in-out infinite;
}
@keyframes pulse-ov {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 0; }
}
.cal-cell.is-today .cal-ovulation-mark {
  background: rgba(255, 230, 180, 0.95);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Legende mit Farbflächen statt Punkten */
.cal-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-muted);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.legend-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
}
.swatch-menstrual {
  background: linear-gradient(135deg, rgba(214, 61, 94, 0.85) 0%, rgba(140, 20, 56, 0.65) 100%);
  border-color: rgba(214, 61, 94, 0.9);
}
.swatch-follicular {
  background: linear-gradient(135deg, rgba(150, 200, 175, 0.5) 0%, rgba(150, 200, 175, 0.2) 100%);
  border-color: rgba(150, 200, 175, 0.5);
}
.swatch-fertile {
  background: linear-gradient(135deg, rgba(245, 200, 130, 0.55) 0%, rgba(245, 200, 130, 0.25) 100%);
  border-color: rgba(245, 200, 130, 0.6);
}
.swatch-ovulation {
  background: radial-gradient(circle, #ffc875 0%, #f5a020 100%);
  border-color: rgba(255, 170, 70, 0.7);
}
.swatch-luteal {
  background: linear-gradient(135deg, rgba(180, 160, 220, 0.5) 0%, rgba(180, 160, 220, 0.2) 100%);
  border-color: rgba(180, 160, 220, 0.5);
}

.cal-disclaimer {
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
  margin: 8px auto 0;
  max-width: 680px;
  line-height: 1.5;
  font-style: italic;
}

/* ============================================================
   Vorhersage-Banner & Marker
   ============================================================ */
.prediction-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  margin: 0 0 24px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 14.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  animation: flash-in 0.4s ease-out;
}
.prediction-banner strong { font-weight: 600; }
.prediction-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-serif);
}
.prediction-text { flex: 1; }
.prediction-date {
  font-size: 13px;
  color: var(--ink-muted);
  margin-left: 4px;
  white-space: nowrap;
}

/* Heute */
.prediction-today {
  background: linear-gradient(135deg, rgba(214, 61, 94, 0.16) 0%, rgba(214, 61, 94, 0.06) 100%);
  border-color: rgba(214, 61, 94, 0.45);
  color: #8a1d35;
}
.prediction-today .prediction-icon {
  background: linear-gradient(135deg, #e85a78 0%, #d63d5e 100%);
  color: #fff;
  animation: pulse-glow 2.4s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 61, 94, 0.5); }
  50%      { box-shadow: 0 0 0 10px rgba(214, 61, 94, 0); }
}

/* In den nächsten Tagen */
.prediction-soon {
  background: linear-gradient(135deg, rgba(232, 184, 193, 0.30) 0%, rgba(232, 184, 193, 0.10) 100%);
  border-color: var(--accent-soft);
  color: var(--primary-deep);
}
.prediction-soon .prediction-icon {
  background: var(--accent);
  color: #fff;
}

/* Überfällig */
.prediction-overdue {
  background: linear-gradient(135deg, rgba(245, 165, 75, 0.18) 0%, rgba(245, 165, 75, 0.06) 100%);
  border-color: rgba(245, 165, 75, 0.5);
  color: #8a4a18;
}
.prediction-overdue .prediction-icon {
  background: linear-gradient(135deg, #f5a020 0%, #d68008 100%);
  color: #fff;
}

[data-theme="dark"] .prediction-today {
  background: linear-gradient(135deg, rgba(232, 90, 120, 0.22) 0%, rgba(232, 90, 120, 0.08) 100%);
  color: #f5b8c8;
}
[data-theme="dark"] .prediction-soon {
  background: linear-gradient(135deg, rgba(232, 184, 193, 0.18) 0%, rgba(232, 184, 193, 0.06) 100%);
  color: var(--primary);
}
[data-theme="dark"] .prediction-overdue {
  background: linear-gradient(135deg, rgba(245, 165, 75, 0.22) 0%, rgba(245, 165, 75, 0.08) 100%);
  color: #f5c898;
}

/* Vorhersage-Marker im Kalender (kein Periodenstart eingetragen) */
.cal-cell.is-predicted {
  border: 1.5px dashed rgba(214, 61, 94, 0.55);
  background: linear-gradient(135deg, rgba(214, 61, 94, 0.06) 0%, transparent 100%);
}
[data-theme="dark"] .cal-cell.is-predicted {
  border-color: rgba(232, 100, 130, 0.5);
  background: linear-gradient(135deg, rgba(232, 100, 130, 0.10) 0%, transparent 100%);
}
.cal-predicted-mark {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 11px;
  border: 1.5px dashed #d63d5e;
  background: transparent;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.cal-cell.is-today.is-predicted {
  border-style: solid;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.6);
}

.swatch-predicted {
  background: transparent;
  border: 1.5px dashed #d63d5e;
}
[data-theme="dark"] .swatch-predicted {
  border-color: #e85a78;
}

/* ============================================================
   Tag-Detail · Periode-Card
   ============================================================ */
.period-card {
  border: 1px solid var(--accent-soft) !important;
}
.period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.period-toggle {
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.period-toggle input { display: none; }
.period-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all 0.18s;
  min-height: 44px;
}
.period-toggle:hover .period-pill {
  border-color: #d63d5e;
  color: var(--ink);
}
.period-drop {
  display: inline-block;
  width: 14px;
  height: 18px;
  background: linear-gradient(180deg, #f5a8b8 0%, #d63d5e 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0.5;
  transition: opacity 0.18s, transform 0.18s;
}
.period-toggle input:checked + .period-pill {
  background: linear-gradient(135deg, #f9e0e6 0%, #f5c8d2 100%);
  border-color: #d63d5e;
  color: #8a1d35;
}
.period-toggle input:checked + .period-pill .period-drop {
  opacity: 1;
  transform: scale(1.1);
}
[data-theme="dark"] .period-toggle input:checked + .period-pill {
  background: linear-gradient(135deg, rgba(214, 61, 94, 0.25) 0%, rgba(214, 61, 94, 0.12) 100%);
  border-color: #e85a78;
  color: #ffc8d4;
}

/* ============================================================
   Konto · Zyklus-Statistiken
   ============================================================ */
.cycle-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-soft);
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  color: var(--primary-deep);
  font-weight: 500;
}
[data-theme="dark"] .stat-value {
  color: var(--primary);
}

/* ============================================================
   Konto · Erscheinungsbild (Mode + Akzent)
   ============================================================ */
.mode-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
.mode-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}
.mode-option:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.mode-option.is-selected {
  border-color: var(--rose);
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  box-shadow: 0 0 0 4px rgba(232, 122, 146, 0.15);
}
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-icon {
  font-size: 22px;
  color: var(--primary);
  font-family: var(--font-serif);
  line-height: 1;
}
.mode-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.accent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.accent-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s;
  overflow: hidden;
}
.accent-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.accent-card.is-selected {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(232, 122, 146, 0.15);
}
.accent-card.is-selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: var(--rose);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.accent-card input { position: absolute; opacity: 0; pointer-events: none; }
.accent-preview {
  display: block;
  width: 100%;
  height: 56px;
  border-radius: 10px;
  position: relative;
}
.accent-preview-rose   { background: linear-gradient(135deg, #e8b8c1 0%, #c98a9b 50%, #8c4a64 100%); }
.accent-preview-violet { background: linear-gradient(135deg, #ccb8e8 0%, #a08ac9 50%, #6b4a8c 100%); }
.accent-preview-amber  { background: linear-gradient(135deg, #ecd2a8 0%, #d4a574 50%, #8c6e3a 100%); }
.accent-preview-teal   { background: linear-gradient(135deg, #b8e0dc 0%, #74c4be 50%, #3a7e7a 100%); }
.accent-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.accent-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
  color: var(--primary-deep);
}
[data-theme="dark"] .accent-name { color: var(--primary); }
.accent-desc {
  font-size: 12px;
  color: var(--ink-muted);
}


.field-label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.subsection-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  font-weight: 500;
  color: var(--primary-deep);
  margin: 28px 0 8px;
  letter-spacing: 0.01em;
}
[data-theme="dark"] .subsection-title { color: var(--primary); }

.muted-small {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 400;
  font-style: normal;
  font-family: var(--font-sans);
}

.period-range-form {
  background: var(--surface-2);
  border: 1px dashed var(--accent-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.period-range-form .subsection-title {
  margin-top: 0;
}

input[type="date"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 44px;
  color-scheme: light;
}
[data-theme="dark"] input[type="date"] {
  color-scheme: dark;
}
input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 184, 193, 0.3);
}

input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 44px;
}
input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 184, 193, 0.3);
}

/* Aktuelle Periode (Bis heute verlängern) */
.active-period-card {
  border-left: 4px solid #d63d5e;
  background: linear-gradient(135deg, var(--glass-card) 0%, rgba(214, 61, 94, 0.05) 100%) !important;
}
[data-theme="dark"] .active-period-card {
  background: linear-gradient(135deg, var(--glass-card) 0%, rgba(232, 90, 120, 0.10) 100%) !important;
}

/* Block-Liste */
.block-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.block-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 4px solid #d63d5e;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.block-row:hover {
  background: var(--surface-2);
}
.block-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.block-dates {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
  font-weight: 500;
}
.block-meta {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 500;
  padding: 3px 10px;
  background: rgba(214, 61, 94, 0.12);
  border-radius: 999px;
  color: #b03350;
}
[data-theme="dark"] .block-meta {
  background: rgba(232, 90, 120, 0.18);
  color: #f0a0b3;
}

/* Chart-Sections */
.chart-section {
  margin-bottom: 32px;
  padding-bottom: 4px;
}
.chart-section:last-child { margin-bottom: 0; }

/* Bar Chart (Top-Symptome) */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr auto;
  gap: 14px;
  align-items: center;
  font-size: 14px;
}
.bar-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bar-name {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-group {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-weight: 600;
}
.bar-track {
  height: 22px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--rose) 60%, var(--primary) 100%);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 4px;
}
.bar-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bar-count {
  font-weight: 600;
  color: var(--primary-deep);
  font-size: 14px;
}
[data-theme="dark"] .bar-count { color: var(--primary); }
.bar-avg {
  font-size: 12px;
  color: var(--ink-muted);
  padding: 2px 8px;
  background: var(--surface-2);
  border-radius: 999px;
}

/* Line/Bar Chart Zykluslängen */
.line-chart {
  position: relative;
  height: 200px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 16px 36px;
  margin-top: 8px;
}
.chart-target-line {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 0;
  border-top: 1.5px dashed var(--gold);
  z-index: 2;
  pointer-events: none;
}
.chart-target-label {
  position: absolute;
  right: 0;
  top: -10px;
  background: var(--gold);
  color: var(--primary-ink);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
[data-theme="dark"] .chart-target-label { color: #1a1118; }
.chart-bars-line {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100%;
  position: relative;
}
.line-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  min-width: 0;
}
.line-bar {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 100%);
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 2px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.line-bar:hover {
  filter: brightness(1.1);
}
.line-val {
  position: absolute;
  top: -18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-deep);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .line-val { color: var(--primary); }
.line-x {
  position: absolute;
  bottom: -22px;
  font-size: 10px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Duration Chart */
.duration-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dur-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.dur-label {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.dur-track {
  height: 22px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.dur-fill {
  height: 100%;
  background: linear-gradient(90deg, #f5a8b8 0%, #d63d5e 100%);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 30px;
}
.dur-val {
  color: white;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Karten / Cards
   ============================================================ */
.card {
  background: var(--glass-card);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.card-wide { max-width: none; }
.card-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: 28px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  color: var(--primary-deep);
}
.card-sub {
  color: var(--ink-soft);
  margin: 0 0 24px;
  font-size: 15px;
}

.day-form { display: flex; flex-direction: column; gap: 0; }

/* ============================================================
   Symptome
   ============================================================ */
.sym-group {
  margin-bottom: 28px;
}
.sym-group:last-child { margin-bottom: 0; }
.sym-group-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-style: italic;
  font-size: 18px;
  color: var(--rose);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--accent-soft);
  letter-spacing: 0.01em;
}
.sym-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sym-row {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: background 0.18s, border-color 0.18s;
}
.sym-row.is-active {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--cal-cell-bg) 100%);
  border-color: var(--border-soft);
}
.sym-check {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  user-select: none;
  min-height: 32px;
}
.sym-check input { display: none; }
.sym-box {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  background: var(--surface);
}
.sym-check:hover .sym-box {
  border-color: var(--rose);
  transform: scale(1.05);
}
.sym-check input:checked + .sym-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--rose) 100%);
  border-color: var(--primary);
}
.sym-check input:checked + .sym-box::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 7px;
  width: 6px;
  height: 11px;
  border-right: 2px solid var(--primary-ink);
  border-bottom: 2px solid var(--primary-ink);
  transform: rotate(45deg);
}
.sym-intensity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  margin-left: 36px;
  flex-wrap: wrap;
}
.int-opt input { display: none; }
.int-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-style: italic;
  transition: all 0.18s;
}
.int-dot:hover {
  border-color: var(--rose);
  color: var(--primary);
  transform: scale(1.08);
}
.int-opt input:checked + .int-dot-1 { background: #fce8ee; border-color: var(--accent-soft); color: var(--primary-deep); }
.int-opt input:checked + .int-dot-2 { background: #f8c6d3; border-color: #e89dad; color: var(--primary-deep); }
.int-opt input:checked + .int-dot-3 { background: var(--accent); border-color: var(--accent); color: var(--primary-ink); }
.int-opt input:checked + .int-dot-4 { background: var(--rose); border-color: var(--rose); color: var(--primary-ink); }
.int-opt input:checked + .int-dot-5 { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%); border-color: var(--primary); color: var(--primary-ink); }
.int-help {
  margin-left: 8px;
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
}

/* ============================================================
   Notizen
   ============================================================ */
.notes-area {
  resize: vertical;
  min-height: 160px;
  font-family: var(--font-sans);
  line-height: 1.7;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 28px;
  flex-wrap: wrap;
}

.readonly-banner {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 24px;
  font-style: italic;
}

/* ============================================================
   Konto / Theme-Picker
   ============================================================ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stack label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.theme-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  background: var(--surface);
  transition: all 0.2s;
  text-align: left;
  overflow: hidden;
}
.theme-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.theme-card.is-selected {
  border-color: var(--rose);
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  box-shadow: 0 0 0 4px rgba(232, 122, 146, 0.15);
}
.theme-card.is-selected::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 14px;
  width: 24px;
  height: 24px;
  background: var(--rose);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}
.theme-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  font-weight: 500;
  color: var(--primary-deep);
  margin: 0 0 4px;
}
.theme-desc {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
}
.theme-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   Admin
   ============================================================ */
.inline-form { display: block; }
.setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.setting-row > div:first-child { flex: 1; min-width: 220px; }
.setting-row strong { font-size: 16px; color: var(--ink); }
.setting-row p { margin: 4px 0 0; font-size: 14px; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.status-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.status-pill.is-on { background: #d8e6d8; color: var(--success); }
.status-pill.is-off { background: var(--surface-3); color: var(--ink-muted); }

.row-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.row-form input { flex: 1; min-width: 180px; }
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  padding: 0 4px;
}
.checkbox-inline input {
  width: 18px;
  height: 18px;
  accent-color: var(--rose);
}

.user-table {
  display: flex;
  flex-direction: column;
}
.user-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.7fr 1fr 2.5fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
  font-size: 14.5px;
}
.user-row:last-child { border-bottom: none; }
.user-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  font-weight: 600;
  padding: 10px 0;
}
.user-name { font-weight: 500; color: var(--ink); }
.self-tag {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 400;
  margin-left: 6px;
  font-style: italic;
}
.role-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface-3);
  color: var(--ink-soft);
  font-weight: 500;
}
.role-admin {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent) 100%);
  color: var(--primary-deep);
  font-weight: 500;
}
.actions-col {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.btn-mini {
  padding: 7px 14px;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
  min-height: 36px;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-mini:hover {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--accent);
  text-decoration: none;
}
.btn-mini-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: var(--primary-ink);
  border-color: var(--primary);
}
.btn-mini-primary:hover { color: var(--primary-ink); }
.btn-mini-danger {
  background: var(--danger-bg);
  color: var(--error);
  border-color: var(--danger-border);
}
.btn-mini-danger:hover { background: var(--danger-border); color: var(--error); }

.action-detail summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
}
.action-detail summary::-webkit-details-marker { display: none; }
.mini-form {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  background: var(--bg);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.mini-form input {
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-family: inherit;
  flex: 1;
  min-width: 120px;
  min-height: 32px;
}
.mini-form-inline { display: inline-block; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  text-align: center;
  padding: 36px 20px;
  font-size: 13px;
  color: var(--ink-muted);
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dot { color: var(--accent); font-size: 14px; }
.footer-name {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--primary);
  font-size: 15px;
}

/* ============================================================
   RESPONSIVE - Tablet (≤ 920px)
   ============================================================ */
@media (max-width: 920px) {
  .topbar { padding: 14px 22px; }
  .main { padding: 28px 22px 60px; }
  .page-head { gap: 18px; }
  .card { padding: 28px 24px; }
}

/* ============================================================
   RESPONSIVE - Mobile (≤ 720px)
   ============================================================ */
@media (max-width: 720px) {
  .topbar {
    padding: 12px 18px;
    gap: 12px;
  }
  .brand-mark { width: 28px; height: 28px; }
  .brand-name { font-size: 24px; }

  /* Hamburger sichtbar machen */
  .menu-toggle { display: flex; }

  /* Desktop-Nav verstecken */
  .topnav-desktop { display: none; }

  /* Mobile-Nav als Slide-In Panel
     visibility + opacity für hartes verstecken (nicht nur transform),
     damit nichts in den Viewport ragt und scrollbar wird */
  .topnav-mobile {
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(85vw, 320px);
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 80px 24px 32px;
    box-shadow: -8px 0 32px rgba(140, 74, 100, 0.25);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.3s,
                opacity 0.3s;
    z-index: 60;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    will-change: transform;
  }
  .topnav-mobile.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s,
                opacity 0.3s;
  }
  .topnav-mobile a {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 16px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
  }
  .topnav-mobile a:hover {
    background: var(--surface-2);
    border-bottom-color: var(--border-soft);
  }
  .topnav-mobile .user-chip {
    margin-bottom: 8px;
    text-align: center;
    padding: 12px 14px;
    font-size: 14px;
    flex-shrink: 0;
  }
  .topnav-mobile .logout {
    margin-top: 12px;
    padding: 14px 12px;
    background: var(--surface-2);
    text-align: center;
  }

  /* Backdrop */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(58, 37, 48, 0.4);
    backdrop-filter: blur(4px);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .main { padding: 24px 16px 60px; }
  .auth-card { padding: 36px 24px; }
  .auth-title { font-size: 36px; }

  .page-head {
    align-items: stretch;
  }
  .page-controls {
    width: 100%;
    justify-content: space-between;
  }
  .user-switcher { flex: 1; }
  .user-switcher select { width: 100%; }

  .card { padding: 22px 18px; border-radius: var(--radius); }
  .card-title { font-size: 24px; }

  /* Kalender kompakter */
  .calendar { padding: 12px; }
  .cal-head { gap: 4px; margin-bottom: 6px; }
  .cal-wd { font-size: 10px; padding: 6px 0; }
  .cal-grid { gap: 4px; }
  .cal-cell {
    padding: 6px 4px;
    border-radius: 10px;
  }
  .cal-day { font-size: 16px; }
  .cal-pill {
    font-size: 9px;
    padding: 2px 6px;
  }
  .cal-cell.has-entry:not(.is-today)::before {
    width: 5px; height: 5px;
    top: 5px; right: 5px;
  }
  .cal-cycle {
    font-size: 9px;
    padding: 0 5px;
  }
  .cal-period-mark {
    width: 6px; height: 8px;
    bottom: 4px;
  }
  .cal-ovulation-mark {
    width: 8px; height: 8px;
    bottom: 4px;
  }
  .cal-ovulation-mark::after { display: none; }
  .cal-predicted-mark { width: 6px; height: 8px; bottom: 4px; }
  .cal-legend { gap: 12px; font-size: 12px; }
  .legend-swatch { width: 13px; height: 13px; }

  .prediction-banner {
    padding: 12px 16px;
    gap: 12px;
    font-size: 13.5px;
  }
  .prediction-icon { width: 28px; height: 28px; font-size: 13px; }
  .prediction-date { display: block; margin-left: 0; margin-top: 2px; }

  /* Symptome - Touch-optimiert */
  .sym-row { padding: 14px 12px; }
  .sym-intensity {
    margin-left: 0;
    margin-top: 14px;
    gap: 6px;
    justify-content: center;
  }
  .int-help {
    width: 100%;
    text-align: center;
    margin-left: 0;
    margin-top: 4px;
  }
  .int-dot {
    width: 40px; height: 40px;
    font-size: 15px;
  }

  /* Admin: Karten statt Tabelle */
  .user-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 14px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    margin-bottom: 10px;
  }
  .user-row:last-child { border-bottom: 1px solid var(--border-soft); }
  .user-head { display: none; }
  .user-row .muted::before { content: 'Erstellt: '; opacity: 0.7; }
  .user-row > div:nth-child(3)::before { content: 'Einträge: '; opacity: 0.7; color: var(--ink-muted); }
  .actions-col { margin-top: 10px; gap: 8px; }

  .row-form input { min-width: 0; width: 100%; }
  .checkbox-inline { width: 100%; }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .form-actions .btn { width: 100%; }

  /* Charts kompakter auf Mobile */
  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .bar-row:last-child { border-bottom: none; }
  .bar-stats {
    justify-content: flex-end;
  }
  .bar-track { order: 2; }
  .bar-stats { order: 3; }

  .line-chart { padding: 14px 12px 32px; height: 180px; }
  .line-bar { max-width: 24px; }
  .line-val { font-size: 10px; top: -16px; }
  .line-x { font-size: 9px; bottom: -20px; }

  .dur-row {
    grid-template-columns: 70px 1fr;
    gap: 8px;
  }
  .dur-label { font-size: 12px; }

  .block-row { padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
  .block-dates { font-size: 16px; }

  .footer { padding: 28px 16px; flex-direction: column; gap: 4px; }
  .footer .dot { display: none; }
}

/* ============================================================
   RESPONSIVE - Klein-Mobile (≤ 380px)
   ============================================================ */
@media (max-width: 380px) {
  .cal-day { font-size: 14px; }
  .cal-pill { display: none; }
  .cal-cycle { display: none; }
  .cal-cell.has-entry:not(.is-today)::before {
    top: 4px; right: 4px;
  }
}

/* ============================================================
   Reduzierte Bewegung respektieren
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  #vellaphine-bg { display: none; }
}
