/* Farben: dunkel ist der Standard, hell überschreibt die Variablen */
:root {
  --bg: #0b0b0c;
  --panel: #111113;
  --panel-2: #18181b;
  --panel-3: #222226;
  --line: #222225;
  --line-2: #2e2e33;
  --text: #ececee;
  --muted: #8a8a91;
  --faint: #5c5c63;
  --accent: #eea94a;
  --accent-text: #1d1405;
  --accent-soft: rgba(238, 169, 74, 0.12);
  --gefahr: #e06c6c;
  --gefahr-soft: rgba(224, 108, 108, 0.14);
  --schatten: 0 12px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

[data-theme="hell"] {
  --bg: #efede8;
  --panel: #fbfaf8;
  --panel-2: #f3f1ed;
  --panel-3: #e8e5df;
  --line: #e2dfd9;
  --line-2: #d3cfc7;
  --text: #1b1b1d;
  --muted: #6e6b66;
  --faint: #a19d96;
  --accent: #df9431;
  --accent-text: #fff;
  --accent-soft: rgba(223, 148, 49, 0.13);
  --schatten: 0 12px 36px rgba(60, 50, 30, 0.16);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input, select, textarea { outline: none; }

svg.icon { display: block; flex-shrink: 0; }

/* Sanfte Übergänge, aus bei "Bewegung reduzieren" */
button, .karte-aufgabe, .bereich-kachel, .schalter, .schalter::after { transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s; }
body.ruhig *, body.ruhig *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Obere Leiste ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
}

.logo { width: 20px; height: 20px; color: var(--text); flex-shrink: 0; }

.tabs { display: flex; gap: 2px; }

.tab {
  background: none;
  border: none;
  padding: 5px 9px;
  border-radius: 7px;
  color: var(--muted);
}

.tab:hover { color: var(--text); }
.tab.active { background: var(--panel-2); color: var(--text); }

.topbar-rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; }

.rund-knopf {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--muted);
}

.rund-knopf:hover { color: var(--text); }

main { padding: 26px 24px 40px; }

/* Fokus im Vollbild: obere Leiste weg */
body.vollbild .topbar { display: none; }

/* ---------- Bausteine ---------- */
.seiten-kopf {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 26px;
}

.seiten-kopf h1 { margin: 0; font-size: 26px; font-weight: 400; letter-spacing: -0.01em; }
.untertitel { color: var(--muted); font-size: 12px; margin-top: 6px; }
.kopf-links { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kopf-rechts { display: flex; align-items: center; gap: 10px; }

.abschnitt-kopf { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; min-height: 24px; }
.abschnitt-titel { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; }
.abschnitt-linie { flex: 1; border-top: 1px solid var(--line); }
.abschnitt-kopf .icon-knopf { margin-left: auto; }
.abschnitt-kopf .abschnitt-linie + .icon-knopf { margin-left: 0; }

.knopf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.knopf:hover { background: var(--panel-2); }
.knopf:disabled { opacity: 0.45; cursor: default; background: var(--panel); }

.knopf.haupt { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.knopf.haupt:hover { filter: brightness(1.06); }
.knopf.gefahr { background: var(--gefahr-soft); border-color: transparent; color: var(--gefahr); }
.knopf.text { background: none; border-color: transparent; color: var(--muted); }
.knopf.text:hover { color: var(--text); }

.icon-knopf {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.icon-knopf:hover { color: var(--text); }
.icon-knopf.an { color: var(--accent); border-color: var(--accent); }
.icon-knopf.ohne-rand { border-color: transparent; background: none; }

/* Segmentschalter, zum Beispiel 12 / 24 Stunden */
.segment {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.segment button {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.segment button.an { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
[data-theme="hell"] .segment button.an { background: var(--panel); }

/* Kippschalter */
.schalter {
  width: 30px;
  height: 18px;
  border-radius: 9px;
  border: none;
  background: var(--panel-3);
  position: relative;
  padding: 0;
  flex-shrink: 0;
}

.schalter::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
}

.schalter.an { background: var(--accent); }
.schalter.an::after { left: 15px; background: #fff; }

.auswahl {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
}

.feld {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 13px;
}

.feld:focus, .auswahl:focus { border-color: var(--faint); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 1px 8px 1px 7px;
  font-size: 11px;
  color: var(--muted);
  background: none;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

button.chip:hover { color: var(--text); }
.chip.an { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

.punkt { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.leer { color: var(--faint); padding: 6px 2px; font-size: 12px; }

.fortschritt { height: 4px; background: var(--panel-3); border-radius: 2px; overflow: hidden; }
.fuellung { height: 100%; background: var(--accent); border-radius: 2px; }

.label-klein { color: var(--muted); font-size: 11px; }
.label-gross { color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; }

/* Aufklappmenü */
.menue {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: var(--schatten);
  padding: 4px;
  z-index: 30;
}

.menue.rechts { left: auto; right: 0; }

.menue-punkt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 6px 8px;
  text-align: left;
  font-size: 12px;
}

.menue-punkt:hover, .menue-punkt.markiert { background: var(--panel-2); }
.menue-punkt .icon { color: var(--muted); }
.menue-punkt .rechts-davon { margin-left: auto; }
.menue-punkt .zweite-zeile { display: block; color: var(--muted); font-size: 11px; }
.menue-punkt.gefahr { color: var(--gefahr); }
.menue-titel { color: var(--faint); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; padding: 6px 8px 4px; }
.menue-linie { border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- Start ---------- */
.start-spalten {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  gap: 28px;
  align-items: start;
}

.start-zahlen { display: flex; align-items: center; gap: 14px; }
.heute-zahl { display: flex; align-items: baseline; gap: 2px; }
.heute-zahl .wert { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.wochen-box { width: 250px; display: flex; flex-direction: column; gap: 5px; }

.abschnitt { margin-bottom: 26px; }

.eingabe-zeile {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--line-2);
  border-radius: 9px;
  padding: 3px 4px 3px 0;
  margin-bottom: 8px;
  background: var(--panel);
  position: relative;
}

.eingabe-zeile:focus-within { border-style: solid; border-color: var(--faint); }

.eingabe-zeile input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 6px 8px;
  font-size: 13px;
}

.eingabe-zeile input::placeholder { color: var(--faint); }
.eingabe-zeile .segment { padding: 1px; }
.eingabe-zeile .segment button { padding: 2px 7px; font-size: 11px; display: inline-flex; gap: 3px; align-items: center; }

.eingabe-zeile.kompakt { padding: 1px 2px 1px 0; }
.eingabe-zeile.kompakt input { padding: 5px 7px; font-size: 12px; }
.eingabe-zeile.kompakt .icon-knopf { width: 18px; height: 18px; border: none; background: none; }

.karten { display: flex; flex-direction: column; gap: 7px; }

.karte-aufgabe {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid transparent;
  border-radius: 9px;
  padding: 9px 12px 9px 11px;
  cursor: pointer;
}

.karte-aufgabe:hover { border-top-color: var(--line-2); border-right-color: var(--line-2); border-bottom-color: var(--line-2); }
.karte-aufgabe.laeuft { border-top-color: var(--accent); border-right-color: var(--accent); border-bottom-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.karte-aufgabe .titel { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; word-break: break-word; }
.karte-aufgabe .titel .icon { color: var(--faint); }
.karte-aufgabe.erledigt .titel { color: var(--faint); text-decoration: line-through; }
.karte-zeile { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.karte-aufgabe .zeit { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.karte-aufgabe.laeuft .zeit { color: var(--accent); }

.haken {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: none;
  padding: 0;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.haken:hover { color: var(--text); border-color: var(--faint); }
.erledigt .haken { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.play {
  background: none;
  border: none;
  padding: 2px;
  color: var(--muted);
  display: inline-flex;
}

.play:hover { color: var(--text); }
.laeuft .play { color: var(--accent); }

/* Tagesleiste und Kalender teilen sich die Blöcke */
.tagesleiste {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  height: calc(100vh - 170px);
  min-height: 360px;
  overflow-y: auto;
  position: sticky;
  top: 90px;
}

.leiste-flaeche { position: relative; margin-left: 46px; margin-right: 8px; background: var(--accent-soft); } /* heute leicht orange wie im Vorbild */

.stunde { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.stunde span { position: absolute; left: -42px; top: -7px; width: 34px; text-align: right; color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }

.block {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 4px;
  border-left: 2px solid;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-height: 3px;
  cursor: pointer;
}

.jetzt { position: absolute; left: 0; right: 0; border-top: 1px solid var(--accent); z-index: 2; pointer-events: none; }
.jetzt::before { content: ""; position: absolute; left: -4px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- Plan ---------- */
.plan-raster {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: calc(100vh - 190px);
  scroll-behavior: smooth;
}

.plan-spalte { flex: 0 0 165px; }
.layout-kompakt .plan-spalte { flex-basis: 135px; }
.layout-breit .plan-spalte { flex-basis: 220px; }

.plan-tag {
  display: flex;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 2px 7px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.plan-tag .nummer { color: var(--faint); font-weight: 500; }
.plan-spalte.heute .plan-tag { color: var(--text); border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.plan-spalte.heute .plan-tag .nummer { color: var(--accent); }
.plan-spalte.vergangen { opacity: 0.6; }

.plan-spalte .karte-aufgabe { padding: 7px 9px 7px 8px; }
.plan-spalte .karte-aufgabe .titel { font-size: 12px; }
.plan-spalte .karte-zeile { margin-top: 6px; gap: 6px; }
.plan-spalte .haken { width: 16px; height: 16px; }

.sonstiges-knopf {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 2px;
}

.sonstiges-knopf:hover { color: var(--muted); }
.sonstiges-knopf .icon { transition: transform 0.15s; }
.sonstiges-knopf.offen .icon { transform: rotate(90deg); }
.monat { color: var(--muted); font-size: 12px; min-width: 90px; text-align: right; }

/* ---------- Kalender ---------- */
.zeitraum { color: var(--muted); font-size: 12px; min-width: 110px; text-align: center; }

.ziel-anzeige { display: flex; align-items: center; gap: 10px; }
.ziel-anzeige .wert { font-size: 18px; font-weight: 500; }
.ziel-anzeige .fortschritt { width: 70px; }

.kalender {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.kal-kopf { display: grid; grid-template-columns: 46px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.kal-tag { padding: 8px 4px; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); }
.kal-tag .nummer { color: var(--faint); font-weight: 500; }
.kal-tag .summe { color: var(--faint); font-weight: 400; font-size: 10px; margin-top: 2px; }
.kal-tag.heute { background: var(--panel-2); color: var(--text); }
.kal-tag.heute .nummer { color: var(--accent); }

.kal-koerper { height: calc(100vh - 230px); min-height: 360px; overflow-y: auto; }
.kal-innen { display: grid; grid-template-columns: 46px repeat(7, 1fr); position: relative; }
.kal-stunden { position: relative; }
.kal-stunde { position: absolute; right: 7px; transform: translateY(-50%); color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.kal-spalte { position: relative; border-left: 1px solid var(--line); }
.kal-spalte.heute { background: var(--accent-soft); }
.kal-linie { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.kal-innen .jetzt { left: 46px; }

/* ---------- Fokus ---------- */
.fokus {
  min-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

body.vollbild main { padding: 0; }
body.vollbild .fokus { min-height: 100vh; }

.fokus-ecke-links { position: absolute; top: 18px; left: 18px; }
.fokus-ecke-rechts { position: absolute; top: 22px; right: 22px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; }
body:not(.vollbild) main > .fokus .fokus-ecke-rechts { top: 0; right: 0; }
body:not(.vollbild) main > .fokus .fokus-ecke-links { top: 0; left: 0; }

.fokus .chip { font-size: 11px; padding: 4px 11px 4px 9px; }
/* Uhr-Hülle und Ringe: nur das Design Smartwatch zeigt sie, sonst ohne Wirkung */
.fokus-uhr { display: contents; }
.fokus-ringe { display: none; }
.fokus-titel { font-size: 18px; margin: 14px 0 6px; }
.fokus-zeit { font-size: 96px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; }
.fokus-status { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin: 6px 0 24px; }
.fokus-status.laeuft { color: var(--accent); }
.fokus-knoepfe { display: flex; gap: 10px; align-items: center; }
.fokus-knoepfe .knopf { padding: 8px 16px; font-size: 13px; }

.fokus-notiz {
  margin-top: 34px;
  width: 100%;
  max-width: 460px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--muted);
  text-align: left;
}

.fokus-notiz:hover, .fokus-notiz:focus-within { border-color: var(--line-2); background: var(--panel); color: var(--text); }
.fokus-leer { color: var(--muted); }

/* ---------- Bereiche ---------- */
.kennzahlen {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 22px;
}

.kennzahl { padding: 14px 18px; }
.kennzahl + .kennzahl { border-left: 1px solid var(--line); }
.kennzahl .wert { font-size: 18px; font-weight: 500; margin-top: 6px; font-variant-numeric: tabular-nums; }

.reiter-zeile { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.hinweis { color: var(--muted); font-size: 11px; margin-bottom: 12px; }

.bereich-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }

.bereich-kachel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-align: left;
}

.bereich-kachel:hover { border-color: var(--line-2); }
.bereich-kachel.ziehen { opacity: 0.4; }
.bereich-kachel.ueber { border-color: var(--accent); }
.kachel-kopf { display: flex; gap: 11px; align-items: flex-start; }
.kachel-symbol { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kachel-kopf .tag-chip { margin-top: 6px; }
.kennzahl-name { display: flex; align-items: center; gap: 5px; }
.kennzahl-name .icon { color: var(--accent); }
.kachel-name { font-weight: 600; font-size: 13px; }
.kachel-text { color: var(--muted); font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.kachel-fuss { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.kachel-fuss .wert { font-size: 24px; font-weight: 500; line-height: 1.1; }
.kachel-kurve { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ziel-marke { color: var(--accent); font-size: 10px; margin-left: 4px; }

.bereich-kachel.neu { border-style: dashed; align-items: center; justify-content: center; color: var(--muted); gap: 6px; }
.bereich-kachel.neu:hover { color: var(--text); }

/* ---------- Rückblick ---------- */
.rb-ziele { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -10px 0 18px; }
.rb-ziele .chip { padding: 3px 10px 3px 8px; }

.rb-reihe { display: grid; gap: 12px; margin-bottom: 12px; }
.rb-reihe.vier { grid-template-columns: repeat(4, 1fr); }
.rb-reihe.zwei { grid-template-columns: 1.45fr 1fr; }
.rb-stapel { display: flex; flex-direction: column; gap: 12px; }

.kachel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.kachel .gross { font-size: 24px; font-weight: 500; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kachel .gross small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.kachel .gross.akzent { color: var(--accent); }
.kachel .unter { color: var(--muted); font-size: 11px; margin-top: 6px; }
.kachel .fortschritt { margin-top: 10px; }

.saeulen { display: flex; gap: 14px; align-items: flex-end; height: 170px; margin-top: 14px; }
.saeule-spalte { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.saeule-wert { font-size: 10px; color: var(--faint); }
.saeule { width: 100%; max-width: 22px; display: flex; flex-direction: column-reverse; border-radius: 3px; overflow: hidden; min-height: 2px; background: var(--line-2); }
.saeule-teil { width: 100%; }
.saeule-name { font-size: 10px; color: var(--faint); }
.saeule-spalte.heute .saeule-name, .saeule-spalte.heute .saeule-wert { color: var(--accent); font-weight: 600; }

.bar-zeile { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; }
.bar-name { width: 120px; display: flex; align-items: center; gap: 7px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar-spur { flex: 1; height: 6px; background: var(--panel-3); border-radius: 3px; overflow: hidden; }
.bar-fuell { height: 100%; border-radius: 3px; }
.bar-wert { width: 60px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.anteil-balken { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: var(--panel-3); margin-top: 14px; }
.legende { display: flex; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }

.verlauf-kopf { display: flex; justify-content: space-between; align-items: flex-start; }
.verlauf-schnitt { text-align: right; }
.verlauf-schnitt .gross { color: var(--accent); margin-top: 2px; }
.verlauf { position: relative; height: 150px; margin-top: 10px; display: flex; gap: 10px; align-items: flex-end; border-bottom: 1px solid var(--line); }
.verlauf .saeule-spalte { gap: 0; }
.verlauf .saeule { max-width: 28px; border-radius: 3px 3px 0 0; background: none; }
.verlauf-linie { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.verlauf-namen { display: flex; gap: 10px; margin-top: 6px; }
.verlauf-namen div { flex: 1; text-align: center; font-size: 10px; color: var(--faint); line-height: 1.35; }
.verlauf-namen .diese { color: var(--accent); }

/* ---------- Einstellungen ---------- */
.einst-raster { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 36px; align-items: start; }
.einst-zeile { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.einst-zeile .titel { font-size: 13px; }
.einst-zeile .text { color: var(--muted); font-size: 11px; margin-top: 3px; max-width: 290px; }
.einst-wochenziel { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.einst-wochenziel input { width: 52px; text-align: right; background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 5px; font-size: 14px; }
.einst-wochenziel input:hover, .einst-wochenziel input:focus { border-color: var(--line-2); background: var(--panel); }
.daten-karte { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.daten-karte .knopf { justify-content: center; }

/* Design-Auswahl: Vorschau unter dem Auswahlfeld */
.design-feld { max-width: 190px; }
.design-vorschau { padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
.design-bild { height: 250px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: var(--panel-2); }
.design-bild iframe { display: block; width: 100%; height: 100%; border: 0; pointer-events: none; }
.design-vorschau .design-text { color: var(--muted); font-size: 11px; margin-top: 8px; }

/* ---------- Fenster (Dialog) ---------- */
.dialog-hintergrund {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 20px;
  overflow-y: auto;
  z-index: 20;
}

.dialog {
  width: 100%;
  max-width: 580px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 18px 20px 20px;
  box-shadow: var(--schatten);
}

.dialog-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.dialog-kopf .gespeichert { color: var(--faint); font-size: 11px; margin-left: auto; }

.dialog-titel {
  width: 100%;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 20px;
  margin: 0 0 6px -7px;
}

.dialog-titel:hover, .dialog-titel:focus { border-color: var(--line-2); }

/* Texteditor mit Werkzeugleiste */
.editor-huelle { margin-bottom: 12px; }
.editor-leiste { display: flex; align-items: center; gap: 2px; padding-bottom: 7px; border-bottom: 1px solid var(--line); margin-bottom: 8px; flex-wrap: wrap; }
.editor-stil { padding: 3px 6px; font-size: 11px; background: none; border-color: transparent; color: var(--muted); }
.editor-trenner { width: 1px; height: 14px; background: var(--line-2); margin: 0 5px; }

.editor-knopf {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.editor-knopf:hover { background: var(--panel-2); color: var(--text); }
.editor-knopf.an { background: var(--panel-3); color: var(--text); }
.editor-buchstabe { font-size: 12px; font-family: Georgia, serif; }
.editor-buchstabe.B { font-weight: 700; font-family: inherit; }
.editor-buchstabe.I { font-style: italic; }
.editor-buchstabe.S { text-decoration: line-through; font-family: inherit; }

.editor { min-height: 110px; padding: 2px 2px 6px; font-size: 13px; line-height: 1.55; outline: none; word-break: break-word; }
.editor:empty::before { content: attr(data-platzhalter); color: var(--faint); pointer-events: none; }
.editor p { margin: 0 0 6px; }
.editor h2 { font-size: 17px; font-weight: 600; margin: 10px 0 6px; }
.editor h3 { font-size: 14px; font-weight: 600; margin: 8px 0 4px; }
.editor blockquote { margin: 6px 0; padding-left: 10px; border-left: 2px solid var(--line-2); color: var(--muted); }
.editor code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--panel-3); border-radius: 4px; padding: 1px 4px; }
.editor a { color: var(--accent); }
.editor ul, .editor ol { margin: 4px 0; padding-left: 22px; }
.editor hr { border: none; border-top: 1px solid var(--line-2); margin: 10px 0; }
.editor ul.checkliste { list-style: none; padding-left: 0; }
.editor ul.checkliste li { position: relative; padding-left: 22px; }
.editor ul.checkliste li::before { content: ""; position: absolute; left: 0; top: 3px; width: 13px; height: 13px; border: 1px solid var(--faint); border-radius: 4px; cursor: pointer; }
.editor ul.checkliste li.erledigt { color: var(--faint); text-decoration: line-through; }
.editor ul.checkliste li.erledigt::before { background: var(--accent); border-color: var(--accent); }

.editor-huelle.kompakt .editor-leiste { opacity: 0; transition: opacity 0.15s; }
.editor-huelle.kompakt:hover .editor-leiste, .editor-huelle.kompakt:focus-within .editor-leiste { opacity: 1; }
.editor-huelle.kompakt .editor { min-height: 70px; }

/* Bereich-Fenster: links Inhalt, rechts Farbe */
.dialog.bereich-fenster { max-width: 680px; padding: 0; overflow: visible; }
.bereich-fenster .dialog-kopf { padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.bereich-spalten { display: grid; grid-template-columns: 1fr 200px; min-height: 260px; }
.bereich-links { padding: 18px; }
.bereich-rechts { padding: 16px; background: var(--panel-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.bereich-rechts .label-gross { margin-top: 6px; }
.bereich-rechts .feld { width: 100%; }
.bereich-fenster .dialog-fuss { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); }
.bereich-titel-zeile { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; position: relative; }
.bereich-titel-zeile .dialog-titel { margin: 0; }
.ziel-zeile { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }

.symbol-knopf { width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: none; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.symbol-knopf:hover { border-color: var(--line-2); background: var(--panel-2); }
.symbol { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }

/* Symbolauswahl */
.menue.symbol-wahl { width: 270px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.symbol-kopf { display: flex; align-items: center; gap: 10px; }
.symbol-kopf > div:nth-child(2) { flex: 1; }
.symbol-kopf .titel { font-weight: 600; font-size: 13px; }
.symbol-vorschau { width: 32px; height: 32px; border-radius: 8px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; }
.segment.breit { display: flex; }
.segment.breit button { flex: 1; }
.symbol-raster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.symbol-feld { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px; border: 1px solid transparent; border-radius: 8px; background: none; font-size: 10px; color: var(--muted); }
.symbol-feld:hover { background: var(--panel-2); }
.symbol-feld.an { border-color: var(--accent); }
.emoji-zeile { display: flex; gap: 6px; }
.emoji-zeile .feld { flex: 1; min-width: 0; }
.emoji-kategorien { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-raster { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-feld { border: 1px solid transparent; background: none; border-radius: 6px; font-size: 17px; padding: 3px 0; line-height: 1.2; }
.emoji-feld:hover { background: var(--panel-2); }
.emoji-feld.an { border-color: var(--accent); }

/* Aufgabenkarte: Titel direkt bearbeiten, "⋯" beim Darüberfahren */
.karte-aufgabe .titel-text { cursor: text; }
.karte-mehr { margin-left: auto; width: 20px; height: 20px; opacity: 0; }
.karte-aufgabe:hover .karte-mehr, .karte-mehr:focus { opacity: 1; }
.titel-feld { flex: 1; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; font-size: inherit; font-weight: inherit; }

.dialog-zeile { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); min-height: 42px; }
.dialog-name { width: 130px; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.dialog-felder { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dialog .feld, .dialog .auswahl { background: var(--panel-2); }
.dialog .klein-zahl { width: 56px; }
.dialog-fuss { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 16px; }

.farb-wahl { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.farb-wahl button { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.farb-wahl button.an { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.farb-wahl input[type="color"] { width: 24px; height: 24px; border: none; background: none; padding: 0; cursor: pointer; }

.zeit-zeile { display: flex; align-items: center; gap: 6px; padding: 5px 0; flex-wrap: wrap; }
.zeit-zeile .label-klein { min-width: 70px; }
.zeit-zeile .feld { padding: 4px 6px; font-size: 12px; }

.fehler { color: var(--gefahr); font-size: 12px; margin-top: 8px; }
.fehler:empty { display: none; }

.wiederkehrend-zeile { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 6px; }
.wiederkehrend-zeile:hover { background: var(--panel-2); }
.wiederkehrend-zeile .regel { margin-left: auto; color: var(--muted); font-size: 11px; }
.menue-inhalt { display: flex; align-items: center; gap: 9px; }

/* ---------- Suche ---------- */
.such-knopf {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 200px;
  height: 27px;
  padding: 0 5px 0 9px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
}

.such-knopf:hover { color: var(--text); }
.such-knopf span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

kbd {
  font-family: inherit;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--panel-2);
}

.dialog.suche { max-width: 560px; padding: 0; overflow: hidden; }
.suche-zeile { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.suche-zeile input { flex: 1; background: none; border: none; padding: 15px 0; font-size: 15px; color: var(--text); }
.suche-liste { max-height: 380px; overflow-y: auto; padding: 6px; }
.suche-liste .menue-punkt { padding: 8px 10px; font-size: 13px; }
.suche-liste .leer { padding: 14px 10px; }

/* Farben als Tags */
.tag-chip { font-size: 10px; padding: 0 7px 0 6px; }
