/* To-Do – neue Optik (19.10.2026, dunkel). Gilt nur auf der To-Do-Seite (body.todo-app); die übrigen App-Manager-Seiten bleiben wie sie sind.
   Schrift Figtree liegt lokal in /static/fonts (SIL Open Font License, OFL-Figtree.txt) – kein Abruf aus dem Netz. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/figtree-latin-700-normal.woff2") format("woff2"); }

body.todo-app {
  --td-bg: #15171c; --td-flaeche: #1e2129; --td-linie: #2a2e38; --td-text: #eceef2; --td-grau: #a3a9b5; --td-akzent: #f2b84b;
  --td-tobias: #7fb2ff; --td-sandra: #f4a3c4; --td-beide: #c9b6f2; --td-rot: #ff8a80; --td-termin: #2f4a7a;
  /* alte Variablen für die Unterseiten mitziehen */
  --bg: var(--td-bg); --karte: var(--td-flaeche); --text: var(--td-text); --leise: var(--td-grau); --akzent: var(--td-akzent); --rand: var(--td-linie); --warn: var(--td-rot);
  background: var(--td-bg); color: var(--td-text); font-family: "Figtree", system-ui, sans-serif; font-size: 16px;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); color-scheme: dark;
}
body.todo-app.td-ohne-leiste { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
body.todo-app.td-ohne-leiste .td-nav { display: none; }
body.todo-app .kopf { background: var(--td-bg); border-bottom-color: var(--td-linie); }
body.todo-app .kopf .knopf { border-radius: 12px; }
body.todo-app main { padding: 12px 16px; }
body.todo-app button, body.todo-app input, body.todo-app select, body.todo-app textarea { font-family: inherit; }
body.todo-app input, body.todo-app select, body.todo-app textarea { background: var(--td-flaeche); color: var(--td-text); border: 1px solid var(--td-linie); border-radius: 12px; min-height: 44px; }
body.todo-app a { color: var(--td-akzent); }
.td [hidden], .td-blatt[hidden], #td-modus[hidden] { display: none !important; }

.td-sym { width: 24px; height: 24px; flex: 0 0 auto; display: block; }
.td-sym.klein { width: 18px; height: 18px; } .td-sym.mini { width: 13px; height: 13px; display: inline-block; vertical-align: -1px; }
.td-sym.gross { width: 64px; height: 64px; color: var(--td-akzent); }
.td-grau { color: var(--td-grau); } .td-grau.klein, .klein.td-grau { font-size: .85rem; margin: 4px 0; }
.td-rot { color: var(--td-rot); } .td-akzent { color: var(--td-akzent); }
.td-h1, .td-unterkopf h1, .td-neu-kopf h1 { font-size: 1.35rem; font-weight: 700; margin: 4px 0 12px; }
.td-meldung { position: sticky; top: 64px; z-index: 6; background: var(--td-flaeche); border: 1px solid var(--td-akzent); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }

/* Untere Leiste: vier gleich große Knöpfe */
.td-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--td-flaeche); border-top: 1px solid var(--td-linie); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
.td-nav-knopf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; min-width: 0;
  border: 0; background: none; color: var(--td-grau); font: 500 .78rem/1.1 "Figtree", system-ui, sans-serif; text-decoration: none; border-radius: 12px; cursor: pointer; }
body.todo-app .td-nav a.td-nav-knopf { color: var(--td-grau); }
body.todo-app .td-nav a.td-nav-knopf.an { color: var(--td-akzent); }
.td-nav-knopf span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Umschalter, Blättern */
.td-kopf-umschalter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.td-kopf-umschalter .td-seg:first-child { flex: 3 1 200px; } .td-kopf-umschalter .td-seg:last-child { flex: 2 1 120px; }
.td-seg { display: flex; background: var(--td-flaeche); border: 1px solid var(--td-linie); border-radius: 14px; padding: 3px; margin-bottom: 12px; }
.td-kopf-umschalter .td-seg { margin-bottom: 0; }
.td-seg button { flex: 1; min-height: 44px; border: 0; border-radius: 11px; background: none; color: var(--td-grau); font: 600 .95rem "Figtree", system-ui, sans-serif; cursor: pointer; min-width: 0; padding: 0 6px; }
.td-seg button[aria-pressed="true"] { background: var(--td-linie); color: var(--td-text); }
.td-blaettern { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.td-pfeil { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--td-linie); background: var(--td-flaeche); color: var(--td-text); cursor: pointer; }
.td-datum { flex: 1; min-height: 44px; border: 0; background: none; color: var(--td-text); font: 700 1.1rem "Figtree", system-ui, sans-serif; cursor: pointer; border-radius: 12px; }

/* Tag */
.td-kasten { background: var(--td-flaeche); border: 1px solid var(--td-linie); border-radius: 16px; padding: 10px 12px; margin-bottom: 14px; }
.td-kasten h2, .td-gruppe h2 { font-size: .95rem; font-weight: 600; color: var(--td-grau); margin: 2px 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.td-kasten > summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.td-eintrag { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 0; border-top: 1px solid var(--td-linie); }
.td-kasten .td-eintrag:first-of-type, .td-zeitleiste .td-eintrag:first-child { border-top: 0; }
.td-eintrag.td-link { text-decoration: none; color: var(--td-text); }
.td-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; color: var(--td-text);
  font: inherit; padding: 6px 0; min-height: 44px; justify-content: center; cursor: pointer; overflow-wrap: anywhere; }
.td-text b { font-weight: 600; } .td-text small { color: var(--td-grau); font-size: .85rem; }
.td-text small.td-rot { color: var(--td-rot); }
.td-ueber .td-text b { color: var(--td-rot); }
.td-wdh { color: var(--td-grau); }
.td-kreis { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; position: relative; }
.td-kreis::before { content: ""; position: absolute; inset: 9px; border: 2px solid var(--td-grau); border-radius: 50%; }
.td-kreis .td-sym { width: 16px; height: 16px; position: relative; }
.td-kreis:hover:not(:disabled) { color: var(--td-akzent); }
.td-kreis:disabled { opacity: .35; cursor: default; }
.td-ueber .td-kreis::before { border-color: var(--td-rot); }
.td-zeitleiste { position: relative; padding-left: 0; }
.td-zeit { flex: 0 0 46px; color: var(--td-grau); font-size: .85rem; font-variant-numeric: tabular-nums; }
.td-termin-block { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--td-termin); border-radius: 12px; padding: 8px 12px; min-height: 48px; }
.td-termin-block .td-text { padding: 0; min-height: 0; cursor: default; }
.td-hinweis { color: var(--td-grau); font-size: .85rem; text-align: center; margin: 14px 0; }
.td-bereich-punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--f); margin-right: 5px; vertical-align: 1px; flex: 0 0 auto; }
.td-bereich-punkt.gross { width: 14px; height: 14px; margin: 0 4px; }

/* Personen-Kreis */
.td-person { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center; font: 700 .8rem "Figtree", system-ui, sans-serif; color: #15171c; background: var(--td-grau); }
.td-person.leer { background: none; }
.td-p-t { background: var(--td-tobias); } .td-p-s { background: var(--td-sandra); } .td-p-b { background: var(--td-beide); }

/* Woche */
.td-wtag { background: var(--td-flaeche); border: 1px solid var(--td-linie); border-radius: 14px; padding: 6px 12px; margin-bottom: 8px; }
.td-wtag h3 { font-size: .9rem; font-weight: 600; color: var(--td-grau); margin: 4px 0; }
.td-wtag.heute { border-color: var(--td-akzent); } .td-wtag.heute h3 { color: var(--td-akzent); }
.td-wzeile { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.td-wzeile .td-zeit { flex-basis: 40px; }
.td-wzeile .td-text { padding: 4px 0; }
.td-zeichen { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; }
.td-z-termin { color: var(--td-tobias); }
.td-kreis.klein::before { inset: 11px; }

/* Monat */
.td-monat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-bottom: 12px; }
.td-mkopf { text-align: center; color: var(--td-grau); font-size: .78rem; padding: 2px 0; }
.td-mtag { min-height: 48px; min-width: 0; border-radius: 12px; border: 1px solid transparent; background: var(--td-flaeche); color: var(--td-text);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 5px 0 4px; font: 600 .9rem "Figtree", system-ui, sans-serif; cursor: pointer; }
.td-mtag.fremd { opacity: .4; }
.td-mtag.heute { background: var(--td-akzent); color: #15171c; }
.td-mtag.gewaehlt { border-color: var(--td-text); }
.td-punkte { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; font-style: normal; max-width: 100%; }
.td-punkt { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--td-grau); }
.td-pp-t { background: var(--td-tobias); } .td-pp-s { background: var(--td-sandra); } .td-pp-b { background: var(--td-beide); } .td-pp-f { background: var(--td-rot); }
.td-mtag.heute .td-punkt { box-shadow: 0 0 0 1px #15171c; }
.td-legende { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--td-grau); font-size: .8rem; }
.td-legende span { display: inline-flex; align-items: center; gap: 5px; }

/* Blatt von unten */
.td-blatt { position: fixed; inset: 0; z-index: 20; }
.td-blatt-hinten { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.td-blatt-inhalt { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto; background: var(--td-flaeche); border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--td-linie); padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .2s ease-out; }
.td-blatt.offen .td-blatt-inhalt { transform: none; }
.td-griff { width: 40px; height: 4px; border-radius: 2px; background: var(--td-linie); margin: 4px auto 12px; }
.td-evo { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0; }
.td-evo h2 { margin: 4px 0 0; font-size: 1.3rem; }
.td-blatt-titel { font-size: 1.2rem; margin: 0 0 6px; overflow-wrap: anywhere; }
.td-blatt-knoepfe { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.td-gross-knopf { width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: var(--td-akzent); color: #15171c; font: 700 1.05rem "Figtree", system-ui, sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.td-zeile-knopf { min-height: 48px; border: 1px solid var(--td-linie); border-radius: 14px; background: none; color: var(--td-text); font: 500 1rem "Figtree", system-ui, sans-serif;
  display: flex; align-items: center; gap: 10px; padding: 0 14px; text-decoration: none; cursor: pointer; }
body.todo-app a.td-zeile-knopf { color: var(--td-text); margin-top: 6px; }
.td-text-knopf { min-height: 48px; border: 0; background: none; color: var(--td-akzent); font: 600 1rem "Figtree", system-ui, sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; text-decoration: none; }
.td-knopf { min-height: 44px; border: 0; border-radius: 12px; background: var(--td-akzent); color: #15171c; font: 600 .95rem "Figtree", system-ui, sans-serif; padding: 0 14px; cursor: pointer; flex: 0 0 auto; }
.td-knopf.leise { background: var(--td-linie); color: var(--td-text); }
.td-knopf.klein { font-size: .9rem; padding: 0 12px; }
.td-datum-zeile { display: flex; gap: 8px; align-items: flex-end; width: 100%; flex-wrap: wrap; }
.td-datum-zeile label { flex: 1 1 160px; display: flex; flex-direction: column; gap: 4px; color: var(--td-grau); font-size: .85rem; }
.td-datum-zeile input { flex: 1 1 140px; }

/* Neue Aufgabe */
.td-neu-kopf { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 4px; }
.td-neu-kopf h1 { margin: 0; text-align: center; }
.td-feld { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; }
.td-feld > span { font-weight: 600; }
.td-neu textarea { min-height: 96px; font-size: 1.1rem; padding: 12px; resize: vertical; width: 100%; }
.td-zwei { display: flex; gap: 8px; flex-wrap: wrap; } .td-zwei > * { flex: 1 1 140px; min-width: 0; }
.td-zwei label, .td-eigene > label, .td-mehr-angaben label { display: flex; flex-direction: column; gap: 4px; color: var(--td-grau); font-size: .85rem; }
.td-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.td-chips button { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--td-linie); background: var(--td-flaeche); color: var(--td-text);
  font: 500 .95rem "Figtree", system-ui, sans-serif; cursor: pointer; }
.td-chips button[aria-checked="true"] { background: var(--td-akzent); border-color: var(--td-akzent); color: #15171c; font-weight: 700; }
.td-chips .td-bchip { border-color: var(--f); color: var(--td-text); }
.td-chips .td-bchip::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--f); margin-right: 7px; }
.td-chips .td-bchip[aria-checked="true"] { background: var(--f); border-color: var(--f); color: #15171c; }
.td-chips .td-bchip[aria-checked="true"]::before { background: #15171c; }
#td-modus { margin-top: 2px; }
.td-eigene { display: flex; flex-direction: column; gap: 10px; background: var(--td-flaeche); border: 1px solid var(--td-linie); border-radius: 14px; padding: 12px; }
.td-klartext { color: var(--td-akzent); margin: 2px 0 0; min-height: 1.2em; }
.td-haken { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.td-haken input { width: 22px; height: 22px; min-height: 0; accent-color: var(--td-akzent); }
.td-haken.td-aus { color: var(--td-grau); } .td-haken small { color: var(--td-grau); }
.td-mehr-angaben { margin: 0 0 12px; } .td-mehr-angaben summary { min-height: 44px; display: flex; align-items: center; color: var(--td-grau); cursor: pointer; }
.td-mehr-angaben > label, .td-mehr-angaben .td-zwei { margin-bottom: 10px; }
.td-speichern-leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--td-bg); border-top: 1px solid var(--td-linie); }

/* Wiederkehrend */
.td-gruppe { background: var(--td-flaeche); border: 1px solid var(--td-linie); border-radius: 16px; padding: 8px 12px; margin-bottom: 12px; }
.td-gruppe h2 small { font-weight: 600; font-size: .8rem; margin-left: auto; }
.td-wk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 52px; border-top: 1px solid var(--td-linie); padding: 2px 0; }
.td-gruppe h2 + .td-wk { border-top: 0; }
.td-naechst { flex: 0 0 auto; font-weight: 600; font-size: .9rem; text-align: right; }

/* Mehr + Listen */
.td-mehr-liste { background: var(--td-flaeche); border: 1px solid var(--td-linie); border-radius: 16px; overflow: hidden; }
.td-mehr-eintrag { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 14px; border-top: 1px solid var(--td-linie); text-decoration: none; }
body.todo-app a.td-mehr-eintrag { color: var(--td-text); }
.td-mehr-eintrag:first-child { border-top: 0; }
.td-mehr-eintrag > span { flex: 1; } .td-mehr-eintrag > .td-sym:last-child { color: var(--td-grau); width: 18px; height: 18px; }
.td-mehr-eintrag.aus { color: var(--td-grau); } .td-mehr-eintrag.aus small { font-size: .8rem; }
.td-unterkopf { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; } .td-unterkopf h1 { margin: 0; flex: 1; }
.td-unterkopf .td-text-knopf .td-sym { width: 18px; height: 18px; }
.td-marken { display: flex; flex-wrap: wrap; gap: 4px; }
.td-marke { font-size: .75rem; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--td-akzent); color: var(--td-akzent); }
.td-marke.rot { border-color: var(--td-rot); color: var(--td-rot); }
#td-seite > .td-eintrag { background: var(--td-flaeche); border: 1px solid var(--td-linie); border-radius: 14px; padding: 4px 10px; margin-bottom: 8px; }

/* gemeinsamer „Idee“-Knopf (vorschlag.js) über die untere Leiste bzw. den Speichern-Knopf heben – der Knopf selbst bleibt unverändert */
body.todo-app #vb-knopf { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
body.todo-app.td-ohne-leiste #vb-knopf { bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
body.todo-app #vb-box { bottom: calc(132px + env(safe-area-inset-bottom)) !important; }
/* lange Titel an Silbengrenzen umbrechen statt mitten im Wort */
.td-text { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.td-wk .td-text { min-width: 9em; }
.td-wk .td-knopf.klein { padding: 0 10px; font-size: .85rem; }
.td-wzeile .td-zeit:empty { display: none; }

/* Kalender-Seite und Assistent (19.10.2026) */
.td-hinweis-karte { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; background: var(--td-flaeche); border: 1px solid var(--td-akzent); border-radius: 14px; padding: 2px 4px 2px 12px; margin-bottom: 10px; }
.td-hinweis-karte > span { flex: 1 1 160px; font-size: .9rem; }
.td-text-knopf.leise { color: var(--td-grau); }
.td-assistent { display: flex; flex-direction: column; gap: 10px; }
.td-assistent p { margin: 0; }
.td-warnung { border-color: var(--td-akzent); } .td-warnung p { color: var(--td-grau); font-size: .9rem; margin-top: 4px; }
.td-gross-knopf:disabled { opacity: .45; cursor: default; }
#td-kal-ich .td-gross-knopf { margin-top: 8px; }

/* Seite „Fotos“ – Testfassung (19.10.2026), gleiche Optik wie To-Do */
body.td-ohne-leiste-fotos { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.fo-kopf .td-marke { vertical-align: middle; margin-left: 6px; }
.fo-paar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fo-karte { margin: 0; min-width: 0; background: var(--td-flaeche); border: 2px solid var(--td-linie); border-radius: 14px; overflow: hidden; }
.fo-karte.fo-vorschlag { border-color: var(--td-akzent); }
.fo-karte img, .fo-keinbild { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #0f1115; }
.fo-keinbild { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--td-grau); }
.fo-keinbild.klein { width: 56px; height: 56px; aspect-ratio: auto; border-radius: 10px; flex: 0 0 56px; }
.fo-karte figcaption { display: flex; flex-direction: column; gap: 2px; padding: 8px; font-size: .82rem; color: var(--td-grau); overflow-wrap: anywhere; }
.fo-karte figcaption b { color: var(--td-text); font-size: .9rem; }
.fo-name { font-size: .75rem; }
.fo-evo { display: flex; align-items: center; gap: 8px; color: var(--td-akzent); margin: 12px 0; }
.fo-evo b { color: var(--td-text); }
.fo-wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.fo-wahl .td-knopf { min-height: 52px; }
.fo-leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--td-flaeche); border-top: 1px solid var(--td-linie); }
.fo-leiste small { grid-column: 1 / -1; text-align: center; min-height: 1em; }
.fo-gross { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; cursor: pointer; }
.fo-liste { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fo-eintrag { display: flex; align-items: center; gap: 10px; min-height: 64px; background: var(--td-flaeche); border: 1px solid var(--td-linie); border-radius: 12px; padding: 4px 10px; }
.fo-eintrag input { width: 24px; height: 24px; min-height: 0; accent-color: var(--td-akzent); flex: 0 0 24px; }
.fo-eintrag img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex: 0 0 56px; }
.fo-evo-knopf:disabled { opacity: .45; }
.fo-vorschau { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 12px; background: #000; }
.fo-vs { flex-wrap: wrap; }
body.td-ohne-leiste-fotos #vb-knopf { bottom: calc(118px + env(safe-area-inset-bottom)) !important; }
