/* ───────────────────────────────────────────────────────────────────
   Plan — Farbsystem
   Rot/Clay gehört ausschliesslich der Zeit (Deadlines).
   Struktur (blockiert, wartet auf) ist dunkel-neutral.
   ─────────────────────────────────────────────────────────────────── */
:root {
  --ground:  #F4F2ED;
  --surface: #FFFDF8;
  --line:    #E3DFD6;
  --hair:    #EFEBE3;

  --ink:     #1F1D1A;
  --muted:   #6B6559;
  --faint:   #8E887B;
  --fainter: #A79F91;

  --teal:    #0F6C63;  --teal-bg:  #DCEBE8;  --teal-fg:  #0B4F49;  --teal-bd:  #B5D5D0;
  --clay:    #B4552F;  --clay-bg:  #F6E3D9;  --clay-fg:  #8A3D1D;  --clay-bd:  #EAC5B1;
  --olive:   #5C7A46;  --olive-bg: #E4EBDC;  --olive-fg: #3F5730;  --olive-bd: #C9D8BC;
  --stone:   #9A9183;  --stone-bg: #EDE9E1;  --stone-fg: #4A453C;  --stone-bd: #DCD5C8;
  --block:   #1F1D1A;

  --edge:    #C4BCAE;

  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 14px;
}

/* manipulation: schnelles Tippen zählt nicht als Doppeltipp-Zoom; Pinch sperren Viewport und app.js */
* { box-sizing: border-box; touch-action: manipulation; }
[x-cloak] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.012em; }
button, input { font: inherit; color: inherit; }
input { min-width: 0; }
.ic { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.grow { flex-grow: 1; }
.sm { font-size: 12px; }
.dim { color: var(--faint); }
.mono { font-family: var(--mono); }
.hot-txt { color: var(--ink); font-weight: 500; }
.sep { width: 1px; height: 22px; background: var(--line); flex: none; }
.flabel { font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); flex: none; }
.mob { display: none !important; }

.app { min-height: 100%; display: flex; flex-direction: column; }

/* ── Kopfzeile ───────────────────────────────────────────────────── */
.top {
  flex: none; height: 56px; display: flex; align-items: center; gap: 12px;
  padding: 0 48px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
/* Wortmarke: Unterlänge des „p" nach unten ausgleichen, damit die x-Höhe mittig sitzt */
.mark { display: block; height: 18px; width: auto; flex: none; margin: 5px 14px 0 0; }
.me {
  display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer;
}
.me:hover { border-color: var(--stone-bd); }
.me.open { border-color: var(--teal); }
/* Menü am Personenkreis: acht Pixel unter der Kopfzeile, rechtsbündig mit dem Kreis */
.me-wrap { position: relative; flex: none; }
.me-pop {
  position: absolute; z-index: 40; top: calc(100% + 19px); right: 0; width: 272px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 14px 34px rgba(31, 29, 26, .14), 0 2px 6px rgba(31, 29, 26, .06);
}
.me-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--hair); }
.me-head .av { width: 32px; height: 32px; font-size: 12.5px; border: none; }
.me-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.me-who strong { font-size: 13.5px; font-weight: 600; }
.me-who strong, .me-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-who span { font-size: 12px; color: var(--muted); }
.me-sep { height: 1px; margin: 4px; background: var(--hair); }
.me-form { margin: 0; display: flex; flex-direction: column; }
.me-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  border: none; border-radius: var(--r-sm); background: transparent;
  font-size: 13px; color: var(--ink); text-align: left; cursor: pointer;
}
.me-item:hover, .me-item:focus-visible { background: var(--ground); outline: none; }
.me-item .ic { width: 15px; height: 15px; stroke-width: 1.5; color: var(--muted); }
.top .sep { height: 20px; }
.top .seg button { height: 28px; padding: 0 13px; }
.top .btn.primary { height: 34px; padding: 0 14px; font-size: 13px; }
/* Die Suche gibt nach, wenn es eng wird, die Knöpfe rechts nicht */
.search.tsearch { flex: 0 1 300px; width: auto; min-width: 80px; height: 34px; }
.tcount { display: flex; align-items: center; gap: 12px; flex: none; font-size: 12.5px; }

/* „Filter“: erscheint, wenn die Filterzeile unter der Kopfzeile verschwunden ist */
.fbtn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px 0 11px; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.fbtn:hover { border-color: var(--stone-bd); color: var(--ink); }
.fbtn.open { border-color: var(--teal); background: #F1F7F6; color: var(--teal-fg); font-weight: 600; }
.fbtn-n {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--ink); color: var(--ground);
  font-family: var(--mono); font-size: 11px; font-style: normal; font-weight: 500;
}
.fbtn-chev { width: 10px; height: 10px; transition: transform .15s; }
.fbtn.open .fbtn-chev { transform: rotate(180deg); }
/* Dann auch „Änderungen“ nur als Symbol, solange nichts Neues da ist */
.top.slim .chg-btn:not(.has) { width: 34px; padding: 0; justify-content: center; }
.top.slim .chg-btn:not(.has) .chg-t { display: none; }

/* ── Knöpfe ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.btn.primary { background: var(--teal); color: #FFFDF8; }
.btn.primary:hover { background: var(--teal-fg); }
.btn.primary:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--muted); font-weight: 500; }
.btn.ghost:hover { border-color: var(--stone-bd); color: var(--ink); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); color: var(--muted); cursor: pointer;
}
.icon-btn.sm { width: 26px; height: 26px; border: none; background: transparent; color: var(--fainter); }
.icon-btn:hover { color: var(--ink); }
.link { border: none; background: none; padding: 0; font-size: 12.5px; color: var(--teal); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--clay-fg); }

.seg { display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--hair); border-radius: 9px; flex: none; }
.seg button {
  height: 30px; padding: 0 15px; border: none; border-radius: 7px; background: transparent;
  color: var(--faint); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(31,29,26,.09); }
.seg.sm { border-radius: 8px; }
.seg.sm button { height: 26px; padding: 0 12px; border-radius: 6px; font-size: 12.5px; }

/* ── Status-Chips ────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--cd); background: var(--cb); color: var(--cf);
  font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip .dot { width: 12px; height: 12px; }
/* Abgewählt ist gestrichelt, damit es sich vom weissen „Offen“ absetzt. */
.chip.off { background: transparent; border-style: dashed; border-color: #D5CEC0; color: var(--fainter); --c: #CFC7B9; }
.chip.plain {
  border: 1px solid var(--line); background: transparent; color: var(--faint); font-weight: 500;
}
.chip.plain.on { background: var(--ink); border-color: var(--ink); color: var(--ground); }
/* Ausgeblendete Gruppe: gestrichelt und durchgestrichen, wie abgewählte Status */
.chip.plain.ex { background: var(--ground); border-style: dashed; border-color: var(--faint); color: var(--stone-fg); }
.chip.plain.ex span { text-decoration: line-through; }
.chip.plain .ic { width: 12px; height: 12px; }

/* Status unterscheiden sich in Fläche und Symbol, nicht nur im Farbton —
   in Graustufen bleibt jeder erkennbar:
   Offen = weiss, leerer Ring · In Arbeit = Petrol, halber Kreis ·
   Blockiert = schwarz, Sperrzeichen · Erledigt = Grün, Häkchen.
   --dot/--ring zeichnen das Symbol; sie lösen var(--c) am Status-Element auf,
   daher greifen Überschreibungen von --c (abgewählt, invertiert) von selbst. */
.s-offen     { --c: var(--faint); --cb: var(--surface);  --cf: var(--stone-fg); --cd: #CFC7B8;
               --dot: transparent; --ring: inset 0 0 0 1.5px var(--c); }
.s-in_arbeit { --c: var(--teal);  --cb: var(--teal-bg);  --cf: var(--teal-fg);  --cd: var(--teal-bd);
               --dot: linear-gradient(90deg, transparent 50%, var(--c) 50%); --ring: inset 0 0 0 1.5px var(--c); }
.s-blockiert { --c: var(--block); --cb: var(--block);    --cf: var(--block);    --cd: var(--block); --ci: var(--surface);
               --dot: linear-gradient(var(--ci), var(--ci)) center / 56% 18% no-repeat, var(--c); --ring: none; }
.s-erledigt  { --c: var(--olive); --cb: var(--olive-bg); --cf: var(--olive-fg); --cd: var(--olive-bd);
               --dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='1 1 10 10'%3E%3Cpath d='M3.7 6.2 5.3 7.8 8.4 4.5' fill='none' stroke='%23FFFDF8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat, var(--c);
               --ring: none; }
/* Auf der schwarzen Fläche kehren Schrift und Symbol sich um. */
.chip.s-blockiert:not(.off), .mini.s-blockiert { color: var(--surface); --c: var(--surface); --ci: var(--block); }

i.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--dot, var(--stone)); box-shadow: var(--ring, none); flex: none; display: inline-block; }

/* ── Avatare ─────────────────────────────────────────────────────── */
.av {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  font-size: 11px; font-weight: 600; background: var(--pb, #EDE9E1); color: var(--pc, #514C43);
  border: 1.5px solid var(--surface);
}
.av.sm { width: 20px; height: 20px; font-size: 10px; }
.av.lg { width: 38px; height: 38px; font-size: 14px; }
/* .p-<schlüssel> setzt app.js aus config.php — siehe paintPeople(). */
.btn-av { cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--fainter); width: 30px; height: 30px; }
.btn-av.on { background: var(--pc, #514C43); border-color: var(--pc, #514C43); color: #FFFDF8; }
.person {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 5px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--fainter); font-size: 13px; font-weight: 500; cursor: pointer;
}
.person.on { border-color: var(--pc); background: var(--pb); color: var(--pc); font-weight: 600; }
.person .av { border-color: transparent; }
.person.on .av { background: var(--pc); color: #FFFDF8; }

/* ── Deadline-Marke ──────────────────────────────────────────────── */
.due {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border: 1px solid transparent; border-radius: 999px;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap;
}
.due.none    { color: #B0A899; }
.due.soon    { background: var(--clay-bg); color: var(--clay-fg); border-color: var(--clay-bd); font-weight: 500; }
.due.late    { background: var(--clay); color: #FFF7F2; font-weight: 500; }
.due.done    { color: var(--fainter); }
.due.inherit { border-style: dashed; border-color: #C9C1B2; }
.due.donedate { color: var(--olive); }
.due.donedate.old { color: var(--fainter); }
.due.soon.inherit { border-color: #D09A7B; }
.due.late.inherit { border-color: var(--clay-fg); }

/* ── Filter ──────────────────────────────────────────────────────── */
.filters {
  flex: none; display: flex; flex-direction: column; gap: 12px;
  padding: 16px 48px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 56px; z-index: 20;
}
.fsent { flex: none; height: 0; }
.frow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fgroup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.fgroup.muted .flabel, .fgroup.muted .seg { opacity: .45; }
.seg button:disabled { cursor: default; }
.fhint { font-size: 12px; color: var(--faint); }
.chips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 9px; width: 216px; height: 38px; padding: 0 12px;
  background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--faint);
}
.search.dashed { width: auto; background: transparent; border-style: dashed; border-color: #C9C1B2; height: 40px; }
.search input { flex-grow: 1; border: none; background: transparent; font-size: 13px; color: var(--ink); outline: none; }
.search input::placeholder { color: var(--fainter); }
/* eigenes X statt des Browser-X, das Firefox gar nicht und Safari nur mit Fokus zeigt */
.search:has(.search-clear) input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-clear {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-right: -6px; padding: 0; border: none; border-radius: 999px;
  background: transparent; color: var(--faint); cursor: pointer;
}
.search-clear:hover { background: var(--line); color: var(--ink); }
.search-clear .ic { width: 10px; height: 10px; }

/* Gruppen-Menü: ein Knopf statt einer Chip-Reihe, die mit jeder Gruppe länger wird */
.gp { position: relative; display: flex; flex: none; }
.gp-btn {
  display: inline-flex; align-items: stretch; height: 28px; max-width: 340px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
}
.gp-btn:hover { border-color: var(--stone-bd); }
.gp-btn.open { border-color: var(--edge); background: var(--ground); color: var(--ink); }
.gp-btn.on { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.gp-trigger {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 0 11px 0 14px;
  border: none; border-radius: 999px; background: transparent; color: inherit;
  font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.gp-btn.on .gp-trigger { padding-right: 9px; border-radius: 999px 0 0 999px; }
.gp-sum { overflow: hidden; text-overflow: ellipsis; }
/* Gewählte und ausgeblendete Gruppen je als Teil: „Marketing +1 | ohne Privat“ */
.gp-part { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.gp-ohne { opacity: .62; }
.gp-div { flex: none; width: 1px; height: 12px; background: rgba(255, 253, 248, .3); }
.gp-more {
  flex: none; padding: 1px 6px; border-radius: 999px; background: rgba(255, 253, 248, .16);
  font-family: var(--mono); font-size: 11px; font-style: normal; font-weight: 500;
}
.gp-chev { width: 10px; height: 10px; transition: transform .15s; }
.gp-btn.open .gp-chev { transform: rotate(180deg); }
.gp-clear {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; padding: 0 2px 0 0; border: none; border-radius: 0 999px 999px 0;
  background: transparent; color: inherit; cursor: pointer;
}
.gp-clear::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 1px; background: rgba(255, 253, 248, .24); }
.gp-clear .ic { width: 10px; height: 10px; }
.gp-pop {
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; width: 352px; padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 14px 34px rgba(31, 29, 26, .14), 0 2px 6px rgba(31, 29, 26, .06);
}
.gp-pop .search { width: auto; height: 36px; padding: 0 11px; }
.gp-list { display: flex; flex-direction: column; gap: 1px; max-height: 324px; overflow-y: auto; }
.gp-row { display: flex; align-items: center; gap: 6px; padding-right: 10px; border-radius: var(--r-sm); }
.gp-row:hover, .gp-row:focus-within { background: var(--ground); }
.gp-row label {
  flex-grow: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; font-size: 13px; cursor: pointer;
}
.gp-row label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-row.on label span { font-weight: 600; }
.gp-row input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--ink); cursor: pointer; }
/* „nur" wählt genau diese Gruppe; erscheint bei Hover und Tastaturfokus */
.gp-only {
  flex: none; height: 22px; padding: 0 8px; border: 1px solid var(--stone-bd); border-radius: 999px;
  background: var(--surface); color: var(--stone-fg); font-size: 11.5px; font-weight: 500; cursor: pointer; opacity: 0;
}
.gp-row:hover .gp-only, .gp-row:focus-within .gp-only { opacity: 1; }
.gp-only:hover { border-color: var(--ink); color: var(--ink); }
/* „ohne“ gesetzt: der Knopf bleibt schwarz stehen, der Name ist durchgestrichen */
.gp-only.pin { opacity: 1; background: var(--ink); border-color: var(--ink); color: var(--surface); }
.gp-row.ex label span { color: var(--faint); text-decoration: line-through; }
.gp-note { margin: 0; padding: 8px 10px; border-radius: var(--r-sm); background: var(--stone-bg); color: var(--stone-fg); font-size: 12px; line-height: 1.45; }
.gp-n { flex: none; min-width: 18px; text-align: right; font-size: 11.5px; color: var(--muted); }
.gp-none { margin: 0; padding: 14px 10px; font-size: 13px; color: var(--muted); }
.gp-foot {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 3px;
  border-top: 1px solid var(--hair); font-size: 11.5px; color: var(--muted);
}
.gp-foot .mono { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-foot .link { white-space: nowrap; }
.gp-foot .link:disabled { color: var(--fainter); cursor: default; }

/* Deadline, Umsetzen: Knopf wie das Gruppen-Menü, gewählt schwarz mit × */
.fdd { position: relative; display: flex; flex: none; }
.gp-btn.on .fdd-k { opacity: .7; }
.fdd-v { font-weight: 600; }
.fm-pop {
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; width: 280px; padding: 6px;
  display: flex; flex-direction: column; gap: 1px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 14px 34px rgba(31, 29, 26, .14), 0 2px 6px rgba(31, 29, 26, .06);
}
.fm-item {
  display: grid; grid-template-columns: minmax(0, 1fr) 16px; column-gap: 10px; align-items: center;
  padding: 8px 10px; border: none; border-radius: var(--r-sm); background: transparent;
  color: var(--ink); text-align: left; cursor: pointer;
}
.fm-item:hover, .fm-item:focus-visible { background: var(--ground); }
.fm-l { grid-column: 1; font-size: 13px; font-weight: 500; }
.fm-d { grid-column: 1; font-size: 11.5px; line-height: 1.35; color: var(--faint); }
.fm-ok { grid-column: 2; grid-row: 1 / 3; color: var(--teal); stroke-width: 1.8; visibility: hidden; }
.fm-item.on .fm-l { font-weight: 600; }
.fm-item.on .fm-ok { visibility: visible; }

/* Sind Deadline und Umsetzen beide gesetzt, steht „und“ dazwischen; ein Klick
   macht „oder“ daraus, dann fasst eine Kapsel die beiden zusammen. Der
   negative Rand hält die Knöpfe an ihrem Platz. */
.ftime { display: flex; align-items: center; gap: 10px; flex: none; }
.ftime.both { gap: 4px; margin: -3px; padding: 3px; border-radius: 999px; }
.ftime.or { background: var(--stone-bg); box-shadow: inset 0 0 0 1px var(--stone-bd); }
.fjoin { display: flex; align-items: center; flex: none; }
.fjoin-btn {
  height: 22px; padding: 0 9px; border: 1px dashed #C9C1B2; border-radius: 999px;
  background: transparent; color: var(--faint); font-size: 11.5px; font-weight: 500; cursor: pointer;
}
.fjoin-btn:hover { border-color: var(--faint); color: var(--ink); }
.ftime.or .fjoin-btn {
  border: 1px solid var(--stone-bd); background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(31, 29, 26, .08);
}
.ftime.or .fjoin-btn:hover { border-color: var(--faint); }

/* Zeitraum der Erledigten, am Erledigt-Chip angehängt; Farben vom Status.
   Die Naht ohne Rand über Breite 0, nicht „none“: .off setzt border-style
   neu und holte sonst einen 3px breiten Strich zurück. */
.cwrap { display: contents; }
.ctail {
  position: relative; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 9px;
  border: 1px solid var(--cd); border-left-width: 0; border-radius: 0 999px 999px 0;
  background: var(--cb); color: var(--cf); font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.ctail::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--cd); }
.ctail .ic { width: 9px; height: 9px; transition: transform .15s; }
.ctail.open .ic { transform: rotate(180deg); }
.ctail.off { background: transparent; border-style: dashed; border-color: #D5CEC0; color: var(--fainter); cursor: default; }
.ctail.off::before { background: #D5CEC0; }
/* Desktop: Presets, darunter eine Filterzeile, beide ohne Beschriftungen. Sie
   scrollen mit der Seite weg, hervorgeholt (peek) kleben sie unter der Kopfzeile. */
@media (min-width: 900px) {
  .filters { position: relative; top: auto; padding: 8px 48px; gap: 8px; }
  /* .filters davor: die Grundregeln für die Preset-Zeile stehen weiter unten */
  .filters .prow { gap: 12px; padding-bottom: 8px; }
  .filters .pgroup { flex: 0 1 auto; }
  .filters .pact { gap: 8px; margin-left: 0; }
  .filters.peek { position: sticky; top: 56px; box-shadow: 0 10px 24px rgba(31, 29, 26, .08); }
  .fmain { gap: 8px 10px; }
  .fmain .flabel, .fmain .fseg, .fmain .fg-done { display: none; }
  .fmain .chips { gap: 6px; }
  .fmain .chip { height: 28px; }
  .fmain .pf, .fmain .btn-av { width: 28px; height: 28px; }
  .fmain .sep { height: 20px; }
  .cwrap.fdone { display: inline-flex; position: relative; }
  .cwrap.fdone > .chip { border-right-width: 0; border-radius: 999px 0 0 999px; padding-right: 10px; }
}
/* Mittlere Breiten: Beschriftungen weichen Symbolen, die Filterzeile darf umbrechen */
@media (min-width: 900px) and (max-width: 1279px) {
  .chg-btn:not(.has) { width: 34px; padding: 0; justify-content: center; }
  .chg-btn:not(.has) .chg-t { display: none; }
}
@media (min-width: 900px) and (max-width: 1099px) {
  .top { gap: 10px; }
  .top .seg button { padding: 0 9px; }
  .mark { margin-right: 6px; }
}

/* ── Presets ─────────────────────────────────────────────────────────
   Gespeicherte Filter über den Filtern. Was gilt, ist schwarz wie jeder
   gewählte Filter; „geändert“ trägt einen Punkt; die eigenen stehen hinter
   einem Strich. Der Avatar heisst: passt sich an, wer angemeldet ist. */
.prow { flex-wrap: nowrap; padding-bottom: 12px; border-bottom: 1px solid var(--hair); }
.pgroup { flex: 1 1 auto; }
.phead { display: flex; align-items: center; gap: 10px; flex: none; }
.pman-m { display: none; }
.pchips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.pchip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--stone-fg);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.pchip:hover { border-color: var(--stone-bd); color: var(--ink); }
.pchip.on, .pchip.on:hover { background: var(--ink); border-color: var(--ink); color: var(--ground); font-weight: 600; }
.pchip.dirty { border-color: var(--ink); background: var(--surface); color: var(--ink); font-weight: 600; }
.pchip.forme { padding-left: 4px; }
.pchip.first { position: relative; margin-left: 15px; }
.pchip.first::before { content: ""; position: absolute; left: -12px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.pchip .pme, .pvm-name .pme { width: 20px; height: 20px; border: none; background: var(--pc); color: #FFFDF8; font-size: 10px; }
.pchip .pmine { width: 12px; height: 12px; margin-right: -2px; color: var(--fainter); }
.pchip.on .pmine { color: rgba(244, 242, 237, .6); }
.pchip .pn { font-size: 11px; font-weight: 400; color: var(--faint); }
.pchip.on .pn { color: rgba(244, 242, 237, .62); }
.pdot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.phint { font-size: 12.5px; color: var(--faint); }
.pact { display: flex; align-items: center; gap: 12px; flex: none; margin-left: auto; }
.pmod { display: flex; align-items: center; gap: 8px; }
.pmod-t { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pmod .btn { height: 30px; padding: 0 12px; gap: 6px; font-size: 12.5px; }
.pmod .btn .ic { width: 12px; height: 12px; stroke-width: 1.8; }
.psave {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px 0 11px;
  border: 1px dashed #C9C1B2; border-radius: 999px; background: transparent; color: var(--stone-fg);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.psave .ic { width: 12px; height: 12px; stroke-width: 1.8; }
.psave:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-fg); }
.psave.open, .psave.open:hover {
  border-style: solid; border-color: var(--teal); background: #F1F7F6; color: var(--teal-fg);
  font-weight: 600; box-shadow: 0 0 0 3px rgba(15, 108, 99, .12);
}
.psave:disabled { opacity: .45; cursor: default; }
.pman { width: 30px; height: 30px; }
.pman.open { border-color: var(--edge); background: var(--ground); color: var(--ink); }
.pstrip { display: none; }

/* Speichern und Verwalten: am Knopf ausgerichtet (pvPlace), auf dem Handy ein Blatt */
.pvp {
  position: fixed; z-index: 45; width: 384px; max-height: calc(100vh - 140px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 14px 34px rgba(31, 29, 26, .14), 0 2px 6px rgba(31, 29, 26, .06);
}
.pvp-head { display: flex; align-items: center; gap: 10px; }
.pvp-head h2 { flex-grow: 1; font-size: 19px; }
.pvp-field { display: flex; flex-direction: column; gap: 8px; }
.pvp-field input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--ground); font-size: 14px; color: var(--ink); outline: none;
}
.pvp-field input:focus { border-color: var(--teal); background: var(--surface); box-shadow: 0 0 0 3px rgba(15, 108, 99, .12); }
.pvp-sum { display: flex; flex-direction: column; border: 1px solid var(--hair); border-radius: 10px; background: #FAF8F3; }
.pvp-li { display: grid; grid-template-columns: 80px minmax(0, 1fr); column-gap: 12px; padding: 8px 12px; font-size: 12.5px; line-height: 1.4; }
.pvp-li + .pvp-li { border-top: 1px solid var(--hair); }
.pvp-li span { color: var(--muted); }
.pvp-li b { font-weight: 500; }
.pvp-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.pvp-me {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--hair); border-radius: 10px; background: var(--ground); cursor: pointer;
}
.pvp-me input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--ink); cursor: pointer; }
.pvp-me > span { display: flex; flex-direction: column; gap: 3px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.pvp-me b { font-size: 13px; font-weight: 600; color: var(--ink); }
.pvp-scope { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pvp-scope button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 10px; }
.pvp-avs { display: inline-flex; }
.pvp-avs .av { width: 18px; height: 18px; font-size: 9px; }
.pvp-avs .av + .av { margin-left: -6px; }
.pvp-err { margin: 0; padding: 9px 12px; border-radius: var(--r-sm); background: var(--clay-bg); color: var(--clay-fg); font-size: 12.5px; }
.pvp-foot { display: flex; align-items: center; gap: 10px; }

.pvm { width: 420px; gap: 2px; padding: 8px; }
.pvm .pvp-head { padding: 8px 8px 6px 12px; }
.pvm-sec { display: flex; flex-direction: column; gap: 1px; }
.pvm-label { padding: 10px 12px 4px; }
.pvm-row { display: flex; align-items: center; gap: 4px; min-height: 50px; padding: 0 4px; border-radius: var(--r-sm); }
.pvm-row:hover, .pvm-row:focus-within, .pvm-row.ren { background: var(--ground); }
.pvm-row.drag { background: var(--hair); opacity: .7; }
.pvm-grip {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 34px; padding: 0;
  border: none; border-radius: 6px; background: transparent; color: var(--edge); cursor: grab;
}
.pvm-grip svg { width: 14px; height: 14px; fill: currentColor; }
.pvm-grip:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.pvm-main {
  flex-grow: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px;
  border: none; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; cursor: pointer;
}
.pvm-name { display: flex; align-items: center; gap: 6px; max-width: 100%; font-size: 13.5px; font-weight: 600; }
.pvm-name .pme { width: 16px; height: 16px; font-size: 8.5px; }
.pvm-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvm-key { flex: none; font-size: 10.5px; font-weight: 400; color: var(--fainter); }
.pvm-sub { max-width: 100%; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvm-n { flex: none; min-width: 22px; margin-right: 4px; text-align: right; font-size: 11.5px; color: var(--muted); }
.pvm-ic {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: none; border-radius: var(--r-sm); background: transparent; color: var(--faint); cursor: pointer;
}
.pvm-ic:hover { background: var(--hair); color: var(--ink); }
.pvm-ic:disabled, .pvm-ic:disabled:hover { opacity: .35; background: transparent; cursor: default; }
.pvm-ic .ic { width: 13px; height: 13px; stroke-width: 1.5; }
.pvm-ud { display: none; }
.pvm-ren { flex-grow: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 0; }
.pvm-ren input {
  flex-grow: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--teal); border-radius: var(--r-sm);
  background: var(--surface); box-shadow: 0 0 0 3px rgba(15, 108, 99, .12); font-size: 13.5px; font-weight: 600; color: var(--ink); outline: none;
}
.pvm-ok {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
  border: none; border-radius: var(--r-sm); background: var(--teal); color: #FFFDF8; cursor: pointer;
}
.pvm-ok .ic { stroke-width: 1.8; }
.pvm-empty { margin: 0; padding: 8px 12px 12px; font-size: 13px; color: var(--faint); }
.pvm-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 10px 12px 6px;
  border-top: 1px solid var(--hair); font-size: 12px; line-height: 1.45; color: var(--muted);
}

/* ── Inhaltsbereich ──────────────────────────────────────────────── */
.main { flex-grow: 1; padding: 28px 48px 48px; }
.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 13px; color: var(--muted);
}
.banner.err { border-color: var(--clay-bd); background: var(--clay-bg); color: var(--clay-fg); }
.banner.inline { margin: 0; }
.blank { padding: 64px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.blank h2 { font-size: 22px; }
.blank p { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; }

/* ── Liste ───────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 28px; }
.sec { display: flex; flex-direction: column; gap: 12px; }
.sec-head { display: flex; align-items: center; gap: 13px; height: 44px; }
.sec-head h2 { font-size: 23px; }
.chev {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface);
  color: var(--muted); cursor: pointer; transition: transform .12s ease;
}
.chev.closed { transform: rotate(-90deg); }
.bar { width: 132px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; flex: none; }
.bar i { display: block; height: 100%; background: var(--olive); }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}

.row {
  position: relative; display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 200px 96px 124px 140px;
  grid-template-rows: minmax(60px, auto);
  column-gap: 16px; align-items: center; min-height: 60px; padding: 0 20px;
}
@media (min-width: 900px) and (max-width: 1199px) {
  .row { grid-template-columns: 132px minmax(0, 1fr) 150px 80px 118px 128px; column-gap: 12px; }
}
.row + .row { border-top: 1px solid var(--hair); }
/* Die ganze Box wählt aus: ein unsichtbarer Knopf liegt unter dem Inhalt,
   nur Status-Chip, Titel und Gruppen fangen Klicks selbst ab. */
.rowhit {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0;
  border: none; background: transparent; cursor: pointer;
}
.rowhit:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.row > :where(:not(.rowhit):not(.rail)) { position: relative; pointer-events: none; }
.row .chip, .row .label, .row .gpill, .row .plan, .row .prio { pointer-events: auto; }
.row .rowmore { pointer-events: auto; cursor: auto; }

/* Aufgeklappt: Beschreibung und Anhänge unter der Zeile, bündig mit dem Titel */
.rowmore { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 10px; max-width: 760px; padding: 2px 0 18px; }
.nodesc { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--faint); }
.nodesc .link { font-size: 13px; }
.ricon { flex: none; display: inline-flex; align-items: center; gap: 2px; color: var(--fainter); font-family: var(--mono); font-size: 11px; }
.ricon .ic { width: 13px; height: 13px; stroke-width: 1.5; }

/* Beschreibung lesen: der Text ist die Fläche, darunter der Link zum Bearbeiten */
.dread { margin-left: -14px; padding: 9px 14px 11px; border: 1px solid transparent; border-radius: var(--r-md); cursor: text; }
.dread:hover { background: var(--surface); border-color: var(--line); }
.dact { display: flex; align-items: center; gap: 14px; margin-top: -4px; }
.dlink { display: inline-flex; align-items: center; gap: 6px; height: 28px; font-size: 13px; font-weight: 500; text-decoration: none; }
.dlink span { text-decoration: underline; text-underline-offset: 3px; }
.dlink .ic { width: 13px; height: 13px; stroke-width: 1.5; }
.dsaved { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--olive-fg); }
.dsaved .ic { width: 13px; height: 13px; stroke-width: 1.8; }

/* Beschreibung bearbeiten, an Ort und Stelle */
.dedit { display: flex; flex-direction: column; gap: 8px; }
.dedit-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dedit-top .fhint { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dedit-ta {
  display: block; width: 100%; min-height: 132px; margin: 0; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--teal); border-radius: var(--r-md);
  box-shadow: 0 0 0 3px rgba(15, 108, 99, .12);
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--ink); resize: vertical; outline: none;
}
.md.preview.dedit-pv { min-height: 132px; padding: 11px 14px; }
.dclash { display: flex; flex-direction: column; gap: 10px; }
.dclash .ddiff { max-height: 220px; padding: 6px 0; font-size: 12px; }
.dclash-act { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dclash-act .btn { height: 32px; padding: 0 12px; font-size: 12.5px; }
.dedit-foot { display: flex; align-items: center; gap: 10px; }
.dstate { font-size: 12px; color: var(--faint); }
.dstate.dirty, .dstate.err { display: inline-flex; align-items: center; gap: 7px; color: var(--teal-fg); }
.dstate.dirty::before, .dstate.err::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.dstate.err { color: var(--clay-fg); }
.dstate.err::before { background: var(--clay); }
.btn.dbtn { height: 32px; gap: 8px; padding: 0 8px 0 12px; font-size: 12.5px; }
.btn.dbtn.primary { padding-left: 14px; }
.dbtn kbd { display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10.5px; line-height: 1; padding: 3px 5px; border-radius: 4px; background: var(--hair); color: var(--muted); }
.dbtn kbd .ic { width: 10.5px; height: 10.5px; stroke-width: 1.8; }
.dbtn .keys { display: inline-flex; gap: 2px; }
.dbtn .keys kbd { min-width: 18.5px; padding: 3px 4px; }
.dbtn.primary kbd { background: rgba(255, 253, 248, .18); color: #FFFDF8; }
.btn.dbtn.warn, .btn.dbtn.warn:hover { color: var(--clay-fg); border-color: var(--clay-bd); }

/* Datei über eine Zeile gezogen */
.row .dropover {
  position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed var(--teal); background: rgba(220, 235, 232, .92);
  color: var(--teal-fg); font-size: 13.5px; font-weight: 600; pointer-events: none;
}
.dropover .ic { width: 16px; height: 16px; }

/* Gerendertes Markdown */
.md { font-size: 13.5px; line-height: 1.6; color: var(--stone-fg); overflow-wrap: anywhere; }
.md > div > *, .md > * { margin: 0; }
.md > div > * + *, .md > * + * { margin-top: 8px; }
.md h4 { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 12px; }
.md h4:first-child { margin-top: 0; }
.md ul, .md ol { padding-left: 20px; }
.md li + li { margin-top: 2px; }
.md strong { font-weight: 600; color: var(--ink); }
.md code { font-family: var(--mono); font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--hair); color: var(--stone-fg); }
.md a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }

/* Anhänge als kleine Kärtchen */
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 32px; padding: 0 10px 0 5px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--ink); font-size: 12.5px; text-decoration: none;
}
a.fchip:hover { border-color: var(--teal); }
.fchip .fname { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fchip .fsize { flex: none; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.fchip.err { border-color: var(--clay-bd); background: var(--clay-bg); }
.fchip.err .fsize { color: var(--clay-fg); font-family: var(--sans); }
.fx { display: inline-flex; padding: 2px; border: none; background: none; color: var(--clay-fg); cursor: pointer; }
.fext {
  flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 4px;
  border-radius: 5px; background: var(--hair); color: var(--muted);
  font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: .02em;
}
.fext.lg { width: 38px; height: 30px; font-size: 9.5px; }
.row:not(.is-self):not(.is-rel):hover { background: #FCFBF7; }
.row.flash { animation: rowflash 1.6s ease-out; }
@keyframes rowflash {
  0%, 30% { box-shadow: inset 0 0 0 2px var(--teal); background: #E6F1EF; }
  100%    { box-shadow: inset 0 0 0 2px transparent; }
}
.row .rail { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.row.is-self { background: #F1F7F6; }
.row.is-self .rail { background: var(--teal); }
.row.is-rel { background: #FAF8F3; }
.row.is-rel .rail { background: var(--stone-bd); }

.cell-label { display: flex; flex-direction: column; justify-content: center; gap: 5px; min-width: 0; }
.lline { display: flex; align-items: center; gap: 10px; min-width: 0; }
.also { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 11px; color: var(--fainter); }
.also-k { flex: none; }
.gpill {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer;
}
.gpill .ic { width: 8px; height: 8px; stroke-width: 1.7; }
.gpill:hover { border-color: var(--teal); color: var(--teal); }
.row.old .gpill { color: var(--fainter); border-color: var(--hair); }
.label {
  min-width: 0; padding: 0; border: none; background: none; text-align: left;
  font-size: 14.5px; font-weight: 500; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.label:hover { text-decoration: underline; text-underline-offset: 3px; }
.row.done .label { color: #948D80; text-decoration: line-through; }
.tag {
  flex: none; padding: 2px 7px; border-radius: 5px; font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; background: var(--stone-bg); color: var(--stone-fg);
}
.tag.self { background: var(--teal-bg); color: var(--teal-fg); }
.tag.draft { display: inline-flex; align-items: center; gap: 4px; padding-left: 6px; background: var(--teal-bg); color: var(--teal-fg); }
.tag.draft .ic { width: 10px; height: 10px; stroke-width: 1.7; }

.cell-dep { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dep, .wait { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 11.5px; white-space: nowrap; }
.dep { color: var(--faint); }
.dep .dtext { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wait { color: var(--fainter); }
/* Symbole für Voraussetzungen und Folge-Todos: Pfeil in das Todo hinein bzw. heraus */
.dico { width: 14px; height: 14px; stroke-width: 1.5; }
.dep .dico.none { color: #B0A899; }
.wait.hot { color: var(--ink); font-weight: 500; }
.cell-dri { display: flex; align-items: center; gap: 4px; }
.cell-due { display: flex; justify-content: flex-end; }

/* ── Umsetzungstag-Marke ─────────────────────────────────────────────
   Neutral, heute Petrol wie „Heute“ im Datumswähler, liegen geblieben dunkel
   (Struktur, keine Frist). Clay nur, wenn der Tag nach der Deadline liegt. */
.cell-plan { display: flex; min-width: 0; }
.plan {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 24px; padding: 0 9px 0 7px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--stone-fg); font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.plan span { overflow: hidden; text-overflow: ellipsis; }
.plan .ic { width: 12px; height: 12px; stroke-width: 1.5; }
.plan:hover { border-color: var(--stone-bd); color: var(--ink); }
.plan:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.plan.none { padding: 0 9px; border-color: transparent; background: transparent; color: #B0A899; font-family: var(--mono); font-size: 11.5px; }
.row:hover .plan.none, .plan.none:hover { border-style: dashed; border-color: #C9C1B2; color: var(--muted); }
.plan.today { background: var(--teal-bg); border-color: var(--teal-bd); color: var(--teal-fg); font-weight: 600; }
.plan.missed { border-color: var(--ink); color: var(--ink); }
.plan.afterdue { border-color: var(--clay-bd); color: var(--clay-fg); }
.plan.open, .plan.open:hover {
  border: 1px solid var(--teal); background: #F1F7F6; color: var(--teal-fg); font-family: var(--sans); font-size: 12px; font-weight: 600;
  padding: 0 9px 0 7px; box-shadow: 0 0 0 3px rgba(15, 108, 99, .12);
}

.empty { order: 3; min-height: 60px; display: flex; align-items: center; padding: 0 20px; font-size: 13px; color: var(--faint); }

/* Ältere Erledigte: stehen im Markup mit in der Zeilenliste, erscheinen per
   order aber erst unter der Zeile, die sie ein- und ausblendet. */
.oldbar {
  order: 1; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 20px;
  border: none; border-top: 1px solid var(--hair); background: #FAF8F3;
  font-size: 12.5px; color: var(--muted); text-align: left;
}
.oldbar.first { border-top: none; }
button.oldbar { cursor: pointer; }
button.oldbar:hover { background: #F5F2EB; }
.oldbar strong { font-weight: 600; color: var(--stone-fg); }
.oldbar .osub { color: var(--fainter); }
.oldbar .oact { margin-left: auto; font-weight: 600; color: var(--teal); }
.ochev {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 20px; height: 20px; border-radius: 5px; background: var(--hair); transition: transform .15s ease;
}
.ochev .ic { width: 12px; height: 12px; stroke-width: 1.8; }
.oldbar[aria-expanded="true"] .ochev { transform: rotate(90deg); }
.row.old { order: 2; border-top: 1px solid var(--hair); }
.row.old .label { color: var(--fainter); }
.row.old .dep { color: #B0A899; }
.row.old .chip { opacity: .7; }
.row.old .av { opacity: .6; }

/* ── Graph ───────────────────────────────────────────────────────── */
.graph { display: flex; flex-direction: column; gap: 20px; }
.glegend { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.leg { display: inline-flex; align-items: center; gap: 9px; }
.leg-ic { width: 34px; height: 10px; flex: none; }
.gscroll { overflow: auto; padding-bottom: 8px; }
.gcanvas { position: relative; }
.edges { position: absolute; left: 0; top: 0; pointer-events: none; }
.edges .edge { fill: none; stroke: var(--edge); stroke-width: 1.6; }
.edges .edge.long { stroke-dasharray: 5 4; opacity: .75; }
.edges .edge.hot { stroke: var(--clay); stroke-width: 2.2; stroke-dasharray: none; opacity: 1; }
.glabel {
  position: absolute; top: 0; font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fainter); white-space: nowrap;
}
.gnode {
  position: absolute; width: 240px; height: 96px; padding: 10px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column; gap: 5px; cursor: pointer;
}
.gnode:hover { border-color: var(--stone-bd); }
.gnode.hot { box-shadow: inset 3px 0 0 var(--clay); }
.gnode.s-erledigt { opacity: .72; }
.gnode.s-erledigt .gnode-label { color: #948D80; text-decoration: line-through; }
.gnode-top { display: flex; align-items: center; gap: 7px; }
.gnode-top .dot { width: 10px; height: 10px; }
.gnode-status { font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--cf); }
.gnode-top .due { height: 21px; padding: 0 8px; font-size: 10.5px; }
.gnode-label {
  padding: 0; border: none; background: none; text-align: left; color: inherit; cursor: pointer;
  font-size: 14px; font-weight: 600; line-height: 1.3; overflow: hidden;
}
.gnode-label:hover { text-decoration: underline; text-underline-offset: 3px; }
.gnode-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; min-width: 0; }
.gnode-foot .dim { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }

/* Kette (schmal) */
.chain { display: flex; flex-direction: column; gap: 18px; }
.chain-focus {
  display: flex; flex-direction: column; gap: 9px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: inset 3px 0 0 var(--c);
}
.chain-focus h2 { font-size: 22px; line-height: 1.2; }
.chain-sec { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.chain-head { display: flex; align-items: baseline; gap: 9px; }
.chain-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 13px; cursor: pointer; }
.chain-row .label { font-size: 13.5px; font-weight: 600; flex-grow: 1; }
.chain-kids { margin: 0 13px 10px 30px; padding-left: 16px; border-left: 1px solid var(--stone-bd); }
.chain-kid { position: relative; display: flex; align-items: center; gap: 9px; height: 40px; cursor: pointer; }
.chain-kid .tick { position: absolute; left: -16px; top: 20px; width: 12px; height: 1px; background: var(--stone-bd); }
.chain-kid .label { font-size: 12.5px; flex-grow: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain-kid .label.done { color: #948D80; text-decoration: line-through; }
.chain-note { margin: 14px 0 0; }

/* ── Kalender ────────────────────────────────────────────────────────
   Umsetzungstage als Karten, Deadlines in Clay; links, was noch keinen
   Tag hat. Gezogen wird mit der Maus, auf dem Handy über die Tagauswahl. */
.cal { display: flex; flex-direction: column; gap: 18px; }
.cal-bar { display: flex; align-items: center; gap: 14px; min-height: 38px; }
.cal-bar h2 { font-size: 23px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.btn.cal-today { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.cal-today:disabled { opacity: .5; cursor: default; }
.btn.cal-today:disabled:hover { border-color: var(--line); color: var(--muted); }
.cal-legend { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--muted); }
.cal-legend .leg { gap: 7px; }
.leg-box { width: 22px; height: 12px; border-radius: 4px; flex: none; }
.leg-box.plan { background: var(--surface); border: 1px solid var(--line); }
.leg-box.is-due { background: var(--clay-bg); border: 1px solid var(--clay-bd); }
.leg-box.inh { border: 1px dashed #D09A7B; }
.cal-body { display: flex; align-items: flex-start; gap: 20px; }

/* Einplanen */
.cal-rail { flex: none; width: 292px; display: flex; flex-direction: column; gap: 14px; }
.cal-box { position: relative; }
.cal-box.is-drop { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 108, 99, .12); }
.cal-boxhead { display: flex; align-items: center; gap: 8px; padding: 12px 14px 11px; }
button.cal-boxhead { width: 100%; border: none; background: transparent; text-align: left; cursor: pointer; }
.cal-boxhead h3 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.cal-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--ink); color: var(--ground); font-size: 10.5px; font-weight: 600;
}
.cal-sub {
  padding: 8px 14px 6px; border-top: 1px solid var(--hair); background: #FAF8F3;
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint);
}
.cal-li { border-top: 1px solid var(--hair); background: var(--surface); cursor: grab; }
.cal-li:hover { background: #FCFBF7; }
.cal-li.dragging { opacity: .4; }
.cal-li-main { display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 8px 8px 8px 8px; }
.cal-li.missed .cal-li-main { align-items: flex-start; min-height: 0; padding: 11px 14px 8px; }
.cal-li.missed .dot { margin-top: 3px; }
.cal-li .grip { width: 10px; height: 14px; fill: #C4BCAE; stroke: none; flex: none; }
.cal-li-body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cal-li-body .label { font-size: 13px; font-weight: 500; }
.cal-li.missed .cal-li-body .label { white-space: normal; line-height: 1.35; }
.cal-li-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; color: var(--fainter); white-space: nowrap; overflow: hidden; }
.cal-li-meta > span { overflow: hidden; text-overflow: ellipsis; }
.cal-li-meta b { font-weight: 500; color: var(--ink); }
.cal-li-meta .hot { color: var(--ink); font-weight: 500; }
.cal-li-meta .due { flex: none; height: 18px; padding: 0 6px; font-size: 10.5px; }
.cal-avs { flex: none; display: flex; gap: 2px; }
.cal-avs .av { border: none; }
.cal-pick { flex: none; }
.cal-pick.on { color: var(--teal); background: var(--teal-bg); }
.cal-li-act { display: flex; gap: 6px; padding: 0 14px 12px 34px; }
.qbtn {
  height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.qbtn:hover { border-color: var(--teal); color: var(--teal-fg); }
.qbtn.on { background: var(--teal-bg); border-color: var(--teal-bd); color: var(--teal-fg); font-weight: 600; }
.cal-none {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 18px 24px;
  border-top: 1px solid var(--hair); text-align: center; font-size: 12.5px; color: var(--muted);
}
.cal-none .ic { width: 22px; height: 22px; stroke: var(--olive); stroke-width: 1.5; }
.cal-none strong { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); }
.cal-hint {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px 11px; border-top: 1px solid var(--hair);
  background: #FAF8F3; font-size: 11.5px; line-height: 1.45; color: var(--muted);
}
.cal-hint .ic { margin-top: 1px; }
.cal-box > .cal-drophint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  border-radius: inherit; background: rgba(220, 235, 232, .9); color: var(--teal-fg);
  font-size: 13px; font-weight: 600; pointer-events: none;
}

/* Woche */
.cal-week {
  flex-grow: 1; min-width: 0; min-height: 560px;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .55fr));
}
.cal-day { display: flex; flex-direction: column; min-width: 0; }
.cal-day + .cal-day { border-left: 1px solid var(--hair); }
.cal-day.we { background: #F8F6F1; }
.cal-day.today { background: #F1F7F6; }
.cal-day.is-drop { box-shadow: inset 0 0 0 2px var(--teal); }
.cal-day.is-drop.drop-due { box-shadow: inset 0 0 0 2px var(--clay); }
.cal-dh { flex: none; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.cal-day.today .cal-dh { background: #E6F1EF; }
.cal-wd { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.cal-num {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: 999px;
  font-family: var(--serif); font-size: 18px; font-weight: 600;
}
.cal-day.we .cal-num { color: var(--faint); }
.cal-day.past .cal-wd, .cal-day.past .cal-num { color: var(--fainter); }
.cal-day.today .cal-wd { color: var(--teal-fg); }
.cal-day.today .cal-num { background: var(--teal); color: #FFFDF8; }
.cal-now { font-size: 11px; font-weight: 600; color: var(--teal-fg); }
.cal-n { font-size: 11px; color: var(--fainter); }
.cal-dbody { flex-grow: 1; display: flex; flex-direction: column; gap: 8px; padding: 10px 8px 14px; }
.cal-card {
  display: flex; flex-direction: column; gap: 8px; padding: 9px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); cursor: grab;
}
.cal-card:hover { border-color: var(--stone-bd); }
.cal-card.left { background: #FAF8F3; border-style: dashed; border-color: var(--stone); }
.cal-card.done { opacity: .72; }
.cal-card.done .cal-card-label { color: #948D80; text-decoration: line-through; }
.cal-card.dragging { opacity: .4; }
.cal-card .tag { align-self: flex-start; font-size: 9.5px; }
.cal-card-top { display: flex; align-items: flex-start; gap: 8px; }
.cal-card-top .dot { margin-top: 3px; }
.cal-card-label {
  min-width: 0; padding: 0; border: none; background: none; text-align: left; color: var(--ink);
  font-size: 12.5px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; cursor: pointer;
}
.cal-card-label:hover { text-decoration: underline; text-underline-offset: 3px; }
.cal-card-foot { display: flex; align-items: center; gap: 4px; min-width: 0; padding-left: 19px; }
.cal-card-foot > span:first-child { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--fainter); }
.cal-card-foot .av { border: none; }
/* Deadline-Karte: wie eine eingeplante, rot getönt. Ziehen verschiebt die Deadline;
   die geerbte (gestrichelt) gehört dem Folge-Todo und bleibt liegen. */
.cal-card.is-due { background: #FBEEE7; border-color: var(--clay-bd); }
.cal-card.is-due:hover { border-color: #DDB29B; }
.cal-card.is-due.inh { background: var(--surface); border-style: dashed; border-color: #D09A7B; }
.cal-card[draggable="false"] { cursor: default; }
.cal-card-via { margin-top: -4px; padding-left: 19px; font-size: 11px; line-height: 1.35; color: var(--clay-fg); overflow-wrap: anywhere; }
.tag.dtag { display: inline-flex; align-items: center; gap: 4px; background: #F3D9CB; color: var(--clay-fg); }
.tag.dtag.inh { background: transparent; box-shadow: inset 0 0 0 1px #D09A7B; }
.tag.dtag .ic { width: 10px; height: 10px; stroke-width: 1.7; }
.cal-dbody > .cal-drophint {
  display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 8px;
  border: 1.5px dashed var(--teal); border-radius: var(--r-md); background: rgba(220, 235, 232, .55);
  color: var(--teal-fg); font-size: 12px; font-weight: 600; text-align: center;
}
.cal-day.drop-due .cal-dbody > .cal-drophint { border-color: var(--clay); background: rgba(246, 227, 217, .6); color: var(--clay-fg); }

/* Monat */
.cal-month {
  flex-grow: 1; min-width: 0;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 34px; grid-auto-rows: minmax(118px, auto);
}
.cal-mwd { display: flex; align-items: center; padding: 0 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--fainter); }
.cal-mwd + .cal-mwd { border-left: 1px solid var(--hair); }
.cal-cell { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-top: 1px solid var(--hair); border-left: 1px solid var(--hair); }
.cal-cell:nth-child(7n + 1) { border-left: none; }
.cal-cell.we { background: #FBFAF6; }
.cal-cell.out { background: #FAF8F3; }
.cal-cell.today { background: #F1F7F6; }
.cal-cell.is-drop { background: #F1F7F6; box-shadow: inset 0 0 0 2px var(--teal); }
.cal-cell.is-drop.drop-due { background: #FBF1EB; box-shadow: inset 0 0 0 2px var(--clay); }
.cal-mnum {
  align-self: flex-start; min-width: 24px; height: 22px; padding: 0 6px; border: none; border-radius: 999px; background: transparent;
  font-family: var(--mono); font-size: 12px; color: var(--stone-fg); text-align: left; cursor: pointer;
}
.cal-mnum:hover { background: var(--hair); }
.cal-cell.we .cal-mnum { color: var(--faint); }
.cal-cell.out .cal-mnum { color: #B0A899; }
.cal-cell.today .cal-mnum { background: var(--teal); color: #FFFDF8; font-weight: 600; }
.cal-ent {
  display: flex; align-items: center; gap: 6px; min-width: 0; height: 22px; padding: 0 7px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: grab;
}
.cal-ent button {
  min-width: 0; padding: 0; border: none; background: none; color: inherit; text-align: left;
  font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cal-ent .dot { width: 9px; height: 9px; }
.cal-ent .ic { width: 11px; height: 11px; stroke-width: 1.5; flex: none; }
.cal-ent .cal-ent-flag { margin-left: auto; color: var(--clay); }
.cal-ent.is-due { background: var(--clay-bg); border-color: var(--clay-bd); color: var(--clay-fg); }
.cal-ent.is-due.inh { background: transparent; border-style: dashed; border-color: #D09A7B; cursor: default; }
.cal-ent.left { background: #FAF8F3; border-style: dashed; border-color: var(--stone); }
.cal-ent.done button { color: #948D80; text-decoration: line-through; }
.cal-ent.dragging { opacity: .4; }
.cal-more { align-self: flex-start; padding: 0 4px; border: none; background: none; font-size: 11.5px; color: var(--teal); cursor: pointer; }
.cal-more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Fußzeile / Tableiste ────────────────────────────────────────── */
.foot {
  flex: none; height: 52px; display: flex; align-items: center; gap: 12px;
  padding: 0 48px; background: var(--surface); border-top: 1px solid var(--line);
}
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--olive); flex: none; }
.pulse.busy { background: var(--teal); }
.tabbar { display: none; }

/* ── Bearbeiten-Panel ────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(31,29,26,.18); z-index: 40; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; z-index: 50;
  background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(31,29,26,.10);
}
.panel form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.panel-top { flex: none; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.panel-top h2 { font-size: 21px; }
.panel-body { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.panel-foot { flex: none; height: 68px; display: flex; align-items: center; gap: 10px; padding: 0 24px; border-top: 1px solid var(--line); }

/* Todo löschen: Papierkorb links im Fuss; die Rückfrage ersetzt den Fuss.
   Dunkel statt rot — Rot gehört den Deadlines. */
.del-btn { flex: none; width: 38px; height: 38px; }
.del-btn:hover { border-color: var(--stone-bd); }
.panel-body { transition: opacity .15s ease; }
.panel-body.dimmed { opacity: .45; pointer-events: none; }
.delq {
  flex: none; display: flex; flex-direction: column; gap: 18px; padding: 20px 24px;
  border-top: 1px solid var(--stone-bd); background: var(--ground); box-shadow: 0 -10px 24px rgba(31, 29, 26, .06);
}
.delq-main { display: flex; align-items: flex-start; gap: 14px; }
.delq-ic {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; background: var(--block); color: var(--surface);
}
.delq-ic .ic { width: 16px; height: 16px; }
.delq-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding-top: 1px; }
.delq-body > strong { font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.delq-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--muted); }
.delq-list li { display: flex; align-items: flex-start; gap: 9px; }
.delq-list .ic { width: 13px; height: 13px; margin-top: 2px; color: var(--faint); }
.delq-list strong { font-weight: 600; color: var(--ink); }
.delq-list .mono { font-size: 11.5px; }
.delq-act { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.delq-act .btn.dbtn { height: 38px; padding-left: 14px; font-size: 13.5px; }
.delq-act .btn.ghost:focus-visible, .delq-act .btn.ghost:focus { outline: none; border-color: var(--teal); color: var(--ink); box-shadow: 0 0 0 3px rgba(15, 108, 99, .14); }
.btn.dark { background: var(--block); color: #FFFDF8; }
.btn.dark:hover { background: #3B3731; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field-head { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.field-head { display: flex; align-items: baseline; gap: 10px; }
.field > input[type="text"], .field > input[type="date"] {
  height: 44px; padding: 0 13px; background: var(--ground); border: 1px solid var(--line);
  border-radius: var(--r-md); font-size: 15px; font-weight: 500; color: var(--ink); outline: none;
}
.field > input[type="date"] { font-family: var(--mono); font-size: 14px; font-weight: 400; }
.field > input:focus { border-color: var(--teal); }

/* Datepicker: ruhiger Kalender ohne rote Wochenenden — Rot bleibt Fristen vorbehalten */
.dp { position: relative; }
.dp-field { display: flex; align-items: center; gap: 8px; }
.dp-trigger {
  flex-grow: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 13px;
  background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--mono); font-size: 14px; color: var(--ink); text-align: left; cursor: pointer;
}
.dp-trigger > .ic { width: 16px; height: 16px; color: var(--faint); }
.dp-trigger.empty .dp-val { font-family: var(--sans); color: var(--fainter); }
.dp-trigger:hover { border-color: var(--stone-bd); }
.dp-trigger.open, .dp-trigger:focus-visible { border-color: var(--teal); outline: none; }
.dp-rel { margin-left: auto; font-family: var(--sans); font-size: 12px; color: var(--faint); white-space: nowrap; }
.dp-clear { flex: none; width: 44px; height: 44px; border-radius: var(--r-md); }
.dp-clear .ic { width: 10px; height: 10px; }
.dp-pop {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 320px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 34px rgba(31, 29, 26, .14), 0 2px 6px rgba(31, 29, 26, .06);
}
.dp-quick { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--hair); }
.dp-quick button {
  height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.dp-quick button:hover { border-color: var(--teal); color: var(--teal-fg); }
.dp-quick button.on { background: var(--teal-bg); border-color: var(--teal-bd); color: var(--teal-fg); }
/* Vorschläge: nach der Voraussetzung (gestrichelt Petrol), vor der Deadline (Clay) */
.dp-quick button.sug { border-style: dashed; border-color: var(--teal); color: var(--teal-fg); }
.dp-quick button.is-due { border-color: var(--clay-bd); color: var(--clay-fg); }
.dp-quick button.is-due:hover { border-color: var(--clay); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-head strong { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.dp-head .icon-btn { width: 32px; height: 32px; border: none; background: transparent; }
.dp-head .icon-btn:hover { background: var(--hair); }
.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dp-wd { padding: 4px 0 6px; text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fainter); }
.dp-day {
  position: relative; height: 38px; padding: 0; border: none; border-radius: 9px; background: transparent;
  font-family: var(--mono); font-size: 13px; color: var(--ink); cursor: pointer;
}
.dp-day:hover { background: var(--hair); }
.dp-day.past { color: var(--fainter); }
.dp-day.out { color: #CFC8BA; }
.dp-day.inh { outline: 1.5px dashed #D09A7B; outline-offset: -4px; color: var(--clay-fg); }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--teal); color: var(--teal-fg); font-weight: 600; }
.dp-day.after { color: #CDA692; }
.dp-day.is-due { box-shadow: inset 0 0 0 1.5px var(--clay); color: var(--clay-fg); font-weight: 600; }
.dp-day.sel, .dp-day.sel:hover { background: var(--teal); box-shadow: none; outline: none; color: #FFFDF8; font-weight: 600; }
.dp-day:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
/* Punkte: wie viel an dem Tag schon eingeplant ist */
.dp-dots { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 2px; pointer-events: none; }
.dp-dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--fainter); }
.dp-day.today .dp-dots i { background: var(--teal); }
.dp-day.sel .dp-dots i { background: rgba(255, 253, 248, .8); }
.dp-dots.static { position: static; display: inline-flex; }
.dp-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair); font-size: 12px; color: var(--muted); }
.dp-legend { display: inline-flex; align-items: center; gap: 7px; margin-left: 12px; }
.dp-key { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.dp-key.today { box-shadow: inset 0 0 0 1.5px var(--teal); }
.dp-key.inh { border: 1.5px dashed #D09A7B; }
.dp-key.is-due { box-shadow: inset 0 0 0 1.5px var(--clay); }
.dp-foot { flex-wrap: wrap; row-gap: 6px; }

/* Umsetzen am im Panel */
.field-head .fhint { font-weight: 400; letter-spacing: 0; text-transform: none; }
.plan-trigger.afterdue { border-color: var(--clay-bd); }
.plan-trigger.afterdue .dp-rel { color: var(--clay-fg); }
.plan-trigger > .ic { stroke-width: 1.4; }
.plan-trigger:not(.empty) > .ic { color: var(--teal); }
.plan-warn, .plan-note {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md);
}
.plan-warn > div, .plan-note > div { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-warn strong, .plan-note strong { font-size: 12.5px; font-weight: 600; }
.plan-warn span, .plan-note span { font-size: 12px; }
.plan-warn .btn, .plan-note .btn { flex: none; height: 30px; padding: 0 11px; font-size: 12px; }
.plan-warn { background: var(--clay-bg); border: 1px solid var(--clay-bd); color: var(--clay-fg); }
.plan-warn .btn { border-color: var(--clay-bd); color: var(--clay-fg); }
.plan-note { background: var(--ground); border: 1px dashed #C9C1B2; color: var(--muted); }
.plan-note strong { color: var(--ink); }

/* Worauf das Todo wartet — im Kalender des Panels und in der Tagauswahl */
.pp-hint {
  display: flex; align-items: flex-start; gap: 9px; margin-bottom: 10px; padding: 9px 11px;
  background: var(--ground); border: 1px dashed #C9C1B2; border-radius: var(--r-md);
  font-size: 12px; line-height: 1.45; color: var(--muted);
}
.pp-hint .av { border: none; }
.pp-hint strong { font-weight: 600; color: var(--ink); }

/* ── Tagauswahl an Zeile und Kalender ────────────────────────────────
   Eine für alle Auslöser, fest am Bildschirm unter dem Auslöser; auf dem
   Handy ein Blatt von unten. */
.pp {
  position: fixed; z-index: 45; width: 336px; max-height: calc(100vh - 16px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 14px 34px rgba(31, 29, 26, .14), 0 2px 6px rgba(31, 29, 26, .06);
}
.pp-in { display: flex; flex-direction: column; padding: 14px; }
.pp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pp-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pp-quick { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--hair); }
.pp-q {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.pp-q:hover { border-color: var(--teal); color: var(--teal-fg); }
.pp-q.on { background: var(--teal-bg); border-color: var(--teal-bd); color: var(--teal-fg); }
.pp-q.sug { border-style: dashed; border-color: var(--teal); color: var(--teal-fg); }
.pp-q.is-due { border-color: var(--clay-bd); color: var(--clay-fg); }
.pp-q .pp-q-d, .pp-q .pp-q-n, .pp-q .pp-q-ok, .pp-q.extra { display: none; }
/* Vorschläge nennen ihr Datum auch auf dem Knopf */
.pp-q.sug .pp-q-d, .pp-q.is-due .pp-q-d { display: inline; font-size: 11.5px; }
.pp-foot { display: flex; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair); }
.pp-foot .link { color: var(--muted); }
.pp-scrim { position: fixed; inset: 0; z-index: 44; background: rgba(31, 29, 26, .24); }

/* ── Status-Menü ─────────────────────────────────────────────────────
   Rechtsklick oder langes Drücken auf einen Status-Chip; der einfache Klick
   geht nur den Hauptweg, Blockiert gibt es hier. */
.row .chip, .crow .chip { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.stm {
  position: fixed; z-index: 45; width: 204px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 14px 34px rgba(31, 29, 26, .14), 0 2px 6px rgba(31, 29, 26, .06);
}
.stm-in { display: flex; flex-direction: column; gap: 2px; }
.stm-head { padding: 4px 10px 6px; }
.stm-item {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 10px;
  border: none; border-radius: 7px; background: transparent; color: var(--ink);
  font-size: 13px; font-weight: 500; text-align: left; cursor: pointer;
}
.stm-item.on { background: var(--ground); }
.stm-item:hover, .stm-item:focus-visible { background: var(--hair); outline: none; }
.stm-item .dot { width: 12px; height: 12px; }
.stm-cur { margin-left: auto; font-size: 11px; color: var(--faint); }

/* ── Priorität ───────────────────────────────────────────────────────
   Optional. Drei Balken, die Zahl der gefüllten trägt die Stufe — auch in
   Graustufen lesbar. Neutral wie alle Struktur, kein Rot: das gehört den
   Deadlines. Ohne Priorität sind alle Balken leer, in der Zeile bleibt der
   Platz vor dem Titel leer, bis man darüberfährt. */
.bars { display: block; width: 16px; height: 16px; flex: none; }
.bars rect { fill: #DCD5C8; }
.bars.hoch rect { fill: var(--ink); }
.bars.mittel .b1, .bars.mittel .b2 { fill: var(--muted); }
.bars.gering .b1 { fill: var(--faint); }

.prio {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  margin: 0 -4px 0 -5px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer;
}
.prio:hover { border-color: var(--stone-bd); background: var(--surface); }
.prio:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.prio.none .bars { opacity: 0; }
.row:hover .prio.none, .prio.none:focus-visible { border-style: dashed; border-color: #C9C1B2; background: transparent; }
.row:hover .prio.none .bars, .prio.none:focus-visible .bars, .prio.none.open .bars { opacity: 1; }
.prio.open, .prio.open:hover { border-style: solid; border-color: var(--teal); background: #F1F7F6; box-shadow: 0 0 0 3px rgba(15, 108, 99, .12); }
.row.old .prio:not(.none) .bars { opacity: .6; }

.sec-hoch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sec-hoch .bars { width: 13px; height: 13px; }

/* Filter: nichts gewählt heisst alle, Wählen grenzt ein — wie bei DRI */
.pf {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.pf:hover { border-color: var(--stone-bd); }
.pf.on, .pf.on:hover { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.pf.on .bars rect { fill: rgba(255, 253, 248, .28); }
.pf.on .bars.hoch rect, .pf.on .bars.mittel .b1, .pf.on .bars.mittel .b2, .pf.on .bars.gering .b1 { fill: #FFFDF8; }

/* Menü an den Balken: wie das Status-Menü, „Ohne“ unter einer Linie */
.stm.prm { width: 212px; }
.prm-head { display: flex; flex-direction: column; gap: 4px; }
.prm-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stm-item.sep { position: relative; margin-top: 9px; }
.stm-item.sep::before { content: ""; position: absolute; left: 4px; right: 4px; top: -6px; height: 1px; background: var(--hair); pointer-events: none; }

/* Panel: vier Stufen nebeneinander, direkt nach dem Status */
.pseg { align-self: flex-start; border-radius: 10px; }
.pseg button { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px 0 12px; border-radius: 8px; font-size: 13.5px; }

.mini.pr { --cd: var(--stone-bd); --cb: var(--surface); --cf: var(--stone-fg); }
.mini .bars { width: 12px; height: 12px; }
.gnode-top .bars { width: 13px; height: 13px; }
.cal-card-top .bars { width: 13px; height: 13px; margin-top: 2px; }
.cal-li-body .lline, .crow-body .lline { gap: 6px; }
.cal-li-body .bars, .crow-body .bars { width: 13px; height: 13px; }

/* Beschreibung und Anhänge im Panel */
.dhead { display: flex; align-items: center; gap: 10px; }
.dlabel { flex-grow: 1; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.field textarea {
  min-height: 190px; padding: 12px 14px; background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--ink); resize: vertical; outline: none;
}
.field textarea:focus { border-color: var(--teal); }
.md.preview { min-height: 190px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.fhint code { font-family: var(--mono); font-size: 11.5px; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 108px; padding: 16px;
  border: 1.5px dashed #C9C1B2; border-radius: var(--r-md); background: #FAF8F3; color: var(--muted); font-size: 13px; text-align: center;
}
.drop > .ic { width: 20px; height: 20px; stroke-width: 1.4; }
.drop.over { border-style: solid; border-color: var(--teal); background: #F1F7F6; color: var(--teal-fg); }
.pick-file { position: relative; color: var(--teal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pick-file input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
.pick-file:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 3px; }
.flist { display: flex; flex-direction: column; gap: 6px; }
.fitem {
  display: flex; align-items: center; gap: 11px; min-height: 50px; padding: 0 6px 0 8px;
  border: 1px solid var(--hair); border-radius: 10px; background: var(--surface);
}
.fitem.err { border-color: var(--clay-bd); background: var(--clay-bg); }
.fbody { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fbody .fname { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmeta { font-size: 11.5px; color: var(--faint); }
.fitem.err .fmeta { color: var(--clay-fg); }
.fbar { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.fbar i { display: block; height: 100%; background: var(--teal); transition: width .2s ease; }
.fitem .icon-btn.sm { width: 32px; height: 32px; }
.fdel.confirm { width: auto; padding: 0 10px; color: var(--clay-fg); font-size: 12px; font-weight: 600; }
.inherit-box {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--ground); border: 1px dashed #C9C1B2; border-radius: var(--r-md);
}
.inherit-box > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-grow: 1; }
.inherit-box strong { font-size: 12.5px; color: var(--clay-fg); }
.inherit-box span { font-size: 12px; color: var(--muted); }
.inherit-box .up { width: 16px; height: 16px; stroke: var(--clay-fg); }
.inherit-box .btn { height: 30px; padding: 0 11px; font-size: 12px; }

.stack { display: flex; flex-direction: column; gap: 6px; }
.pick {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 6px 0 13px;
  background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-md);
}
.pick.flat { background: var(--surface); border-color: var(--hair); }
.pick .label { flex-grow: 1; font-size: 13.5px; cursor: default; }
.pick .label:hover { text-decoration: none; }
.hotbar { display: inline-block; width: 3px; height: 16px; border-radius: 2px; background: var(--clay); flex: none; }
.suggest { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.suggest button {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 13px;
  border: none; background: transparent; text-align: left; font-size: 13.5px; cursor: pointer;
}
.suggest button:hover { background: var(--hair); }
.suggest button + button { border-top: 1px solid var(--hair); }
.pad { padding: 12px 13px; margin: 0; }
.gclean { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gclean .link { color: var(--faint); text-decoration: none; }
.gclean .link:hover { color: var(--clay-fg); text-decoration: underline; text-underline-offset: 3px; }
.newgroup input {
  height: 30px; width: 108px; padding: 0 12px; border: 1px dashed #C9C1B2; border-radius: 999px;
  background: transparent; font-size: 12.5px; color: var(--ink); outline: none;
}
.newgroup input:focus { border-style: solid; border-color: var(--teal); }

/* ── „Wer bist du" ───────────────────────────────────────────────── */
.who { position: fixed; inset: 0; z-index: 60; background: rgba(244,242,237,.92); display: flex; align-items: center; justify-content: center; padding: 24px; }
.who-box { width: 100%; max-width: 420px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; gap: 10px; }
.who-box h1 { font-size: 26px; }
.who-box p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.who-row { display: flex; gap: 10px; }
.who-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.who-btn:hover { border-color: var(--teal); background: var(--teal-bg); }

/* ── „Mit Claude verbinden" ──────────────────────────────────────── */
.who-box.conn { max-width: 560px; gap: 16px; max-height: calc(100vh - 48px); overflow-y: auto; }
.who-box.conn p { margin: 0; }
.conn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.conn-fresh {
  display: flex; flex-direction: column; gap: 16px; padding: 16px;
  background: var(--teal-bg); border: 1px solid var(--teal-bd); border-radius: var(--r-md);
}
.conn-fresh .flabel { color: var(--teal-fg); }
.conn-fresh .sm.dim { color: var(--teal-fg); opacity: .8; }
.conn-copy { display: flex; align-items: flex-start; gap: 8px; }
.conn-copy code {
  flex-grow: 1; min-width: 0; padding: 9px 11px; background: var(--surface); border: 1px solid var(--teal-bd);
  border-radius: var(--r-sm); font-family: var(--mono); font-size: 11.5px; line-height: 1.5; word-break: break-all;
  user-select: all;
}
.conn-copy .btn { flex: none; height: 36px; padding: 0 12px; }
.conn-warn { margin: 0; color: var(--teal-fg); }
.conn-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.conn-row .mono { white-space: nowrap; }
.conn-name { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.conn-new { display: flex; gap: 8px; }
.conn-new input {
  flex-grow: 1; height: 38px; padding: 0 12px; background: var(--ground); border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 13.5px; outline: none;
}
.conn-new input:focus { border-color: var(--teal); }

/* ── Änderungen anderer ──────────────────────────────────────────────
   Farbe der Person, die geändert hat (.p-<id> setzt --pc/--pb) — kein
   Rot, das bleibt den Deadlines. */
.chg { position: relative; flex: none; }
.chg-btn {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chg-btn.has { padding-left: 5px; color: var(--ink); font-weight: 600; }
.chg-btn:hover { border-color: var(--stone-bd); }
.chg-btn.open { border-color: var(--teal); background: #F1F7F6; }
.chg-avs { display: inline-flex; align-items: center; }
.chg-avs .av + .av { margin-left: -7px; }

.chg-pop {
  position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; width: 460px;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 14px 34px rgba(31, 29, 26, .14), 0 2px 6px rgba(31, 29, 26, .06);
}
.chg-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 10px;
  padding: 16px 16px 12px;
}
.chg-head h2 { font-size: 19px; }
.chg-sub { font-size: 12px; color: var(--muted); }
.chg-all { justify-self: end; white-space: nowrap; }
.chg-list { max-height: min(560px, calc(100vh - 220px)); overflow-y: auto; }
.chg-dlabel {
  padding: 9px 16px 7px; border-top: 1px solid var(--hair); background: #FAF8F3;
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint);
}
.chg-item {
  display: grid; grid-template-columns: 8px 26px minmax(0, 1fr) auto; column-gap: 10px; align-items: start;
  width: 100%; padding: 11px 16px; border: none; border-top: 1px solid var(--hair);
  background: var(--surface); text-align: left; color: var(--ink); cursor: pointer;
}
.chg-item:hover { background: #FCFBF7; }
.chg-item:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.chg-dot { width: 8px; height: 8px; margin-top: 9px; border-radius: 50%; background: transparent; }
.chg-item.fresh .chg-dot { background: var(--pc, var(--stone)); }
.chg-item .av { border: none; }
.chg-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chg-lead { font-size: 12.5px; color: var(--stone-fg); }
.chg-lead strong { font-weight: 600; color: var(--ink); }
.chg-todo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chg-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 500; }
.chg-label.gone { color: var(--faint); text-decoration: line-through; }
.chg-item:not(.fresh) .chg-lead, .chg-item:not(.fresh) .chg-lead strong, .chg-item:not(.fresh) .chg-label { color: var(--muted); }
.chg-time { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.chg-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; font-size: 12px; color: var(--muted); }
.chg-st, .chg-dates { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chg-dates { font-family: var(--mono); font-size: 11.5px; color: var(--ink); font-weight: 500; }
.chg-dates s { color: var(--faint); font-weight: 400; }
.chg-text { min-width: 0; overflow-wrap: anywhere; }
.ic.arr { width: 12px; height: 12px; stroke: var(--faint); stroke-width: 1.5; }
.mini {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px;
  border: 1px solid var(--cd); border-radius: 999px; background: var(--cb); color: var(--cf);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.mini .dot { width: 9px; height: 9px; }
.mini.was { opacity: .75; }
.ctag {
  flex: none; padding: 2px 7px; border-radius: 5px; background: var(--teal-bg); color: var(--teal-fg);
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.ctag.new { margin-left: 6px; background: var(--pb, var(--stone-bg)); color: var(--pc, var(--stone-fg)); vertical-align: 1px; }
.chg-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 24px;
  border-top: 1px solid var(--hair); text-align: center; font-size: 12.5px; color: var(--muted);
}
.chg-empty .ic { width: 22px; height: 22px; stroke: var(--olive); stroke-width: 1.5; }
.chg-empty strong { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); }
.chg-empty .link { margin-top: 4px; }
.chg-foot {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px;
  border-top: 1px solid var(--hair); background: #FAF8F3; font-size: 12px; color: var(--muted);
}

/* Hinweis, wenn beim Abgleich Neues von anderen kommt */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 45; }
.toast-box {
  display: flex; align-items: center; gap: 12px; padding: 7px 7px 7px 9px;
  background: var(--ink); color: var(--ground); border-radius: 12px; box-shadow: 0 12px 30px rgba(31, 29, 26, .22);
}
.toast .av { width: 28px; height: 28px; border-color: var(--ink); }
.toast-txt { font-size: 13px; }
.toast-txt strong { font-weight: 600; }
.toast-go {
  height: 32px; padding: 0 12px; border: none; border-radius: var(--r-sm);
  background: rgba(255, 253, 248, .12); color: #FFFDF8; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.toast-go:hover { background: rgba(255, 253, 248, .2); }
.toast-x {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  border: none; border-radius: var(--r-sm); background: transparent; color: var(--edge); cursor: pointer;
}
.toast-x .ic { width: 12px; height: 12px; }
.toast { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
/* Gerade gelöscht — der Balken zeigt, wie lange „Rückgängig“ noch geht. */
.undo-box { flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.undo-row { display: flex; align-items: center; gap: 12px; padding: 7px 7px 7px 14px; }
.undo-row > .ic { width: 15px; height: 15px; color: var(--edge); }
.undo-track { display: block; height: 2px; background: rgba(255, 253, 248, .12); }
.undo-track i { display: block; height: 100%; background: var(--edge); transform-origin: left center; animation: undo-left 8s linear forwards; }
@keyframes undo-left { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Im Panel: was sich seit dem letzten Blick geändert hat */
.news {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px;
  background: #FAF8F3; border: 1px solid var(--line); border-radius: var(--r-md);
}
.news-head { display: flex; align-items: center; gap: 10px; }
.news-head .av { border-color: #FAF8F3; }
.news-head > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.news-head strong { font-size: 13.5px; font-weight: 600; }
.news-head > div > span { font-size: 12px; color: var(--muted); }
.news-list { list-style: none; margin: 0; padding: 0 0 0 36px; display: flex; flex-direction: column; gap: 6px; }
.news-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12.5px; color: var(--stone-fg); }
.news-k { width: 104px; flex: none; color: var(--muted); }
.news-t { min-width: 0; overflow-wrap: anywhere; }

/* Punkt am Feld und Zeile darunter, in der Farbe der Person */
.fmark {
  display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 0; border-radius: 50%;
  background: var(--pc, var(--stone)); vertical-align: middle;
}
.fnote { margin: 0; font-size: 12px; color: var(--muted); }
.fnote b, .fhint b { font-weight: 600; color: var(--pc, var(--ink)); }
.fnote s { font-family: var(--mono); }

/* Beschreibung: Zeilen vorher/nachher */
.ddiff {
  display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; padding: 10px 0;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75; color: var(--stone-fg);
}
.dl { display: grid; grid-template-columns: 30px minmax(0, 1fr); padding-right: 14px; }
.dg { text-align: center; }
.dt { white-space: pre-wrap; overflow-wrap: anywhere; }
.dl.add { background: var(--pb, var(--teal-bg)); color: var(--ink); }
.dl.add .dg { color: var(--pc, var(--teal)); font-weight: 500; }
.dl.del { background: #F5F2EB; color: var(--faint); }
.dl.del .dt { text-decoration: line-through; }

/* Verlauf eines Todos */
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hist li { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; column-gap: 12px; padding-bottom: 16px; }
.hist li:not(:last-child)::before {
  content: ""; position: absolute; left: 12px; top: 30px; bottom: 2px; width: 1px; background: var(--line);
}
.hist .av { border: none; }
.hist-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding-top: 4px; }
.hist-lead { font-size: 13px; line-height: 1.4; color: var(--stone-fg); }
.hist-lead strong { font-weight: 600; color: var(--ink); }
.hist-time { padding-top: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.hist-more { align-self: flex-start; }

/* Gleichzeitig gespeichert */
.clash { display: flex; flex-direction: column; gap: 16px; }
.clash-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: var(--pb, var(--stone-bg)); border: 1px solid var(--pc, var(--stone-bd)); border-radius: var(--r-md);
}
.clash-head .av { border-color: var(--surface); }
.clash-head > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.clash-head strong { font-size: 13.5px; font-weight: 600; }
.clash-head span { font-size: 12.5px; line-height: 1.5; color: var(--stone-fg); }
.clash-pill {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px;
  background: var(--ink); color: var(--ground); font-size: 10px; font-weight: 600; letter-spacing: .06em;
}
.clash-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.clash-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  text-align: left; color: var(--ink); cursor: pointer;
}
.clash-opt:hover { border-color: var(--stone-bd); }
.clash-opt.on { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); background: #F1F7F6; }
.clash-opt .chip { cursor: inherit; }
.clash-who { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.clash-who .av { border: none; }
.clash-val { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.clash-hint { color: var(--ink); font-weight: 500; }

/* ───────────────────────────────────────────────────────────────────
   Schmal — Handy
   ─────────────────────────────────────────────────────────────────── */
@media (max-width: 899px) {
  .desk { display: none !important; }
  .mob { display: flex !important; }

  /* Als Home-Bildschirm-App kann iOS oben Platz für die Statusleiste verlangen;
     Kopfzeile und alles, was darunter klebt, rücken dann mit. Sonst ist der Wert 0. */
  .top { height: calc(56px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 12px 0 16px; gap: 10px; }
  .mark { height: 19px; margin: 5px 0 0; }
  .me-item { height: 44px; font-size: 14px; }
  .me { height: 40px; width: 40px; padding: 0; justify-content: center; border: none; }
  .who-box.conn { padding: 20px 16px; }
  .conn-new, .conn-copy { flex-direction: column; align-items: stretch; }

  /* Das Filter-Blatt liegt fest zwischen Kopfzeile und Tableiste und scrollt
     für sich — klebte es wie auf dem Desktop, liefe die Liste darunter weiter
     und sein unterer Teil bliebe unerreichbar. */
  .filters {
    position: fixed; top: calc(56px + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 25;
    padding: 14px 16px 16px; gap: 16px; display: none; border-bottom: none;
    overflow-y: auto; overscroll-behavior: contain;
  }
  .filters.open { display: flex; }
  .filters > * { flex-shrink: 0; }
  html:has(.filters.open) { overflow: hidden; }
  .frow { flex-direction: column; align-items: stretch; gap: 16px; }
  .frow.fend { flex-direction: row; align-items: center; }
  .fgroup { flex-direction: column; align-items: stretch; gap: 8px; }
  .fgroup .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-radius: 10px; }
  .fgroup .seg button { height: 38px; padding: 0 6px; border-radius: 8px; font-size: 13px; }
  .fgroup .btn-av { width: 38px; height: 38px; font-size: 12.5px; }
  /* Im Blatt stehen Deadline und Umsetzen untereinander, „und | oder“ dazwischen */
  .ftime, .ftime.both { flex-direction: column; align-items: stretch; gap: 16px; margin: 0; padding: 0; }
  .ftime.or { background: none; box-shadow: none; }
  .fjoin { flex-direction: column; align-items: center; gap: 6px; margin: -4px 0; }
  .fjoin-m { align-self: stretch; align-items: center; gap: 12px; }
  .fjoin-m i { flex-grow: 1; height: 1px; background: var(--line); }
  .fjoin-m .seg { border-radius: 999px; }
  .fjoin-m .seg button { height: 30px; padding: 0 16px; border-radius: 999px; font-size: 12.5px; }
  .oldbar { min-height: 46px; padding: 0 14px; }
  .oldbar .osub { display: none; }
  .search { width: 100%; }

  /* unten Platz für die Tableiste samt Home-Balken (als Home-Bildschirm-App) */
  .main { padding: 14px 16px calc(92px + env(safe-area-inset-bottom, 0px)); }
  .list { gap: 18px; }
  .sec-head { height: 32px; gap: 10px; }
  .sec-head h2 { font-size: 18px; }
  .bar { width: 54px; height: 5px; }

  .row {
    grid-template-columns: 22px minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto;
    grid-template-areas: "chip label label due" "chip dep plan dri";
    column-gap: 11px; row-gap: 3px; padding: 12px 14px; min-height: 66px;
  }
  .row .chip { grid-area: chip; width: 22px; height: 22px; padding: 0; justify-content: center; border-radius: 50%; align-self: center; }
  .row .chip span { display: none; }
  .row .chip .dot { width: 12px; height: 12px; }
  .cell-label { grid-area: label; }
  .cell-label .label { font-size: 14px; font-weight: 600; }
  .cell-dep { grid-area: dep; }
  .cell-dri { grid-area: dri; justify-self: end; align-self: center; }
  .cell-due { grid-area: due; justify-self: end; }
  .cell-due .due { height: 21px; padding: 0 8px; font-size: 10.5px; }
  .cell-plan { grid-area: plan; justify-self: end; align-self: center; }
  .plan, .plan.open, .plan.open:hover { height: 21px; padding: 0 8px 0 6px; font-size: 10.5px; }
  .plan .ic { width: 11px; height: 11px; }
  .plan.none { display: none; }
  .tag { display: none; }
  .av { width: 21px; height: 21px; font-size: 10px; }
  .cell-dri { gap: 3px; }
  .also { font-size: 11.5px; }
  .also-m { color: var(--stone-fg); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .graph { gap: 14px; }
  .glegend { gap: 14px; font-size: 12px; }

  .foot { display: none; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex; background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar button {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 4px; border: none; background: transparent;
    color: var(--faint); font-size: 11px; font-weight: 500; cursor: pointer;
  }
  .tabbar button.on { color: var(--teal); font-weight: 600; }
  .tabbar .ic { width: 20px; height: 20px; }
  .tabbar .badge {
    position: absolute; top: 8px; right: 50%; margin-right: -22px;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    background: var(--ink); color: var(--ground); font-size: 10px; font-style: normal;
    display: flex; align-items: center; justify-content: center;
  }

  /* Änderungen: auf dem Handy eine eigene Ansicht zwischen Kopfzeile und Tableiste */
  .chg { display: contents; }
  .chg-pop {
    position: fixed; top: calc(56px + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    width: auto; border: none; border-radius: 0; box-shadow: none; background: var(--ground); z-index: 25;
  }
  .chg-head { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 12px; gap: 6px; }
  .chg-head h2 { font-size: 24px; }
  .chg-sub { order: 1; font-size: 12.5px; }
  .chg-all { order: 3; }
  .chg-seg { order: 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-top: 8px; border-radius: 10px; }
  .chg-seg button { height: 38px; font-size: 13px; }
  .chg-all { justify-self: end; min-height: 32px; font-size: 13px; }
  .chg-list { flex-grow: 1; max-height: none; margin: 0 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
  .chg-day:first-child .chg-dlabel { border-top: none; }
  .chg-item { grid-template-columns: 8px 28px minmax(0, 1fr) auto; padding: 12px 14px; }
  .chg-item .av { width: 28px; height: 28px; font-size: 11px; }
  .chg-label { font-size: 14px; }
  .chg-foot { background: transparent; border-top: none; }
  .toast { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .toast-box { padding: 6px 6px 6px 10px; gap: 10px; }
  .toast-txt { flex-grow: 1; min-width: 0; }
  .toast-go { height: 40px; }
  .toast-x { width: 40px; height: 40px; }
  .toast { align-items: stretch; }
  .undo-box { padding: 0; gap: 0; }
  .undo-row { padding: 6px 6px 6px 12px; gap: 10px; }
  .news-k { width: 100%; }
  .news-list { padding-left: 0; }
  .clash-opts { grid-template-columns: minmax(0, 1fr); }
  .panel-foot .clash-hint { display: none; }

  .panel { width: 100%; border-left: none; }
  .panel-body { padding: 16px; gap: 18px; }
  .dp-pop { left: 0; right: 0; width: auto; }
  .dp-day { height: 44px; }
  .panel-top { padding: 0 8px 0 16px; }
  .panel-foot { height: 76px; padding: 0 16px; }
  .panel-foot .btn { height: 48px; }
  .panel-foot .btn.primary { flex-grow: 1; }
  .panel-foot .del-btn { width: 48px; height: 48px; }
  .delq { padding: 16px; }
  .delq-act .btn, .delq-act .btn.dbtn { flex: 1; height: 48px; }
  .field > input[type="text"], .field > input[type="date"] { height: 48px; }
  .chip { height: 40px; padding: 0 15px; font-size: 13.5px; }
  .person { height: 44px; flex: 1; justify-content: center; }
  .pick { min-height: 44px; }
  .icon-btn.sm { width: 32px; height: 32px; }

  /* Kalender: Wochenleiste, der gewählte Tag, darunter Einplanen */
  .cal { gap: 12px; }
  .cal-bar { gap: 6px; min-height: 40px; }
  .cal-bar h2 { font-size: 20px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .cal-nav { flex-shrink: 0; }
  .cal-bar > .mono { display: none; }
  .cal-nav .icon-btn { width: 40px; height: 40px; }
  .btn.cal-today { height: 40px; }
  .cal-body { flex-direction: column; align-items: stretch; gap: 18px; }
  .cal-rail { width: auto; }
  .cal-mob { flex-direction: column; gap: 10px; }
  .cal-strip {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  }
  .cal-sday {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 62px; padding: 0; border: none; border-radius: 11px; background: transparent; cursor: pointer;
  }
  .cal-sday-wd { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
  .cal-sday-num { font-family: var(--mono); font-size: 16px; font-weight: 500; color: var(--ink); }
  .cal-sday.we .cal-sday-num { color: var(--faint); }
  .cal-sday.past .cal-sday-wd, .cal-sday.past .cal-sday-num { color: var(--fainter); }
  .cal-sday.today:not(.on) { box-shadow: inset 0 0 0 1.5px var(--teal); }
  .cal-sday.today:not(.on) .cal-sday-num { color: var(--teal-fg); font-weight: 600; }
  .cal-sday.on { background: var(--teal); }
  .cal-sday.on .cal-sday-wd { color: var(--teal-bg); }
  .cal-sday.on .cal-sday-num { color: #FFFDF8; font-weight: 600; }
  .cal-dots { display: flex; gap: 3px; height: 4px; }
  .cal-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--fainter); }
  .cal-sday.on .cal-dots i { background: rgba(255, 253, 248, .85); }
  .cal-dots i.fl { background: var(--clay); }
  .cal-sday.on .cal-dots i.fl { background: #F6C7B0; }
  .cal-dayhead { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
  .cal-dayhead h2 { font-size: 22px; }
  .crow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; column-gap: 10px; align-items: center; min-height: 64px; padding: 10px 8px 10px 14px; }
  .crow + .crow { border-top: 1px solid var(--hair); }
  .crow .chip { width: 22px; height: 22px; padding: 0; justify-content: center; border-radius: 50%; }
  .crow .chip .dot { width: 12px; height: 12px; }
  .crow-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .crow-body .label { font-size: 14px; font-weight: 600; line-height: 1.3; white-space: normal; }
  .crow-meta { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crow-pick { width: 40px; height: 40px; }
  .crow-avs { display: flex; gap: 3px; }
  .crow-avs .av { border: none; }
  .crow.left { background: #FAF8F3; }
  .crow.done .label { color: #948D80; text-decoration: line-through; }
  .crow.is-due { background: #FBEEE7; }
  .crow.is-due.inh { background: var(--surface); }
  .crow-meta.dl-meta { display: flex; align-items: center; gap: 6px; }
  .crow-meta.dl-meta > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .crow.is-due.inh .crow-meta.dl-meta > span:last-child { color: var(--clay-fg); }
  .crow-meta .tag { font-size: 9.5px; padding: 2px 6px; }
  .cal-empty { margin: 0; padding: 18px 14px; font-size: 13px; color: var(--faint); }
  .cal-boxhead.mob { min-height: 56px; }
  .cal-open { font-size: 13px; font-weight: 600; color: var(--teal); }
  .cal-chev { color: var(--teal); transition: transform .15s; }
  .cal-chev.up { transform: rotate(180deg); }
  .cal-li { cursor: default; }
  .cal-li-main { min-height: 60px; padding: 8px 8px 8px 14px; }
  .cal-pick { width: 40px; height: 40px; }
  .qbtn { height: 36px; padding: 0 14px; font-size: 13px; }
  .cal-li-act { flex-wrap: wrap; }

  /* Status-Menü: Fingergrösse */
  .stm { width: 224px; }
  .stm-item { height: 44px; font-size: 15px; }

  /* Tagauswahl als Blatt von unten */
  .pp {
    left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-height: 88vh;
    border: none; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 32px rgba(31, 29, 26, .16);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .pp-in { padding: 8px 16px 20px; }
  .pp-grab { align-self: center; width: 36px; height: 4px; border-radius: 2px; background: #DCD5C8; margin-bottom: 10px; }
  .pp-head { align-items: flex-start; }
  .pp-title strong { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.012em; }
  .pp-quick { flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 0; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
  .pp-q, .pp-q.extra {
    display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
    height: auto; min-height: 56px; padding: 8px 16px; border: none; border-radius: 0; text-align: left; color: var(--ink);
  }
  .pp-q.sug, .pp-q.is-due, .pp-q.on { border: none; }
  .pp-q + .pp-q { border-top: 1px solid var(--hair); }
  .pp-q .pp-q-l { grid-column: 1; grid-row: 1; font-size: 15px; font-weight: 600; }
  .pp-q .pp-q-d { display: block; grid-column: 1; grid-row: 2; font-size: 12px; color: var(--faint); }
  .pp-q .pp-q-n { display: block; grid-column: 2; grid-row: 1 / 3; justify-self: end; font-size: 12px; color: var(--faint); }
  .pp-q .pp-q-ok { display: block; grid-column: 3; grid-row: 1 / 3; width: 18px; height: 18px; color: var(--teal); stroke-width: 1.8; }
  .pp-q.more .ic { grid-column: 3; grid-row: 1 / 3; width: 16px; height: 16px; color: var(--faint); }
  .pp-q:hover { color: var(--ink); }
  .pp-q.on { background: #F1F7F6; box-shadow: inset 3px 0 0 var(--teal); color: var(--teal-fg); }
  .pp-q.sug .pp-q-l { color: var(--teal-fg); }
  .pp-q.is-due .pp-q-l { color: var(--clay-fg); }
  .pp-cal .dp-day { height: 44px; }
  .pp-foot .link { min-height: 44px; font-size: 13px; }
}

/* Beschreibung bearbeiten auf dem Handy: volle Zeilenbreite, 16 px gegen
   das Hineinzoomen beim Antippen, Knöpfe in Daumengrösse. */
@media (max-width: 899px) {
  .row .tag.draft { display: inline-flex; }
  .rowmore.editing { grid-column: 1 / -1; }
  .dedit-top .seg { flex-grow: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-radius: 10px; }
  .dedit-top .seg button { height: 34px; border-radius: 8px; font-size: 13px; }
  .dedit-ta { font-family: var(--sans); font-size: 16px; line-height: 1.5; }
  .dedit-foot { flex-wrap: wrap; }
  .dedit-foot .dstate { width: 100%; }
  .dedit-foot .grow { display: none; }
  .btn.dbtn, .btn.dbtn.primary { height: 44px; padding: 0 18px; font-size: 14px; }
  .btn.dbtn.primary { flex-grow: 1; }
  .dclash-act .btn { height: 44px; }
}

/* Priorität auf dem Handy: ohne Priorität keine Balken (gesetzt wird sie dann
   im Panel), sonst ein grösserer Tippbereich; das Menü wird ein Blatt von
   unten, der Filter eine Viererreihe mit Wort. */
@media (max-width: 899px) {
  .prio { position: relative; width: 22px; height: 22px; margin: 0 -3px 0 -4px; }
  .prio::before { content: ""; position: absolute; inset: -11px; }
  .prio.none { display: none; }

  .fgroup .pf-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .pf { width: auto; height: 38px; font-size: 13px; }

  .pseg { align-self: stretch; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pseg button { justify-content: center; height: 40px; padding: 0 4px; }

  .stm.prm {
    left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-height: 88vh; overflow-y: auto;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    border: none; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 32px rgba(31, 29, 26, .16);
  }
  .prm-head { padding: 0 2px 12px; }
  .prm-head .stm-head { padding: 0; }
  .prm-head strong { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.012em; }
  .prm .stm-item { height: auto; min-height: 56px; gap: 14px; padding: 8px 12px; font-size: 15px; font-weight: 600; }
  .prm .stm-item .bars { width: 20px; height: 20px; }
  .prm-desc { font-size: 12px; font-weight: 400; color: var(--faint); }
}

/* Presets auf dem Handy: im Filter-Blatt oben als Chips zum Umbrechen, dazu
   eine Leiste über der Liste, die man seitlich wischt. Speichern sitzt im Fuss
   des Blatts, Speichern- und Verwalten-Dialog kommen als Blatt von unten. */
@media (max-width: 899px) {
  .prow { gap: 12px; padding-bottom: 16px; }
  .pgroup { gap: 10px; }
  .pman-m { display: inline; margin-left: auto; font-size: 13px; }
  .pchips { gap: 8px; }
  .pchip { height: 40px; padding: 0 14px; gap: 8px; font-size: 13.5px; }
  .pchip.forme { padding-left: 6px; }
  .pchip .pme { width: 26px; height: 26px; font-size: 11px; }
  .pchip .pmine { width: 14px; height: 14px; }
  .pchip .pn { font-size: 11.5px; }
  .pchips .pchip.first { margin-left: 0; }
  .pchips .pchip.first::before { display: none; }
  .pact { margin-left: 0; }
  .pmod { flex-wrap: wrap; }
  .pmod-t { width: 100%; }
  .pmod .btn { height: 40px; font-size: 13px; }
  .psave-m { height: 44px; padding: 0 14px; font-size: 13px; }
  .psave-m .ic { width: 12px; height: 12px; stroke-width: 1.8; }

  .pstrip {
    display: flex; align-items: center; gap: 8px; position: sticky; top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 19;
    height: 60px; padding: 0 16px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .pstrip::-webkit-scrollbar { display: none; }
  .pstrip .pchip { flex: none; }
  .pstrip .pchip.first { margin-left: 13px; }
  .pstrip .pchip.first::before { left: -11px; top: 9px; bottom: 9px; }
  .pstrip::after { content: ""; flex: none; width: 8px; height: 1px; }

  .pvp {
    left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-height: 88vh;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    border: none; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 32px rgba(31, 29, 26, .16);
  }
  .pvp .pp-grab { margin-bottom: -6px; }
  .pvp-head h2 { font-size: 20px; }
  .pvp-field input { height: 46px; font-size: 16px; }
  .pvp-li { font-size: 13px; }
  .pvp-me input { width: 20px; height: 20px; margin: 0; }
  .pvp-scope button { height: 40px; font-size: 13.5px; }
  .pvp-foot .grow { display: none; }
  .pvp-foot .btn.primary { flex-grow: 1; height: 48px; font-size: 15px; }
  .pvm { gap: 2px; }
  .pvm .pvp-head { padding: 4px 0 6px 4px; }
  .pvm-row { min-height: 60px; padding: 0; }
  .pvm-ic { width: 40px; height: 40px; }
  .pvm-ud { display: inline-flex; }
  .pvm-ren input { height: 44px; font-size: 16px; }
  .pvm-ok { width: 44px; height: 44px; }
}

/* ───────────────────────────────────────────────────────────────────
   Anmelden — index.php, vor der App. Ein Passwort für alle.
   ─────────────────────────────────────────────────────────────────── */
.login {
  min-height: 100%; padding: 48px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  /* Linien wie auf Notizpapier */
  background: var(--ground) repeating-linear-gradient(to bottom, transparent 0, transparent 31px, #EAE6DD 31px, #EAE6DD 32px);
}
.login-mark { display: block; height: 22px; width: auto; }
.login-box {
  width: 100%; max-width: 400px; padding: 32px; display: flex; flex-direction: column; gap: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(31, 29, 26, .04), 0 12px 32px rgba(31, 29, 26, .06);
}
.login-box h1 { font-size: 28px; }
.login-box p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.login-box code { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.login-box .field > label { color: var(--muted); }
.login-box .btn { height: 44px; font-size: 14px; }
.login-box .btn.ghost { color: var(--ink); text-decoration: none; }
.login-box button:focus-visible, .login-box a:focus-visible, .login-keep input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.login-head { display: flex; flex-direction: column; gap: 10px; }
.login-off { opacity: .55; }

.login-pw { position: relative; display: flex; align-items: center; }
.login-pw input {
  width: 100%; height: 44px; padding: 0 48px 0 13px; background: var(--ground); border: 1px solid var(--line);
  border-radius: var(--r-md); font-size: 15px; font-weight: 500; color: var(--ink); outline: none;
}
.login-pw input:focus { border-color: var(--teal); }
.login-pw input.err { background: var(--surface); border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-bg); }
.login-pw input:disabled { background: var(--hair); cursor: not-allowed; }
.login-eye {
  position: absolute; right: 4px; width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer;
}
.login-eye:hover { color: var(--ink); }
.login-eye:disabled { cursor: not-allowed; }
.login-eye .ic { width: 16px; height: 16px; stroke-width: 1.5; }
.login-eye .ic-off, .login-eye.on .ic-on { display: none; }
.login-eye.on .ic-off { display: block; }

.login-err { display: flex; align-items: flex-start; gap: 8px; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--clay-fg); }
.login-note {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.45;
  background: var(--clay-bg); border: 1px solid var(--clay-bd); border-radius: var(--r-md); color: var(--clay-fg);
}
.login-err .ic, .login-note .ic { width: 16px; height: 16px; margin-top: 1px; stroke-width: 1.5; }
.login-err strong, .login-note strong { font-weight: 600; }
.login-note .mono { font-weight: 500; }

.login-keep { display: flex; align-items: center; gap: 10px; min-height: 24px; font-size: 13.5px; cursor: pointer; }
.login-keep input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--teal); }
.login-keep .mono { margin-left: auto; font-size: 12px; color: var(--muted); }

.login-lock {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
  background: var(--stone-bg); border: 1px solid var(--stone-bd); border-radius: var(--r-md); color: var(--stone-fg);
}
.login-lock .ic { width: 18px; height: 18px; stroke-width: 1.5; }
.login-code {
  margin: 0; padding: 14px 16px; overflow-x: auto; white-space: pre;
  background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--ink);
}
.login-code .c { color: var(--muted); }
.login-code .s { color: var(--teal-fg); }

@media (max-width: 899px) {
  .login { justify-content: flex-start; padding-top: 112px; }
  .login-mark { height: 20px; }
  .login-box { padding: 24px 20px; }
  .login-box h1 { font-size: 26px; }
  .login-box .btn { height: 48px; font-size: 15px; border-radius: 10px; }
  .login-pw input { height: 48px; padding-right: 52px; font-size: 16px; }
  .login-eye { right: 2px; width: 44px; height: 44px; }
  .login-keep { min-height: 44px; gap: 12px; font-size: 14px; }
  .login-keep input { width: 20px; height: 20px; }
}
