/* v834: To-dos je Projekt – Liste und Woche. Gestaltung wie Terminplan: eigene Farbtokens für Tag/Nacht unter
   #view-todos. Statusfarben (vom Anwender gewählt) nur als Punkt bzw. Streifen, Schrift immer in Textfarbe. */
#view-todos {
  --td-bg: #f4f6f9; --td-surface: #ffffff; --td-surface-2: #f8fafc; --td-surface-3: #f1f4f8;
  --td-border: #e3e8ef; --td-border-strong: #cfd6e0; --td-line: #edf1f5;
  --td-text: #0f1a2a; --td-text-2: #44536a; --td-text-3: #5f6b7f;
  --td-accent: #2563eb; --td-accent-soft: #eaf1ff; --td-on-accent: #ffffff;
  --td-bad: #b42318; --td-bad-soft: #fdecea; --td-ok: #0a7d56;
  --td-warn: #a15c00; --td-warn-soft: #fff6e5;
  --td-shadow-sm: 0 1px 2px rgba(15, 26, 42, .05);
  --td-shadow: 0 1px 2px rgba(15, 26, 42, .04), 0 2px 8px -2px rgba(15, 26, 42, .06);
  --td-shadow-pop: 0 18px 40px -12px rgba(15, 26, 42, .28), 0 4px 12px -4px rgba(15, 26, 42, .12);
  --td-font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
  --td-font-display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
}
html[data-theme="dark"] #view-todos {
  --td-bg: #1a1d21; --td-surface: #21252b; --td-surface-2: #252a31; --td-surface-3: #2a3038;
  --td-border: #323942; --td-border-strong: #424b56; --td-line: #2b3139;
  --td-text: #eef1f5; --td-text-2: #bac3cf; --td-text-3: #8d97a5;
  --td-accent: #6b9bff; --td-accent-soft: rgba(107, 155, 255, .14); --td-on-accent: #0b1424;
  --td-bad: #ff8a80; --td-bad-soft: rgba(255, 138, 128, .12); --td-ok: #3ccf95;
  --td-warn: #f2b24c; --td-warn-soft: rgba(242, 178, 76, .13);
  --td-shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --td-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 4px 14px -6px rgba(0, 0, 0, .4);
  --td-shadow-pop: 0 22px 48px -12px rgba(0, 0, 0, .6), 0 4px 14px -4px rgba(0, 0, 0, .4);
}
body[data-app-view="todos"] .app-layout, body[data-app-view="todos"] .app-layout > main { max-width: none; width: 100%; margin: 0; padding: 0; display: block; }
body[data-app-view="todos"] { background: var(--bg); }
#view-todos { background: var(--td-bg); color: var(--td-text); font-family: var(--td-font); min-height: calc(100vh - 60px); }
/* App-weite Knopf-/Feldregeln ohne Gewicht zurücksetzen – die Klassen unten gewinnen immer */
:where(#view-todos, .td-schwebe) :is(button, input, select, textarea) { font-family: var(--td-font); box-shadow: none; margin: 0; width: auto; min-height: 0; line-height: 1.2; }
:where(#view-todos, .td-schwebe) svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.td { display: grid; gap: 16px; padding: 20px 24px 28px; }
.td-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.td-titel { display: grid; gap: 2px; }
.td-eyebrow { color: var(--td-text-3); font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.td-titel h2 { margin: 0; font: 650 26px/1.15 var(--td-font-display); letter-spacing: -.01em; color: var(--td-text); }
.td-stand { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; color: var(--td-text-2); font-size: 13px; }
.td-stand b { color: var(--td-text); font-weight: 650; }
.td-stand .td-spaet, .td-stand .td-spaet b { color: var(--td-bad); }
.td-werkzeuge { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Rechner: Liste|Woche · Filter · Suchen · Status (im HTML steht der Filter zuletzt, für das Handy-Raster) */
.td-werkzeuge > .td-seg-zwei { order: 1; }
.td-werkzeuge > .td-suche { order: 2; }
.td-werkzeuge > [data-td="status"] { order: 3; }
.td-seg { display: inline-flex; height: 36px; padding: 3px; gap: 2px; border: 1px solid var(--td-border); border-radius: 10px; background: var(--td-surface-2); }
.td-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--td-text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.td-seg button[aria-pressed="true"] { background: var(--td-surface); color: var(--td-text); box-shadow: var(--td-shadow-sm); }
.td-zahl { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--td-surface-3); color: var(--td-text-2); font-size: 11.5px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.td-seg button[aria-pressed="true"] .td-zahl { background: var(--td-accent-soft); color: var(--td-text); }
.td-suche { display: inline-flex; align-items: center; gap: 8px; height: 36px; width: 220px; padding: 0 12px; border: 1px solid var(--td-border); border-radius: 10px; background: var(--td-surface); color: var(--td-text-3); }
.td-suche input { flex: 1; min-width: 0; height: 30px; padding: 0; border: 0; background: transparent; color: var(--td-text); font-size: 13px; outline: none; }
.td-suche input::placeholder { color: var(--td-text-3); }
.td-knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--td-border); border-radius: 10px; background: var(--td-surface); color: var(--td-text); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.td-knopf.primaer { border-color: var(--td-accent); background: var(--td-accent); color: var(--td-on-accent); }
.td-knopf.gefahr { border-color: color-mix(in srgb, var(--td-bad) 45%, var(--td-border)); color: var(--td-bad); }
.td-knopf:disabled { opacity: .55; cursor: default; }
.td-leer { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; color: var(--td-text-2); font-size: 14px; text-align: center; }
.td-leer b { color: var(--td-text); font-size: 15px; }

/* ------------------------------------------------------------------ Liste */
.td-karte { border: 1px solid var(--td-border); border-radius: 14px; background: var(--td-surface); box-shadow: var(--td-shadow); overflow: hidden; }
.td-neu { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--td-border); background: var(--td-surface); }
/* sichtbares Eingabefeld (vorher ohne Rahmen – wirkte wie eine Beschriftung); „+“ gehört zum Feld */
.td-neu-feld { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; height: 40px; margin: 0; padding: 0 12px 0 10px; border: 1px solid var(--td-border-strong); border-radius: 10px; background: var(--td-surface-2); cursor: text; }
.td-neu-feld:focus-within { border-color: var(--td-accent); background: var(--td-surface); box-shadow: 0 0 0 3px var(--td-accent-soft); }
.td-neu-plus { display: grid; place-items: center; width: 22px; height: 22px; color: var(--td-accent); flex: 0 0 auto; }
.td-neu-plus svg { width: 20px; height: 20px; stroke-width: 2; }
.td-neu-feld input { flex: 1; min-width: 0; height: 36px; padding: 0; border: 0; background: transparent; color: var(--td-text); font-size: 15px; outline: none; }
.td-neu-feld input::placeholder { color: var(--td-text-3); }
.td-neu-feld.td-hinweis { animation: td-hinweis .5s ease 2; }
@keyframes td-hinweis { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--td-accent) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .td-neu-feld.td-hinweis { animation: none; } }
.td-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px dashed var(--td-border-strong); border-radius: 999px; background: transparent; color: var(--td-text-2); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.td-chip.gesetzt { border-style: solid; border-color: color-mix(in srgb, var(--td-accent) 45%, var(--td-border)); background: var(--td-accent-soft); color: var(--td-text); }
.td-chip svg { width: 15px; height: 15px; }
.td-chip .td-chip-weg { display: grid; place-items: center; width: 18px; height: 18px; margin-right: -6px; border-radius: 50%; color: var(--td-text-2); }

.td-liste { display: grid; }
.td-zeile { display: grid; grid-template-columns: 52px minmax(0, 1fr) 160px 170px 180px 180px 160px 44px; align-items: center; min-height: 62px; border-bottom: 1px solid var(--td-line); }
.td-zeile:last-child { border-bottom: 0; }
.td-kopfzeile { min-height: 36px; background: var(--td-surface-2); border-bottom: 1px solid var(--td-border); color: var(--td-text-3); font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.td-kopfzeile > span { padding: 0 12px; }
.td-kopfzeile > span:nth-child(2) { padding-left: 0; }
.td-check { display: grid; place-items: center; width: 52px; height: 100%; }
.td-check button, .tw-check { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 2px solid var(--td-border-strong); border-radius: 50%; background: transparent; color: transparent; cursor: pointer; }
.td-check button svg, .tw-check svg { width: 13px; height: 13px; stroke-width: 2.6; }
.td-check button:hover, .tw-check:hover { border-color: var(--td-ok); color: var(--td-ok); }
.erledigt .td-check button, .erledigt .tw-check { border-color: var(--td-ok); background: var(--td-ok); color: var(--td-surface); }
.td-text { min-width: 0; padding: 10px 12px 10px 0; }
/* nie abschneiden: lange Titel, Namen und Status brechen um */
.td-text b { display: block; color: var(--td-text); font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.td-text small { display: block; margin-top: 2px; color: var(--td-text-3); font-size: 12.5px; }
.td-zeile.erledigt .td-text b, .tw-karte.erledigt b { color: var(--td-text-3); text-decoration: line-through; text-decoration-color: var(--td-border-strong); }
.td-titel-feld { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--td-accent); border-radius: 8px; background: var(--td-surface); color: var(--td-text); font: 600 15px/1.2 var(--td-font); outline: none; }
.td-person { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 0 12px; border: 0; background: transparent; color: var(--td-text); font-size: 13.5px; text-align: left; cursor: pointer; }
.td-person > span:last-child { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.td-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--td-surface-3); box-shadow: inset 0 0 0 1px var(--td-border); color: var(--td-text-2); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.td-avatar.ich { background: var(--td-accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--td-accent) 35%, transparent); color: var(--td-text); }
.td-avatar.leer { background: transparent; box-shadow: none; border: 1.5px dashed var(--td-border-strong); }
.td-person.leer { color: var(--td-text-3); }
.td-status-zelle { padding: 0 12px; min-width: 0; }
.td-status { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; max-width: 100%; padding: 4px 10px 4px 11px; border: 1px solid var(--td-border); border-radius: 999px; background: var(--td-surface); color: var(--td-text); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.td-status > span { min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: left; line-height: 1.25; }
.td-status i, .td-menue i.punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--st); flex: 0 0 auto; }
.td-status svg { width: 13px; height: 13px; color: var(--td-text-3); }
.td-datum { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; margin: 0 0 0 12px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--td-text-2); font-size: 13.5px; font-variant-numeric: tabular-nums; text-align: left; cursor: pointer; white-space: nowrap; }
.td-datum:hover { background: var(--td-surface-3); }
.td-datum.bald { color: var(--td-text); font-weight: 600; }
.td-datum.spaet { background: var(--td-bad-soft); color: var(--td-bad); font-weight: 650; }
.td-datum.liegt { background: var(--td-warn-soft); color: var(--td-warn); font-weight: 650; }
.td-datum.leer { color: var(--td-text-3); }
.td-datum svg { display: none; }
.td-kurz { display: none; }
.td-mehr { display: grid; place-items: center; }
.td-mehr button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--td-text-3); font-size: 18px; cursor: pointer; }
.td-mehr button:hover { background: var(--td-surface-3); color: var(--td-text); }
.td-erledigt-kopf { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 18px; border: 0; border-top: 1px solid var(--td-border); background: var(--td-surface-2); color: var(--td-text-2); font-size: 13.5px; font-weight: 650; cursor: pointer; text-align: left; }
.td-erledigt-kopf svg { width: 15px; height: 15px; transition: transform .15s ease; }
.td-erledigt-kopf[aria-expanded="true"] svg { transform: rotate(90deg); }
.td-erledigt-kopf .td-zahl { min-width: 22px; height: 20px; line-height: 20px; font-size: 12px; }
@media (min-width: 1181px) { .td-unten { display: contents; } }

/* ------------------------------------------------------------------ Woche */
.tw { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.tw-panel, .tw-woche { border: 1px solid var(--td-border); border-radius: 14px; background: var(--td-surface); box-shadow: var(--td-shadow); }
.tw-panel { display: grid; gap: 10px; padding: 12px 14px 14px; }
.tw > .tw-panel { grid-template-columns: auto minmax(220px, 340px) 1fr; align-items: center; column-gap: 14px; }
.tw > .tw-panel > .tw-stapel { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); min-height: 52px; }
.tw > .tw-panel > small { justify-self: end; }
.tw-panel-kopf { display: flex; align-items: center; gap: 8px; }
.tw-panel-kopf b { font-size: 14px; font-weight: 650; }
.tw-panel small { color: var(--td-text-3); font-size: 12px; }
.tw-neu { display: flex; align-items: center; min-width: 0; }
.tw-neu .td-neu-feld { height: 38px; }
.tw-neu .td-neu-feld input { height: 32px; font-size: 13.5px; }
.tw-neu .td-neu-plus svg { width: 16px; height: 16px; }
.tw-stapel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; min-width: 0; }
.tw-hinweis { align-self: center; color: var(--td-text-3); font-size: 12.5px; }
.tw-karte { position: relative; display: grid; gap: 8px; min-width: 0; padding: 9px 9px 9px 12px; border: 1px solid var(--td-border); border-radius: 10px; background: var(--td-surface); box-shadow: var(--td-shadow-sm); cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.tw-karte::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; border-radius: 10px 0 0 10px; background: var(--st); }
.tw-karte b { color: var(--td-text); font-size: 13px; font-weight: 600; line-height: 1.35; hyphens: auto; overflow-wrap: anywhere; }
.tw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 22px; min-width: 0; }
.tw-meta .td-avatar { width: 22px; height: 22px; font-size: 9.5px; }
.tw-frist { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--td-surface-3); color: var(--td-text-2); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.tw-frist svg { width: 11px; height: 11px; stroke-width: 2; }
.tw-frist.spaet { background: var(--td-bad-soft); color: var(--td-bad); }
.tw-frist.warn, .tw-frist.liegt { background: var(--td-warn-soft); color: var(--td-warn); }
.tw-check { width: 20px; height: 20px; margin-left: auto; }
.tw-woche { overflow: hidden; }
.tw-nav { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--td-border); }
.tw-nav b { font-size: 15px; font-weight: 650; white-space: nowrap; }
.tw-nav span { color: var(--td-text-2); font-size: 13px; white-space: nowrap; }
.tw-pfeil { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--td-border); border-radius: 9px; background: var(--td-surface); color: var(--td-text); cursor: pointer; }
.tw-pfeil svg { width: 16px; height: 16px; }
.tw-nav .td-knopf { height: 32px; margin-left: auto; }
.tw-tage { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tw-tag { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-width: 0; border-right: 1px solid var(--td-line); }
.tw-tag:last-child { border-right: 0; }
.tw-tag.we { background: var(--td-surface-2); }
.tw-tagkopf { display: flex; align-items: baseline; gap: 6px; min-width: 0; padding: 10px 8px 8px 10px; border-bottom: 1px solid var(--td-line); }
.tw-tagkopf b { font-size: 13px; font-weight: 700; }
.tw-tagkopf span { color: var(--td-text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tw-tagkopf .td-zahl { margin-left: auto; }
.tw-tag.heute .tw-tagkopf { box-shadow: inset 0 3px 0 var(--td-accent); }
.tw-tag.heute .tw-tagkopf b, .tw-tag.heute .tw-tagkopf span { color: var(--td-accent); }
.tw-tag.vorbei .tw-tagkopf b, .tw-tag.vorbei .tw-tagkopf span { color: var(--td-text-3); }
.tw-tag .tw-stapel { min-height: 360px; padding: 8px; }
/* Ziehen */
.tw-ziel { outline: 2px dashed var(--td-accent); outline-offset: -4px; border-radius: 10px; background: var(--td-accent-soft) !important; }
.tw-quelle { opacity: .35; }
.tw-platzhalter { height: 6px; border-radius: 3px; background: var(--td-accent); }
.tw-geist { position: fixed; z-index: 9500; margin: 0; transform: rotate(-2deg); box-shadow: var(--td-shadow-pop); pointer-events: none; opacity: .96; }
body.tw-zieht, body.tw-zieht * { cursor: grabbing !important; user-select: none !important; }
.tw-handy { display: none; }

/* ------------------------------------------------------------------ Menüs, Details, Status verwalten */
.td-schwebe {
  --td-surface: #ffffff; --td-surface-2: #f8fafc; --td-surface-3: #f1f4f8; --td-border: #e3e8ef; --td-border-strong: #cfd6e0;
  --td-text: #0f1a2a; --td-text-2: #44536a; --td-text-3: #5f6b7f; --td-accent: #2563eb; --td-accent-soft: #eaf1ff; --td-on-accent: #ffffff;
  --td-bad: #b42318; --td-ok: #0a7d56; --td-shadow-pop: 0 18px 40px -12px rgba(15, 26, 42, .28), 0 4px 12px -4px rgba(15, 26, 42, .12);
  --td-font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
  --td-font-display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
  color: var(--td-text); font-family: var(--td-font);
}
html[data-theme="dark"] .td-schwebe {
  --td-surface: #21252b; --td-surface-2: #252a31; --td-surface-3: #2a3038; --td-border: #323942; --td-border-strong: #424b56;
  --td-text: #eef1f5; --td-text-2: #bac3cf; --td-text-3: #8d97a5; --td-accent: #6b9bff; --td-accent-soft: rgba(107, 155, 255, .14); --td-on-accent: #0b1424;
  --td-bad: #ff8a80; --td-ok: #3ccf95; --td-shadow-pop: 0 22px 48px -12px rgba(0, 0, 0, .6), 0 4px 14px -4px rgba(0, 0, 0, .4);
}
.td-menue { position: fixed; z-index: 9600; display: grid; gap: 2px; min-width: 220px; max-width: min(320px, calc(100vw - 24px)); max-height: min(420px, calc(100vh - 24px)); overflow: auto; padding: 6px; border: 1px solid var(--td-border); border-radius: 12px; background: var(--td-surface); box-shadow: var(--td-shadow-pop); }
.td-menue button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--td-text); font-size: 13.5px; font-weight: 550; text-align: left; cursor: pointer; }
.td-menue button:hover, .td-menue button:focus-visible { background: var(--td-surface-3); outline: none; }
.td-menue button[aria-checked="true"] { background: var(--td-accent-soft); }
.td-menue button.gefahr { color: var(--td-bad); }
.td-menue hr { width: 100%; height: 1px; margin: 4px 0; border: 0; background: var(--td-border); }
.td-menue .td-avatar { width: 24px; height: 24px; font-size: 10px; }
.td-menue small { color: var(--td-text-3); font-size: 12px; padding: 4px 10px 2px; }
.td-detail { position: fixed; z-index: 9600; width: min(380px, calc(100vw - 24px)); padding: 16px; border: 1px solid var(--td-border); border-radius: 14px; background: var(--td-surface); box-shadow: var(--td-shadow-pop); }
.td-detail-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.td-detail-kopf b { font-size: 14px; font-weight: 650; }
.td-zu { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--td-border); border-radius: 9px; background: transparent; color: var(--td-text); font-size: 18px; cursor: pointer; }
.td-detail label { display: grid; gap: 5px; margin: 0 0 10px; color: var(--td-text-2); font-size: 12.5px; font-weight: 650; }
.td-detail :is(textarea, select, input) { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--td-border); border-radius: 9px; background: var(--td-surface); color: var(--td-text); font-size: 14px; font-weight: 400; }
.td-detail textarea { resize: vertical; min-height: 60px; line-height: 1.4; }
.td-detail .td-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.td-detail-fuss { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.td-detail-fuss small { color: var(--td-text-3); font-size: 12px; }
.td-dialog-hinter { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px); }
.td-dialog { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--td-border); border-radius: 18px; background: var(--td-surface); box-shadow: var(--td-shadow-pop); }
.td-dialog-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 6px; }
.td-dialog-kopf h3 { margin: 2px 0 0; font: 650 21px/1.2 var(--td-font-display); color: var(--td-text); }
.td-dialog-kopf .td-zu { width: 36px; height: 36px; border-radius: 10px; font-size: 20px; }
.td-dialog-hinweis { margin: 0; padding: 0 24px 14px; color: var(--td-text-2); font-size: 13px; line-height: 1.5; }
.td-st-liste { display: grid; gap: 8px; padding: 0 24px; }
.td-st-zeile { display: grid; grid-template-columns: 22px 34px minmax(0, 1fr) auto 36px; align-items: center; gap: 10px; padding: 8px 8px 8px 6px; border: 1px solid var(--td-border); border-radius: 12px; background: var(--td-surface-2); }
.td-griff { display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--td-text-3); cursor: grab; touch-action: none; }
.td-griff svg { width: 16px; height: 16px; }
.td-farbe { position: relative; width: 34px; height: 34px; overflow: hidden; border: 1px solid var(--td-border-strong); border-radius: 9px; background: var(--st); cursor: pointer; }
.td-farbe input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.td-st-zeile input[type="text"] { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--td-border); border-radius: 9px; background: var(--td-surface); color: var(--td-text); font-size: 14px; }
.td-schalter { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: var(--td-text-2); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.td-schalter .bahn { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--td-border-strong); }
.td-schalter .bahn::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s ease; }
.td-schalter[aria-checked="true"] .bahn { background: var(--td-ok); }
.td-schalter[aria-checked="true"] .bahn::after { left: 18px; }
.td-st-weg { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--td-text-3); cursor: pointer; }
.td-st-weg:hover { color: var(--td-bad); }
.td-st-neu { display: inline-flex; align-items: center; gap: 8px; margin: 12px 24px 0; height: 38px; padding: 0 14px; border: 1px dashed var(--td-border-strong); border-radius: 10px; background: transparent; color: var(--td-text); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.td-dialog-fuss { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px 24px 22px; }
.td-dialog-fuss .td-knopf { height: 44px; font-size: 14px; }

/* ------------------------------------------------------------------ Handy */
/* Mittlere Breiten (Tablet, kleiner Laptop): Liste als Karten – nichts wird zu eng (v838: ab 1180 px wegen „Erfasst von“) */
@media (max-width: 1180px) {
  .td-kopfzeile { display: none; }
  .td-zeile { position: relative; grid-template-columns: 44px minmax(0, 1fr) 40px; grid-template-areas: "c t m" ". d d"; align-items: start; min-height: 0; padding: 12px 0; row-gap: 10px; }
  .td-check { grid-area: c; height: auto; padding-top: 1px; width: 44px; }
  .td-text { grid-area: t; padding: 0 34px 0 0; }
  .td-mehr { grid-area: m; align-self: start; margin-top: -4px; }
  .td-unten { grid-area: d; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; min-width: 0; padding-right: 8px; }
  .td-unten .td-status-zelle { order: 1; flex: 0 0 auto; padding: 0; }
  .td-unten .td-datum { order: 2; gap: 5px; margin: 0; padding: 0 5px; }
  .td-unten .td-datum svg { display: inline; width: 14px; height: 14px; }
  .td-unten .td-datum.leer { display: none; }
  /* Kürzel fest oben rechts neben „⋯“ – darunter Status, Geplant, Fällig in einer Zeile */
  .td-unten .td-person { position: absolute; top: 10px; right: 44px; margin: 0; padding: 0; }
  .td-unten .td-person > span:last-child { display: none; }
  .td-unten .td-status { min-height: 28px; gap: 7px; padding: 4px 10px 4px 10px; }
  .td-unten .td-status svg { display: none; }
  .td-lang { display: none; }
  .td-kurz { display: inline; }
  .td-erfasst { display: none; }
  .td-text .td-erfasst-zeile { display: inline; }
}
@media (max-width: 820px) {
  .tw { display: none; }
  .tw-handy { display: grid; gap: 12px; }
  .tw-handy .tw-woche { overflow: visible; }
  .tw-handy .tw-nav { padding: 8px 10px; }
  .tw-handy .tw-nav span { display: none; }
  .tw-leiste { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 8px; }
  .tw-leiste button { display: grid; justify-items: center; gap: 2px; height: 58px; padding: 6px 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--td-text-2); font-size: 11.5px; font-weight: 600; cursor: pointer; }
  .tw-leiste button b { color: var(--td-text); font-size: 16px; font-weight: 650; }
  .tw-leiste button i { width: 5px; height: 5px; border-radius: 50%; background: var(--td-text-3); }
  .tw-leiste button i.leer { background: transparent; }
  .tw-leiste button.we { background: var(--td-surface-2); }
  .tw-leiste button.heute b { color: var(--td-accent); }
  .tw-leiste button[aria-pressed="true"] { border-color: var(--td-accent); background: var(--td-accent-soft); }
  .tw-leiste button[aria-pressed="true"] i { background: var(--td-accent); }
  .tw-handy .tw-woche .tw-stapel { padding: 0 10px 12px; }
  .tw-handy .tw-tagtitel { display: flex; align-items: baseline; gap: 8px; padding: 2px 10px 10px; }
  .tw-handy .tw-tagtitel b { font-size: 15px; font-weight: 650; }
  .tw-handy .tw-tagtitel span { color: var(--td-text-2); font-size: 13px; }
  .tw-handy .tw-karte b { font-size: 14px; }
  .tw-handy .tw-panel { padding: 12px 10px; }
  .tw-handy .tw-panel > .tw-stapel { min-height: 0; }
}
@media (max-width: 640px) {
  .td { gap: 12px; padding: 14px 0 24px; } /* die App hat am Handy schon 16 px Seitenrand */
  .td-kopf { align-items: stretch; flex-direction: column; gap: 12px; }
  .td-titel h2 { font-size: 22px; }
  .td-werkzeuge { display: grid; grid-template-columns: minmax(0, 1fr) 40px 40px; gap: 8px; }
  .td-werkzeuge.k1, .td-werkzeuge.k2.suche-offen { grid-template-columns: minmax(0, 1fr) 40px; }
  .td-werkzeuge.k0, .td-werkzeuge.k1.suche-offen { grid-template-columns: minmax(0, 1fr); }
  .td-werkzeuge .td-seg { display: flex; height: 40px; }
  .td-werkzeuge .td-seg button { flex: 1; height: 32px; padding: 0 6px; }
  .td-werkzeuge .td-seg-zwei { grid-column: 1 / -1; grid-row: 2; }
  .td-suche { width: 40px; height: 40px; justify-content: center; padding: 0; cursor: pointer; }
  .td-suche input { display: none; }
  .td-suche.offen { grid-column: 1 / -1; grid-row: 3; width: auto; justify-content: flex-start; padding: 0 12px; }
  .td-suche.offen input { display: block; font-size: 16px; }
  .td-werkzeuge .td-knopf { width: 40px; height: 40px; padding: 0; }
  .td-werkzeuge .td-knopf span { display: none; }
  .td-neu { flex-wrap: wrap; gap: 8px; padding: 10px 12px 12px; }
  .td-neu .td-neu-feld { order: 1; flex: 1 1 100%; }
  .td-neu-feld input { font-size: 16px; }
  .td-neu .td-chip { order: 3; }
  .td-st-zeile { grid-template-columns: 18px 30px minmax(0, 1fr) 36px; grid-template-areas: "g f n w" ". . s ."; }
  .td-st-zeile .td-griff { grid-area: g; }
  .td-st-zeile .td-farbe { grid-area: f; width: 30px; height: 30px; }
  .td-st-zeile input[type="text"] { grid-area: n; }
  .td-st-zeile .td-schalter { grid-area: s; justify-self: start; }
  .td-st-zeile .td-st-weg { grid-area: w; }
  .td-dialog-kopf, .td-dialog-hinweis, .td-st-liste, .td-dialog-fuss { padding-left: 16px; padding-right: 16px; }
  .td-st-neu { margin-left: 16px; }
  /* Details als Blatt von unten */
  .td-detail { left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; max-height: calc(100vh - 80px); overflow: auto; }
}

/* ------------------------------------------------------------------ Arbeitsbereich: Eintrag „To-dos“ (wie Terminplan) */
#todoCard::before { content: ""; }
#bauleiterArbeitsbereich #todoCard { min-height: 78px !important; padding: 15px 76px 15px 70px !important; }
#bauleiterArbeitsbereich #todoCard > #btnTodosOeffnen {
  position: absolute !important; inset: 0 !important; z-index: 4 !important; width: 100% !important; min-width: 0 !important; max-width: none !important;
  height: 100% !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; transform: none !important; border: 0 !important;
  border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: transparent !important; font-size: 0 !important; cursor: pointer !important;
}
#bauleiterArbeitsbereich #todoCard::after {
  content: "›"; position: absolute; right: 20px; top: 39px; transform: translateY(-50%); z-index: 3;
  color: var(--text-muted); font-size: 26px; font-weight: 400; line-height: 1; pointer-events: none;
}
#todoCard .todo-start-count[hidden] { display: none !important; }
@media (max-width: 900px) {
  #bauleiterArbeitsbereich #todoCard { min-height: 74px !important; padding: 14px 58px 14px 60px !important; }
  #bauleiterArbeitsbereich #todoCard::after { right: 14px; top: 37px; }
}
@media (max-width: 620px) {
  #bauleiterArbeitsbereich #todoCard { min-height: 72px !important; padding: 13px 48px 13px 56px !important; }
  #bauleiterArbeitsbereich #todoCard::after { right: 10px; top: 36px; font-size: 24px; }
}
/* Zahl-Plaketten im Arbeitsbereich lesbar (vorher hell 3,7 : 1): Akzent mit Schriftfarbe gemischt (wie v790 Links) */
#bauleiterArbeitsbereich :is(.anfahrpunkte-count, #globalDokumenteCard .dokumente-start-count) { color: color-mix(in srgb, var(--accent) 72%, var(--text)) !important; }

/* v836: Zeichen in Liste und Woche – ≡ Beschreibung, Büroklammer = Anhänge, Bild = Bilder */
.td-mehrinfo { display: inline-flex; gap: 5px; }
.td-mehrinfo span { display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px; border-radius: 6px; background: var(--td-surface-3); color: var(--td-text-2); font-size: 11.5px; font-weight: 650; line-height: 1; }
.td-mehrinfo svg { width: 12px; height: 12px; stroke-width: 2; }
.td-text small:has(.td-mehrinfo) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.td-detail-knoepfe { display: inline-flex; gap: 8px; }

/* v836: Fenster wie die Hilfe (feldhilfe.css) – Ansicht mit Angaben und Anhängen, Bearbeiten mit Feldern und Dateien */
.tdf.feldhilfe-ansicht.feldhilfe-mittig { width: min(760px, calc(100vw - 32px)); max-height: min(88vh, 920px); }
.tdf-bearbeiten {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; margin: 0; padding: 0 14px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tdf-bearbeiten:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.tdf-bearbeiten svg { width: 16px; height: 16px; }
.tdf-meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 14px; border-bottom: 1px solid var(--border); }
.tdf-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 11px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.tdf-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--st); }
.tdf-chip small { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.tdf-chip svg { width: 14px; height: 14px; color: var(--text-muted); }
.tdf-chip.spaet { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); color: color-mix(in srgb, var(--bad) 80%, var(--text)); }
.tdf-avatar { display: grid; place-items: center; width: 22px; height: 22px; margin-left: -5px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); font-size: 9.5px; font-weight: 700; }
.feldhilfe-inhalt.tdf-inhalt { padding-top: 16px; }
.tdf-anhaenge { display: grid; gap: 8px; }
.tdf-anhaenge:not(:empty) { margin-top: 4px; }
.tdf-anhaenge h3 { margin: 6px 0 2px; color: var(--text-muted); font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.tdf-datei {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 8px 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.tdf-datei.fehler { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.tdf-datei.fehler small { color: color-mix(in srgb, var(--bad) 80%, var(--text)); }
.tdf-typ { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--typ); color: #ffffff; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; }
.tdf-datei-text { min-width: 0; }
.tdf-datei b { display: block; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.tdf-datei small { color: var(--text-muted); font-size: 12.5px; }
.tdf-datei-knopf { display: inline-flex; align-items: center; gap: 6px; height: 34px; margin: 0; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tdf-datei-knopf:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tdf-datei-knopf svg { width: 15px; height: 15px; }
.tdf-datei-weg { display: grid; place-items: center; width: 34px; height: 34px; margin: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; }
.tdf-datei-weg:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); color: color-mix(in srgb, var(--bad) 80%, var(--text)); }
.tdf-datei-weg svg { width: 16px; height: 16px; }
.tdf-titel-feld {
  box-sizing: border-box; display: block; width: 100%; min-height: 44px; margin: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--input-bg); color: var(--text); font: inherit; font-size: 17px; font-weight: 650; line-height: 1.3; resize: none; overflow: hidden;
}
.tdf-titel-feld:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.tdf-felder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.tdf-felder label { display: grid; gap: 5px; margin: 0; color: var(--text-muted); font-size: 12.5px; font-weight: 650; }
.tdf-felder :is(select, input) {
  box-sizing: border-box; width: 100%; min-height: 40px; margin: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--input-bg); color: var(--text); font: inherit; font-size: 14px; font-weight: 400;
}
.tdf-ablage {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; min-height: 60px; padding: 10px 14px;
  border: 1.5px dashed var(--border); border-radius: 12px; color: var(--text-muted); font-size: 13.5px; text-align: center;
}
.tdf-ablage.tdf-ziel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tdf-ablage svg { width: 18px; height: 18px; }
.tdf-ablage-wahl { position: relative; display: inline-block; color: color-mix(in srgb, var(--accent) 75%, var(--text)); font-weight: 650; text-decoration: underline; cursor: pointer; }
.tdf-ablage-wahl:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tdf-fuss-loeschen { display: inline-flex; align-items: center; gap: 7px; }
.tdf-fuss-loeschen svg { width: 16px; height: 16px; }
.tdf-kurz { display: none; }
.feldhilfe-schaltflaeche.tdf-gefahr { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); color: color-mix(in srgb, var(--bad) 80%, var(--text)); }
@media (max-width: 640px) {
  .tdf-felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tdf-meta { padding: 0 16px 12px; }
  .tdf-bearbeiten span { display: none; }
  .tdf-bearbeiten { width: 40px; padding: 0; justify-content: center; }
  .tdf-datei-knopf span { display: none; }
  .tdf-datei-knopf { width: 34px; padding: 0; justify-content: center; }
  .tdf-lang { display: none; }
  .tdf-kurz { display: inline; }
}

/* v837: Titel in der Ansicht per Klick ändern */
.tdf .feldhilfe-titel.tdf-titel-klick { margin-left: -6px; padding: 1px 6px; border-radius: 7px; cursor: text; outline: none; }
.tdf .feldhilfe-titel.tdf-titel-klick:hover,
.tdf .feldhilfe-titel.tdf-titel-klick:focus-visible { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.tdf .feldhilfe-titel.tdf-titel-klick:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.tdf .feldhilfe-titel.tdf-titel-klick::after {
  content: ""; display: inline-block; width: 15px; height: 15px; margin-left: 8px; vertical-align: -2px; opacity: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='m14 6 4 4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='m14 6 4 4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tdf .feldhilfe-titel.tdf-titel-klick:is(:hover, :focus-visible)::after { opacity: .75; }
@media (hover: none) { .tdf .feldhilfe-titel.tdf-titel-klick::after { opacity: .6; } }
.tdf-titel-rahmen { min-width: 0; }
.tdf-titel-eingabe {
  display: block; box-sizing: border-box; width: calc(100% + 9px); margin: 1px 0 0 -9px; padding: 2px 8px; border: 1px solid var(--accent); border-radius: 8px;
  background: var(--input-bg); color: var(--text); font: inherit; font-size: 16.5px; font-weight: 650; line-height: 1.35; outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); resize: none; overflow: hidden; overflow-wrap: anywhere; min-height: 0;
}
.feldhilfe-gross-an .tdf-titel-eingabe { font-size: 19px; }
@media (max-width: 640px) { .tdf-titel-eingabe { font-size: 17px; } }
.tdf-titel-hinweis { display: block; margin-top: 5px; color: var(--text-muted); font-size: 12px; font-weight: 500; }

/* v837: Bilder links (wie ein eingefügter Schnappschuss), Knopfleiste daneben, Verschieben per Ziehen */
.tdf .feldhilfe-dok figure,
.tdf-editor .fhe-flaeche figure.fhe-bild { margin-left: 0; margin-right: auto; }
.tdf .feldhilfe-dok figcaption,
.tdf-editor .fhe-flaeche figure.fhe-bild figcaption { text-align: left; }
.tdf-editor .fhe-flaeche figure.fhe-bild.fhe-leiste-rechts .fhe-bildleiste { top: 0; left: calc(100% + 10px); transform: none; }
.tdf-editor .fhe-flaeche figure.fhe-bild .fhe-bild-rahmen { cursor: grab; }
.tdf-editor .fhe-quelle .fhe-bild-rahmen { opacity: .3; }
.tdf-editor .fhe-geist {
  position: absolute; z-index: 20; margin: 0; pointer-events: none; opacity: .92; transform: rotate(-1.2deg);
  box-shadow: 0 18px 40px rgb(15 23 42 / 28%);
}
.tdf-editor .fhe-geist img { width: 100%; }
.tdf-editor .fhe-einfuegelinie { position: absolute; z-index: 19; height: 3px; border-radius: 2px; background: var(--accent); pointer-events: none; }
.tdf-editor .fhe-einfuegelinie::before { content: ""; position: absolute; left: -5px; top: -3.5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tdf-editor.fhe-zieht-bild, .tdf-editor.fhe-zieht-bild * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

/* v838: „Erfasst von“ – breit als eigene Spalte (Kürzel, Name, Datum), schmal als Zeile unter dem Titel */
.td-erfasst { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 0 12px; color: var(--td-text); font-size: 13.5px; }
.td-erfasst .td-avatar { background: var(--td-surface); box-shadow: inset 0 0 0 1.5px var(--td-border-strong); }
.td-erfasst > span:last-child { display: grid; min-width: 0; line-height: 1.3; }
.td-erfasst-name { overflow-wrap: anywhere; }
.td-erfasst small { color: var(--td-text-3); font-size: 12px; }
.td-text .td-erfasst-zeile, .td-text .td-erfasst-zeile + .td-trenner { display: none; }
@media (max-width: 1180px) {
  .td-erfasst { display: none; }
  .td-text .td-erfasst-zeile, .td-text .td-erfasst-zeile + .td-trenner { display: inline; }
}
.td-stand .td-liegt { color: var(--td-warn); }
.td-stand .td-liegt b { color: var(--td-warn); }

/* v838: Ansichten Tag · Woche · 2 Wochen · Monat */
.td-seg-kurz { display: none; }
#view-todos {
  --td-we: color-mix(in srgb, var(--td-text) 4.5%, var(--td-surface)); --td-we-kopf: color-mix(in srgb, var(--td-text) 8%, var(--td-surface));
  --td-ft: rgba(220, 38, 38, .07); --td-ft-streifen: rgba(220, 38, 38, .15); --td-ft-linie: #dc2626; --td-ft-text: #b42318;
  --td-ft-kopf: color-mix(in srgb, var(--td-surface) 88%, #dc2626);
}
html[data-theme="dark"] #view-todos {
  --td-we: color-mix(in srgb, var(--td-text) 5%, var(--td-surface)); --td-we-kopf: color-mix(in srgb, var(--td-text) 9%, var(--td-surface));
  --td-ft: rgba(255, 123, 123, .08); --td-ft-streifen: rgba(255, 123, 123, .16); --td-ft-linie: #ff7b7b; --td-ft-text: #ff9b9b;
  --td-ft-kopf: color-mix(in srgb, var(--td-surface) 86%, #ff7b7b);
}
/* Wochenende deutlich grau, Feiertage rot gestreift mit Namen (wie in der Einsatzplanung) */
.tw-tag.we { background: var(--td-we); }
.tw-tag.we .tw-tagkopf { background: var(--td-we-kopf); }
.tw-tag.ft { background: repeating-linear-gradient(135deg, var(--td-ft-streifen) 0 2px, transparent 2px 9px), var(--td-ft); }
.tw-tag.ft .tw-tagkopf { background: var(--td-ft-kopf); box-shadow: inset 0 3px 0 var(--td-ft-linie); }
.tw-tag.ft .tw-tagkopf b, .tw-tag.ft .tw-tagkopf > span:not(.td-zahl):not(.tw-feiertag) { color: var(--td-ft-text); }
.tw-tag.we.vorbei .tw-tagkopf b, .tw-tag.we.vorbei .tw-tagkopf > span:not(.td-zahl):not(.tw-feiertag) { color: var(--td-text-2); }
.tw-tag.heute .tw-tagkopf { box-shadow: inset 0 3px 0 var(--td-accent); }
/* „heute“ auch auf grauem Wochenende lesbar: Akzent mit Schriftfarbe gemischt */
.tw-tag.heute .tw-tagkopf b, .tw-tag.heute .tw-tagkopf > span:not(.td-zahl):not(.tw-feiertag) { color: color-mix(in srgb, var(--td-accent) 78%, var(--td-text)); }
.tw-tagkopf { flex-wrap: wrap; row-gap: 4px; }
.tw-feiertag { display: inline-flex; align-items: center; min-height: 18px; padding: 1px 7px; border-radius: 7px; background: var(--td-surface); box-shadow: inset 0 0 0 1px var(--td-ft-linie);
  color: var(--td-ft-text); font-size: 11px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.tw-tag.vorbei.ft .tw-tagkopf b { color: var(--td-ft-text); }
/* Karte: wer hat es erfasst */
.tw-von { display: flex; align-items: flex-start; gap: 4px; margin-top: -4px; color: var(--td-text-3); font-size: 11.5px; line-height: 1.3; }
.tw-von svg { flex: 0 0 auto; width: 11px; height: 11px; margin-top: 2px; stroke-width: 2; }
.tw-von span { min-width: 0; overflow-wrap: anywhere; }
/* 2 Wochen: zwei Reihen à 7 Tage */
.tw-tage.zwei + .tw-tage.zwei { border-top: 1px solid var(--td-border); }
.tw-tage.zwei .tw-tag .tw-stapel { min-height: 210px; }
/* Monat: Wochentage oben, 7 Spalten, Tage anderer Monate blass */
.tw-monatkopf { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--td-line); }
.tw-monatkopf span { padding: 8px 10px; color: var(--td-text-2); font-size: 12px; font-weight: 700; }
.tw-monatkopf span.we { background: var(--td-we-kopf); }
.tw-monat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tw-monat .tw-tag { border-right: 1px solid var(--td-line); border-bottom: 1px solid var(--td-line); }
.tw-monat .tw-tag:nth-child(7n) { border-right: 0; }
.tw-monat .tw-tagkopf { padding: 6px 8px; }
.tw-monat .tw-tagkopf span:first-child { color: var(--td-text); font-size: 13px; font-weight: 700; }
.tw-monat .tw-tag .tw-stapel { min-height: 92px; gap: 6px; padding: 6px; }
.tw-monat .tw-tag.fremd .tw-tagkopf, .tw-monat .tw-tag.fremd .tw-stapel { opacity: .5; }
.tw-monat .tw-karte { gap: 5px; padding: 6px 7px 6px 10px; }
.tw-monat .tw-karte b { font-size: 12.5px; }
.tw-monat .tw-meta { min-height: 20px; gap: 4px; }
.tw-monat .tw-meta .td-avatar { width: 20px; height: 20px; font-size: 9px; }
/* Tag: eine breite Spalte, Karten nebeneinander */
.tw-tagansicht .tw-tag { border-right: 0; }
.tw-tagansicht .tw-tagkopf { padding: 12px 14px 10px; }
.tw-tagansicht .tw-tagkopf b { font-size: 15px; }
.tw-tagansicht .tw-stapel { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); min-height: 320px; padding: 12px; gap: 10px; }
/* Handy: Leiste und Monatsraster mit Wochenende und Feiertagen */
.tw-leiste-kopf { display: none; }
@media (max-width: 820px) {
  .tw-leiste button.we { background: var(--td-we); }
  .tw-leiste button.ft { background: var(--td-ft-kopf); box-shadow: inset 0 0 0 1px var(--td-ft-linie); }
  .tw-leiste button.ft b, .tw-leiste button.ft { color: var(--td-ft-text); }
  .tw-leiste button.fremd { opacity: .5; }
  .tw-leiste.monat button { height: 46px; padding: 5px 0; }
  .tw-leiste-kopf { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 8px 8px 0; }
  .tw-leiste-kopf span { color: var(--td-text-2); font-size: 11.5px; font-weight: 700; text-align: center; }
  .tw-handy .tw-tagtitel { flex-wrap: wrap; row-gap: 4px; }
}
@media (max-width: 640px) {
  .td-werkzeuge .td-seg-ansicht button { padding: 0 2px; font-size: 12.5px; }
  .td-seg-lang { display: none; }
  .td-seg-kurz { display: inline; }
}
/* ------------------------------------------------------------------ v839: neues To-do direkt im Tag (Doppelklick) */
.tw-tagneu { display: flex; min-width: 0; }
.tw-tagneu .td-neu-feld { height: 36px; gap: 6px; padding: 0 10px 0 8px; background: var(--td-surface); }
.tw-tagneu .td-neu-feld input { height: 32px; font-size: 13px; }
.tw-tagneu .td-neu-plus svg { width: 15px; height: 15px; }
.tw-monat .tw-tagneu .td-neu-feld { height: 30px; gap: 4px; padding: 0 8px 0 6px; border-radius: 8px; }
.tw-monat .tw-tagneu .td-neu-feld input { height: 26px; font-size: 12.5px; }
@media (max-width: 1100px) { .tw-monat .tw-tagneu .td-neu-plus { display: none; } .tw-monat .tw-tagneu .td-neu-feld { padding: 0 6px; } }
/* doppelt tippen soll anlegen, nicht hineinzoomen */
.tw-tag, .tw-handy .tw-stapel, .tw-handy .tw-tagtitel { touch-action: manipulation; }
@media (max-width: 820px) { .tw-handy .tw-tagneu .td-neu-feld { height: 42px; } .tw-handy .tw-tagneu .td-neu-feld input { height: 38px; font-size: 16px; } }

/* ============ v924: Mangel an einem Arbeitsschritt („Status der Montage“) ============
   Symbol „Mangel“ ganz rechts im Kopf des Schritts (wie „zuweisen“ der Arbeitslisten, gleiche Größe; Reihenfolge fest
   über order – beide zeichnen unabhängig voneinander). Offene To-dos stehen als eigene Zeile unter dem Titel. */
.checkliste-feld > .attributgruppen-feldkopf > :is(.al-zuweisen, .al-chip) { order: 5; }
.checkliste-feld > .attributgruppen-feldkopf > .tdm-knopf { order: 6; flex: 0 0 auto; margin: -5px 0 -5px 2px; }
.checkliste-feld > .tdm-zeile { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; min-width: 0; }
.tdm-knopf {
  display: inline-grid !important; place-items: center; width: 30px !important; height: 30px !important; min-width: 0 !important;
  min-height: 0 !important; padding: 0 !important; border: 1px dashed color-mix(in srgb, var(--text-muted) 70%, transparent) !important;
  border-radius: 50% !important; background: transparent !important; color: var(--text-muted) !important; box-shadow: none !important; cursor: pointer;
  touch-action: manipulation;
}
.tdm-knopf:hover, .tdm-knopf:focus-visible {
  border-style: solid !important; border-color: color-mix(in srgb, var(--warn) 80%, var(--text)) !important;
  color: color-mix(in srgb, var(--warn) 80%, var(--text)) !important;
}
.tdm-knopf svg, .tdm-chip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tdm-chip {
  display: inline-flex !important; align-items: center; gap: 7px; width: auto !important; height: 30px !important; min-width: 0 !important;
  min-height: 0 !important; max-width: 100%; margin: 0; padding: 0 12px 0 9px !important; box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--warn) 60%, var(--border)) !important; border-radius: 999px !important;
  background: color-mix(in srgb, var(--warn) 14%, var(--bg-elevated)) !important; color: var(--text) !important; box-shadow: none !important;
  font-size: 13px !important; font-weight: 500 !important; line-height: 1 !important; white-space: nowrap; cursor: pointer; text-align: left;
}
.tdm-chip svg { flex: 0 0 auto; color: color-mix(in srgb, var(--warn) 75%, var(--text)); }
.tdm-chip b { flex: 0 0 auto; font-weight: 700; }
.tdm-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.tdm-chip:hover { background: color-mix(in srgb, var(--warn) 22%, var(--bg-elevated)) !important; }
/* Element aus der To-do-Liste geöffnet: Schritt kurz hervorheben */
:is(.checkliste-feld, .attributgruppen-custom-feld, .signal-attributgruppen-panel).tdm-hervor { animation: tdm-hervor 2.4s ease-out; }   /* v972: alle Gruppen */
@keyframes tdm-hervor {
  0%, 35% { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--warn) 85%, transparent); background-color: color-mix(in srgb, var(--warn) 12%, transparent); }
  100% { box-shadow: inset 0 0 0 2px transparent; background-color: transparent; }
}
/* im Bearbeitungsmodus (Attribute ordnen/ändern) nicht im Weg – wie die Arbeitslisten */
.signal-attributgruppen-bereich.attribut-bearbeitungsmodus :is(.tdm-knopf, .tdm-zeile) { display: none !important; }
.signal-attributgruppen-bereich.attribut-bearbeitungsmodus .tdm-bb { display: none !important; }   /* v972 */

/* v925: Mangel im To-do-Editor (kompakt, Vollbild per Knopf): oben der Bezug zum Schritt und „auf ‚nein‘ zurücksetzen“ */
.tdm-kontext {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 9%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border));
}
.tdm-kontext > svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: color-mix(in srgb, var(--warn) 75%, var(--text)); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tdm-kontext > span { display: grid; gap: 1px; min-width: 0; }
.tdm-kontext small { color: var(--text-muted); font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.tdm-kontext b { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.tdm-editor .tdm-option, .tdm-editor .tdm-hinweis { flex: 0 0 auto; }
.tdm-editor .tdf-titel-feld::placeholder { color: color-mix(in srgb, var(--text-muted) 85%, transparent); font-weight: 500; }
/* Rückfrage nach dem Erledigen: Schritt wieder auf „ja“? (am Rechner mittig, am Handy Blatt von unten) */
.tdm-frage .tdm-frage-symbol { background: color-mix(in srgb, var(--ok) 16%, transparent); color: color-mix(in srgb, var(--ok) 75%, var(--text)); }
.tdm-frage .tdm-frage-symbol svg { width: 18px; height: 18px; stroke-width: 2.2; }
.tdm-element { color: var(--text-muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.tdm-inhalt { display: grid; gap: 14px; padding-top: 4px; }
.tdm-option {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; margin: 0; padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border)); border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 8%, var(--bg-elevated)); cursor: pointer; font-weight: 400;
}
.tdm-option input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.tdm-option > span { display: grid; gap: 3px; min-width: 0; }
.tdm-option b { font-size: 14px; font-weight: 650; color: var(--text); }
.tdm-option small { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }
/* Schrift etwas kräftiger als „gedämpft“: auf der getönten Fläche hell und dunkel ≥ 4,5 : 1 (gemessen 4,48 vorher) */
.tdm-hinweis { margin: 0; padding: 10px 12px; border-radius: 9px; background: color-mix(in srgb, var(--text) 5%, transparent); color: color-mix(in srgb, var(--text-muted) 70%, var(--text)); font-size: 13px; line-height: 1.45; }
.tdm-fuss { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); }
/* To-do teilen (PDF) – Symbol im Kopf des To-do-Fensters, gleich groß wie Vollbild/Schließen */
.tdf-teilen {
  display: inline-grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; margin: 0; padding: 0; border: 0;
  border-radius: 10px; background: transparent; color: var(--text-muted); cursor: pointer;
}
.tdf-teilen svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tdf-teilen:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.tdf-teilen.tdf-laedt { cursor: progress; opacity: .55; }
.td-detail-knoepfe .td-knopf svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 640px) {
  .tdm-fuss { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); }
  .tdm-fuss .feldhilfe-fuss-luecke { display: none; }
  .tdf-teilen { width: 44px; height: 44px; }
  /* neuer Mangel ohne „To-do löschen“: Abbrechen und Speichern je halbe Breite (sonst bliebe rechts ein Drittel leer) */
  .tdm-editor .feldhilfe-editor-fuss { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { :is(.checkliste-feld, .attributgruppen-custom-feld, .signal-attributgruppen-panel).tdm-hervor { animation: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--warn) 85%, transparent); } }

/* To-do-Liste und Fenster: Bezug zum Element („Mangel an …“), antippen öffnet das Element */
.td-element {
  display: flex; align-items: center; gap: 5px; width: fit-content; max-width: 100%; margin: 3px 0 0; padding: 0; border: 0; background: none;
  color: color-mix(in srgb, var(--accent) 78%, var(--text)); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; text-align: left;
}
.td-element svg { flex: 0 0 auto; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.td-element span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-element:hover span { text-decoration: underline; text-underline-offset: 2px; }
button.tdf-chip.tdf-element { font: inherit; cursor: pointer; max-width: 100%; }
button.tdf-chip.tdf-element > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.tdf-chip.tdf-element:hover { border-color: var(--accent); }

/* ============ v972: To-do auch in den anderen Gruppen (IBS, Abnahme, Baufreiheiten …) und für die ganze Baubehinderung ============
   Anwender 10.11.2026: „… flexibler werden, was die Möglichkeiten der To-Do-Aufnahme angeht“. Symbol rechts im Kopf des
   Punkts (nach Farbknöpfen und Sortierung), offene To-dos als eigene Zeile darunter – wie in „Status der Montage“. */
.attributgruppen-custom-feld:not(.checkliste-feld) > .attributgruppen-feldkopf > .tdm-knopf { order: 6; flex: 0 0 auto; margin: -5px 0 -5px 2px; align-self: flex-start; }
.attributgruppen-custom-feld:not(.checkliste-feld) > .tdm-zeile { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; min-width: 0; }
/* Baubehinderung: Knopf „To-do“ in der Leiste der Anzeigen (wie „Neue Anzeige“), offene To-dos der Anzeige darunter */
.baubehinderung-nav-todo {
  display: inline-flex !important; align-items: center; gap: 6px; flex: 0 0 auto; width: auto !important; height: 36px !important;
  min-height: 0 !important; padding: 0 12px !important; border: 1px dashed color-mix(in srgb, var(--text-muted) 70%, transparent) !important;
  border-radius: 10px !important; background: var(--bg-elevated) !important; color: var(--text) !important; box-shadow: none !important;
  font-weight: 700 !important; white-space: nowrap; cursor: pointer;   /* Schrift wie „Neue Anzeige“ */
}
.baubehinderung-nav-todo svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: color-mix(in srgb, var(--warn) 80%, var(--text)); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.baubehinderung-nav-todo:hover:not(:disabled), .baubehinderung-nav-todo:focus-visible {
  border-style: solid !important; border-color: color-mix(in srgb, var(--warn) 80%, var(--text)) !important;
}
.baubehinderung-nav-todo:disabled { opacity: .55; cursor: not-allowed; }
.tdm-zeile.tdm-bb-zeile { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; min-width: 0; }
@media (max-width: 720px) {   /* Handy: „Neue Anzeige“ · „To-do“ · Löschen in einer Zeile (die Leiste ist dort ein Raster) */
  .baubehinderung-anzeigen-nav:has(> .baubehinderung-nav-todo) { grid-template-columns: 40px minmax(0, 1fr) auto 40px; }
  .baubehinderung-anzeigen-nav:has(> .baubehinderung-nav-todo) > .baubehinderung-nav-status { grid-column: 2 / 4; }
  .baubehinderung-anzeigen-nav:has(> .baubehinderung-nav-todo) > [data-baubehinderung-naechste] { grid-column: 4; }
  .baubehinderung-anzeigen-nav:has(> .baubehinderung-nav-todo) > .baubehinderung-nav-neu { grid-column: 1 / 3; }
  /* nur das Symbol (wie Löschen) – sonst bräche „Neue Anzeige“ um; die Beschriftung bleibt für Vorlesehilfen (aria-label) */
  .baubehinderung-anzeigen-nav > .baubehinderung-nav-todo { grid-column: 3; justify-content: center; width: 40px !important; height: 42px !important; padding: 0 !important; }   /* wie Löschen */
  .baubehinderung-anzeigen-nav > .baubehinderung-nav-todo span { display: none; }
  .baubehinderung-anzeigen-nav:has(> .baubehinderung-nav-todo) > .baubehinderung-nav-loeschen { grid-column: 4; }
}
