/* Lifetree — Dämmerungslicht-Palette: tiefes Blau, warmes Ocker, Off-White */
:root {
  --bg: #faf6ef;
  --bg-card: #ffffff;
  --ink: #1c2a40;
  --ink-soft: #5a6a80;
  --blue: #16263d;
  --blue-mid: #2c4468;
  --ochre: #c98a2b;
  --ochre-soft: #f3e3c8;
  --line: #e8e0d2;
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino", "Georgia", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tab-h: 64px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: hidden;
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-mid) 70%, #4a5f82 100%);
  color: #f6efe2;
  min-height: calc(172px + env(safe-area-inset-top));
  /* Padding = der Rahmen um die vollflächige Heatmap */
  padding: calc(16px + env(safe-area-inset-top))
           calc(16px + env(safe-area-inset-right))
           16px
           calc(16px + env(safe-area-inset-left));
  transition: min-height 0.28s ease, padding 0.28s ease;
}

/* Kollabiert: flache sticky Zeile mit kleinem Titel + 9-Tage-Farbstreifen */
.app-header.collapsed {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: calc(8px + env(safe-area-inset-top))
           calc(14px + env(safe-area-inset-right))
           8px
           calc(14px + env(safe-area-inset-left));
}

/* Heatmap füllt den Header vollflächig, bis auf einen schmalen Rahmen */
.activity-heatmap {
  position: absolute;
  inset: calc(14px + env(safe-area-inset-top))
         calc(14px + env(safe-area-inset-right))
         14px
         calc(14px + env(safe-area-inset-left));
  z-index: 0;
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 2px;
}
.hm-cell {
  position: relative;
  min-width: 0; min-height: 0;
  border: none; padding: 0; margin: 0;
  border-radius: 2px;
  cursor: pointer;
  background: rgba(246, 239, 226, 0.09);
  touch-action: manipulation;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;   /* erledigte Streifen füllen von unten */
}
.hm-cell.hm-empty { visibility: hidden; cursor: default; }
.hm-cell:disabled { cursor: default; }
/* Sonnenjahres-Event (Wende/Gleiche): heller Rahmen als Marke */
.hm-cell.hm-solar { box-shadow: inset 0 0 0 1px rgba(246, 239, 226, 0.85); }
/* Mondphasen: Vollmond = heller Punkt, Neumond = hohler Ring (oben in der Zelle) */
.hm-newmoon::before, .hm-fullmoon::before {
  content: ""; position: absolute; top: 1px; left: 50%;
  transform: translateX(-50%); width: 3px; height: 3px; border-radius: 50%; z-index: 1;
}
.hm-fullmoon::before { background: #f6efe2; }
.hm-newmoon::before { background: transparent; box-shadow: 0 0 0 1px rgba(246, 239, 226, 0.9); }
.hm-slice {
  width: 100%;
  flex-shrink: 0;
  /* helle Haarlinie trennt Streifen auf jedem Hintergrund (auch kühle Farben) */
  border-top: 0.5px solid rgba(246, 239, 226, 0.4);
}
.hm-today { box-shadow: 0 0 0 1.5px #f6efe2; }
.hm-today.hm-solar { box-shadow: 0 0 0 1.5px #f6efe2; }
/* Zukunft = Vision/Potential: leicht gedämpft, aber gut sicht- & wählbar */
.hm-cell.hm-future { opacity: 0.88; }
.hm-cell.hm-future.hm-today { opacity: 1; }

/* ---------- Kollaps: 9-Tage-Streifen (letzte 6 + nächste 3) ---------- */
.activity-heatmap { transition: opacity 0.2s ease; }
.app-header.collapsed .activity-heatmap { opacity: 0; pointer-events: none; }

/* Streifen im Normalzustand ausgeblendet, erscheint nur kollabiert */
.hm-strip { display: none; }
.app-header.collapsed .hm-strip {
  order: 1;
  flex: 1;
  display: flex;
  gap: 3px;
  height: 30px;
  min-width: 0;
}
.hm-scell {
  position: relative;
  flex: 1;
  min-width: 0;
  border: none; padding: 0; margin: 0;
  border-radius: 3px;
  cursor: pointer;
  touch-action: manipulation;
  overflow: hidden;
  background: rgba(246, 239, 226, 0.09);
  display: flex;
  flex-direction: column-reverse;   /* erledigte Streifen füllen von unten */
}
.hm-scell .hm-slice { border-top-width: 1px; }
.hm-scell.hm-future { opacity: 0.85; }
.hm-scell.hm-today { box-shadow: 0 0 0 1.5px #f6efe2; }

/* Titel schrumpft kollabiert in die Zeile, Datum weicht */
.app-header.collapsed .header-titles { order: 0; flex: 0 0 auto; }
.app-header.collapsed .app-title { font-size: 1.05rem; }
.app-header.collapsed .app-sub { display: none; }

@media (prefers-reduced-motion: reduce) {
  .app-header, .activity-heatmap { transition: none; }
}

/* ---------- Mondwelle: solide Block-Fläche, Oberkante = Mondphase ---------- */
.activity-heatmap.hm-wave { display: block; overflow: hidden; }
.hm-bar {
  position: absolute;
  bottom: 0;
  border-radius: 2px 2px 0 0;
  border: none; padding: 0; margin: 0;
  cursor: pointer; touch-action: manipulation;
}
.hm-bar.hm-future { opacity: 0.88; }
.hm-bar.hm-done { box-shadow: inset 0 0 0 1px rgba(11, 20, 34, 0.3); }
.hm-bar.hm-solar { box-shadow: inset 0 2px 0 rgba(246, 239, 226, 0.95); z-index: 3; }
.hm-bar.hm-today { z-index: 5; box-shadow: 0 0 0 2px #f6efe2; }

/* Titel + Datum als Overlay über der Heatmap; Taps fallen auf die Zellen */
.header-titles {
  position: relative;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(11, 20, 34, 0.6), 0 0 2px rgba(11, 20, 34, 0.5);
}
.app-title {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.app-sub { color: #e4dcca; font-size: 0.9rem; margin-top: 2px; }

/* Ein Info-Icon direkt hinter dem Titel */
.title-row { display: flex; align-items: center; gap: 10px; }
.hdr-btn {
  pointer-events: auto;
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(246, 239, 226, 0.45);
  background: rgba(22, 38, 61, 0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #f6efe2;
  font-family: var(--serif);
  font-size: 0.85rem; line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.hdr-btn:active { background: rgba(22, 38, 61, 0.65); }

/* Legende unten links */
.hm-legend {
  position: absolute;
  left: calc(16px + env(safe-area-inset-left));
  bottom: 9px;
  z-index: 2;
  pointer-events: none;
  display: flex; align-items: center; gap: 3px;
  color: #d3dcea;
  font-size: 0.68rem;
  text-shadow: 0 1px 4px rgba(11, 20, 34, 0.7);
}
.hm-key { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---------- Views ---------- */
#view-container { max-width: 640px; margin: 0 auto; padding: 16px; }
.view { display: none; }
.view.active { display: block; animation: fadein 0.25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.section-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--blue);
  margin: 22px 0 10px;
}

.loading { color: var(--ink-soft); padding: 24px 0; text-align: center; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.sky-card {
  background: linear-gradient(180deg, #fdf9f1 0%, #f7edda 100%);
  border-color: #eadfc6;
}
.sky-row { display: flex; justify-content: space-between; gap: 8px; }
.sky-item { display: flex; flex-direction: column; align-items: center; flex: 1; text-align: center; }
.sky-icon { font-size: 1.5rem; }
.sky-label { font-size: 0.72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.sky-item strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--blue); }
.sky-daylight { text-align: center; font-size: 0.85rem; color: var(--ochre); margin-top: 10px; font-weight: 500; }

/* ---------- Events ---------- */
.event-list { display: flex; flex-direction: column; gap: 10px; }
.event {
  --acc: var(--ochre);
  --tint: var(--bg-card);
  background: var(--tint);
  border: 1px solid var(--line);
  border-left: 4px solid var(--acc);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
/* Aktivitäts-Kategorien: Farbe zeigt, was getan wird */
.event.cat-regulation   { --acc: #5f7d55; --tint: #eef2ea; }
.event.cat-nahrung      { --acc: #c2892f; --tint: #f8eeda; }
.event.cat-training     { --acc: #b85c34; --tint: #f7e7dc; }
.event.cat-regeneration { --acc: #a8432f; --tint: #f7e2db; }
.event.cat-ritual       { --acc: #4f6ea6; --tint: #e7ebf4; }
.event.cat-neutral      { --acc: var(--ochre); --tint: var(--bg-card); }
.event.allday { border-style: solid; }
.event-cat {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--acc);
  margin-bottom: 2px;
}
/* Erledigt-Schalter */
.event-check {
  flex-shrink: 0;
  align-self: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--acc);
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  transition: transform 0.08s ease;
}
.event-check:active { transform: scale(0.9); }
/* Trefferfläche auf ~44px vergrößern, ohne die 30px-Scheibe zu verändern */
.event-check::before {
  content: "";
  position: absolute;
  inset: -7px;
}
.event-check::after {
  content: "✓";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 800;
  color: var(--acc); opacity: 0.3;
}
.event.done .event-check { background: var(--acc); }
.event.done .event-check::after { color: #fff; opacity: 1; }
.event.done .event-title { text-decoration: line-through; color: var(--ink-soft); }
/* Erledigt: schmal zusammenfalten — nur Zeit, Titel (1 Zeile), Haken */
.event.done {
  padding: 6px 12px;
  align-items: center;
  opacity: 0.82;
}
.event.done .event-cat { display: none; }
.event.done .event-desc { display: none; }
.event.done .event-title {
  font-size: 0.86rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event.done .event-time { font-size: 0.82rem; padding-top: 0; }
.event.done .event-check { width: 24px; height: 24px; }
.event.done .event-check::after { font-size: 0.8rem; }
.event-time {
  min-width: 52px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--acc);
  font-size: 0.9rem;
  padding-top: 2px;
}
.event-body { flex: 1; min-width: 0; }
.event-title { font-weight: 600; font-size: 0.98rem; color: var(--blue); }
.event-desc {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin-top: 4px;
  white-space: pre-line;
  display: none;
}
.event.open .event-desc { display: block; }
.event { cursor: pointer; }
.empty-day {
  text-align: center; color: var(--ink-soft); padding: 32px 16px;
  background: var(--bg-card); border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ---------- Baum-Navigation (Heute) ---------- */
.tree-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tree-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: left;
  font-family: var(--sans);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.1s ease;
}
.tree-card:active { transform: scale(0.97); }
.tree-emoji { font-size: 1.4rem; }
.tree-name { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--blue); }
.tree-desc { font-size: 0.78rem; color: var(--ink-soft); }

/* ---------- Zyklus / Tagesnavigation ---------- */
.day-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 6px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.day-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg);
  font-size: 1.4rem; color: var(--blue); cursor: pointer;
  flex-shrink: 0; line-height: 1;
}
.day-btn:active { background: var(--ochre-soft); }
.day-center { display: flex; flex-direction: column; align-items: center; flex: 1; }
#day-picker {
  border: none; background: transparent; font-family: var(--serif);
  font-size: 1.15rem; font-weight: 600; color: var(--blue);
  text-align: center; cursor: pointer;
}
.day-label { font-size: 0.8rem; color: var(--ink-soft); }
.range-hint { font-size: 0.78rem; color: var(--ink-soft); text-align: center; margin-bottom: 12px; }

/* ---------- Segmented control ---------- */
.segmented {
  display: flex; background: #efe8da; border-radius: 12px; padding: 3px;
  margin-bottom: 14px; gap: 3px;
}
.seg-btn {
  flex: 1; border: none; background: transparent; padding: 8px 4px;
  border-radius: 10px; font-family: var(--sans); font-size: 0.85rem;
  color: var(--ink-soft); cursor: pointer; font-weight: 500;
}
.seg-btn.active { background: var(--bg-card); color: var(--blue); font-weight: 600; box-shadow: 0 1px 3px rgba(22,38,61,0.12); }

/* ---------- Dokument-Rendering ---------- */
.doc-content {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  overflow-wrap: break-word;
}
.doc-content h1, .doc-content h2, .doc-content h3, .doc-content h4 {
  font-family: var(--serif);
  color: var(--blue);
  line-height: 1.3;
  margin: 1.4em 0 0.5em;
}
.doc-content h1:first-child, .doc-content h2:first-child { margin-top: 0; }
.doc-content h1 { font-size: 1.5rem; }
.doc-content h2 { font-size: 1.25rem; border-bottom: 2px solid var(--ochre-soft); padding-bottom: 6px; }
.doc-content h3 { font-size: 1.05rem; }
.doc-content p, .doc-content ul, .doc-content ol { margin-bottom: 0.8em; font-size: 0.94rem; }
.doc-content ul, .doc-content ol { padding-left: 1.3em; }
.doc-content li { margin-bottom: 0.3em; }
.doc-content blockquote {
  border-left: 3px solid var(--ochre);
  padding-left: 12px; color: var(--ink-soft); font-style: italic; margin-bottom: 0.8em;
}
.doc-content code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82em; background: #f2ecdf; padding: 1px 5px; border-radius: 5px;
}
.doc-content pre {
  background: var(--blue); color: #e8e0d2; padding: 14px;
  border-radius: 10px; overflow-x: auto; margin-bottom: 0.9em;
  font-size: 0.78rem; line-height: 1.45;
}
.doc-content pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.doc-content hr { border: none; border-top: 1px solid var(--line); margin: 1.4em 0; }
.doc-content table { border-collapse: collapse; width: 100%; font-size: 0.85rem; margin-bottom: 0.9em; display: block; overflow-x: auto; }
.doc-content th, .doc-content td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; }
.doc-content th { background: var(--ochre-soft); font-family: var(--serif); }
.doc-content em:last-child { color: var(--ink-soft); }

/* ---------- Tab-Bar ---------- */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(250, 246, 239, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 100;
}
.tab {
  flex: 1; border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; color: var(--ink-soft);
  font-family: var(--sans);
  padding-top: 6px;
}
.tab-icon { font-size: 1.35rem; filter: grayscale(1) opacity(0.55); }
.tab.active .tab-icon { filter: none; }
.tab-label { font-size: 0.68rem; font-weight: 500; }
.tab.active { color: var(--blue); }
.tab.active .tab-label { font-weight: 700; }

/* ---------- Zyklus: Schnellzugriff + Kategorie-Legende ---------- */
/* Datums-Block: Picker + Schnellzugriff gehören zusammen, Abstand nach oben */
.day-block { margin-top: 14px; }
.day-block .day-nav { margin-bottom: 8px; }
.day-quick {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 0 4px;
}
.chip-btn {
  border: 1px solid var(--line); background: var(--bg-card);
  color: var(--ink-soft); border-radius: 999px;
  padding: 4px 12px; font-family: var(--sans); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; touch-action: manipulation;
}
.chip-btn.chip-active { background: var(--ochre-soft); border-color: var(--ochre); color: var(--blue); font-weight: 600; }
.range-hint { font-size: 0.78rem; color: var(--ink-soft); }

.cat-legend {
  margin-top: 16px; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px;
}
.cat-legend summary {
  cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--blue);
  font-family: var(--serif);
}
.cat-legend-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 7px; }
.cat-legend-list li { font-size: 0.85rem; color: var(--ink-soft); }
.cat-legend-list b { color: var(--ink); }
.cat-dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.cat-legend-note { font-size: 0.8rem; color: var(--ink-soft); margin: 10px 0 0; font-style: italic; }

/* ---------- Baum-Intro + Profil-Karte ---------- */
.baum-intro { margin-bottom: 6px; }
.baum-intro p { font-size: 0.94rem; color: var(--ink); margin-bottom: 8px; }
.baum-hint { font-size: 0.82rem; color: var(--ink-soft); font-style: italic; }
.baum-intro + .tree-nav { margin-top: 8px; }

.profil-card {
  width: 100%; margin: 12px 0 18px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #fdf9f1, #f4ecdd);
  border: 1px solid #e6d9bf; border-radius: var(--radius);
  padding: 14px; text-align: left; cursor: pointer; font-family: var(--sans);
  touch-action: manipulation;
}
.profil-card:active { transform: scale(0.99); }
.profil-card-body { display: flex; flex-direction: column; gap: 2px; }

#baum-content { margin-top: 4px; }

/* ---------- Vitalvision-Liste ---------- */
.vv-list { display: flex; flex-direction: column; gap: 10px; }
.vv-card {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-left: 4px solid var(--ochre); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: inherit;
  touch-action: manipulation;
}
.vv-card:active { background: var(--ochre-soft); }
.vv-title { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--blue); }
.vv-desc { font-size: 0.82rem; color: var(--ink-soft); }
.vv-card-all { border-left-color: var(--blue-mid); background: #f3f0ea; }

/* ---------- Profil-Formular ---------- */
#profil-form { margin-top: 12px; }
#profil-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 10px; }
#profil-form label:last-child { margin-bottom: 0; }
#profil-form input, #profil-form select {
  width: 100%; box-sizing: border-box;   /* sprengt sonst den Rahmen */
  font-family: var(--sans); font-size: 0.95rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--bg);
}
#profil-form input:focus, #profil-form select:focus { outline: 2px solid var(--ochre-soft); border-color: var(--ochre); }
.field-row { display: flex; gap: 10px; }
.field-row label { flex: 1; min-width: 0; }
.field-note { font-size: 0.78rem; color: var(--ink-soft); margin: 6px 0 0; font-style: italic; }
#geo-btn { margin-top: 4px; align-self: flex-start; }

.profil-history { margin-top: 4px; }
.hist-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem;
}
.hist-meta { color: var(--ink-soft); font-size: 0.8rem; }

/* ---------- Start-Overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(22, 38, 61, 0.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.overlay[hidden] { display: none; }   /* sonst überschreibt display:flex das hidden-Attribut */
.overlay-card {
  background: var(--bg); border-radius: 22px;
  max-width: 440px; width: 100%; padding: 26px 22px;
  box-shadow: 0 20px 60px rgba(11, 20, 34, 0.4);
  margin: auto;
}
.overlay-emoji { font-size: 2.4rem; text-align: center; }
.overlay-card h2 { font-family: var(--serif); font-size: 1.5rem; color: var(--blue); text-align: center; margin: 6px 0 12px; }
.overlay-card > p { font-size: 0.94rem; color: var(--ink); margin-bottom: 14px; }
.overlay-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.overlay-list li { font-size: 0.9rem; color: var(--ink); }
.overlay-privacy {
  font-size: 0.86rem; color: var(--blue); background: var(--ochre-soft);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 18px;
}
.overlay-preset-lead { font-size: 0.86rem; color: var(--ink-soft); margin-bottom: 10px; }
.overlay-presets { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.preset-btn {
  width: 100%; text-align: left; cursor: pointer; touch-action: manipulation;
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-card);
  font-family: var(--sans);
}
.preset-btn:active { background: var(--ochre-soft); border-color: var(--ochre); }
.preset-btn b { font-size: 0.98rem; color: var(--blue); }
.preset-btn span { font-size: 0.82rem; color: var(--ink-soft); }
.overlay-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-primary, .btn-secondary {
  width: 100%; padding: 13px; border-radius: 12px;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; touch-action: manipulation; border: none;
}
.btn-primary { background: var(--blue); color: #f6efe2; }
.btn-secondary { background: transparent; border: 1px solid var(--line); color: var(--blue); }

/* ---------- Start-Menü (Dropdown am Info-Icon) ---------- */
.menu-backdrop { position: fixed; inset: 0; z-index: 290; background: rgba(22, 38, 61, 0.3); }
.menu-backdrop[hidden] { display: none; }
.start-menu {
  position: fixed; z-index: 300;
  top: calc(52px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  width: min(360px, calc(100vw - 20px));
  max-height: calc(100vh - 90px - env(safe-area-inset-top));
  overflow-y: auto;
  background: var(--bg);
  border-radius: 18px;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 18px 50px rgba(11, 20, 34, 0.4);
  animation: menudrop 0.18s ease;
}
.start-menu[hidden] { display: none; }
@keyframes menudrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.menu-title { font-family: var(--serif); font-size: 1.25rem; color: var(--blue); margin-bottom: 8px; }
.menu-lead { font-size: 0.9rem; color: var(--ink); margin-bottom: 12px; }
.menu-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 7px; }
.menu-list li { font-size: 0.86rem; color: var(--ink); }
.menu-privacy { font-size: 0.82rem; color: var(--blue); background: var(--ochre-soft); border-radius: 10px; padding: 8px 10px; margin-bottom: 14px; }
.menu-preset-lead { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 8px; }
.menu-foot { display: flex; gap: 8px; margin-top: 14px; }
.menu-foot .btn-primary, .menu-foot .btn-secondary { padding: 11px; font-size: 0.9rem; }
/* Profil-Foldout im Menü */
.menu-profil {
  margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px;
}
.menu-profil > summary {
  cursor: pointer; font-family: var(--serif); font-weight: 600;
  color: var(--blue); font-size: 0.95rem; list-style: none;
}
.menu-profil > summary::-webkit-details-marker { display: none; }
.menu-profil > summary::before { content: "▸ "; color: var(--ochre); }
.menu-profil[open] > summary::before { content: "▾ "; }

@media (min-width: 640px) {
  .tree-nav { grid-template-columns: repeat(2, 1fr); }
  .vv-list { display: grid; grid-template-columns: 1fr 1fr; }
}
