/* Taskado Desktop — Layer über style_mobile.css.
   Gleiches Design-System (Tokens, Karten, Typo), aber Desktop-Verhalten:
   feste Sidebar statt Bottom-Nav/Drawer, zentrierte Content-Spalte,
   Bottom-Sheets werden zentrierte Modals, Hover-Aktionen an den Karten. */

/* ---------- Shell ---------- */

body.is-desktop {
  background: var(--bg-app);
}

.dt-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.dt-main {
  flex: 1;
  min-width: 0;
  /* Der Screen bleibt die Scroll-Fläche der Seite (wie mobil) */
}

/* Screens laufen in einer zentrierten Spalte — lesbar wie ein Dokument */
body.is-desktop .screen__body,
body.is-desktop .screen__head,
body.is-desktop .screen > * {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

body.is-desktop .screen__body {
  padding: 12px 32px 60px;   /* kein Platzhalter für eine Bottom-Nav */
}

/* ---------- Sidebar ---------- */

.dt-sidebar {
  width: 264px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-drawer);
  border-right: 1px solid var(--border);
  z-index: 40;
}

.dt-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 12px;
}

.dt-sidebar__logo .tt-logo { width: 28px; height: 28px; display: block; }

.dt-sidebar__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* „Neu"-Knopf mit aufklappbaren Zielen */
.dt-sidebar__new { position: relative; padding: 4px 12px 10px; }

.dt-newbtn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-input);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.dt-newbtn:hover { filter: brightness(1.08); }
.dt-newbtn__chev { margin-left: auto; opacity: 0.75; }

.dt-newmenu {
  position: absolute;
  left: 12px; right: 12px;
  top: calc(100% - 4px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  z-index: 60;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.dt-newmenu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.dt-newmenu__item:hover { background: var(--bg-tile); }
.dt-newmenu__item .ms { font-size: 18px; color: var(--muted); }

/* Navigation */
.dt-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 2px 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.dt-navitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  cursor: pointer;
  min-height: 34px;
}
.dt-navitem:hover { background: var(--bg-tile); color: var(--text); }
.dt-navitem.is-active {
  background: var(--tint-accent);
  color: var(--text);
  font-weight: 600;
}
.dt-navitem.is-active .ms { color: var(--accent); }
.dt-navitem .ms { font-size: 19px; color: var(--muted); flex-shrink: 0; }

.dt-navitem__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.dt-navitem__badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dt-navitem__badge.is-run { background: var(--accent); color: var(--on-accent); }

/* Farbpunkt der Listen im Baum */
.dt-navitem__dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--disabled);
  flex-shrink: 0;
  margin: 0 4px 0 5px;
}

.dt-navsection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 4px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dt-navsection__manage {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
  display: inline-flex;
}
.dt-navsection__manage:hover { color: var(--text); background: var(--bg-tile); }
.dt-navsection__manage .ms { font-size: 16px; }

/* Benutzer unten */
.dt-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* Eingebettet in ein Backend (index_desktop.js, ?embed=1): ohne Kopf mit
   Logo und ohne Benutzer/Abmelden — das Backend hat beides selbst */
.is-embedded .dt-sidebar__brand,
.is-embedded .dt-sidebar__user,
.is-embedded .tb-rail__logo {
  display: none;
}

.dt-sidebar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-tile);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dt-sidebar__userbody { min-width: 0; display: flex; flex-direction: column; }
.dt-sidebar__username {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt-sidebar__userlogin { font-size: 11px; color: var(--muted); }

.dt-sidebar__logout {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
}
.dt-sidebar__logout:hover { color: var(--danger); background: var(--bg-tile); }

/* ---------- Sheets → zentrierte Modals ---------- */

body.is-desktop .sheet {
  left: 50%;
  right: auto;
  bottom: auto;
  top: 50%;
  width: min(600px, calc(100vw - 48px));
  max-height: 86vh;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  padding: 18px 22px 20px;
  transform: translate(-50%, -46%);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
body.is-desktop .sheet.is-open {
  transform: translate(-50%, -50%);
  opacity: 1;
}
body.is-desktop .sheet__handle { display: none; }

/* Breite Formulare (Notizen): so breit wie der Seiteninhalt (980px) */
body.is-desktop .sheet.sheet--wide {
  width: min(980px, calc(100vw - 48px));
}

/* Massenbearbeitung: eckige Auswahl-Box (3px) statt Abhak-Kreis — markiert
   Aufgaben für die Toolbar, abgehakt wird woanders */
.tkd-select {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tkd-select .ms { font-size: 16px; color: var(--on-accent); opacity: 0; }
.tkd-select:hover { border-color: var(--accent); }
.tkd-select.is-on { background: var(--accent); border-color: var(--accent); }
.tkd-select.is-on .ms { opacity: 1; }

/* Die Toolbar klappt von oben herunter, sobald etwas markiert ist */
.tkd-bulkbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 14px;
  animation: tkdBulkDown 0.22s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  /* Bleibt beim Scrollen oben stehen, solange etwas markiert ist — direkt
     an der Oberkante (-16px = Innenabstand von .tkd__scroll), sonst
     schauen die weggescrollten Zeilen darueber hervor */
  position: sticky;
  top: -16px;
  z-index: 5;
}
@keyframes tkdBulkDown {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: none; }
}
.tkd-bulkbar__count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-right: 4px;
  white-space: nowrap;
}
.tkd-bulkbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-tile);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.tkd-bulkbar__btn:hover { border-color: var(--accent); }
.tkd-bulkbar__btn .ms { font-size: 17px; }
.tkd-bulkbar__chev { font-size: 15px !important; color: var(--muted); margin-left: -2px; }
.tkd-bulkbar__btn--icon { padding: 7px 8px; }
.tkd-bulkbar__spacer { flex: 1; }

/* Kompakte Variante über der Subtask-Liste im Detail-Panel */
.tkd-bulkbar--panel {
  flex-wrap: wrap;
  padding: 6px 10px;
  margin-bottom: 10px;
}
.tkd-bulkbar--panel .tkd-bulkbar__btn { font-size: 12px; padding: 6px 9px; }

/* 9d-Ausbau: Warndreieck an Sidebar-Listen (Person heute abwesend) */
.dt-navitem__warn {
  color: var(--danger);
  font-size: 15px;
  margin-left: auto;
  flex-shrink: 0;
}
.dt-navitem__warn + .dt-navitem__n { margin-left: 6px; }

/* Herkunft von Aufgaben aus anderen Instanzen (Brücken, Konzept 9b/9c) */
.tkd-row__frominstance {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--tint-accent);
  border-radius: 99px;
  padding: 1px 8px;
  white-space: nowrap;
}

body.is-desktop .picker-sheet {
  left: 50%;
  right: auto;
  bottom: auto;
  top: 50%;
  width: min(440px, calc(100vw - 48px));
  max-height: 76vh;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  transform: translate(-50%, -46%);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
body.is-desktop .picker-sheet.is-open {
  transform: translate(-50%, -50%);
  opacity: 1;
}
body.is-desktop .picker-sheet .sheet__handle { display: none; }

/* Overlays etwas kräftiger — der Fokus liegt auf dem Modal */
body.is-desktop .sheet-overlay.is-open,
body.is-desktop .picker-overlay.is-open { background: rgba(0, 0, 0, 0.55); }

/* ---------- Karten: Hover-Aktionen statt Wischgesten ---------- */

body.is-desktop .tt-swipe { position: relative; }

body.is-desktop .dt-hoveractions {
  position: absolute;
  top: 50%;
  inset-inline-end: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 3;
}
body.is-desktop .tt-swipe:hover .dt-hoveractions,
body.is-desktop .tt-swipe:focus-within .dt-hoveractions {
  opacity: 1;
  pointer-events: auto;
}

.dt-hoveract {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.dt-hoveract:hover { color: var(--text); background: var(--bg-tile); }
.dt-hoveract .ms { font-size: 16px; }
.dt-hoveract--done:hover { color: var(--accent); border-color: var(--border-focus); }

/* Auf Geräten ohne Maus nie zeigen */
@media (hover: none) {
  .dt-hoveractions { display: none !important; }
}

/* ---------- Feinschliff ---------- */

/* Board darf breiter laufen als die Lese-Spalte */
body.is-desktop .tt-board { max-width: 100%; }

/* Reminder oben mittig statt volle Breite */
body.is-desktop .tt-reminder {
  left: 50%;
  right: auto;
  transform: translateX(-50%) translateY(-8px);
  min-width: 380px;
  max-width: 560px;
}
body.is-desktop .tt-reminder.is-open { transform: translateX(-50%) translateY(0); }

/* Laufende-Zeit-Pille oben rechts, nicht über der Sidebar */
body.is-desktop .runningbar--fixed {
  left: auto;
  right: 18px;
  top: 14px;
  transform: none;
}

/* Toast unten rechts statt unten mittig */
body.is-desktop .toast {
  left: auto;
  right: 22px;
  bottom: 22px;
  transform: none;
}

/* Dezente Scrollbars im dunklen Design */
body.is-desktop ::-webkit-scrollbar { width: 10px; height: 10px; }
body.is-desktop ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}
body.is-desktop ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
  background-clip: content-box;
}
body.is-desktop ::-webkit-scrollbar-track { background: transparent; }

/* Klickbare Zeilen zeigen den Zeiger — am Handy irrelevant, hier Standard */
body.is-desktop .row,
body.is-desktop .tt-task,
body.is-desktop .picker-item { cursor: pointer; }

/* Schmalere Fenster: Sidebar kompakt (nur Icons waere Ausbau — hier schmaler) */
@media (max-width: 1080px) {
  .dt-sidebar { width: 228px; }
  body.is-desktop .screen__body { padding: 12px 20px 60px; }
}

/* ══════════ Desktop-Hauptbereich nach dem Claude-Design ══════════
   (Taskado Desktop.dc.html): fixer Kopf, gruppierte Liste, Board,
   Kalender, Matrix und das ständige Detail-Panel rechts. */

/* Die Shell wird zur festen Bühne; gescrollt wird in den Spalten */
body.is-desktop .dt-shell { height: 100vh; overflow: hidden; }
body.is-desktop .dt-main { height: 100vh; overflow-y: auto; overflow-x: hidden; }

.tkd {
  display: flex;
  height: 100%;
  min-height: 100vh;
  align-items: stretch;
  max-width: none !important;
}

.tkd__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-screen);
}

/* Die Kopfleiste sitzt in derselben Spalte wie der Inhalt darunter. Ohne
   das lief sie über die volle Fensterbreite, während .tkd-view auf 1160px
   zentriert ist — auf einem breiten Schirm standen Suche, Umschalter und
   Titel weit außerhalb der Liste.
   Begrenzt wird der INHALT (siehe .tkd__head > *), nicht der Kopf selbst:
   nur so rechnen beide auf derselben Grundlage. Dazu derselbe reservierte
   Streifen für den Rollbalken wie im Scrollbereich darunter, sonst
   zentriert sich die Liste um dessen halbe Breite versetzt. `hidden` macht
   das Element zum Scroll-Container, ohne dass je ein Balken erscheint. */
.tkd__head {
  flex-shrink: 0;
  padding: 20px 28px 0;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.tkd__head > * {
  max-width: 1160px;
  margin-inline: auto;
}

.tkd__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;   /* breites Board scrollt hier, nicht die Seite */
  padding: 16px 28px 40px;
  /* Der Platz des Rollbalkens bleibt reserviert, auch wenn gerade keiner
     da ist — sonst rückt der Inhalt beim Auftauchen um seine Breite nach
     links und stünde wieder anders als der Kopf. */
  scrollbar-gutter: stable;
}

.tkd-view {
  animation: tkdIn 0.22s ease;
  max-width: 1160px;
  margin-inline: auto;
}
/* Neuzeichnen derselben Ansicht (Speichern, Nachladen): nicht erneut
   einfahren — sonst zuckt die Liste nach jedem Erledigen */
.tkd-view.is-refresh { animation: none; }
@keyframes tkdIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Kopf ── */
.tkd-head__top { display: flex; align-items: flex-start; gap: 16px; }
.tkd-head__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tkd-head__title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.tkd-head__sub { font-size: 13px; font-weight: 600; color: var(--subtitle); }
.tkd-head__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.tkd-timer {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-focus);
  border-radius: 99px;
  padding: 6px 7px 6px 13px;
}
.tkd-timer[hidden] { display: none; }
.tkd-timer__clock { font-size: 17px; color: var(--muted); }
.tkd-timer__dot {
  width: 9px; height: 9px; border-radius: 3px;
  background: var(--accent);
  flex-shrink: 0;
}
.tkd-timer__dot.is-pulse { animation: tkdPulse 2s infinite; }
@keyframes tkdPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 155, 74, 0.45); }
  60% { box-shadow: 0 0 0 7px rgba(79, 155, 74, 0); }
}
.tkd-timer__name { font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.tkd-timer__name:hover { color: var(--text); }
.tkd-timer__time { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
/* Ab zwei laufenden Erfassungen: Info-Symbol mit Kurzinfo aller Aufgaben */
.tkd-timer__info {
  font-size: 16px;
  color: var(--muted);
  cursor: help;
  flex-shrink: 0;
}
.tkd-timer__info:hover { color: var(--text); }

.tkd-timer__stop {
  border: 0; background: var(--bg-tile); color: var(--text-2);
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tkd-timer__stop:hover { color: var(--danger); }
.tkd-timer__stop .ms { font-size: 15px; }

.tkd-head__bar { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

.tkd-search {
  flex: 1;
  max-width: 430px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 8px 12px;
  background: var(--bg-elevated);
}
.tkd-search .ms { font-size: 17px; color: var(--muted); }
.tkd-search__input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  color: var(--text); font-family: inherit; font-size: 13px; padding: 0;
}
.tkd-search__kbd {
  font-size: 10.5px; font-weight: 700; color: var(--disabled);
  border: 1px solid var(--border-strong); border-radius: 5px; padding: 2px 5px;
  white-space: nowrap;
}

.tkd-views {
  margin-left: auto;
  display: flex; align-items: center; gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 3px;
}
.tkd-views__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.tkd-views__btn .ms { font-size: 17px; color: var(--nav-inactive); }
.tkd-views__btn:hover { color: var(--text); }
.tkd-views__btn.is-active { background: var(--bg-tile); color: var(--text); }
.tkd-views__btn.is-active .ms { color: var(--accent); }

/* ── Chips + Gruppen ── */
.tkd-chips { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.tkd-chip {
  border: 1px solid var(--border-strong);
  background: transparent; color: var(--muted);
  border-radius: 99px; padding: 6px 13px;
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.tkd-chip:hover { color: var(--text); }
.tkd-chip.is-active {
  background: var(--tint-accent);
  border-color: var(--border-focus);
  color: var(--text);
}
.tkd-chips__done { margin-left: auto; font-size: 12px; color: var(--muted); }

.tkd-group {
  display: flex; align-items: center; gap: 8px;
  margin: 2px 2px 8px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.tkd-group.is-alert { color: #e07a52; }
.tkd-group .ms { font-size: 15px; }
.tkd-group__n { font-weight: 600; color: var(--disabled); text-transform: none; letter-spacing: 0; }

.tkd-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }

/* ── Aufgaben-Zeile ── */
.tkd-row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  /* Die Flaechenfarbe laeuft ueber eine Variable, weil der Verlaufs-Rahmen
     einer laufenden Zeit sie als Innenflaeche mitzeichnet — mit der
     Kurzform `background` haette Hover/Auswahl den Rahmen geloescht */
  --row-bg: var(--bg-card);
  background-color: var(--row-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
  transition: border-color 0.12s ease;
}
.tkd-row:hover { --row-bg: var(--bg-tile); }
.tkd-row.is-selected { border-color: var(--border-focus); --row-bg: var(--bg-tile); }

/* Laufende Zeiterfassung — derselbe Rahmen wie an der Karte der App:
   gruen fuer die eigene Zeit, lila fuer die KI, bei beidem ein Verlauf */
.tkd-running,
.tkd-running-ai,
.tkd-running-both { position: relative; }
.tkd-running { border-color: var(--ok, #4f9b4a) !important; border-width: 2px !important; }
.tkd-running-ai { border-color: #a678c4 !important; border-width: 2px !important; }
.tkd-running-both {
  border: 2px solid transparent !important;
  background-image:
    linear-gradient(var(--row-bg, var(--bg-card)), var(--row-bg, var(--bg-card))),
    linear-gradient(100deg, #4f9b4a, #a678c4) !important;
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
/* Der Rahmen atmet im Sekundentakt — wie in der App */
@keyframes tkdBreathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 155, 74, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(79, 155, 74, 0.10); }
}
.tkd-running { animation: tkdBreathe 2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .tkd-running { animation: none; }
}

.tkd-check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #3f3d38; background: transparent; color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; padding: 0;
  transition: all 0.15s ease;
}
.tkd-check .ms { font-size: 18px; }
.tkd-check:hover { border-color: var(--accent); }
.tkd-check.is-done { background: var(--accent); border-color: var(--accent); color: var(--bg-screen); }

.tkd-row__prio { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.tkd-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tkd-row__title {
  font-size: 14px; font-weight: 600; line-height: 1.35;
  /* Lange Titel brechen auf eine zweite Zeile um, erst danach … */
  overflow: hidden; text-overflow: ellipsis; white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; line-clamp: 2;
}
/* Erledigt: durchgestrichen wie auf der Karte in der App, dazu steht rechts
   statt des Termins der Zeitpunkt des Abhakens */
.tkd-row__title.is-done { text-decoration: line-through; color: var(--nav-inactive); }
.tkd-row.is-done .tkd-row__prio { opacity: 0.5; }
.tkd-row__due.tkd-row__done { color: var(--muted); }
.tkd-row__subline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tkd-row__list { font-size: 11.5px; font-weight: 600; color: var(--subtitle); flex-shrink: 0; }
.tkd-row__proj { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tkd-row__meta {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  transition: opacity 0.12s ease;
}
.tkd-row__count {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.tkd-row__count .ms { font-size: 15px; }
/* Abonnenten-Glocke und laufende Zeit heben sich vom Rest ab */
.tkd-row__count--bell { color: var(--bell, #e8c14a); }
.tkd-row__count--run { color: var(--prio-mid, #c67a2e); }
.tkd-row__count--run .ms { animation: tkdRunPulse 1.6s ease-in-out infinite; }
@keyframes tkdRunPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Beteiligte: kleine, leicht überlappende Gesichter vor dem Verantwortlichen */
.tkd-row__people { display: inline-flex; align-items: center; }
.tkd-row__face {
  width: 18px; height: 18px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1.5px solid var(--bg-elevated);
  margin-inline-start: -6px;
}
.tkd-row__people .tkd-row__face:first-child { margin-inline-start: 0; }
.tkd-row__face--txt {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-tile); color: var(--muted);
  font-size: 8px; font-weight: 700;
}
.tkd-row__flag { font-size: 16px; }
.tkd-row__due {
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, 0.07); color: var(--text-2);
  white-space: nowrap;
}
.tkd-row__due.is-late { background: rgba(192, 85, 47, 0.16); color: #e07a52; }
.tkd-row__due.is-today { background: rgba(198, 122, 46, 0.16); color: var(--prio-mid); }
.tkd-row__avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-tile); color: var(--muted);
  font-size: 9.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Profilfoto statt Initialen, wenn eines hinterlegt ist */
.tkd-row__avatar--photo { object-fit: cover; flex-shrink: 0; }

/* Ein dezenter Menue-Knopf am Zeilenende statt schwebender Buttons */
.tkd-row__menu {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 8px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.tkd-row:hover .tkd-row__menu,
.tkd-row.is-selected .tkd-row__menu { opacity: 1; }
.tkd-row__menu:hover { background: var(--bg-elevated); color: var(--text); }
.tkd-row__menu .ms { font-size: 18px; }

.tkd-rowmenu {
  position: fixed;
  z-index: 120;
  min-width: 190px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  animation: tkdIn 0.14s ease;
}
.tkd-rowmenu__item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--text);
  font-family: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.tkd-rowmenu__item:hover { background: var(--bg-tile); }
.tkd-rowmenu__item .ms { font-size: 17px; color: var(--muted); }

/* Halten zum Erledigen: der Kreis fuellt sich von unten, der Haken wird
   sichtbar — loslassen vor Ablauf bricht ab */
.tkd-check { position: relative; overflow: hidden; }
.tkd-check__fill {
  position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
}
.tkd-check.is-holding .tkd-check__fill {
  transform: scaleY(1);
  transition: transform 3s linear;
}
.tkd-check .ms { position: relative; z-index: 1; }
.tkd-check.is-holding { border-color: var(--accent); }
.tkd-check.is-holding .ms { color: var(--on-accent); transition: color 0.8s ease 0.5s; }
.tkd-check.is-done .tkd-check__fill { transform: scaleY(1); }

.tkd-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 0; color: var(--muted); font-size: 13px; font-weight: 600;
}
.tkd-empty__ring {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(79, 155, 74, 0.12); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.tkd-empty__ring .ms { font-size: 24px; }

/* ── Board ── */
.tkd-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(215px, 1fr));
  gap: 14px;
  align-items: start;
}
.tkd-board__col {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  min-height: 200px;
}
.tkd-board__colhead { display: flex; align-items: center; gap: 9px; padding: 2px 4px 12px; }
.tkd-board__colicon {
  width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tkd-board__colicon .ms { font-size: 16px; }
.tkd-board__colname { font-size: 13px; font-weight: 700; }
.tkd-board__coln {
  margin-left: auto;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  background: var(--bg-tile); border-radius: 99px; padding: 2px 8px;
}
.tkd-board__cards { display: flex; flex-direction: column; gap: 8px; }

.tkd-bcard {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 12px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 7px;
}
.tkd-bcard:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); }
.tkd-bcard.is-selected { border-color: var(--border-focus); }
.tkd-bcard__row { display: flex; align-items: center; gap: 8px; }
.tkd-bcard__row .tkd-row__avatar { margin-left: auto; width: 20px; height: 20px; font-size: 9px; }
.tkd-bcard__title { font-size: 13px; font-weight: 600; line-height: 1.35; min-width: 0; }
.tkd-bcard__title.is-done { text-decoration: line-through; color: var(--nav-inactive); }
.tkd-bcard__next {
  position: absolute; top: 8px; inset-inline-end: 8px;
  width: 24px; height: 24px; border-radius: 8px;
  background: var(--bg-tile); border: 1px solid var(--border-strong);
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s ease;
}
.tkd-bcard:hover .tkd-bcard__next { opacity: 1; pointer-events: auto; }
.tkd-bcard__next:hover { color: var(--accent); border-color: var(--border-focus); }
.tkd-bcard__next .ms { font-size: 15px; }

/* ── Kalender ── */
.tkd-cal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
}
.tkd-cal__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; }
.tkd-cal__month { font-size: 16px; font-weight: 700; }
.tkd-cal__nav { display: flex; gap: 6px; color: var(--muted); }
.tkd-cal__navbtn {
  border: 0; background: transparent; color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 4px; border-radius: 8px;
  display: inline-flex; align-items: center;
}
.tkd-cal__navbtn .ms { font-size: 19px; }
.tkd-cal__navbtn:hover { background: var(--bg-tile); color: var(--text); }
.tkd-cal__navbtn--today { background: var(--bg-tile); padding: 4px 10px; }
.tkd-cal__dow {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--disabled);
  text-align: center; padding-bottom: 6px;
}
.tkd-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.tkd-cal__pad { min-height: 74px; }
.tkd-cal__day {
  min-height: 74px; border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  padding: 8px 9px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
}
.tkd-cal__day:hover { background: var(--bg-tile); }
.tkd-cal__day.is-today {
  background: rgba(79, 155, 74, 0.10);
  border-color: var(--border-focus);
}
.tkd-cal__num { font-size: 12px; font-weight: 500; color: var(--text-2); }
.tkd-cal__day.is-today .tkd-cal__num { font-weight: 800; color: var(--accent); }
.tkd-cal__dots { display: flex; gap: 3px; flex-wrap: wrap; }
.tkd-cal__dot { width: 7px; height: 7px; border-radius: 2px; }

/* ── Matrix ── */
.tkd-matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tkd-quad {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-top: 3px solid var(--muted);
  border-radius: 16px;
  padding: 14px;
  min-height: 170px;
}
.tkd-quad__head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 10px; }
.tkd-quad__name { font-size: 13.5px; font-weight: 700; }
.tkd-quad__hint { font-size: 11.5px; color: var(--muted); }
.tkd-quad__n { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.tkd-quad__list { display: flex; flex-direction: column; gap: 7px; }
.tkd-qrow {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.tkd-qrow:hover { background: var(--bg-tile); }
.tkd-qrow.is-selected { border-color: var(--border-focus); }
.tkd-qrow__title {
  font-size: 12.5px; font-weight: 600;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
}

/* ── Detail-Panel ── */
/* Das Detail faehrt als grosses Panel von rechts heraus — es existiert
   erst, wenn eine Aufgabe angeklickt wurde (Klick erneut/X/Esc schliesst) */
.tkd-detail {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: min(880px, 94vw);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-strong);
  min-height: 0;
  z-index: 55;
  transform: translateX(103%);
  transition: transform 0.25s ease;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
}
.tkd-detail.is-open { transform: translateX(0); }
.tkd-detail__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 28px 20px; }
.tkd-detail__empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--disabled); font-size: 13px;
}
.tkd-detail__empty .ms { font-size: 30px; }

.tkd-detail__head { display: flex; align-items: flex-start; gap: 12px; }
.tkd-detail__check { margin-top: 1px; }
.tkd-detail__title {
  margin: 0; flex: 1;
  font-size: 20px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em;
}
.tkd-detail__title.is-done { text-decoration: line-through; color: var(--nav-inactive); }
.tkd-detail__more {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; padding: 4px; border-radius: 8px; flex-shrink: 0;
}
.tkd-detail__more:hover { background: var(--bg-tile); color: var(--text); }
.tkd-detail__more .ms { font-size: 19px; }

.tkd-props {
  display: flex; flex-direction: column;
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
}
.tkd-prop {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px;
}
.tkd-prop + .tkd-prop { border-top: 1px solid var(--hairline); }
.tkd-prop__icon {
  width: 20px; flex-shrink: 0;
  display: inline-flex; justify-content: center; align-items: center;
  color: var(--muted); font-size: 18px;
}
.tkd-prop__label { font-size: 12px; color: var(--muted); width: 88px; flex-shrink: 0; }
.tkd-prop__value { font-size: 13px; font-weight: 600; min-width: 0; }
.tkd-prop__listdot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.tkd-prio4 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5px;
  width: 20px;
}
.tkd-prio4__cell { height: 8px; border-radius: 1.5px; }

.tkd-subs { margin-top: 18px; }
.tkd-subs__head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
}
.tkd-subs__n { margin-left: auto; color: var(--accent); }
.tkd-subs__track {
  height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden; margin-bottom: 10px;
}
.tkd-subs__fill {
  display: block; height: 100%; border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.tkd-subs__list { display: flex; flex-direction: column; gap: 6px; }
.tkd-sub {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
}
.tkd-sub:hover { background: var(--bg-tile); }
.tkd-sub__ring {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #3f3d38; color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s ease;
}
.tkd-sub__ring .ms { font-size: 14px; }
.tkd-sub.is-done .tkd-sub__ring {
  border-color: var(--accent); background: var(--accent); color: var(--bg-screen);
}
.tkd-sub__title { font-size: 13px; font-weight: 500; }
.tkd-sub.is-done .tkd-sub__title { text-decoration: line-through; color: var(--nav-inactive); }

/* Das eingebettete Gespräch füllt die Panel-Breite */
.tkd-detail .tt-talk { margin-top: 4px; }

/* Schmalere Fenster: Detail-Panel kompakter, Board scrollt horizontal */
@media (max-width: 1500px) {
  .tkd-board { grid-template-columns: repeat(5, minmax(190px, 1fr)); overflow-x: auto; }
}

/* Brand-Badge + Listen-Zaehler in der Sidebar (Design-Feinschliff) */
.dt-sidebar__flag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 2px 6px;
}
.dt-navitem__n { margin-left: auto; font-size: 11px; color: var(--disabled); }

/* Gespraech im Panel: Fusszeile und Eingabefeld passen sich dem helleren
   Panel-Hintergrund an */
.tkd-detail .tt-talk__footer { background: var(--bg-elevated); }
.tkd-detail .tt-var-editor { background: var(--bg-tile); }

/* Direkt bearbeitbare Eigenschafts-Zeilen */
.tkd-prop--edit { cursor: pointer; border-radius: 9px; }
.tkd-prop--edit:hover { background: var(--bg-tile); }
.tkd-prop__pen {
  margin-left: auto;
  font-size: 14px;
  color: var(--disabled);
  opacity: 0;
  transition: opacity 0.12s ease;
}
.tkd-prop--edit:hover .tkd-prop__pen { opacity: 1; }
.tkd-prio4--edit .tkd-prio4__cell { cursor: pointer; }
.tkd-prio4--edit .tkd-prio4__cell:hover { outline: 1px solid rgba(255, 255, 255, 0.4); }
.tkd-prop__input {
  background: var(--bg-tile);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  padding: 4px 8px;
  outline: none;
  color-scheme: dark;
}
.tkd-prop__clear {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; padding: 3px; border-radius: 6px; margin-left: 4px;
}
.tkd-prop__clear:hover { color: var(--danger); }
.tkd-prop__clear .ms { font-size: 15px; }
.tkd-detail__titleinput {
  flex: 1;
  background: var(--bg-tile);
  border: 1px solid var(--border-focus);
  border-radius: 9px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 9px;
  outline: none;
  min-width: 0;
}

/* Zusatz-Details im grossen Panel */
.tkd-detail__desc {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
}
.tkd-detail__desc p { margin: 0 0 8px; }
.tkd-detail__desc :last-child { margin-bottom: 0; }

.tkd-prop__range {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}

.tkd-timebtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--border-focus);
  border-radius: 99px;
  background: var(--tint-accent);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.tkd-timebtn .ms { font-size: 16px; color: var(--accent); }
.tkd-timebtn:hover { filter: brightness(1.15); }
.tkd-timebtn.is-stop { border-color: rgba(192, 85, 47, 0.5); background: rgba(192, 85, 47, 0.12); }
.tkd-timebtn.is-stop .ms { color: var(--danger); }

.tkd-sub--file { text-decoration: none; color: var(--text); }

/* Der Halte-Kreis neben der Ueberschrift ist im grossen Panel praesenter */
.tkd-detail__check { width: 30px; height: 30px; }
.tkd-detail__check .ms { font-size: 20px; }

.tkd-detail__full {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.tkd-detail__full .screen {
  min-height: auto;
  background: transparent;
  padding-top: 0;
}
body.is-desktop .tkd-detail__full .screen > *,
body.is-desktop .tkd-detail__full .screen__body,
body.is-desktop .tkd-detail__full .screen__head {
  max-width: none;
}
.tkd-detail__full .screen__body { padding: 4px 24px 44px; }

/* Im Panel gibt es kein "Zurueck" — die Kopfleiste des Panels uebernimmt */
.tkd-detail__full .detail-top > a { display: none; }

/* Bei genug Platz steht das Detail NEBEN der Liste (die rueckt zusammen);
   erst auf kleineren Bildschirmen legt es sich als Overlay darueber */
@media (min-width: 1600px) {
  body.is-desktop:not(.is-tablet) .tkd-detail {
    position: static;
    width: 0;
    transform: none;
    transition: width 0.25s ease;
    overflow: hidden;
    box-shadow: none;
    border-left: 0;
  }
  body.is-desktop:not(.is-tablet) .tkd-detail.is-open {
    width: 880px;
    border-left: 1px solid var(--border-strong);
  }
  /* Der Inhalt behaelt seine Breite, waehrend die Spalte auffaehrt */
  body.is-desktop:not(.is-tablet) .tkd-detail > * {
    width: 880px;
    flex-shrink: 0;
  }
}

/* Eingebettete Aufgabenliste (Projekt-Reiter, Kalender-Tag): ohne eigenen
   Kopf, waechst mit dem Inhalt. Das Detail faehrt dort immer als Overlay
   heraus — als Spalte daneben passte es nicht in den umgebenden Screen. */
.tkd.tkd--embedded { min-height: 0; height: auto; }
.tkd--embedded .tkd__main { background: transparent; }
.tkd--embedded .tkd__scroll { padding: 0; overflow: visible; }
.tkd--embedded .tkd-view { max-width: none; }
body.is-desktop .tkd.tkd--embedded > .tkd-detail {
  display: flex;
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: min(880px, 94vw);
  transform: translateX(103%);
  transition: transform 0.25s ease;
  overflow: visible;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
  border-left: 1px solid var(--border-strong);
}
body.is-desktop .tkd.tkd--embedded > .tkd-detail.is-open { transform: translateX(0); }

/* Abhak-Kreis und Schliessen-X sitzen in der Icon-Zeile des Details */
.tkd-detail__full .detail-top { display: flex; align-items: center; gap: 8px; }
.tkd-detail__full .detail-top .tkd-check { margin-right: auto; }

/* ---------- Eltern-Streifen im Detail-Panel ---------- */
/* Verschachtelte Unteraufgaben: die Eltern gucken links als schmale,
   klickbare Streifen mit vertikaler Ueberschrift heraus */
.tkd-detail__row {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
}
.tkd-crumbs { display: flex; flex-shrink: 0; }
.tkd-crumb {
  width: 44px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: flex-start;   /* die Eltern-Ueberschrift sitzt oben buendig */
  justify-content: center;
  padding: 16px 0;
}
.tkd-crumb:hover { background: var(--bg-tile); }
.tkd-crumb__label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  max-height: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tkd-crumb:hover .tkd-crumb__label { color: var(--text); }

/* ---------- Die grosse Lauf-Pille als globales Element ---------- */
.tkd-timer--floating {
  position: fixed;
  top: 14px;
  inset-inline-end: 18px;
  z-index: 45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.tkd-timer__dots { display: inline-flex; align-items: center; gap: 4px; }

/* Eingebettete Aufgabenkarten (z.B. Subtasks im Panel) tragen am Desktop
   denselben Halte-Abhak-Kreis wie die Hauptliste */
.tkd-check--inline { margin-inline-end: 2px; }
body.is-desktop .tt-swipe__row { align-items: center; }

/* Notiz-Editor am Desktop deutlich groesser */
body.is-desktop .tt-mention-editor {
  min-height: 260px;
  max-height: 48vh;
}

/* Das ⋯-Menue der eingebetteten Karten (z.B. Subtasks) erscheint wie in
   der Hauptliste erst beim Ueberfahren */
body.is-desktop .tt-swipe .tkd-row__menu { opacity: 0; margin-inline-start: auto; }
body.is-desktop .tt-swipe:hover .tkd-row__menu,
body.is-desktop .tt-swipe:focus-within .tkd-row__menu { opacity: 1; }

/* Stift an der Beschreibungs-Sektion — erscheint beim Ueberfahren rechts */
.tt-descsec__head { display: flex; align-items: center; }
.tt-descsec__edit {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 7px;
  display: inline-flex;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.tt-descsec:hover .tt-descsec__edit { opacity: 1; }
.tt-descsec__edit:hover { color: var(--text); background: var(--bg-tile); }
.tt-descsec__edit .ms { font-size: 16px; }

/* Beschreibungs-Editor am Desktop deutlich hoeher — und unter dem Feld
   bleibt Luft, damit die @-Vorschlagsliste voll sichtbar aufklappt */
body.is-desktop .sheet .tt-var-editor--rich {
  min-height: 240px;
  max-height: 40vh;
}
body.is-desktop .tkd-descsheet .tt-mention-wrap {
  margin-bottom: 220px;
}

/* ── Agenten ─────────────────────────────────────────────────────────────
 *
 * Der Reiter „Agent" an einer Aufgabe: Status, Rückfragen, Ergebnisse und
 * der Verlauf. Bewusst nüchtern — die Farbe kommt vom Zustand, nicht von
 * der Dekoration.
 */

.tt-agent { display: flex; flex-direction: column; }

.tt-agent__intro {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Auswahl: welcher Agent soll übernehmen */

.tt-agent__pick { display: flex; flex-direction: column; gap: 8px; }

.tt-agent__card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.tt-agent__card:disabled { opacity: 0.5; cursor: default; }

.tt-agent__card-icon { font-size: 22px; color: var(--info-2); flex: 0 0 auto; }
.tt-agent__card-main { flex: 1 1 auto; min-width: 0; }
.tt-agent__card-name { font-weight: 600; font-size: 14px; }
.tt-agent__card-desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tt-agent__card-go   { color: var(--muted); font-size: 20px; flex: 0 0 auto; }

.tt-agent__caps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tt-agent__cap {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-tile);
  color: var(--text-2);
}

.tt-agent__empty {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  padding: 14px 0;
}

/* Kopf: wer arbeitet gerade woran */

.tt-agent__head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
}
.tt-agent__head.is-running  { border-left-color: var(--info); }
.tt-agent__head.is-waiting  { border-left-color: var(--muted); }
.tt-agent__head.is-question { border-left-color: var(--subtitle); }
.tt-agent__head.is-done     { border-left-color: var(--success); }
.tt-agent__head.is-error    { border-left-color: var(--danger); }
.tt-agent__head.is-cancelled{ border-left-color: var(--disabled); }

.tt-agent__head-icon { font-size: 24px; color: var(--info-2); flex: 0 0 auto; }
.tt-agent__head-main { flex: 1 1 auto; min-width: 0; }
.tt-agent__head-name { font-weight: 600; font-size: 14px; }

.tt-agent__head-status {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  font-size: 12px;
  margin-top: 3px;
}
.tt-agent__head-dot { font-size: 15px; }

/* Solange gearbeitet wird, dreht sich das Symbol — der einzige Ort, an dem
 * die Ansicht von sich aus etwas tut */
.tt-agent__head.is-running .tt-agent__head-dot {
  animation: tt-agent-spin 2.4s linear infinite;
}
@keyframes tt-agent-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .tt-agent__head.is-running .tt-agent__head-dot { animation: none; }
}

.tt-agent__head-time    { color: var(--muted); }
.tt-agent__head-error   { color: var(--danger); font-size: 12px; margin-top: 5px; }
.tt-agent__head-summary { color: var(--text-2); font-size: 12px; margin-top: 5px; line-height: 1.45; }
.tt-agent__head-actions { flex: 0 0 auto; }

/* Rückfrage: das Einzige, was wirklich einen Menschen braucht */

.tt-agent__ask {
  padding: 13px;
  background: var(--tint-accent);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
}

.tt-agent__ask-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}
.tt-agent__ask-text {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 6px;
}

.tt-agent__choices {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 11px;
}
.tt-agent__choices .btn { width: 100%; justify-content: flex-start; }
.tt-agent__opt-desc { color: var(--muted); font-size: 12px; margin-left: 6px; }

.tt-agent__answer { display: flex; gap: 7px; margin-top: 11px; }
.tt-agent__answer .input { flex: 1 1 auto; }

/* Angebotene Aktionen: Taskado zeigt sie, führt sie aber nie selbst aus */

.tt-agent__offers { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }

.tt-agent__offer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--bg-tile);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}
.tt-agent__offer-main  { min-width: 0; }
.tt-agent__offer-title { font-size: 13px; font-weight: 600; }
.tt-agent__offer-host  { color: var(--muted); font-size: 11px; margin-top: 1px; }

/* Ergebnisse */

.tt-agent__art {
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 8px;
}
.tt-agent__art-head { display: flex; align-items: center; gap: 7px; }
.tt-agent__art-title { font-weight: 600; font-size: 13px; flex: 1 1 auto; min-width: 0; }
.tt-agent__art-type {
  font-size: 11px;
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-tile);
}
.tt-agent__art-desc { color: var(--text-2); font-size: 12px; margin-top: 6px; }

/* Inhalte eines Agenten stehen als Text da, nie als HTML */
.tt-agent__art-content {
  margin: 9px 0 0;
  padding: 10px;
  background: var(--bg-screen);
  border-radius: 10px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
}

.tt-agent__art-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  color: var(--info-2);
  font-size: 12px;
  text-decoration: none;
}

/* Verlauf — zugleich das Protokoll, wer wann was getan hat */

.tt-agent__evs { display: flex; flex-direction: column; }

.tt-agent__ev {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}
.tt-agent__ev:last-child { border-bottom: 0; }

.tt-agent__ev-icon { font-size: 17px; color: var(--muted); flex: 0 0 auto; margin-top: 1px; }
.tt-agent__ev.is-warn  .tt-agent__ev-icon { color: var(--subtitle); }
.tt-agent__ev.is-error .tt-agent__ev-icon { color: var(--danger); }

.tt-agent__ev-main { flex: 1 1 auto; min-width: 0; }
.tt-agent__ev-text { font-size: 13px; line-height: 1.45; word-break: break-word; }
.tt-agent__ev-meta { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* Frühere Läufe */

.tt-agent__more {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  padding: 12px 0 4px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.tt-agent__hist { display: flex; flex-direction: column; gap: 6px; }
.tt-agent__hist-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: var(--bg-tile);
  border-radius: 11px;
  font-size: 12px;
}
.tt-agent__hist-row .ms { font-size: 17px; color: var(--muted); }
.tt-agent__hist-row.is-done  .ms { color: var(--success); }
.tt-agent__hist-row.is-error .ms { color: var(--danger); }
.tt-agent__hist-main { min-width: 0; }

/* Verwaltung in den Einstellungen */

.tt-agent-row { align-items: center; }
.tt-agent-row.is-off { opacity: 0.55; }

.tt-agent-row__btn {
  background: none;
  border: 0;
  padding: 6px;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
}
.tt-agent-row__btn .ms { font-size: 19px; }

/* Ein frisch erzeugter MCP-Zugang: die Adresse steht genau einmal da */
.tt-mcp-fresh {
  padding: 13px;
  background: var(--tint-accent);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
}
.tt-mcp-fresh__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

/* Filter nach Faehigkeit — erscheint erst, wenn es genug Agenten gibt */
.tt-agent__filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.tt-agent__cap-btn {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-tile);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}
.tt-agent__cap-btn.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* ---------- Mitarbeiter-Kacheln ---------- */
/* Auf dem Desktop ist Platz: die Kacheln brechen um, statt zu scrollen, und
   fallen eine Stufe größer aus als in der mobilen Ansicht. */
body.is-desktop .tt-staff-host { margin: 8px 0 18px; }
body.is-desktop .tt-staff__eyebrow { margin-bottom: 9px; }
body.is-desktop .tt-staff__row {
  flex-wrap: wrap;
  overflow-x: visible;
  padding-bottom: 0;
  gap: 10px;
}
body.is-desktop .tt-staff {
  width: 112px;
  gap: 6px;
  padding: 12px 8px 10px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
body.is-desktop .tt-staff:hover { background: var(--bg-tile); }
body.is-desktop .tt-staff__ring { width: 64px; height: 64px; }
body.is-desktop .tt-staff__avatar { font-size: 15px; }
body.is-desktop .tt-staff__avatar--text .ms { font-size: 22px; }
body.is-desktop .tt-staff__name { font-size: 13px; }
body.is-desktop .tt-staff__meta { font-size: 11px; }
body.is-desktop .tt-staff__avatar--list .ms { font-size: 24px; }
