/* ==========================================================================
   Design-System: Neurodiversitäts-freundlich & barrierefrei (WCAG 2.1 AA)
   – Beruhigende, warme Farben (nicht grell)
   – Hoher Kontrast (≥ 4.5:1 für Text)
   – Klare visuelle Hierarchie
   – Große Klickziele (min 44px)
   – Konsistenter Abstandsrhythmus (8px-Raster)
   – prefers-reduced-motion / prefers-color-scheme
   ========================================================================== */

:root {
  --bg: #1a1a2e;
  --bg-elevated: #222240;
  --card: #2a2a48;
  --card-hover: #32325a;
  --border: #3d3d64;
  --text: #eae8f2;
  --text-secondary: #b8b4cc;
  --accent: #8b7cf7;
  --accent-strong: #a498ff;
  --accent-bg: rgba(139, 124, 247, 0.12);
  --success: #5cbd8a;
  --success-bg: rgba(92, 189, 138, 0.12);
  --danger: #e87070;
  --danger-bg: rgba(232, 112, 112, 0.12);
  --focus-ring: #a498ff;
  --input-bg: #1e1e36;
  --radius: 10px;
  --radius-lg: 14px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
}

/* Helles Theme (manuell gewählt) */
[data-theme="light"] {
  --bg: #f5f3fa;
  --bg-elevated: #edeaf5;
  --card: #ffffff;
  --card-hover: #f0edfa;
  --border: #d5d0e8;
  --text: #2a2745;
  --text-secondary: #6b6588;
  --accent: #6c5ce7;
  --accent-strong: #5a4bd4;
  --accent-bg: rgba(108, 92, 231, 0.08);
  --success: #2e9e63;
  --success-bg: rgba(46, 158, 99, 0.08);
  --danger: #d44444;
  --danger-bg: rgba(212, 68, 68, 0.08);
  --focus-ring: #6c5ce7;
  --input-bg: #f0edfa;
}
/* Automatisch (System-Präferenz) */
@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg: #f5f3fa;
    --bg-elevated: #edeaf5;
    --card: #ffffff;
    --card-hover: #f0edfa;
    --border: #d5d0e8;
    --text: #2a2745;
    --text-secondary: #6b6588;
    --accent: #6c5ce7;
    --accent-strong: #5a4bd4;
    --accent-bg: rgba(108, 92, 231, 0.08);
    --success: #2e9e63;
    --success-bg: rgba(46, 158, 99, 0.08);
    --danger: #d44444;
    --danger-bg: rgba(212, 68, 68, 0.08);
    --focus-ring: #6c5ce7;
    --input-bg: #f0edfa;
  }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont,
               'Segoe UI', system-ui, Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
/* Manuelles Reduzieren von Animationen */
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

/* Extra-großer Fokus-Rahmen (Braillezeile / Tastatur) */
.large-focus :focus-visible {
  outline: 4px solid var(--focus-ring) !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 6px var(--accent-bg) !important;
}

/* ---- Skip-Link ---- */
.skip-link {
  position: absolute; top: -100%; left: var(--space-md);
  background: var(--accent); color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius); font-weight: 700; font-size: 0.95rem;
  z-index: 1000; text-decoration: none;
}
.skip-link:focus {
  top: var(--space-md);
  outline: 3px solid var(--focus-ring); outline-offset: 2px;
}

/* ---- Fokus ---- */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Navigation ---- */
.site-nav {
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--border);
  padding: var(--space-md) var(--space-lg);
  display: flex; align-items: center; gap: var(--space-md);
  flex-wrap: wrap;
}
.site-nav__brand {
  font-size: 1.25rem; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: var(--space-sm);
  text-decoration: none;
}
.site-nav__links {
  display: flex; gap: var(--space-sm); flex-wrap: wrap; list-style: none;
}
.site-nav__link {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  text-decoration: none; color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius); font-size: 1rem; font-weight: 600;
  min-height: 44px; min-width: 44px;
  transition: background 0.15s ease, color 0.15s ease;
  border: 2px solid transparent;
}
.site-nav__link:hover { color: var(--text); background: var(--card); }
.site-nav__clock {
  margin-left: auto;
  font-size: 1.1rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent); text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background 0.15s ease;
}
.site-nav__clock:hover { background: var(--card); }
/* Theme-Toggle in Nav */
.theme-toggle {
  background: none; border: 2px solid var(--border); cursor: pointer;
  color: var(--text-secondary); font-size: 1.15rem; line-height: 1;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius);
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); background: var(--card); }
.site-nav__link[aria-current="page"] {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
[data-theme="light"] .site-nav__link[aria-current="page"] { color: #fff; }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .site-nav__link[aria-current="page"] { color: #fff; }
}

/* ---- Hauptbereich ---- */
.main-content {
  max-width: 860px;
  margin: var(--space-xl) auto;
  padding: 0 var(--space-lg);
}

/* ---- Einstellungen Layout ---- */
.settings-layout {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}
.settings-main {
  flex: 1;
  min-width: 0;
}

/* ---- Einstellungen Sidebar (rechts) ---- */
.settings-sidebar {
  position: sticky;
  top: var(--space-md);
  flex: 0 0 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-sm);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  max-height: calc(100vh - var(--space-lg) * 2);
  overflow-y: auto;
  scrollbar-width: thin;
}
.settings-sidebar__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: calc(var(--radius) - 2px);
  transition: background 0.15s, color 0.15s;
}
.settings-sidebar__link:hover {
  color: var(--text);
  background: var(--bg-elevated);
}
.settings-sidebar__link--active {
  color: #fff;
  background: var(--accent);
}

/* Mobile: sidebar wird horizontal oben */
@media (max-width: 820px) {
  .settings-layout {
    flex-direction: column-reverse;
  }
  .settings-sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    flex: none;
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--bg);
    border: none;
    border-bottom: 2px solid var(--border);
    border-radius: 0;
    padding: var(--space-xs) 0;
  }
  .settings-sidebar::-webkit-scrollbar { display: none; }
  .settings-sidebar__link {
    padding: var(--space-xs) var(--space-sm);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
  }
  .settings-sidebar__link--active {
    border-color: var(--accent);
  }
}

.page-title {
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: var(--space-lg); line-height: 1.3;
  display: flex; align-items: center; gap: var(--space-sm);
}

/* ---- Section Card ---- */
.section-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border);
}
.section-card__title {
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--accent-strong);
  display: flex; align-items: center; gap: var(--space-sm);
}

/* ---- Formulare ---- */
.form-group { margin-bottom: var(--space-md); }
.form-label {
  display: block; font-size: 0.95rem; font-weight: 600;
  color: var(--text); margin-bottom: var(--space-xs);
}
.form-hint {
  display: block; font-size: 0.85rem; color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}
.form-input {
  width: 100%; padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--input-bg); color: var(--text);
  font-size: 1rem; line-height: 1.5; min-height: 44px;
  transition: border-color 0.15s ease; font-family: inherit;
}
.form-input:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.form-input::placeholder { color: var(--text-secondary); opacity: 0.7; }
select.form-input { appearance: auto; cursor: pointer; }
input[type="color"].form-input { height: 44px; padding: var(--space-xs); cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ---- Checkbox ---- */
.toggle-row {
  display: flex; align-items: center; gap: var(--space-md);
  margin-bottom: var(--space-md); cursor: pointer; min-height: 44px;
}
.toggle-row input[type="checkbox"] {
  appearance: none; width: 24px; height: 24px;
  border: 2px solid var(--border); border-radius: 6px;
  background: var(--input-bg); cursor: pointer; flex-shrink: 0;
  display: grid; place-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.toggle-row input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent);
}
.toggle-row input[type="checkbox"]:checked::after {
  content: "✓"; color: #fff; font-size: 0.85rem; font-weight: 700;
}
.toggle-row input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--focus-ring); outline-offset: 2px;
}
.toggle-label { font-size: 1rem; font-weight: 600; color: var(--text); cursor: pointer; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-sm); padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius); border: 2px solid transparent;
  cursor: pointer; font-size: 1rem; font-weight: 700; font-family: inherit;
  min-height: 44px; min-width: 44px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); font-size: 0.9rem; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-elevated); border-color: var(--text-secondary); }
.btn-group { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-md); }

.btn-icon {
  padding: var(--space-sm); min-width: 44px; min-height: 44px;
  font-size: 1.3rem; line-height: 1; border-radius: var(--radius);
}
.btn-remove {
  background: var(--danger-bg); color: var(--danger);
  border: 2px solid var(--danger); font-weight: 700;
}
.btn-remove:hover { background: var(--danger); color: #fff; }
.btn-add {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-bg); color: var(--accent-strong);
  border: 2px dashed var(--accent); border-radius: var(--radius);
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  min-height: 44px; transition: background 0.15s ease; font-family: inherit;
}
.btn-add:hover { background: var(--accent); color: #fff; border-style: solid; }

/* ---- Kalender-Liste ---- */
.cal-list { list-style: none; }
.cal-item-wrap {
  margin-bottom: var(--space-sm); border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-elevated); overflow: hidden;
}
.cal-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md); min-height: 52px; flex-wrap: wrap; gap: var(--space-sm);
}
.cal-info { display: flex; align-items: center; gap: var(--space-md); }
.cal-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.cal-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.cal-name { font-weight: 700; font-size: 1rem; }
.cal-type {
  font-size: 0.85rem; color: var(--text-secondary);
  background: var(--accent-bg); padding: 2px var(--space-sm); border-radius: 6px;
}

/* ---- Sub-Kalender ---- */
.sub-cal-form, .sub-cal-discover {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border-top: 1px solid var(--border);
}
.sub-cal-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.sub-cal-row {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
}
.sub-cal-row .toggle-row { flex: 1; }

/* ---- Kalender-Legende ---- */
.legend {
  display: flex; flex-wrap: wrap; gap: var(--space-sm);
  margin-bottom: var(--space-lg); padding: var(--space-md);
  background: var(--bg-elevated); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.legend__item {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  font-size: 0.95rem; color: var(--text-secondary); padding: var(--space-xs) var(--space-sm);
}
.legend__dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }

/* ---- Tagesgruppe ---- */
.day-group { margin-bottom: var(--space-2xl); }
.day-group__heading {
  font-size: 1.05rem; font-weight: 700; color: var(--text-secondary);
  letter-spacing: 0.03em; padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border); margin-bottom: var(--space-md);
}

/* ---- Event-Karte ---- */
.event-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-sm); }
.event-card {
  display: flex; align-items: flex-start; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--card); border-radius: var(--radius);
  border-left: 5px solid var(--accent);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  min-height: 56px;
}
.event-card:hover, .event-card:focus-within {
  background: var(--card-hover); box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.event-card__time {
  min-width: 120px; font-size: 1rem; font-weight: 700;
  color: var(--accent-strong); white-space: nowrap; padding-top: 2px;
}
.event-card__body { flex: 1; min-width: 0; }
.event-card__summary { font-weight: 700; font-size: 1.05rem; line-height: 1.4; word-break: break-word; }
.event-card__meta {
  font-size: 0.9rem; color: var(--text-secondary); margin-top: var(--space-xs);
  display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: center;
}
.event-card__calendar { display: inline-flex; align-items: center; gap: var(--space-xs); font-weight: 600; }
.event-card__cal-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.event-card__location { display: inline-flex; align-items: center; gap: var(--space-xs); }

.badge-allday {
  display: inline-block; background: var(--accent-bg); color: var(--accent-strong);
  font-size: 0.8rem; font-weight: 700; padding: 2px var(--space-sm);
  border-radius: 6px; letter-spacing: 0.02em;
}

/* ---- Leerer Zustand ---- */
.empty-state {
  text-align: center; color: var(--text-secondary);
  padding: var(--space-2xl) var(--space-lg); font-size: 1.1rem; line-height: 1.6;
}
.empty-state__icon { font-size: 2.5rem; margin-bottom: var(--space-md); display: block; }

/* ---- Termine-Zähler ---- */
.event-count {
  display: inline-block; background: var(--accent-bg); color: var(--accent-strong);
  font-size: 0.85rem; font-weight: 700; padding: var(--space-xs) var(--space-sm);
  border-radius: 6px; margin-left: var(--space-sm); vertical-align: middle;
}

/* ---- Jetzt-Linie ---- */
.now-line { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) 0; margin: var(--space-sm) 0; }
.now-line__rule { flex: 1; height: 2px; background: var(--danger); border: none; }
.now-line__label {
  font-size: 0.8rem; font-weight: 700; color: var(--danger); white-space: nowrap;
  padding: 2px var(--space-sm); background: var(--danger-bg); border-radius: 6px;
}
.now-line__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }

/* ---- Countdown-Badge ---- */
.countdown {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  font-size: 0.8rem; font-weight: 700; padding: 2px var(--space-sm);
  border-radius: 6px; white-space: nowrap;
}
.countdown--future { background: var(--success-bg); color: var(--success); }
.countdown--now { background: var(--danger-bg); color: var(--danger); }
.countdown--past { background: var(--bg-elevated); color: var(--text-secondary); opacity: 0.7; }

/* ---- Trennlinie ---- */
.divider { border: none; border-top: 2px solid var(--border); margin: var(--space-lg) 0; }

/* ---- Flash Messages ---- */
.flash-messages { margin-bottom: var(--space-md); }
.flash-msg {
  padding: var(--space-sm) var(--space-md); border-radius: var(--radius);
  font-weight: 600; display: flex; align-items: center; gap: var(--space-md);
  margin-bottom: var(--space-xs);
}
.flash-success { background: var(--success); color: #fff; }
.flash-error { background: var(--danger); color: #fff; }
.flash-info { background: var(--primary); color: #fff; }
.flash-close {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 1.2rem; padding: 0; margin-left: auto; opacity: 0.8;
  min-width: 28px; min-height: 28px; display: grid; place-content: center;
}
.flash-close:hover { opacity: 1; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: var(--space-lg); right: var(--space-lg);
  padding: var(--space-md) var(--space-lg); border-radius: var(--radius);
  font-size: 1rem; font-weight: 600; display: none; z-index: 100;
  max-width: 400px; box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  align-items: center; gap: var(--space-md);
}
.toast.ok, .toast.err { display: flex; }
.toast.ok { background: var(--success); color: #fff; }
.toast.err { background: var(--danger); color: #fff; }
.toast__close {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 1.2rem; padding: 0; margin-left: auto; opacity: 0.8;
  min-width: 32px; min-height: 32px; display: grid; place-content: center;
  border-radius: 4px;
}
.toast__close:hover { opacity: 1; background: rgba(255,255,255,0.2); }

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  margin-top: 3rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}
.site-footer a {
  color: var(--accent);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }

/* ---- Hinweisbox ---- */
.info-box {
  background: var(--accent-bg); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: var(--space-md);
  margin-bottom: var(--space-md); font-size: 0.95rem; line-height: 1.5; color: var(--text);
}

/* ---- Zeitfelder mit +/- ---- */
.time-fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-md); margin-bottom: var(--space-lg); }
.time-fieldset legend { padding: 0 var(--space-sm); }
.time-list { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-md); }
.time-row { display: flex; align-items: center; gap: var(--space-sm); }
.time-input { max-width: 160px; margin-bottom: 0 !important; }
.week-day-input { max-width: 200px; margin-bottom: 0 !important; }

/* ---- Notification-Banner ---- */
.notification-banner {
  display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap;
  background: var(--accent-bg); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: var(--space-md);
  margin-bottom: var(--space-lg); font-size: 0.95rem;
  animation: notif-slide-in 0.3s ease-out;
}
.notification-banner span { flex: 1; min-width: 200px; }
@keyframes notif-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================================================================
   TAGESPLAN – Jetzt / Als Nächstes / Später
   =========================================================================== */

/* ---- Quick-Add ---- */
.quick-add {
  margin-bottom: var(--space-lg);
  display: flex; flex-direction: column; gap: var(--space-sm);
}
.quick-add__row {
  display: flex; gap: var(--space-sm); align-items: center;
}
.quick-add__input {
  flex: 1; padding: var(--space-md);
  border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--input-bg); color: var(--text);
  font-size: 1.05rem; font-family: inherit; min-height: 52px;
}
.quick-add__input:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.quick-add__input::placeholder { color: var(--text-secondary); opacity: 0.7; }

/* Action Buttons (Play + Schedule) */
.quick-add__btn {
  flex-shrink: 0; width: 52px; height: 52px;
  border-radius: 50%; border: 2px solid var(--border);
  background: var(--bg-elevated); color: var(--text-secondary);
  font-size: 1.4rem; cursor: pointer;
  display: inline-grid; place-content: center;
  transition: all 0.2s;
}
.quick-add__btn:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.08); }
.quick-add__btn--play { color: var(--success); border-color: var(--success); }
.quick-add__btn--play:hover {
  background: var(--success); color: #fff;
  box-shadow: 0 0 12px color-mix(in srgb, var(--success) 40%, transparent);
}
.quick-add__btn--schedule { font-size: 1.3rem; }
.quick-add__btn--active,
.quick-add__btn--schedule:hover {
  border-color: var(--accent); color: var(--accent);
}
.quick-add__btn--active {
  background: var(--accent-bg);
}

/* Schedule Panel */
.quick-add__schedule {
  display: none; flex-direction: column; gap: var(--space-md);
  background: var(--bg-elevated); border: 2px solid var(--accent);
  border-radius: var(--radius); padding: var(--space-lg);
  animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.quick-add__schedule-fields {
  display: flex; gap: var(--space-md); flex-wrap: wrap;
}
.quick-add__field {
  display: flex; flex-direction: column; gap: var(--space-xs); flex: 1; min-width: 140px;
}
.quick-add__field-label {
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quick-add__date, .quick-add__time, .quick-add__duration {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--input-bg); color: var(--text);
  font-family: inherit; font-size: 0.95rem; min-height: 44px; width: 100%;
}
.quick-add__date:focus, .quick-add__time:focus, .quick-add__duration:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.quick-add__duration-wrap {
  display: flex; align-items: center; gap: var(--space-xs);
}
.quick-add__duration-label {
  color: var(--text-secondary); font-size: 0.9rem;
}
.quick-add__btn--confirm {
  align-self: flex-end; min-width: 200px;
}

/* ---- Timer Quick-Action Buttons ---- */
.timer-quick-actions {
  display: flex; gap: var(--space-sm); margin-bottom: var(--space-lg); flex-wrap: wrap;
}
.timer-quick-btn {
  flex: 1; min-width: 100px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--bg-elevated); color: var(--text);
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.timer-quick-btn:hover { transform: scale(1.04); }
.timer-quick-btn__icon { font-size: 1.6rem; line-height: 1; }
.timer-quick-btn__label { font-size: 0.8rem; font-weight: 600; }
.timer-quick-btn__duration { font-size: 0.75rem; color: var(--text-secondary); }

.timer-quick-btn--pomodoro { border-color: #e74c3c; }
.timer-quick-btn--pomodoro:hover { background: #e74c3c; color: #fff; box-shadow: 0 0 12px rgba(231,76,60,.35); }
.timer-quick-btn--coffee { border-color: #8b5e3c; }
.timer-quick-btn--coffee:hover { background: #8b5e3c; color: #fff; box-shadow: 0 0 12px rgba(139,94,60,.35); }
.timer-quick-btn--meal { border-color: #27ae60; }
.timer-quick-btn--meal:hover { background: #27ae60; color: #fff; box-shadow: 0 0 12px rgba(39,174,96,.35); }

/* ---- Routine Cards ---- */
.zone__title--routine { color: var(--accent); }

.routine-card {
  background: var(--bg-elevated); border-radius: var(--radius);
  padding: var(--space-md); transition: background 0.2s;
}
.routine-card__header {
  display: flex; align-items: center; gap: var(--space-sm);
}
.routine-card__icon { font-size: 1.5rem; flex-shrink: 0; }
.routine-card__info { flex: 1; min-width: 0; }
.routine-card__title { display: block; font-size: 1rem; }
.routine-card__time {
  font-size: 0.8rem; color: var(--text-secondary);
}
.routine-card__meta {
  display: flex; gap: var(--space-xs); flex-shrink: 0;
}
.badge--steps, .badge--duration {
  font-size: 0.75rem; padding: 2px 8px; border-radius: 99px;
  background: var(--accent-bg); color: var(--accent);
}

.routine-steps-list {
  list-style: none; padding: 0; margin: var(--space-sm) 0 0 0;
  display: flex; flex-direction: column; gap: 4px;
}
.routine-step {
  display: flex; align-items: center;
  padding: 4px var(--space-sm); border-radius: 6px;
  transition: background 0.15s;
}
.routine-step:hover { background: var(--card-hover); }
.routine-step--done { opacity: 0.55; }
.routine-step__label {
  display: flex; align-items: center; gap: var(--space-sm);
  cursor: pointer; flex: 1; font-size: 0.9rem;
}
.routine-step__check {
  width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer;
}
.routine-step__title {
  flex: 1;
}
.routine-step--done .routine-step__title { text-decoration: line-through; }
.routine-step__duration {
  font-size: 0.75rem; color: var(--text-secondary); flex-shrink: 0;
}

/* Routine Start Button */
.btn-routine-start {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--success); background: transparent;
  color: var(--success); font-size: 1rem; cursor: pointer;
  display: inline-grid; place-content: center;
  transition: all 0.2s;
}
.btn-routine-start:hover {
  background: var(--success); color: #fff;
  box-shadow: 0 0 10px color-mix(in srgb, var(--success) 40%, transparent);
}

/* Status Badges */
.badge--active {
  font-size: 0.7rem; padding: 2px 8px; border-radius: 99px;
  background: var(--success); color: #fff; font-weight: 600;
  animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.badge--done {
  font-size: 0.85rem; padding: 2px 8px; border-radius: 99px;
  background: var(--accent-bg); color: var(--accent);
}

/* Current Step Highlight */
.routine-step--current {
  background: var(--accent-bg); border-radius: 6px;
  border-left: 3px solid var(--accent);
  padding-left: calc(var(--space-sm) + 3px) !important;
}
.routine-step--current .routine-step__title { font-weight: 600; }

/* Active Routine Card */
.timeline-item--routine.timeline-item--active {
  border-left-color: var(--success) !important;
  box-shadow: 0 0 0 2px var(--success), 0 2px 12px rgba(91, 189, 138, 0.2);
  animation: pulse-routine 2s ease-in-out infinite;
}
.timeline-item--routine.timeline-item--active .routine-card {
  border-left-color: var(--success) !important;
}
.timeline-item--routine.timeline-item--active .routine-card__icon {
  animation: icon-pulse 2s ease-in-out infinite;
  display: inline-block;
}
@keyframes pulse-routine {
  0%, 100% { box-shadow: 0 0 0 2px var(--success), 0 2px 8px rgba(91, 189, 138, 0.1); }
  50% { box-shadow: 0 0 0 3px var(--success), 0 2px 16px rgba(91, 189, 138, 0.35); }
}

/* Done Routine Card */
.timeline-item--routine.timeline-item--done {
  opacity: 0.6;
}
.timeline-item--routine.timeline-item--done .routine-card__title {
  text-decoration: line-through;
  color: var(--text-secondary);
}

/* Collapsed steps (before start) */
.routine-steps-list--collapsed {
  max-height: 0; overflow: hidden; margin: 0;
  transition: max-height 0.3s ease-out;
}

/* Progress Bar */
.routine-progress {
  margin: var(--space-xs) 0 0 0;
}
.routine-progress__bar {
  height: 4px; border-radius: 2px;
  background: var(--border); overflow: hidden;
}
.routine-progress__bar--daily {
  height: 6px; border-radius: 3px;
}
.routine-progress__fill {
  height: 100%; border-radius: inherit;
  background: var(--accent);
  transition: width 0.4s ease;
  min-width: 0;
}
.routine-progress__fill--done {
  background: var(--success);
}

/* Daily Progress Summary */
.routine-daily-progress {
  padding: var(--space-xs) var(--space-md) var(--space-sm);
}
.routine-daily-progress__info {
  display: flex; justify-content: space-between;
  font-size: 0.8rem; color: var(--text-secondary);
  margin-bottom: 4px;
}
.routine-daily-progress__pct {
  font-weight: 600; color: var(--accent);
}

.timeline-item--routine.timeline-item--done .routine-card {
  opacity: 0.5;
}

/* ---- Play Button (active routine) ---- */
.btn-routine-play {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--accent); background: transparent;
  color: var(--accent); font-size: 1rem; cursor: pointer;
  display: grid; place-content: center;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-routine-play:hover {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* ---- Routine Step-Through Overlay ---- */
.routine-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.routine-overlay__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.routine-overlay__panel {
  position: relative; z-index: 1;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg, 16px);
  width: 92vw; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: flex; flex-direction: column;
}
.routine-overlay__header {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.routine-overlay__icon { font-size: 1.8rem; }
.routine-overlay__title {
  flex: 1; margin: 0; font-size: 1.2rem; font-weight: 700;
}
.routine-overlay__close {
  background: none; border: none; color: var(--text-secondary);
  font-size: 1.3rem; cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius);
}
.routine-overlay__close:hover { color: var(--text); background: var(--bg-hover); }
.routine-overlay__progress {
  padding: var(--space-sm) var(--space-lg);
}
.routine-overlay__progress-text {
  display: block; font-size: 0.8rem; color: var(--text-secondary);
  margin-bottom: 4px;
}
.routine-overlay__step {
  padding: var(--space-lg) var(--space-lg);
  text-align: center;
  min-height: 140px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-sm);
  transition: background 0.3s;
}
.routine-overlay__step--complete {
  background: color-mix(in srgb, var(--success) 10%, transparent);
}
.routine-overlay__step-number {
  font-size: 0.8rem; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.routine-overlay__step-title {
  font-size: 1.5rem; font-weight: 700; margin: 0;
  line-height: 1.3;
}
.routine-overlay__step-duration {
  font-size: 0.9rem; color: var(--text-secondary);
}
.routine-overlay__steps-list {
  padding: 0 var(--space-lg) var(--space-sm);
  display: flex; flex-direction: column; gap: 2px;
  max-height: 160px; overflow-y: auto;
}
.routine-overlay__mini-step {
  display: block; width: 100%; text-align: left;
  padding: 6px 10px; border-radius: var(--radius);
  border: none; background: transparent;
  color: var(--text-secondary); font-size: 0.85rem;
  cursor: pointer; transition: background 0.15s;
}
.routine-overlay__mini-step:hover { background: var(--bg-hover); }
.routine-overlay__mini-step--current {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--text); font-weight: 600;
  border-left: 3px solid var(--accent);
}
.routine-overlay__mini-step--done {
  text-decoration: line-through; opacity: 0.5;
}
.routine-overlay__nav {
  display: flex; gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
}
.routine-overlay__nav .btn { flex: 1; }
.routine-overlay__check-btn { font-size: 1rem; padding: 10px; }

/* ---- Timer Ring (Overlay) ---- */
.routine-overlay__timer-ring {
  position: relative;
  width: 120px; height: 120px;
  margin: var(--space-sm) auto;
}
.routine-overlay__timer-svg {
  width: 100%; height: 100%;
}
.routine-overlay__timer-svg circle:first-child {
  opacity: 0.2;
}
.routine-overlay__timer-svg circle:last-child {
  transition: stroke-dashoffset 1s linear;
}
.routine-overlay__timer-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.routine-overlay__notify-indicator {
  font-size: 0.8rem; color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 10px; border-radius: 99px;
}
.routine-overlay__total-timer {
  display: flex; align-items: center; gap: var(--space-xs);
  justify-content: center;
  margin-top: var(--space-xs);
  font-size: 0.85rem; color: var(--text-secondary);
}
.routine-overlay__total-time {
  font-weight: 700; font-size: 1.1rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---- Inline Timer on Card ---- */
.routine-card__timer {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  margin-top: var(--space-xs);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: var(--radius);
  font-size: 0.85rem;
  animation: pulse-timer 2s ease-in-out infinite;
}
.routine-card__timer-counter {
  font-weight: 700; color: var(--accent);
  font-size: 0.75rem;
  background: var(--accent-bg);
  padding: 1px 6px; border-radius: 99px;
}
.routine-card__timer-step {
  flex: 1; font-weight: 600; color: var(--text);
}
.routine-card__timer-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--accent);
  font-size: 1rem;
}
.routine-card__timer-total {
  font-size: 0.75rem; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ---- Notify Bot Badge in Editor ---- */
.routine-step-edit__notify {
  display: inline-flex; align-items: center; gap: 2px;
  cursor: pointer; font-size: 1rem; flex-shrink: 0;
}

/* ---- Routine Editor (Verwaltungsseite) ---- */
.routine-editor { margin-bottom: var(--space-md); }
.routine-editor__header {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md); border-radius: var(--radius);
}
.routine-editor__icon { font-size: 1.5rem; }
.routine-editor__info { flex: 1; min-width: 0; }
.routine-editor__info strong { display: block; }
.routine-editor__actions { display: flex; gap: var(--space-xs); }
.routine-editor__edit {
  padding: var(--space-md); border-top: 1px solid var(--border);
}
.routine-editor__steps {
  padding: var(--space-md); border-top: 1px solid var(--border);
}
.routine-editor__steps-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; margin-bottom: var(--space-sm);
}

.routine-steps-edit-list {
  list-style: none; padding: 0; margin: 0 0 var(--space-sm);
  display: flex; flex-direction: column; gap: 4px;
}
.routine-step-edit {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: 4px var(--space-sm); border-radius: 6px;
  background: var(--card);
}
.routine-step-edit__handle {
  cursor: grab; color: var(--text-secondary); font-size: 1.1rem;
  user-select: none; padding: 0 4px;
}
.routine-step-edit__title { flex: 1; }

.routine-step-add {
  display: flex; gap: var(--space-xs); align-items: center;
}
.routine-step-add__input { flex: 1; }

/* Weekday Picker */
.weekday-picker {
  display: flex; gap: var(--space-xs); flex-wrap: wrap;
}
.weekday-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 99px;
  border: 2px solid var(--border); background: var(--bg-elevated);
  cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
}
.weekday-chip:has(input:checked) {
  border-color: var(--accent); background: var(--accent-bg); color: var(--accent);
}
.weekday-chip input { display: none; }

/* Routine Form */
.routine-form { display: flex; flex-direction: column; gap: var(--space-md); }

/* Icon Picker */
.icon-picker-wrap { position: relative; }
.icon-picker-btn { width: 100%; }
.icon-picker-dropdown {
  position: absolute; top: 100%; left: 0; z-index: 100;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  padding: var(--space-sm); min-width: 300px; max-width: 360px;
  max-height: 400px; overflow-y: auto;
}
.icon-picker__search-wrap {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-elevated);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-xs);
}
.icon-picker__search {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--input-bg); color: var(--text);
  font-size: 0.85rem; outline: none;
}
.icon-picker__search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.icon-picker__no-results {
  text-align: center; padding: var(--space-md);
  color: var(--text-secondary); font-size: 0.85rem;
}
.icon-picker__group { margin-bottom: var(--space-xs); }
.icon-picker__label {
  font-size: 0.7rem; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  display: block; margin-bottom: 2px;
}
.icon-picker__icons {
  display: flex; flex-wrap: wrap; gap: 2px;
}
.icon-picker__item {
  width: 36px; height: 36px; display: inline-grid;
  place-content: center; font-size: 1.2rem;
  border: none; background: transparent; border-radius: 6px;
  cursor: pointer; transition: background 0.15s;
}
.icon-picker__item:hover {
  background: var(--accent-bg);
}

/* Focus-Button – groß & präsent */
.btn-focus {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-grid; place-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s,
              transform 0.2s, box-shadow 0.2s;
}
.btn-focus:hover {
  background: var(--accent-bg); border-color: var(--accent);
  color: var(--accent); transform: scale(1.1);
}
.btn-focus--active {
  background: var(--accent); border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 40%, transparent);
  animation: focus-pulse 2s ease-in-out infinite;
}
@keyframes focus-pulse {
  0%, 100% { box-shadow: 0 0 6px var(--accent); }
  50% { box-shadow: 0 0 10px var(--accent); }
}

/* ---- Timeline-Zone ---- */
.zone { margin-bottom: var(--space-xl); }
.zone__header {
  display: flex; align-items: center; gap: var(--space-sm);
  margin-bottom: var(--space-md); padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border);
}
.zone__header--clickable {
  cursor: pointer; list-style: none; user-select: none;
}
.zone__header--clickable::-webkit-details-marker { display: none; }
.zone__header--clickable::marker { content: ''; }
.zone__header--clickable::after {
  content: '▶'; font-size: 0.8rem; color: var(--text-secondary);
  margin-left: auto; transition: transform 0.2s ease;
}
details[open] > .zone__header--clickable::after { transform: rotate(90deg); }
details > .timeline-list { margin-top: var(--space-md); }
.zone--done { margin-bottom: var(--space-xl); }
.zone--done > .zone__header::after {
  content: '▶'; font-size: 0.8rem; color: var(--text-secondary);
  margin-left: auto; transition: transform 0.2s ease;
}
.zone--done[open] > .zone__header::after { transform: rotate(90deg); }
.zone--done > .timeline-list { margin-top: var(--space-md); }
.zone__title {
  font-size: 1.1rem; font-weight: 700; color: var(--text-secondary);
}
.zone__title--now { color: var(--danger); position: relative; padding-left: var(--space-md); }
.zone__title--now::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--danger); border-radius: 2px;
}
.zone__title--next { color: var(--accent-strong); }
.zone__title--done { color: var(--success); }
.zone__count {
  font-size: 0.8rem; font-weight: 700; padding: 2px var(--space-sm);
  border-radius: 6px; background: var(--accent-bg); color: var(--accent-strong);
}

/* ---- Timeline-Item (gemeinsam für Termine & Todos) ---- */
.timeline-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-sm); }

.timeline-item {
  display: flex; align-items: flex-start; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--card); border-radius: var(--radius);
  border-left: 5px solid var(--accent);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  min-height: 56px; position: relative;
}
.timeline-item:hover, .timeline-item:focus-within {
  background: var(--card-hover); box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.timeline-item--todo { border-left-color: var(--success); }
.timeline-item--active {
  border-left-color: var(--danger) !important;
  box-shadow: 0 0 0 2px var(--danger), 0 2px 12px rgba(220,38,38,0.2);
  animation: pulse-border 2s ease-in-out infinite;
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 2px var(--danger), 0 2px 8px rgba(220,38,38,0.1); }
  50% { box-shadow: 0 0 0 2px var(--danger), 0 2px 12px rgba(220,38,38,0.2); }
}

/* ---- Typ-Icons ---- */
.type-icon {
  flex-shrink: 0; width: 36px; height: 36px;
  display: grid; place-content: center;
  border-radius: 50%; font-size: 1.1rem;
  margin-top: 2px;
}
.type-icon--event {
  background: var(--accent-bg); border: 2px solid var(--accent);
}
.timeline-item--event { border-left-color: var(--accent); }
.timeline-item--active .type-icon--event {
  background: var(--danger); border-color: var(--danger);
  animation: icon-pulse 2s ease-in-out infinite;
}

/* ---- Status-Badges ---- */
.badge--live {
  background: var(--danger); color: #fff;
  font-weight: 700; font-size: 0.75rem;
  padding: 2px 10px; border-radius: 99px;
  animation: badge-pulse 1.5s ease-in-out infinite;
  white-space: nowrap;
}
.badge--soon {
  background: var(--warning, #f59e0b); color: #fff;
  font-weight: 700; font-size: 0.75rem;
  padding: 2px 10px; border-radius: 99px;
  white-space: nowrap;
  animation: badge-glow-soon 2s ease-in-out infinite;
}
.badge--overdue {
  background: var(--danger-bg, #fef2f2); color: var(--danger);
  font-weight: 700; font-size: 0.75rem;
  padding: 2px 10px; border-radius: 99px;
  border: 1px solid var(--danger);
  white-space: nowrap;
}
.badge--active {
  background: var(--success); color: #fff;
  font-weight: 700; font-size: 0.75rem;
  padding: 2px 10px; border-radius: 99px;
  animation: badge-pulse 1.5s ease-in-out infinite;
  white-space: nowrap;
}

.timeline-item--overdue {
  border-left-color: var(--danger) !important;
}
.timeline-item--overdue .timeline-item__time {
  color: var(--danger);
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}
@keyframes badge-glow-soon {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 8px 2px rgba(245, 158, 11, 0.3); }
}
@keyframes icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.timeline-item--done {
  opacity: 0.55;
  border-left-color: var(--success) !important;
  background: var(--success-bg);
}
.timeline-item--done .timeline-item__summary {
  text-decoration: line-through;
  color: var(--text-secondary);
}
.timeline-item--hiding {
  transition: opacity 0.4s ease, max-height 0.5s ease 0.2s, margin 0.5s ease 0.2s, padding 0.5s ease 0.2s;
  opacity: 0;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  pointer-events: none;
}

.timeline-item__time {
  min-width: 80px; font-size: 0.95rem; font-weight: 700;
  color: var(--accent-strong); white-space: nowrap; padding-top: 2px;
}
.timeline-item__body { flex: 1; min-width: 0; }
.timeline-item__summary { font-weight: 700; font-size: 1rem; line-height: 1.4; word-break: break-word; }
.timeline-item__meta {
  font-size: 0.85rem; color: var(--text-secondary); margin-top: var(--space-xs);
  display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center;
}

/* ---- Todo-Checkbox auf der Timeline ---- */
.todo-check {
  appearance: none; width: 28px; height: 28px;
  border: 2px solid var(--success); border-radius: 50%;
  background: transparent; cursor: pointer; flex-shrink: 0;
  display: grid; place-content: center;
  transition: background 0.15s ease;
  margin-top: 2px;
}
.todo-check:checked {
  background: var(--success); border-color: var(--success);
  transform: scale(1.15);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}
.todo-check:checked::after { content: "✓"; color: #fff; font-size: 0.9rem; font-weight: 700; }
.todo-check:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* ---- Mikroschritte ---- */
.steps { margin-top: var(--space-sm); padding-left: var(--space-sm); }
.steps__list { list-style: none; display: flex; flex-direction: column; gap: var(--space-xs); }
.steps--nested { margin-top: var(--space-xs); padding-left: var(--space-lg); }
.step {
  display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
  font-size: 0.9rem; color: var(--text-secondary); min-height: 36px;
}
.step[data-depth="1"] { padding-left: var(--space-lg); }
.step[data-depth="2"] { padding-left: calc(var(--space-lg) * 2); }
.step[data-depth="3"] { padding-left: calc(var(--space-lg) * 3); }
.step__check {
  appearance: none; width: 20px; height: 20px;
  border: 2px solid var(--border); border-radius: 4px;
  background: var(--input-bg); cursor: pointer; flex-shrink: 0;
  display: grid; place-content: center;
}
.step__check:checked { background: var(--success); border-color: var(--success); }
.step__check:checked::after { content: "✓"; color: #fff; font-size: 0.7rem; font-weight: 700; }
.step__text--done { text-decoration: line-through; opacity: 0.6; }
.step__add-sub, .step__delete {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; padding: var(--space-xs); border-radius: 6px;
  color: var(--text-secondary); opacity: 0.4; transition: opacity 0.15s, background 0.15s;
  min-width: 32px; min-height: 32px; display: grid; place-content: center;
}
.step:hover .step__add-sub,
.step:hover .step__delete,
.step__add-sub:focus-visible,
.step__delete:focus-visible { opacity: 1; }
.step__add-sub:hover { color: var(--accent); background: var(--accent-bg); }
.step__delete:hover { color: var(--danger); background: var(--danger-bg); }
.step__children-container { width: 100%; }

.steps__add {
  display: flex; gap: var(--space-sm); margin-top: var(--space-sm);
}
.steps__add-input {
  flex: 1; padding: var(--space-xs) var(--space-sm);
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--input-bg); color: var(--text);
  font-size: 0.85rem; font-family: inherit; min-height: 32px;
}

/* ---- Fortschrittsbalken ---- */
.progress-bar {
  position: relative;
  height: 20px; background: var(--border); border-radius: 10px;
  margin-top: var(--space-sm); overflow: hidden;
}
.progress-bar__fill {
  height: 100%; background: var(--success); border-radius: 10px;
  transition: width 0.3s ease;
}
.progress-bar__label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600;
  color: var(--text); mix-blend-mode: difference;
  pointer-events: none; white-space: nowrap;
}

/* ---- Zeitbalken (Video-Player-Stil) ---- */
.time-bar {
  position: relative; height: 6px; background: var(--border); border-radius: 3px;
  margin-bottom: var(--space-sm); overflow: visible; cursor: default;
}
.time-bar__fill {
  height: 100%; background: var(--accent); border-radius: 3px;
  transition: width 1s linear; width: 0%;
}
.time-bar__label {
  font-size: 0.7rem; color: var(--text-secondary);
  margin-top: 4px; text-align: right;
}

/* ---- Vergangene Termine ---- */
.timeline-item--past { opacity: 0.5; }
.timeline-item--past .timeline-item__summary { text-decoration: line-through; }
.past-check {
  width: 28px; height: 28px; display: grid; place-content: center;
  border-radius: 50%; background: var(--success); color: #fff;
  font-size: 0.9rem; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}

/* ---- Dauer-Badge ---- */
.duration-badge {
  font-size: 0.8rem; color: var(--text-secondary);
  background: var(--bg-elevated); padding: 2px var(--space-sm);
  border-radius: 6px;
}
.step__duration {
  font-size: 0.75rem; color: var(--text-secondary);
  background: var(--bg-elevated); padding: 1px 6px;
  border-radius: 4px; white-space: nowrap;
}
.edit-form__duration { max-width: 120px; }

/* ---- Aktions-Buttons (tiny) ---- */
.timeline-item__actions {
  display: flex; gap: var(--space-xs); margin-top: var(--space-sm);
  opacity: 0.5; transition: opacity 0.15s;
}
.timeline-item:hover .timeline-item__actions,
.timeline-item:focus-within .timeline-item__actions { opacity: 1; }
.btn-tiny {
  background: none; border: 1px solid transparent; cursor: pointer;
  font-size: 0.85rem; padding: 2px 6px; border-radius: 6px;
  color: var(--text-secondary); min-width: 32px; min-height: 32px;
  display: inline-grid; place-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.btn-tiny:hover { background: var(--bg-elevated); border-color: var(--border); }
.btn-edit:hover { color: var(--accent); }

.btn-delete-todo:hover { color: var(--danger); }

/* ---- Description ---- */
.timeline-item__description {
  font-size: 0.85rem; color: var(--text-secondary); margin-top: var(--space-xs);
  line-height: 1.4;
}

/* ---- Inline Edit Form ---- */
.edit-form { display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-sm) 0; }
.edit-form__row { display: flex; gap: var(--space-sm); }
.edit-form__row--two { display: grid; grid-template-columns: auto 1fr; gap: var(--space-sm); }
.edit-form__row--three { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-sm); }
.edit-form__title { font-size: 1rem; font-weight: 700; }
.edit-form__date { max-width: 160px; }
.edit-form__time { max-width: 140px; }
.edit-form__actions { display: flex; gap: var(--space-sm); }
.btn-sm { padding: var(--space-xs) var(--space-md); font-size: 0.85rem; min-height: 36px; }

/* ---- Tageszusammenfassung ---- */
.summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.summary-card__greeting {
  font-size: 1.1rem; font-weight: 700; margin: 0 0 var(--space-sm) 0;
  color: var(--text-primary);
}
.summary-card__weather { margin-top: var(--space-sm); }
.summary-card__weather-text {
  font-family: 'Atkinson Hyperlegible', monospace;
  font-size: 0.8rem; line-height: 1.3;
  white-space: pre-wrap; word-break: break-word;
  margin: 0; padding: var(--space-sm);
  background: var(--background); border-radius: var(--radius-md);
  overflow-x: auto;
}

/* ---- Losgehzeit-Karte ---- */
.departure-card {
  display: flex; align-items: center; gap: var(--space-md);
  background: var(--surface); border: 2px solid #e67e22;
  border-radius: var(--radius-lg); padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.departure-card--free {
  border-color: var(--accent);
}
.departure-card__icon {
  font-size: 2rem; margin: 0; flex-shrink: 0;
}
.departure-card__content {
  flex: 1; min-width: 0;
}
.departure-card__time {
  font-size: 1.15rem; font-weight: 700; margin: 0;
  color: var(--text-primary);
}
.departure-card__detail {
  font-size: 0.9rem; margin: var(--space-xs) 0 0 0;
  color: var(--text-secondary);
}

/* ---- Weckzeit-Karte ---- */
.wakeup-card {
  background: var(--surface); border: 2px solid #9b59b6;
  border-radius: var(--radius-lg); padding: 0;
  margin-bottom: var(--space-lg);
  cursor: pointer;
}
.wakeup-card[open] {
  cursor: default;
}
.wakeup-card__header {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-lg);
  list-style: none;
  flex-wrap: wrap;
}
.wakeup-card__header::-webkit-details-marker { display: none; }
.wakeup-card__header::marker { content: ""; }
.wakeup-card__icon {
  font-size: 2rem; flex-shrink: 0;
}
.wakeup-card__time {
  font-size: 1.15rem; font-weight: 700;
  color: var(--text-primary);
}
.wakeup-card__detail {
  font-size: 0.9rem;
  color: var(--text-secondary);
  width: 100%;
}
.wakeup-card__breakdown {
  padding: 0 var(--space-lg) var(--space-lg);
  border-top: 1px solid var(--border);
}
.wakeup-card__breakdown-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: var(--space-md) 0 var(--space-sm);
}
.wakeup-card__components {
  list-style: none;
  padding: 0; margin: 0;
}
.wakeup-card__component {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-xs) 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.wakeup-card__component:last-child { border-bottom: none; }
.wakeup-card__component-label {
  color: var(--text-primary);
}
.wakeup-card__component-value {
  color: var(--text-secondary);
  font-family: var(--font-mono, monospace);
  font-weight: 600;
}
.wakeup-card__result {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(155, 89, 182, 0.1);
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  color: #9b59b6;
  font-weight: 700;
}


/* ---- Drag Handle ---- */
.drag-handle {
  cursor: grab; color: var(--text-secondary); opacity: 0.4;
  font-size: 1.2rem; padding: var(--space-xs); user-select: none;
}
.drag-handle:hover { opacity: 0.8; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .site-nav { padding: var(--space-sm) var(--space-md); }
  .main-content { margin: var(--space-md) auto; padding: 0 var(--space-md); }
  .section-card { padding: var(--space-md); }
  .event-card, .timeline-item {
    flex-direction: column; gap: var(--space-xs); padding: var(--space-md);
  }
  .event-card__time, .timeline-item__time { min-width: unset; }
  .quick-add__schedule-fields { flex-direction: column; }
  .quick-add__btn--confirm { align-self: stretch; }
}

/* ---- Page Header mit Bon-Button ---- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md);
}

/* ---- Bon-Drucker Button ---- */
.btn-bon {
  background: var(--bg-elevated); border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  font-size: 1.5rem; padding: var(--space-sm) var(--space-md);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: inline-grid; place-content: center;
  min-width: 48px; min-height: 48px;
}
.btn-bon:hover {
  background: var(--accent-bg); border-color: var(--accent);
  transform: scale(1.05);
}
.btn-bon:active { transform: scale(0.95); }
.btn-bon--loading {
  opacity: 0.6; pointer-events: none;
}

/* ---- KI-Assistent ---- */
.btn-ai-assist {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; padding: 2px 4px; border-radius: 4px;
  transition: background 0.15s;
}
.btn-ai-assist:hover { background: var(--accent-bg); }

.ai-popup {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: ai-fade-in 0.2s ease;
}
@keyframes ai-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.ai-popup__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-sm); font-weight: 600;
}
.ai-popup__close {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: var(--text-secondary);
  padding: 0 4px;
}
.ai-popup__body { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.ai-popup__body .btn-sm { font-size: 0.85rem; padding: 4px 10px; }
.ai-popup__result { width: 100%; margin-top: var(--space-sm); }

.ai-estimate strong { color: var(--accent); }
.ai-estimate p { margin: 4px 0 8px; font-size: 0.85rem; color: var(--text-secondary); }

.ai-error { color: var(--danger, #e74c3c); font-size: 0.85rem; }

.ai-steps-suggest ul { list-style: none; padding: 0; margin: var(--space-xs) 0; }
.ai-steps-suggest li { padding: 4px 0; font-size: 0.9rem; }
.ai-steps-suggest .step__duration { color: var(--text-secondary); font-size: 0.8rem; }
.ai-step-item { display: flex; align-items: center; gap: 4px; }
.ai-step-title { flex: 1; font-size: 0.85rem; padding: 2px 6px; min-width: 0; }
.ai-step-dur { width: 56px; font-size: 0.85rem; padding: 2px 4px; text-align: center; }

.ai-step-list { list-style: none; padding: 0; margin: var(--space-xs) 0; }
.ai-step-list li { padding: 4px 0; font-size: 0.9rem; }
.ai-step-list small { color: var(--text-secondary); }

.ai-routine-result { margin-top: var(--space-sm); padding: var(--space-sm); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); }
.ai-routine-suggest { cursor: pointer; font-size: 1rem; }

/* ---- Zeitansage / Sprechende Uhr ---- */
.zeitansage-clock-card { text-align: center; }
.zeitansage-clock {
  padding: var(--space-lg) 0;
}
.clock__time {
  display: block;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  color: var(--accent);
  line-height: 1.1;
}
.clock__date {
  display: block;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}
.zeitansage-controls {
  display: flex; justify-content: center; gap: var(--space-sm);
  padding-bottom: var(--space-sm);
}

/* Preset-Chips */
.zeitansage-presets {
  display: flex; flex-wrap: wrap; gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.preset-chip {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}
.preset-chip:hover { border-color: var(--accent); }
.preset-chip[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.zeitansage-options {
  display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: flex-end;
  margin-top: var(--space-sm);
}

/* Wecker-Liste */
.alarm-list { list-style: none; padding: 0; margin: var(--space-md) 0 0; }
.alarm-item {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-xs);
  transition: all 0.2s;
}
.alarm-item--disabled { opacity: 0.5; }
.alarm-item--ringing {
  animation: alarm-ring 0.3s ease infinite alternate;
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
@keyframes alarm-ring {
  from { transform: translateX(-2px); }
  to { transform: translateX(2px); }
}
.alarm-item__time {
  font-size: 1.4rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 5ch;
  color: var(--accent);
}
.alarm-item__label { flex: 1; font-size: 0.95rem; }
.alarm-item__days { font-size: 0.8rem; color: var(--text-secondary); min-width: 8ch; }
.alarm-item__actions { display: flex; align-items: center; gap: var(--space-xs); }

/* Toggle-Schalter */
.alarm-toggle {
  position: relative; display: inline-block; width: 44px; height: 24px;
}
.alarm-toggle input { opacity: 0; width: 0; height: 0; }
.alarm-toggle__slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 24px;
  transition: 0.2s;
}
.alarm-toggle__slider::before {
  content: ''; position: absolute;
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: 0.2s;
}
.alarm-toggle input:checked + .alarm-toggle__slider { background: var(--accent); }
.alarm-toggle input:checked + .alarm-toggle__slider::before { transform: translateX(20px); }

.alarm-create { margin-bottom: var(--space-md); }

/* ---- Theme-Auswahl (Einstellungen) ---- */
.theme-choices {
  display: flex; gap: var(--space-md); flex-wrap: wrap;
  border: none; padding: 0; margin: var(--space-sm) 0 0;
}
.theme-choice {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-sm);
  cursor: pointer;
  padding: var(--space-sm);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 100px;
}
.theme-choice:hover { border-color: var(--accent); }
.theme-choice--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.theme-choice__preview {
  width: 72px; height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
}
.theme-choice__preview--dark { background: #1a1a2e; }
.theme-choice__preview--light { background: #f5f3fa; }
.theme-choice__preview--auto { display: flex; }
.theme-half { flex: 1; }
.theme-half--dark { background: #1a1a2e; }
.theme-half--light { background: #f5f3fa; }
.theme-choice__label {
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary);
}
.theme-choice--active .theme-choice__label { color: var(--accent); }

/* ---- Screenreader-only ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---- Verbesserter Fokus für Tastaturnutzer ---- */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Standard-Fokus ausblenden, nur :focus-visible zeigen */
:focus:not(:focus-visible) {
  outline: none;
}
/* Focus innerhalb von Karten-Elementen deutlicher markieren */
.section-card :focus-visible,
.timeline-item :focus-visible {
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-bg);
}

/* ---- Hoher Kontrast (Windows/System) ---- */
@media (forced-colors: active) {
  :root {
    --focus-ring: Highlight;
    --accent: LinkText;
  }
  .btn, .btn-primary, .btn-outline, .btn-danger {
    border: 2px solid ButtonText !important;
  }
  .theme-choice__preview,
  .theme-choice__preview--dark,
  .theme-choice__preview--light,
  .theme-half--dark,
  .theme-half--light {
    forced-color-adjust: none;
  }
}

/* ---- Braillezeile: Emojis als Text ausblenden, nur Semantik ---- */
@media (prefers-contrast: more) {
  :root {
    --accent-bg: rgba(108, 92, 231, 0.2);
    --success-bg: rgba(46, 158, 99, 0.2);
    --danger-bg: rgba(212, 68, 68, 0.2);
  }
}

/* ==========================================================================
   Detail-Karten & Formulare
   ========================================================================== */

/* ---- Brotkrumen ---- */
.breadcrumb {
  margin-bottom: var(--space-md);
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.breadcrumb a:hover { text-decoration: underline; }

/* ---- Detail-Karte ---- */
.detail-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.detail-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.detail-card__check { flex-shrink: 0; }
.detail-card__title {
  flex: 1;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  word-break: break-word;
}
.detail-card__title--done {
  text-decoration: line-through;
  opacity: 0.6;
}
.detail-card__actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}
.detail-card__cal-dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Detail-Meta ---- */
.detail-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.detail-meta__item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ---- Detail-Sektionen ---- */
.detail-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: var(--space-md) 0 var(--space-sm);
  color: var(--text);
}
.detail-card__description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  white-space: pre-wrap;
}
.detail-card__section {
  margin-bottom: var(--space-md);
}

/* ---- Detail-Edit ---- */
.detail-card__edit {
  margin-top: var(--space-md);
}
.edit-form__label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}
.edit-form__textarea {
  resize: vertical;
  min-height: 60px;
}

/* ---- Detail-AI ---- */
.detail-card__ai {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

/* ---- Formular-Styles ---- */
.detail-card--form {
  max-width: 600px;
}
.form-group {
  margin-bottom: var(--space-md);
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: 0.9rem;
}
.form-check input[type="checkbox"] {
  width: 18px; height: 18px;
}
.form-row--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.form-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* ---- Page-Header mit Aktion rechts ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ---- Klickbare Event-Cards ---- */
.event-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.event-card--clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}
.event-card--clickable:hover {
  background: var(--card-hover);
}

/* ---- Klickbare Timeline-Titel ---- */
.timeline-item__link {
  color: inherit;
  text-decoration: none;
}
.timeline-item__link:hover {
  text-decoration: underline;
  color: var(--accent);
}

/* ---- Inline-Formular ---- */
.inline-form {
  display: inline;
}

/* ---- Flash-Messages ---- */
.flash-messages {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md);
}
.flash-msg {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
}
.flash-msg--success { background: var(--success-bg); color: var(--success); }
.flash-msg--error, .flash-msg--danger { background: var(--danger-bg); color: var(--danger); }
.flash-msg--warning { background: var(--accent-bg); color: var(--accent); }
