/* ==========================================================================
   ZuVielGefühl? – Stylesheet
   --------------------------------------------------------------------------
   Aufbau dieser Datei:
   1. Design-Tokens (Variablen)       – hier zuerst anpassen, wenn du Farben/
                                         Abstände/Schriftgrößen ändern willst
   2. Reset & Basiselemente
   3. Layout (Navigation, Seitenrahmen)
   4. Komponenten (Buttons, Karten, Formulare, Modal, Tags, Timeline …)
   5. Tool-spezifische Styles (Gefühle, Problem-Schollen, Erwartungs-Rad)
   6. Responsive Anpassungen
   ========================================================================== */

/* -------------------------------------------------------------------------
   1. Design-Tokens
   ------------------------------------------------------------------------- */
:root {
  /* Farbpalette (aus dem Blueprint, Abschnitt 3.2) – bleibt in beiden
     Themes unverändert, nur die Neutraltöne drumherum passen sich an. */
  --orange: #f99234;
  --brown: #534439;
  --taupe: #baa89b;
  --teal: #00c9ac;
  --teal-dark: #009178;

  /* Abgeleitete, warme Neutraltöne (Hell-Theme, Standard) */
  --bg: #fbf6ef;
  --bg-elevated: #ffffff;
  --bg-sunken: #f3eade;
  --text: #3d3128;
  --text-muted: #8c7c6d;
  --border: #e8dece;
  --border-strong: #d9c9b3;
  --heading: var(--brown);

  --accent: var(--teal);
  --accent-dark: var(--teal-dark);
  --accent-warm: var(--orange);
  --accent-warm-dark: #e07e1f;

  --danger: #c65c3b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(61, 49, 40, 0.07), 0 1px 1px rgba(61, 49, 40, 0.04);
  --shadow-md: 0 8px 20px rgba(61, 49, 40, 0.09), 0 2px 6px rgba(61, 49, 40, 0.05);
  --shadow-lg: 0 20px 48px rgba(61, 49, 40, 0.16), 0 6px 16px rgba(61, 49, 40, 0.07);

  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --nav-width: 232px;
  --content-max: 980px;

  --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark-Theme: automatisch nach Systemeinstellung ---
   Greift nur, wenn niemand explizit über den Umschalter in der Navigation
   "Hell" oder "Dunkel" erzwungen hat (siehe [data-theme] weiter unten). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #201a15;
    --bg-elevated: #2b241e;
    --bg-sunken: #251f19;
    --text: #f1e6d8;
    --text-muted: #b3a291;
    --border: #3c332a;
    --border-strong: #4d4132;
    --heading: #f7ede0;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  }
}

/* --- Dark-/Hell-Theme: manuell über den Umschalter erzwungen ---
   Muss nach der @media-Regel stehen, damit es sie bei gleicher
   Spezifität per Quellreihenfolge zuverlässig überstimmt. */
[data-theme="dark"] {
  --bg: #201a15;
  --bg-elevated: #2b241e;
  --bg-sunken: #251f19;
  --text: #f1e6d8;
  --text-muted: #b3a291;
  --border: #3c332a;
  --border-strong: #4d4132;
  --heading: #f7ede0;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg: #fbf6ef;
  --bg-elevated: #ffffff;
  --bg-sunken: #f3eade;
  --text: #3d3128;
  --text-muted: #8c7c6d;
  --border: #e8dece;
  --border-strong: #d9c9b3;
  --heading: var(--brown);

  --shadow-sm: 0 1px 2px rgba(61, 49, 40, 0.07), 0 1px 1px rgba(61, 49, 40, 0.04);
  --shadow-md: 0 8px 20px rgba(61, 49, 40, 0.09), 0 2px 6px rgba(61, 49, 40, 0.05);
  --shadow-lg: 0 20px 48px rgba(61, 49, 40, 0.16), 0 6px 16px rgba(61, 49, 40, 0.07);
}

/* -------------------------------------------------------------------------
   2. Reset & Basiselemente
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Sicherheitsnetz: horizontales Scrollen ist auf keinem Gerät erwünscht.
     Auf Desktop ändert das nichts (dort tritt ohnehin kein Overflow auf),
     auf Mobile fängt es zuverlässig jede Breiten-Überraschung ab. */
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.4em;
  color: var(--heading);
}

h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }

a { color: var(--teal-dark); }

button {
  font-family: inherit;
}

svg { display: block; }

::selection {
  background: var(--teal);
  color: white;
}

:focus-visible {
  outline: 2.5px solid var(--accent-dark);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* -------------------------------------------------------------------------
   3. Layout
   ------------------------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* --- Seitennavigation (Desktop) --- */
.nav {
  width: var(--nav-width);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-mobile-close {
  display: none; /* nur auf Mobil sichtbar, siehe Abschnitt 6 (Responsive) */
  align-self: flex-end;
  margin-bottom: 10px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 20px;
}

.nav-brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.nav-brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.nav-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.nav-link svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--text-muted); transition: color var(--transition); }

.nav-link:hover { background: var(--bg-sunken); }

.nav-link.active {
  background: rgba(0, 201, 172, 0.13);
  color: var(--teal-dark);
}
.nav-link.active svg { color: var(--teal-dark); }

.nav-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* --- Mobile Topbar --- */
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--heading);
}
.topbar-brand svg { width: 26px; height: 26px; }

.topbar-menu-btn {
  border: none;
  background: var(--bg-sunken);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--heading);
}
.topbar-menu-btn svg { width: 20px; height: 20px; }

/* --- Content --- */
.content {
  flex: 1;
  min-width: 0;
  padding: 34px 40px 90px;
}

.content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.view-header-text .eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--teal-dark);
  margin-bottom: 6px;
}

.view-header-text p {
  color: var(--text-muted);
  max-width: 56ch;
}

/* -------------------------------------------------------------------------
   4. Komponenten
   ------------------------------------------------------------------------- */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--teal);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--teal-dark); }

.btn-warm {
  background: var(--orange);
  color: #ffffff;
}
.btn-warm:hover { background: var(--accent-warm-dark); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--heading);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-sunken); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--bg-sunken); color: var(--text); }

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
}
.btn-danger-ghost:hover { background: rgba(198, 92, 59, 0.1); }

.btn-icon {
  padding: 9px;
  border-radius: var(--radius-full);
}

.btn-sm { padding: 7px 13px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* --- Karten --- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

/* Prominente Eintrags-Karte, z.B. "Problem eintragen" vor der
   Problem-Schollen-Visualisierung – Formular-Eingabe soll im
   Vordergrund stehen, die Visualisierung ist die Ergänzung danach. */
.cta-card {
  background: linear-gradient(135deg, rgba(249, 146, 52, 0.1), rgba(0, 201, 172, 0.07));
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cta-card-text p { color: var(--text-muted); margin-top: 4px; max-width: 48ch; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  text-align: left;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.tool-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-card-icon svg { width: 24px; height: 24px; }

.tool-card h3 { margin-bottom: 2px; }
.tool-card p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

/* Icon-Hintergründe je Tool (nutzt die Blueprint-Palette) */
.icon-bg-teal { background: rgba(0, 201, 172, 0.15); color: var(--teal-dark); }
.icon-bg-orange { background: rgba(249, 146, 52, 0.16); color: var(--accent-warm-dark); }
.icon-bg-brown { background: rgba(83, 68, 57, 0.12); color: var(--heading); }
.icon-bg-taupe { background: rgba(186, 168, 155, 0.3); color: var(--heading); }

/* --- Dashboard-Hero --- */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 38px 34px;
  margin-bottom: 30px;
  background: linear-gradient(135deg, #fff9f1 0%, #fdf1e4 55%, #fbe9d8 100%);
  border: 1px solid var(--border);
  overflow: hidden;
}

.hero-orbits {
  position: absolute;
  right: -60px;
  top: -60px;
  width: 320px;
  height: 320px;
  opacity: 0.55;
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal-dark);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.hero h1 { position: relative; max-width: 20ch; }

.hero-message {
  position: relative;
  font-size: 1.08rem;
  color: var(--text);
  max-width: 46ch;
  margin-top: 6px;
}

.hero-message-swap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  border: none;
  background: var(--hero-chip-bg, rgba(255,255,255,0.6));
  color: var(--heading);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}
.hero-message-swap:hover { background: rgba(255,255,255,0.9); }
.hero-message-swap svg { width: 15px; height: 15px; }

/* --- Formulare --- */
.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 6px;
}
.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.input, .textarea, select.input {
  width: 100%;
  font-family: var(--font);
  font-size: 0.94rem;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}
.input:focus, .textarea:focus, select.input:focus {
  border-color: var(--teal);
  background: var(--bg-elevated);
  outline: none;
}

.textarea { resize: vertical; min-height: 78px; }

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-row input[type="range"] {
  flex: 1;
  accent-color: var(--teal);
}
.range-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--teal-dark);
  min-width: 2.4em;
  text-align: center;
  background: rgba(0,201,172,0.12);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 0.85rem;
}

.chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chip {
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 6px 13px;
  border-radius: var(--radius-full);
  font-size: 0.83rem;
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover { border-color: var(--teal); }
.chip.selected {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
  font-weight: 600;
}
.chip-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.form-step-indicator {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.form-step-dot {
  height: 5px;
  flex: 1;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background var(--transition);
}
.form-step-dot.done { background: var(--teal); }
.form-step-dot.active { background: var(--accent-warm); }

/* --- Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(61, 49, 40, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 160ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 26px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}
.modal-close {
  border: none;
  background: var(--bg-sunken);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}
.modal-close svg { width: 16px; height: 16px; }

.modal-sm { max-width: 380px; }
.modal-lg { max-width: 640px; }

/* --- Tags/Badges (verknüpfte Elemente) --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-sunken);
  color: var(--heading);
  border: 1px solid var(--border);
}
.tag-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- Empty States --- */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 52px; height: 52px; margin: 0 auto 14px; opacity: 0.55; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { max-width: 40ch; margin: 0 auto 18px; }

/* --- Toasts --- */
.toast-stack {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  width: 100%;
  max-width: 380px;
  padding: 0 16px;
}
.toast {
  background: var(--brown);
  color: #fff8ef;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--teal); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Segmented control (Daten-Ansicht: Typ-Auswahl) --- */
.seg-control {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-sunken);
  padding: 5px;
  border-radius: var(--radius-full);
  width: fit-content;
  margin-bottom: 22px;
}
.seg-btn {
  border: none;
  background: transparent;
  padding: 8px 15px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.seg-btn.active {
  background: var(--bg-elevated);
  color: var(--heading);
  box-shadow: var(--shadow-sm);
}

/* --- Datenliste --- */
.data-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.data-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.data-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.data-row-main { min-width: 0; }
.data-row-main h3 { margin-bottom: 3px; font-size: 0.98rem; }
.data-row-meta { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 6px; }
.data-row-desc { color: var(--text); font-size: 0.86rem; opacity: 0.85; }
.data-row-side { display: flex; gap: 6px; flex-shrink: 0; }

/* -------------------------------------------------------------------------
   5. Tool-spezifische Styles
   ------------------------------------------------------------------------- */

/* --- Tool 1: Gefühle-Tagebuch --- */
.feeling-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.feeling-entry {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 22px;
}
.feeling-entry::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.feeling-entry:last-child::before { display: none; }
.feeling-entry.is-recurrence::before { background: var(--teal); opacity: 0.4; }

.feeling-dot {
  width: 41px;
  height: 41px;
  border-radius: 50%;
  background: var(--bg-sunken);
  border: 2px solid var(--bg-elevated);
  box-shadow: 0 0 0 2px var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--heading);
  z-index: 1;
}

.feeling-card {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.feeling-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }

.feeling-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.feeling-card-top h3 { margin: 0; }
.feeling-card-time { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; font-family: var(--font-mono); }
.feeling-card-desc { font-size: 0.87rem; color: var(--text); opacity: 0.85; margin: 4px 0 8px; }
.recurrence-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--teal-dark);
  font-weight: 600;
  margin-top: 6px;
}
.recurrence-badge svg { width: 12px; height: 12px; }

.guided-question {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 14px;
}

/* --- Tool 2: Problem-Schollen --- */
.lake-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(200deg, #eafaf6 0%, #d7f2ea 45%, #c9ece2 100%);
  border: 1px solid var(--border);
  aspect-ratio: 16 / 11;
  min-height: 420px;
}
.lake-axis-label {
  position: absolute;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--teal-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
}
.lake-corner-hint {
  position: absolute;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-warm-dark);
  background: rgba(255,255,255,0.75);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 5px;
}
.lake-corner-hint svg { width: 12px; height: 12px; }

.floe {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 46% 54% 53% 47% / 51% 46% 54% 49%;
  background: var(--bg-elevated);
  border: 2px solid var(--taupe);
  box-shadow: var(--shadow-sm);
  padding: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.2;
  transition: box-shadow var(--transition), border-color var(--transition);
  user-select: none;
  touch-action: none;
}
.floe:hover, .floe:focus-visible { box-shadow: var(--shadow-md); border-color: var(--accent-warm); }
.floe-priority { border-color: var(--accent-warm); background: #fff8f0; }

/* --- Tool 3: Erwartungs-Rad --- */
.wheel-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at center, #fffaf3 0%, #fdf3e6 60%, #fbecd8 100%);
  border: 1px solid var(--border);
  aspect-ratio: 1 / 1;
  max-width: 640px;
  margin: 0 auto;
  overflow: visible;
}

.wheel-svg .node-me circle { fill: var(--brown); }
.wheel-svg .node-me text { fill: #fff8ef; font-weight: 700; }

.wheel-svg .node-person circle { fill: var(--bg-elevated); stroke: var(--heading); stroke-width: 2; }
.wheel-svg .node-person text { fill: var(--heading); font-weight: 600; }
.wheel-svg .node-person { cursor: grab; }
.wheel-svg .node-person.dragging { cursor: grabbing; }

/* Erwartungen (warmes Orange) als kontinuierlich zu "mir" fließende
   Energiestrahlen, Wünsche (Teal) als ruhige, feststehende Umlaufbahnen –
   bewusst unterschiedliche Farben, damit beide Typen auf einen Blick
   unterscheidbar sind. */
.wheel-svg .expectation-line {
  stroke: var(--accent-warm-dark);
  stroke-width: 2.4;
  stroke-linecap: round;
  fill: none;
  opacity: 0.9;
  stroke-dasharray: 9 7;
  filter: drop-shadow(0 0 3px rgba(224, 126, 31, 0.55));
  animation: energyFlow 1.4s linear infinite;
}
/* Steht die Erwartung im Einklang mit einem Wunsch, endet die Linie nicht
   mehr im Zentrum, sondern trifft als sanfte Kurve flach auf dessen
   Umlaufbahn (siehe tool-expectations.js, harmonizedRadius + Tangente) –
   sie "zielt" auf den Wunsch statt auf "mich" und zeigt keinen
   Richtungskonflikt mehr. Farblich wechselt sie dabei zu Teal (der Farbe
   des Wunsches), kräftig hervorgehoben statt animiert. */
.wheel-svg .expectation-line.harmony {
  stroke: var(--teal);
  stroke-width: 3;
  stroke-dasharray: none;
  opacity: 1;
  animation: none;
  filter: drop-shadow(0 0 6px rgba(0, 201, 172, 0.85));
}
@keyframes energyFlow { to { stroke-dashoffset: -32; } }

.wheel-svg .desire-orbit { stroke: var(--teal-dark); stroke-width: 1.5; stroke-dasharray: 3 5; fill: none; opacity: 0.5; }

.wheel-svg .link-target { fill: transparent; cursor: pointer; }
/* Unsichtbare, größere Trefferflächen für zuverlässiges Antippen auf
   Touchscreens. Bewusst OHNE :hover-Regel, damit sich am sichtbaren
   Desktop-Hover-Verhalten nichts ändert – diese Flächen dienen nur der
   Klick-/Tap-Erkennung. */
.wheel-svg .link-target-touch,
.wheel-svg .marker-touch-pad {
  fill: transparent;
  cursor: pointer;
}
.wheel-svg .link-target:hover { fill: rgba(198, 92, 59, 0.18); }

/* Konflikt: bewusst drastischer – kräftiges Rot/Rost statt Orange (das
   jetzt den Erwartungen gehört), größer, mit pulsierender Schockwelle
   dahinter statt nur zu flackern. */
.wheel-svg .link-marker-conflict { fill: var(--danger); filter: drop-shadow(0 0 5px rgba(198, 92, 59, 0.9)); }
.wheel-svg .conflict-halo {
  fill: none;
  stroke: var(--danger);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: conflictPulse 1.3s ease-out infinite;
}
@keyframes conflictPulse {
  0% { transform: scale(0.6); opacity: 0.75; }
  100% { transform: scale(2.4); opacity: 0; }
}
.spark-flicker {
  transform-box: fill-box;
  transform-origin: center;
  animation: sparkFlicker 1.1s infinite;
}
@keyframes sparkFlicker {
  0%, 18%, 22%, 52%, 58%, 100% { opacity: 1; transform: scale(1); }
  20%, 55% { opacity: 0.3; transform: scale(0.82); }
}

/* Einklang: zwei ruhige, leuchtende Punkte in Teal (Wunschfarbe) – keine
   Bewegung, nur farblich hervorgehoben (äquivalent zum Konflikt). */
.wheel-svg .link-marker-harmony { fill: var(--teal); filter: drop-shadow(0 0 4px rgba(0, 201, 172, 0.8)); }

.wheel-svg .drag-preview { stroke: var(--accent-warm-dark); stroke-width: 2; stroke-dasharray: 4 4; fill: none; pointer-events: none; }

/* Breite, unsichtbare Hit-Zonen entlang der gesamten Linien-/Bahnlänge:
   Ein Hover soll überall auf der Linie greifen, nicht nur exakt auf den
   dünnen, gestrichelten Pixeln (die zudem Lücken haben). transparent
   zählt für die Treffererkennung als "gemalt", ganz ohne SVG-<filter>-
   Tricks. */
.wheel-svg .line-hit-area {
  stroke: transparent;
  stroke-width: 20;
  fill: none;
  cursor: help;
}
/* Wunsch-Umlaufbahnen sind zusätzlich klickbar (öffnet den Wunsch zum
   Bearbeiten) – seit der "Ball" entfernt wurde, übernimmt die Bahn
   selbst diese Aufgabe. */
.wheel-svg .line-hit-area.clickable { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .wheel-svg .expectation-line,
  .spark-flicker,
  .wheel-svg .conflict-halo {
    animation: none;
  }
}

/* Hover-Infopopup im Erwartungs-Rad (Wunsch-Umlaufbahn, Erwartungs-Linie,
   Konflikt-/Einklang-Punkt). Folgt der Maus, pointer-events:none damit es
   selbst kein Hover/Leave auf dem darunterliegenden Element auslöst. */
.wheel-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--brown);
  color: #fff8ef;
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-width: 220px;
  z-index: 10;
  opacity: 0;
  transition: opacity 120ms ease;
  line-height: 1.45;
}

.wheel-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.wheel-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wheel-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.wheel-legend svg { width: 14px; height: 14px; flex-shrink: 0; }
.legend-icon-conflict { color: var(--danger); display: inline-flex; }
.legend-icon-harmony { color: var(--teal); display: inline-flex; }

/* -------------------------------------------------------------------------
   5b. Dark-Theme-Anpassungen für Flächen mit fest codierten Verläufen
   (Hero, Problem-See, Erwartungs-Rad-Hintergrund). Alles andere passt sich
   automatisch über die Design-Tokens an – nur diese dekorativen
   Verläufe sind bewusst nicht variablenbasiert, weil mehrfarbige
   Gradienten als CSS-Variable unhandlich wären.
   ------------------------------------------------------------------------- */
:root { --hero-chip-bg: rgba(255, 255, 255, 0.6); }

@media (prefers-color-scheme: dark) {
  :root {
    --hero-chip-bg: rgba(0, 0, 0, 0.28);
  }
  .hero { background: linear-gradient(135deg, #2a2018 0%, #33261a 55%, #3a2a1c 100%); }
  .lake-wrap { background: linear-gradient(200deg, #163531 0%, #10322c 45%, #0d2b26 100%); }
  .floe-priority { background: #3a2c1c; }
  .wheel-wrap { background: radial-gradient(circle at center, #2a2018 0%, #241c15 60%, #1f1811 100%); }
}

[data-theme="dark"] {
  --hero-chip-bg: rgba(0, 0, 0, 0.28);
}
[data-theme="dark"] .hero { background: linear-gradient(135deg, #2a2018 0%, #33261a 55%, #3a2a1c 100%); }
[data-theme="dark"] .lake-wrap { background: linear-gradient(200deg, #163531 0%, #10322c 45%, #0d2b26 100%); }
[data-theme="dark"] .floe-priority { background: #3a2c1c; }
[data-theme="dark"] .wheel-wrap { background: radial-gradient(circle at center, #2a2018 0%, #241c15 60%, #1f1811 100%); }

[data-theme="light"] .hero { background: linear-gradient(135deg, #fff9f1 0%, #fdf1e4 55%, #fbe9d8 100%); }
[data-theme="light"] .lake-wrap { background: linear-gradient(200deg, #eafaf6 0%, #d7f2ea 45%, #c9ece2 100%); }
[data-theme="light"] .floe-priority { background: #fff8f0; }
[data-theme="light"] .wheel-wrap { background: radial-gradient(circle at center, #fffaf3 0%, #fdf3e6 60%, #fbecd8 100%); }

/* -------------------------------------------------------------------------
   6. Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .topbar { display: flex; }
  .content { padding: 22px 16px 70px; }
  .hero { padding: 26px 22px; }
  .hero-orbits { width: 200px; height: 200px; right: -40px; top: -40px; }

  .nav.mobile-open {
    display: flex;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    padding-top: 16px;
  }

  .nav-mobile-close { display: flex; }

  /* --- Problem-Schollen: eigenes Seitenverhältnis + gedeckelte
     Schollen-Größe, damit auf schmalen Screens garantiert nichts über
     den Rand hinausragt (siehe auch das globale overflow-x-Sicherheits-
     netz weiter oben). Betrifft ausschließlich Mobile, Desktop bleibt
     bei der ursprünglichen Regel (Abschnitt 5). --- */
  .lake-wrap {
    aspect-ratio: 4 / 5;
    min-height: 320px;
  }
  .floe {
    max-width: 34vw;
    max-height: 26vw;
    font-size: 0.68rem;
    padding: 6px;
  }
  .lake-axis-label { font-size: 0.64rem; }
  .lake-corner-hint { font-size: 0.64rem; padding: 4px 8px; }

  /* --- Erwartungs-Rad: etwas mehr Luft für Namen-Labels, die auf
     schmalen Screens sonst knapp am Rand stehen. --- */
  .wheel-wrap { max-width: 100%; }
}
