/* ==================================================================
   Apple-Stil (Entwurf)
   Liegt über app.css und stellt die Optik auf die Gestaltung von
   Apple um (Human Interface Guidelines): Systemschrift, hellgrauer
   Grund mit weißen Karten, große runde Ecken, kaum Rahmen, iOS-Blau
   als Akzent, Segmented Control statt Reiter, halbtransparente Leisten.
   Wer den alten Stil zurück will, entfernt nur den Verweis in index.html.
   ================================================================== */

/* ---------- Farben ---------- */
#app {
  --messing: #007aff;          /* Akzent (Name bleibt, damit app.css weiter passt) */
  --messing-warm: #0a84ff;
  --putz: #f2f2f7;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d1d1d6;
  --line-soft: #e5e5ea;
  --nacht: #1c1c1e;
  --frei: #8e8e93;
  --frei-soft: #f2f2f7;
  --sperr: #ff3b30;
  --sperr-soft: rgba(255, 59, 48, .12);
  --glas: rgba(0, 122, 255, .10);
  --fuellung: rgba(118, 118, 128, .12);      /* graue Flächen wie in iOS */
  --fuellung-stark: rgba(118, 118, 128, .20);
  --segment: #ffffff;
  --leiste: rgba(249, 249, 249, .82);
  --td-rot: #ff3b30;

  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.011em;
  font-feature-settings: normal;
}
#app[data-theme="dark"] {
  --messing: #0a84ff;
  --messing-warm: #409cff;
  --putz: #2c2c2e;
  --bg: #000000;
  --surface: #1c1c1e;
  --ink: #f5f5f7;
  --muted: #98989f;
  --line: #38383a;
  --line-soft: #2c2c2e;
  --nacht: #2c2c2e;
  --frei: #8e8e93;
  --frei-soft: #2c2c2e;
  --sperr: #ff453a;
  --sperr-soft: rgba(255, 69, 58, .18);
  --glas: rgba(10, 132, 255, .18);
  --fuellung: rgba(118, 118, 128, .24);
  --fuellung-stark: rgba(118, 118, 128, .34);
  --segment: #636366;
  --leiste: rgba(22, 22, 24, .82);
  --td-rot: #ff453a;
  background: var(--bg);
}
html:has(#app[data-theme="light"]) body, html:has(#app:not([data-theme])) body { background: #f2f2f7; }
html:has(#app[data-theme="dark"]) body { background: #000; }

/* Zahlen in derselben Schrift, aber gleich breit (statt Schreibmaschinenschrift) */
#app .num { font-family: inherit; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------- Kopf ---------- */
#app .top { border-bottom: none; padding-bottom: 6px; margin-bottom: 14px; }
#app .top::after { display: none; }
#app h1, #app .sperrkasten h1 {
  font-family: inherit; font-size: 30px; font-weight: 700; letter-spacing: -0.025em;
}
#app .sub { text-transform: none; letter-spacing: 0; font-size: 13px; }
#app .siegel {
  border-radius: 11px; font-family: inherit; font-weight: 700; font-size: 23px; color: #fff;
  background: linear-gradient(180deg, #2b95ff, #0062e0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
#app .burger span { background: var(--messing); }

/* ---------- Bereiche: Segmented Control ---------- */
#app .seitennav {
  display: inline-flex; flex-wrap: nowrap; gap: 0; padding: 2px; margin: 0 0 18px;
  background: var(--fuellung); border-radius: 9px; max-width: 100%; overflow-x: auto;
}
#app .seitennav button {
  border: none; background: transparent; color: var(--ink); border-radius: 7px;
  padding: 6px 16px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
#app .seitennav button:hover { background: transparent; color: var(--ink); }
#app .seitennav button.aktiv {
  background: var(--segment); color: var(--ink); font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
}
#app .rg-tabs { display: inline-flex; gap: 0; padding: 2px; background: var(--fuellung); border-radius: 9px; }
#app .rg-tabs button { border: none; background: transparent; color: var(--ink); border-radius: 7px; padding: 5px 14px; }
#app .rg-tabs button.aktiv {
  background: var(--segment); color: var(--ink); border: none; font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
}

/* ---------- Karten ---------- */
#app .tafel, #app .kpi, #app .obj, #app .ekarte, #app .td, #app .pv-ergebnis .niveau-block {
  border: none; border-radius: 14px; box-shadow: none; background: var(--surface);
}
#app .tafel { padding: 16px 18px; margin-bottom: 16px; }
#app .tafel.heute { border-left: none; }
#app .tafel h3 {
  text-transform: none; letter-spacing: -0.015em; font-size: 17px; font-weight: 600; color: var(--ink);
}
#app .kpis.split .kpi { background: var(--surface); border: none; }
#app .kpi.hero { background: linear-gradient(160deg, #2b95ff, #0062e0); color: #fff; }
#app .kpi.hero::before { display: none; }
#app .kpi.hero .label { color: rgba(255, 255, 255, .75); }
#app .obj:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
#app .obj-head:hover { background: rgba(118, 118, 128, .06); }
#app .obj-title, #app .sl-name, #app .rg-gruppe {
  font-family: inherit; font-weight: 600; letter-spacing: -0.015em;
}
#app .obj-title { font-size: 17px; }
#app .ekarte.summe { background: var(--surface); border: none; }

/* Listen wie in den iPhone-Einstellungen: feine Trennlinien, keine Kästen */
#app .doclist { border: none; background: var(--surface); border-radius: 12px; }
#app .modal .doclist { background: var(--putz); }
#app .docrow, #app .faellig, #app .mpunkt, #app .gzeile, #app .planblock { border-color: var(--line-soft); }

/* ---------- Knöpfe ---------- */
#app button {
  border: none; border-radius: 10px; background: var(--fuellung); color: var(--messing);
  font-weight: 600; padding: 8px 15px;
}
#app button:hover { background: var(--fuellung-stark); color: var(--messing); border-color: transparent; }
#app button:active { transform: scale(.97); opacity: .85; }
#app button.primary { background: var(--messing); color: #fff; }
#app button.primary:hover { background: var(--messing); color: #fff; filter: brightness(1.08); }
#app button.ghost { background: transparent; color: var(--messing); }
#app button.ghost:hover { background: var(--glas); color: var(--messing); }
#app button.danger { background: var(--sperr-soft); color: var(--sperr); }
#app button.danger:hover { background: var(--sperr-soft); color: var(--sperr); filter: brightness(1.05); }
#app button.tiny { border-radius: 8px; padding: 5px 11px; }
#app button:disabled { opacity: .45; }
#app button.theme { color: var(--ink); }

/* Zeilen-Knöpfe in Menüs bleiben in Textfarbe */
#app .sl-gruppe button, #app .sl-fuss button, #app .menueliste button, #app .fabmenu button {
  color: var(--ink); background: transparent; font-weight: 500; border-radius: 10px;
}
#app .sl-gruppe button:hover, #app .sl-fuss button:hover, #app .menueliste button:hover {
  background: var(--fuellung); color: var(--ink);
}
#app .fabmenu button { background: var(--surface); box-shadow: 0 4px 16px rgba(0, 0, 0, .18); }
#app .sl-gruppe > span { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }
#app .seitenleiste { border-right: none; background: var(--bg); box-shadow: 4px 0 30px rgba(0, 0, 0, .18); }
#app .sl-gruppe { background: var(--surface); border-radius: 12px; padding: 4px; }
#app .sl-gruppe > span { padding: 8px 10px 4px; }
#app .sl-kopf, #app .sl-fuss { border-color: transparent; }

#app .vorlesen, #app .mikro {
  border: none; background: var(--glas); color: var(--messing); font-weight: 600;
}
#app .vorlesen:hover, #app .vorlesen.laeuft { background: var(--messing); color: #fff; }
#app .kalkopf button { border: none; background: var(--fuellung); color: var(--messing); }
#app .kalkopf button:hover { background: var(--fuellung-stark); color: var(--messing); }

#app .fab {
  background: var(--messing); color: #fff;
  box-shadow: 0 8px 20px rgba(0, 122, 255, .35);
}

/* ---------- Eingabefelder ---------- */
#app input[type="text"], #app input[type="number"], #app input[type="date"], #app input[type="time"],
#app input[type="url"], #app input[type="password"], #app input[type="email"], #app select, #app textarea {
  background: var(--putz); border: 1px solid transparent; border-radius: 10px; color: var(--ink);
}
#app .modal input[type="text"], #app .modal input[type="number"], #app .modal input[type="date"],
#app .modal input[type="time"], #app .modal input[type="password"], #app .modal select, #app .modal textarea {
  background: var(--fuellung);
}
#app input:focus, #app select:focus, #app textarea:focus {
  outline: none; border-color: var(--messing); box-shadow: 0 0 0 3px rgba(0, 122, 255, .22);
}
#app .field label, #app .feldchen > span, #app .monat span {
  text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--muted);
}

/* ---------- Fenster ---------- */
#app .backdrop { background: rgba(0, 0, 0, .32); backdrop-filter: blur(6px); }
#app .modal {
  border-top: none; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}
#app .modal h2 { font-family: inherit; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
#app .modal .hint { font-size: 14px; }
#app .hintbox { background: var(--glas); color: var(--ink); border-left: none; border-radius: 12px; }
#app .sum-line { background: var(--putz); color: var(--ink); border-radius: 10px; }
#app .mahnung { background: var(--glas); border: none; color: var(--ink); border-radius: 12px; }
#app .sperrkasten { border: none; border-top: none; border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .08); }
#app .toast {
  background: rgba(28, 28, 30, .92); color: #fff; border: none; border-radius: 14px;
  padding: 12px 18px; backdrop-filter: blur(20px); box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
#app .foot { text-transform: none; letter-spacing: 0; font-size: 12px; }

/* ---------- Kalender und Tagesplan ---------- */
#app .kaltag { background: transparent; border-radius: 12px; }
#app .kaltag:hover { background: var(--fuellung); border-color: transparent; }
#app .kaltag .wtag { letter-spacing: 0; }
#app .kaltag.gewaehlt { background: var(--messing); }
#app .kaltag.gewaehlt .wzahl, #app .kaltag.gewaehlt .wtag { color: #fff; }
#app .kaltag.gewaehlt .kalpunkt { background: #fff; }
#app .kaltag.heute:not(.gewaehlt) .wzahl, #app .kaltag.heute:not(.gewaehlt) .wtag { color: var(--td-rot); }
#app .ztermin.aufgabe {
  background: linear-gradient(var(--glas), var(--glas)), var(--surface);
  border-left-color: var(--messing);
}
#app .mnr { background: var(--messing); color: #fff; }
#app .mnr.rot { background: var(--td-rot); }
#app .gpille { border: none; background: var(--fuellung); }
#app .planblock .num { color: var(--messing); }

/* ---------- Leisten: halbtransparent mit Unschärfe ---------- */
#app .untenleiste {
  background: var(--leiste); border-top: .5px solid var(--line);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
#app .untenleiste button { background: transparent; color: var(--muted); font-weight: 500; letter-spacing: 0; }
#app .untenleiste button.aktiv { color: var(--messing); }
#app .untenleiste button.aktiv span { text-shadow: none; }
@media (max-width: 620px) {
  #app .top {
    background: var(--leiste); border-bottom: .5px solid var(--line);
    backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
  #app h1 { font-size: 22px; }
  #app .tafel { border-radius: 12px; }
}

/* ---------- Druckvorschau: Leiste im neuen Akzent ---------- */
#druck .dk-leiste span { color: #0a84ff; }
#druck .dk-leiste button.primary { background: #007aff; border-color: #007aff; color: #fff; }

/* ---------- Feinschliff nach dem ersten Durchgang ---------- */
#app { accent-color: var(--messing); }
/* Segmented Controls stehen jeweils in einer eigenen Zeile, nur so breit wie nötig */
#app .seitennav, #app .rg-tabs { display: flex; width: max-content; max-width: 100%; }
#app .rg-tabs { margin: 0 0 16px; }
@media (max-width: 620px) { #app .seitennav { display: none; } }
/* Kennzahlen: Beschriftung wie in Apples Übersichten */
#app .kpi .label { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }
/* Suchfeld auf grauem Grund: weiß mit Lupe, wie in iOS */
#app .searchrow input {
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
  padding-left: 36px;
}
/* Fensterüberschrift wie die Titelzeile in iOS */
#app .fensterkopf { border-bottom-color: var(--line-soft); }
#app .fensterkopf span { text-transform: none; letter-spacing: -0.01em; font-size: 15px; font-weight: 600; color: var(--ink); }
#app .zurueck { background: transparent; padding-left: 10px; box-shadow: none; }
#app .kpi.hero .value, #app .kpi.hero .value * { color: #fff; }

/* ---------- Dialoge (ersetzen die grauen Browser-Fenster) ---------- */
#dialog {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(0, 0, 0, .32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  animation: dlg-rein .16s ease both;
}
@keyframes dlg-rein { from { opacity: 0; } to { opacity: 1; } }
#dialog .dlg {
  width: 100%; max-width: 380px; background: rgba(250, 250, 252, .96); color: #1d1d1f;
  border-radius: 16px; padding: 22px 20px 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  animation: dlg-auf .18s cubic-bezier(.2, .8, .25, 1) both;
}
@keyframes dlg-auf { from { transform: scale(1.06); } to { transform: none; } }
#dialog h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; text-align: center; }
#dialog p { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: #3c3c43; text-align: center; }
#dialog input, #dialog textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; color: inherit;
  background: rgba(118, 118, 128, .12); border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px;
}
#dialog textarea { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; resize: vertical; }
#dialog input:focus, #dialog textarea:focus { outline: none; border-color: #007aff; box-shadow: 0 0 0 3px rgba(0, 122, 255, .22); }
#dialog .dlg-knoepfe { display: flex; gap: 8px; }
#dialog .dlg-knoepfe button {
  flex: 1; font: inherit; font-size: 15px; font-weight: 600; border: none; border-radius: 11px; padding: 11px 12px;
  background: rgba(118, 118, 128, .14); color: #007aff; cursor: pointer;
}
#dialog .dlg-knoepfe button.primaer { background: #007aff; color: #fff; }
#dialog .dlg-knoepfe button.gefahr { background: rgba(255, 59, 48, .12); color: #ff3b30; }
#dialog .dlg-knoepfe button:active { opacity: .8; }
#dialog[data-theme="dark"] .dlg { background: rgba(44, 44, 46, .96); color: #f5f5f7; }
#dialog[data-theme="dark"] p { color: #aeaeb2; }
#dialog[data-theme="dark"] .dlg-knoepfe button { background: rgba(118, 118, 128, .28); color: #0a84ff; }
#dialog[data-theme="dark"] .dlg-knoepfe button.primaer { background: #0a84ff; color: #fff; }
#dialog[data-theme="dark"] input, #dialog[data-theme="dark"] textarea { background: rgba(118, 118, 128, .28); }

/* Fehlermeldungen: rot markiert, bleiben stehen, bis man sie wegtippt */
#app .toast.fehler { background: rgba(28, 28, 30, .94); border-left: 4px solid #ff453a; cursor: pointer; padding-right: 30px; }
#app .toast.fehler::after { content: '✕'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); opacity: .6; font-size: 12px; }

/* Ladebalken oben, solange etwas lädt */
#ladebalken {
  position: fixed; left: 0; right: 0; top: 0; height: 2.5px; z-index: 10001; pointer-events: none;
  background: linear-gradient(90deg, transparent, #007aff 30%, #5ac8fa 60%, transparent);
  background-size: 50% 100%; background-repeat: no-repeat;
  opacity: 0; transition: opacity .2s;
}
#ladebalken.an { opacity: 1; animation: lade-lauf 1.1s linear infinite; }
@keyframes lade-lauf { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* Datum mit Uhrzeit (z. B. Besichtigung) wie die anderen Felder */
#app input[type="datetime-local"] {
  font: inherit; width: 100%; padding: 9px 12px; color: var(--ink);
  background: var(--fuellung); border: 1px solid transparent; border-radius: 10px;
}

/* Einheiten-Tabelle: ganze Zeile klickbar, Pfeil statt "Bearbeiten" */
#app table.einheiten tr.unitrow { cursor: pointer; }
#app table.einheiten tr.unitrow:hover td { background: rgba(118, 118, 128, .07); }
#app table.einheiten .rowpfeil { color: var(--muted); font-size: 20px; width: 24px; text-align: center; }
#app table.einheiten tr.unitrow:hover .rowpfeil { color: var(--messing); }

/* Tagesplan als Leiste in der Tages-Karte */
#app .planleiste {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  margin: 12px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--glas);
}
#app .planleiste .planzeile { display: flex; gap: 8px; align-items: baseline; margin: 0; font-size: 14px; flex: 1 1 260px; }
#app .planleiste .plansymbol { color: var(--messing); font-size: 15px; }
#app .planleiste .planknoepfe { display: flex; gap: 6px; margin: 0; flex-wrap: wrap; }

/* Suche für alles */
#app button.lupe { display: inline-flex; align-items: center; justify-content: center; }
#app .modal[data-fenster="suche"] { max-width: 560px; }
#app .such-feld input {
  width: 100%; font: inherit; font-size: 17px; padding: 11px 14px; color: var(--ink);
  background: var(--fuellung); border: 1px solid transparent; border-radius: 12px;
}
#app .such-feld input:focus { outline: none; border-color: var(--messing); }
#app #suche-treffer { margin-top: 12px; }
#app .such-leer { color: var(--muted); font-size: 14px; padding: 14px 4px; }
#app .such-gruppe { margin-bottom: 10px; }
#app .such-kopf {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 6px 4px 4px;
}
#app button.such-treffer {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  text-align: left; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink); min-height: 0; box-shadow: none;
}
#app button.such-treffer:hover, #app button.such-treffer.gewaehlt { background: rgba(0, 122, 255, .1); }
#app .such-treffer .st-titel { font-size: 15px; }
#app .such-treffer .st-unten { font-size: 12.5px; color: var(--muted); }
#app .such-mehr { font-size: 12.5px; color: var(--muted); padding: 2px 10px; }

/* Aufgaben wischen (Handy): rechts = erledigt, links = auf morgen */
#app .td-zeile[data-tid] { touch-action: pan-y; }
#app .td-zeile.wischt { transition: none; z-index: 1; background: var(--surface); }
#app .td-zeile:not(.wischt) { transition: transform .2s ease; }
#app .td-zeile.wischt::before, #app .td-zeile.wischt::after {
  position: absolute; top: 0; bottom: 0; width: 200px; display: flex; align-items: center;
  font-size: 14px; font-weight: 600; color: #fff; pointer-events: none;
}
#app .td-zeile.wischt::before { content: '✓ Erledigt'; right: 100%; justify-content: flex-end; padding-right: 16px; background: #8e8e93; }
#app .td-zeile.wischt::after { content: 'Auf morgen'; left: 100%; justify-content: flex-start; padding-left: 16px; background: #8e8e93; }
#app .td-zeile.wisch-fertig::before { background: #34c759; }
#app .td-zeile.wisch-morgen::after { background: #ff9500; }

/* Fußzeile: nur ein kurzes "Gespeichert", das von selbst verblasst */
#app .foot { min-height: 16px; }
#app .foot-frisch { color: var(--muted); transition: opacity .6s; }
#app .foot-frisch.weg { opacity: 0; }

/* Abrechnungen: Liste zuerst, Formular auf Wunsch */
#app .tafel h3 .rg-knopf.primary { background: var(--messing); color: #fff; border: 0; padding: 6px 12px; border-radius: 999px; font-weight: 600; }
#app .linkknopf {
  display: inline; border: 0; background: none; padding: 0; margin: 0; min-height: 0; box-shadow: none;
  color: var(--messing); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline;
}

/* Heute: eine Karte für Reihenfolge, Woche und Zeitplan */
#app .tagkarte .tagnav { display: inline-flex; gap: 6px; }
#app .tagkarte .tagnav button {
  border: none; background: var(--fuellung); color: var(--messing); border-radius: 8px;
  padding: 5px 10px; font-size: 13px; min-height: 0; box-shadow: none;
}
#app .tagkarte .tagnav button:hover { background: var(--fuellung-stark); }
#app .tagkarte .kalwochenstreifen { margin: 12px 0 4px; }
#app .tagspalten { display: grid; grid-template-columns: 1fr; gap: 6px 24px; margin-top: 4px; }
@media (min-width: 900px) {
  #app .tagspalten { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  #app .tagzeit { border-left: 1px solid var(--line-soft); padding-left: 24px; }
}
#app .tagzeit-kopf {
  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  margin: 12px 0 6px;
}
#app .tagzeit .kalleer { padding: 14px 0; }
#app button.memomehr {
  display: block; border: 0; background: none; padding: 8px 0 0; min-height: 0; box-shadow: none;
  font: inherit; font-size: 13px; color: var(--messing); font-weight: 600; cursor: pointer; text-align: left;
}
#app ol.memoliste.ohnenr .mpunkt { padding-left: 2px; }
#app ol.memoliste .mpunkt.frist .mwas { color: var(--sperr); }
#app .plankal { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--fuellung); }

/* Heute links: erst „Heute eingeplant“ (mit Uhrzeit), dann „Noch nicht eingeplant“ */
#app .tagabschnitt {
  display: flex; align-items: center; gap: 8px; margin: 14px 0 2px;
  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
#app .tagabschnitt:first-child { margin-top: 12px; }
#app .tagabschnitt .anzahl.rot { background: var(--sperr-soft); color: var(--sperr); }
#app .planliste .muhr { width: 44px; flex: none; font-size: 14px; font-weight: 600; color: var(--messing); margin-top: 1px; }
#app .planliste .mpunkt.vorbei { opacity: .5; }
#app .planliste .mpunkt.jetzt .mwas { color: var(--messing); }
#app .planliste .mpunkt.liegen .muhr { color: var(--sperr); } #app .planliste .mwarum .rot { color: var(--sperr); }
#app .planliste .td-kreis.an { background: var(--messing); border-color: var(--messing); color: #fff; }
#app .planliste .mpunkt.abgehakt .mwas { text-decoration: line-through; color: var(--muted); }
#app .planliste .td-kreis.an svg { opacity: 1; color: #fff; }
/* Heute: der Zeitplan darf fast die ganze Fensterhöhe nutzen */
#app .tagzeit .zeitrahmen { max-height: max(520px, calc(100vh - 230px)); }
@media (max-width: 899px) { #app .tagzeit .zeitrahmen { max-height: 70vh; } }

/* Aufgaben: Filter-Chips, Wartet, Verlauf */
#app .td-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
#app .td-fchip {
  border: 0; background: var(--fuellung); color: var(--ink); border-radius: 999px; padding: 4px 11px;
  font-size: 13px; font-weight: 600; min-height: 0; box-shadow: none; cursor: pointer;
}
#app .td-fchip span { color: var(--muted); font-weight: 500; margin-left: 2px; }
#app .td-fchip.an { background: var(--messing); color: #fff; }
#app .td-fchip.an span { color: rgba(255,255,255,.8); }
#app .td-ftrenner { width: 1px; height: 18px; background: var(--line-soft); margin: 0 4px; }
#app .td-sanduhr { width: 18px; text-align: center; font-size: 14px; flex: none; }
#app .td-uhrchips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 8px; }
#app .td-m-leer { padding: 6px 10px; color: var(--muted); font-size: 13px; }
#app .td-m-zeit { margin: 4px 8px 8px; width: calc(100% - 16px); }
#app .td-verlauf { display: flex; gap: 6px; margin: 6px 0 4px; }
#app .td-verlauf input { flex: 1; }
/* Ziehen in den Zeitplan */
#app [data-zieh] { cursor: grab; }
#app.zieht .tagkarte .zeitachse { outline: 2px dashed var(--messing); outline-offset: 4px; border-radius: 8px; }
#app .zmarke {
  position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--messing); z-index: 70; pointer-events: none;
  font-size: 11px; font-weight: 700; color: var(--messing); padding-left: 52px; line-height: 16px;
}

/* Nachhaken: ein Tipp direkt an der Aufgabe */
#app .td-warteknopf { font-size: 14px; }
#app .td-nachhaken {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -2px 0 8px 32px;
  font-size: 12.5px; color: var(--muted);
}
#app .mtext .td-nachhaken { margin: 6px 0 2px; }
#app .td-nachhaken.faellig .nh-text { color: var(--sperr); font-weight: 600; }
#app .td-nachhaken .nh-knopf {
  border: 0; background: var(--fuellung); color: var(--messing); border-radius: 999px;
  padding: 4px 11px; font-size: 12.5px; font-weight: 600; min-height: 0; box-shadow: none; cursor: pointer;
}
#app .td-nachhaken .nh-knopf.primaer { background: var(--messing); color: #fff; }
#app .toast.mit-aktion button + button { margin-left: 4px; }
#app .td-warteknopf.mini {
  border: 0; background: transparent; box-shadow: none; min-height: 0; padding: 2px 6px; margin-right: 2px;
  font-size: 14px; opacity: .35; cursor: pointer; flex: none;
}
#app .mpunkt:hover .td-warteknopf.mini, #app .td-warteknopf.mini:focus { opacity: 1; }
@media (max-width: 620px) { #app .td-warteknopf.mini { opacity: .7; } }
#app .td-f-warten .td-f-klein { margin: 0 0 6px; }
#app .td-f-warten .td-f-klein.rot { color: var(--sperr); font-weight: 600; }
#app .td-f-wknoepfe { display: flex; flex-wrap: wrap; gap: 6px; }
#app .td-f-wknoepfe .nh-knopf {
  border: 0; background: var(--fuellung); color: var(--messing); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; font-weight: 600; min-height: 0; box-shadow: none; cursor: pointer;
}
#app .td-f-wknoepfe .nh-knopf.primaer { background: var(--messing); color: #fff; }

/* ===== Großer Bildschirm: den Platz nutzen ===== */
@media (min-width: 1100px) {
  /* Aufgabenliste über die ganze Karte statt nach 820 px Schluss */
  #app .td-inhalt { max-width: none; padding: 24px 36px 44px; }
  #app .td { grid-template-columns: 250px minmax(0, 1fr); }
  /* Aufgabenfenster wächst mit dem Bildschirm */
  #app .modal.mittel { max-width: min(1320px, 90vw); width: min(1320px, 90vw); height: auto; max-height: 90vh; }
  #app .modal.mittel .td-fenster { grid-template-columns: minmax(0, 1fr) 320px; }
  #app .modal.mittel #t-besch { min-height: 180px; }
}
@media (min-width: 1600px) {
  #app .td-inhalt { padding: 26px 48px 48px; }
  #app .modal.mittel .td-fenster { grid-template-columns: minmax(0, 1fr) 360px; }
}
