/* ============================================================================
   Taskado Mobile — Design Tokens + Global Components
   Quelle: Claude-Design "Todo App" (Aufgaben › ToDo — Mobile)
   ============================================================================ */

@import url('./mobile/fonts/fonts.css');

:root {
  /* Backgrounds */
  --bg-app:       #0a0a0c;
  --bg-screen:    #131316;
  --bg-elevated:  #17171a;
  --bg-card:      #1a1a1d;
  --bg-nav:       #1d1d20;
  --bg-drawer:    #161619;
  --bg-tile:      #1e1e21;

  /* Borders */
  --border:       rgba(255, 255, 255, 0.07);
  --hairline:     rgba(255, 255, 255, 0.05);
  --border-strong:rgba(255, 255, 255, 0.10);
  --border-focus: rgba(79, 155, 74, 0.40);
  --tint-accent:  rgba(79, 155, 74, 0.08);

  /* Text */
  --text:         #f4f3ef;
  --text-2:       #cbc9c2;
  --muted:        #8a877e;
  --disabled:     #5d5b54;
  --nav-inactive: #75736b;
  /* Untertitel einer Liste — gedämpftes Gold */
  --subtitle:     #c9a54d;

  /* Accent + Status */
  --accent:       #4f9b4a;
  --on-accent:    #0f1a0e;
  --success:      #4f9b4a;
  --danger:       #c0552f;
  --info:         #5a8fd8;
  --info-2:       #7fb0e6;

  /* Priorität (Terrakotta / Orange / Salbei) */
  --prio-high:    #c0552f;
  --prio-mid:     #c67a2e;
  --prio-low:     #7ba874;
  --prio-none:    #6b7078;

  /* Radii */
  --radius-card:  16px;
  --radius-input: 11px;
  --radius-sheet: 24px;
  --radius-pill:  99px;
  --radius-nav:   19px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 6px;
  --s-3: 8px;
  --s-4: 11px;
  --s-5: 14px;
  --s-6: 18px;
  --s-7: 22px;

  --screen-pad-x: 18px;
  --hit-min:      44px;
}

* { box-sizing: border-box; }

a {
  color: inherit;
  text-decoration: none;
}

/* Global button reset — kills the Chrome/Safari "buttonface" default
   background (which was leaking through as a white plate on any button
   whose class didn't set its own background: .apphdr__plus, .iconbtn,
   .drawer__close, etc.). Class-specific rules further down remain the
   source of truth for background/border/color. */
button {
  background-color: transparent;
  background-image: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
button:focus { outline: none; }

/* ---------- Dark scrollbar (matches Graphite tokens) ---------- */
/* Firefox */
html {
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
}
/* Chrome / Edge / Safari — do NOT combine with scrollbar-width on the same
   element, Chrome falls back to native styling when both are set. */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: var(--bg-app);
  color: var(--text);
  /* Die Emoji-Schriften haengen hinten dran: so sieht ein Zeichen im
     Fliesstext genauso aus wie in der Auswahl und in den Reaktionen. */
  font-family: 'Manrope', -apple-system, system-ui, 'Segoe UI',
               'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji',
               'Android Emoji', sans-serif;
  font-size: 14px;
  font-weight: 400;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  overflow-x: hidden;
  /* Tell the browser we're in a dark theme so native controls (date/time
     pickers, calendar indicator, spin buttons) render in dark. */
  color-scheme: dark;
}

/* Dark theme for native date/time controls. */
input[type="date"],
input[type="time"],
input[type="month"],
input[type="week"],
input[type="datetime-local"] {
  color-scheme: dark;
  color: var(--text);
  position: relative;
  /* Reserve space on the right for the custom icon we paint over the native
     one (Chrome's built-in indicator is inconsistently coloured across
     versions, and `filter: invert()` on ::-webkit-calendar-picker-indicator
     is ignored in some builds — this approach is deterministic). */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23cbc9c2" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-inline-end: 38px;
}
input[type="time"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23cbc9c2" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><polyline points="12,7 12,12 15,14"/></svg>');
}
/* Nuke Chrome's built-in indicator glyph — the custom one shown as the
   input's background takes over. The indicator button still receives the
   click and opens the picker. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: 40px;
  height: 100%;
  padding: 0;
  cursor: pointer;
}

#app {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  /* `clip` instead of `hidden`: same horizontal clipping, but doesn't turn
     #app into a scroll container — otherwise position: sticky descendants
     (roster day header) would stick to #app instead of the page. */
  overflow-x: clip;
}

/* ---------- Material Symbols Rounded ---------- */
.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  display: inline-block;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* ---------- Screen / Layout ---------- */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--bg-screen);
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
}

.screen__body {
  flex: 1;
  /* + inset-bottom: the bottom nav is lifted by the same amount, otherwise the
     last rows stay hidden behind it in the native app */
  padding: var(--s-3) var(--screen-pad-x) calc(var(--s-6) + 76px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  /* The page itself scrolls (#app/.screen use min-height), so this element
     must NOT be a scroll container: `overflow-y: auto` / `overflow-x: hidden`
     would capture position: sticky children and the roster day header could
     never stick to the viewport. `clip` keeps the horizontal clipping. */
  overflow-x: clip;
}

.screen__title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Untertitel klein unter dem Titel im Kopf */
.screen__subtitle {
  font-size: 12px;
  color: var(--subtitle);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen__hero {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.meta {
  font-size: 12px;
  color: var(--muted);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hairline {
  height: 1px;
  background: var(--hairline);
  margin: var(--s-5) 0;
}

/* ---------- App header (back + title + actions) ---------- */
/* Rechts oben koennen mehrere Knoepfe stehen (Reihenfolge, Plus) */
.apphdr__right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.apphdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--screen-pad-x) var(--s-4);
  /* Native app (Capacitor sets --safe-area-inset-top): the status bar already
     leaves room above, so the header shrinks its top padding by that amount.
     Browser/PWA: variable missing → unchanged 16px. */
  padding-top: max(4px, calc(16px - var(--safe-area-inset-top, 0px)));
}
.apphdr__left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.apphdr__titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.apphdr__back {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  cursor: pointer;
}
.apphdr__back .ms { font-size: 21px; }
.apphdr__plus {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.apphdr__plus .ms { font-size: 19px; }

/* ---------- Search bar ---------- */
.searchbar {
  display: flex; align-items: center; gap: var(--s-3);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 9px 12px;
  margin: var(--s-1) 0 var(--s-5);
}
.searchbar input,
.searchbar__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 0;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}
.searchbar__input::-webkit-search-cancel-button,
.searchbar__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.searchbar input::placeholder,
.searchbar__input::placeholder { color: var(--muted); }
.searchbar .ms { font-size: 17px; color: var(--muted); }

/* ---------- Filter chips ---------- */
/* Eine Zeile, horizontal scrollbar (wie im Design) statt Umbruch */
.chips {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
/* Chip, der abgesetzt am rechten Rand sitzt (z. B. „Erledigt") */
.chip--right { margin-inline-start: auto; }
.chip {
  flex: none;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}
.chip.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* ---------- List rows ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
}
.row + .row { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--hairline); }
.row__main { flex: 1; min-width: 0; }
.row__title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  font-size: 10px;
  color: var(--on-accent);
  background: var(--success);
  border-radius: 5px;
  padding: 3px 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* Fixed-size square badge for list rows — customer numbers keep the coloured
   plate, rows without a number get the customer's initials instead. Size is
   locked so every row lines up regardless of the badge content. */
.badge-square {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--on-accent);
  padding: 2px 4px;
  text-align: center;
  line-height: 1.15;
  flex-shrink: 0;
  overflow: hidden;
  letter-spacing: 0.02em;
}
.badge-square--success { background: var(--success); }
.badge-square--danger  { background: var(--danger);  }
.badge-square--info    { background: var(--info);    color: var(--on-accent); }
.badge-square--accent  { background: var(--accent);  }
.badge-square--initials {
  /* When no customer number is present we show the initials on a neutral
     tile so the coloured status ID isn't misleadingly implied. */
  background: var(--bg-tile);
  color: var(--text-2);
  font-size: 14px;
}
.badge--danger { background: var(--danger); }
.badge--info   { background: var(--info); }
.badge--accent { background: var(--accent); }

.dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.dot--success { background: var(--success); }
.dot--danger  { background: var(--danger); }
.dot--info    { background: var(--info); }

/* ---------- Cards / KPI tiles ---------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px;
  background: var(--bg-card);
}

.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.kpi__label { font-size: 12px; color: var(--muted); }
.kpi__value { font-size: 19px; font-weight: 600; margin-top: var(--s-1); letter-spacing: -0.01em; }
.kpi__value--xl { font-size: 38px; font-weight: 800; }

/* Gold progress bar */
.bar {
  position: relative;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.bar__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent);
  border-radius: 99px;
}

/* ---------- Detail header + tabs ---------- */
.detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--screen-pad-x) var(--s-4);
  /* same as .apphdr: less top padding below the status bar in the native app */
  padding-top: max(4px, calc(16px - var(--safe-area-inset-top, 0px)));
}
.detail-top .ms { font-size: 21px; color: var(--text-2); cursor: pointer; }

.detail-titleblock {
  padding: 0 var(--screen-pad-x) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.detail-titleblock__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.detail-titleblock__title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
}
.detail-titleblock__id    { font-size: 12px; color: var(--muted); }
.detail-titleblock__sub   { font-size: 14px; color: var(--text-2); margin-top: var(--s-1); }

.tabs {
  display: flex;
  justify-content: space-between;
  padding: var(--s-4) var(--screen-pad-x);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.tab {
  color: var(--muted);
  cursor: pointer;
  padding-bottom: var(--s-3);
  margin-bottom: calc(var(--s-3) * -1 - 1px);
  border-bottom: 2px solid transparent;
}
.tab.is-active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ---------- Key/Value rows ---------- */
.kv {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--hairline);
  gap: 12px;
}
.kv:last-child { border-bottom: 0; }
.kv__key   { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.kv__value { font-size: 13px; text-align: end; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Graues Kettenglied an allem, was aus einem gekoppelten System kommt
   (Creator). Es steht rechts bei den uebrigen Symbolen — am Titel saesse
   es je nach Laenge des Namens an einer anderen Stelle. */
.row__linkmark {
  font-size: 15px;
  color: var(--muted);
  flex-shrink: 0;
  opacity: 0.8;
  margin-inline-end: 6px;
}

/* Herkunfts-Instanz: das Kuerzel als Quadrat ganz links vor dem Symbol.
   Gelesen wird ueber alle Instanzen zugleich — das Quadrat sagt, aus
   welcher die Zeile stammt. Feste Breite, damit die Namen darunter
   buendig bleiben, auch wenn ein Kuerzel kuerzer ist. */
.tt-inst-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  /* Oben 2 px: bei zentriertem Inhalt und border-box sitzt die Schrift damit
     genau 1 px tiefer — optisch mittig, die Kachel bleibt 20 px hoch */
  padding: 2px 4px 0;
  border-radius: 5px;
  background: var(--chip-bg, rgba(126, 189, 245, 0.22));
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1;
  flex-shrink: 0;
  text-transform: uppercase;
  /* Etwas Luft zum Symbol dahinter — sonst kleben Quadrat und Icon
     aneinander */
  margin-inline-end: 4px;
}

/* Wer in mehreren Instanzen steckt, traegt mehrere Quadrate. Der Abstand
   zum Symbol dahinter steht dann an der Gruppe, nicht an jedem Quadrat —
   sonst waere die Luecke zwischen den Quadraten zu gross. */
.tt-inst-badge-group {
  display: inline-flex;
  gap: 3px;
  flex-shrink: 0;
  margin-inline-end: 4px;
}

.tt-inst-badge-group .tt-inst-badge { margin-inline-end: 0; }

/* Erfassungsweg hinter dem Anleger: „von wem" und „woreuber" in einer Zeile */
.tt-via {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: 8px;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  color: var(--muted);
  font-size: 11px;
  vertical-align: middle;
}
.tt-via .ms { font-size: 13px; }

/* ---------- Form header (centered title, icon left) ---------- */
.formhdr {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 16px var(--screen-pad-x) var(--s-4);
  border-bottom: 1px solid var(--border);
}
.formhdr__icon {
  position: absolute;
  left: var(--s-5);
  font-size: 20px;
  color: var(--text-2);
  cursor: pointer;
}
.formhdr__title {
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Form fields ---------- */
.form-body {
  padding: var(--s-5) var(--screen-pad-x) calc(var(--s-6) + 78px);
  overflow-y: auto;
  flex: 1;
}
.field { margin-bottom: 13px; }
.field-row { display: flex; gap: 10px; margin-bottom: 13px; }
.field-row > .field { flex: 1; margin-bottom: 0; }

.field__label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.field__input,
.field__select,
.field__textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  background: transparent;
  color: var(--text);
  outline: 0;
}
.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  border-color: var(--border-focus);
  background: var(--tint-accent);
}
.field__select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 10px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-inline-end: 32px;
}

/* Custom combo trigger (replaces native <select> to keep dark styling) */
.field__combo {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  min-height: 42px;
}
.field__combo-label {
  flex: 1;
  min-width: 0;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field__combo-label:empty::before {
  content: '—';
  color: var(--muted);
}
.field__combo-chev { color: var(--muted); font-size: 18px; flex-shrink: 0; }

/* ---------- Picker (stackable bottom-sheet) ---------- */
.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 9, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  /* Ueber jedem Formular — auch ueber einem gestapelten (91) */
  z-index: 99;
}
.picker-overlay.is-open { opacity: 1; pointer-events: auto; }

.picker-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 12px var(--screen-pad-x) calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.22s ease;
  max-height: 80vh;
  overflow-y: auto;
  color: var(--text);
}
.picker-sheet.is-open { transform: translateY(0); }

.picker-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-card);
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--hairline);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: start;
  background-color: transparent;
  cursor: pointer;
  width: 100%;
}
.picker-item:first-child { border-top: 0; }
.picker-item:active { background-color: rgba(255, 255, 255, 0.05); }
.picker-item.is-selected {
  color: var(--accent);
}
.picker-item__body { flex: 1; min-width: 0; }
.picker-item__label {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-item__sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
/* Struktur-Zeile im Picker: zeigt nur, wo die darunter stehenden Einträge
   hängen, und ist selbst nicht auswählbar. */
.picker-item--header {
  cursor: default;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 10px;
  padding-bottom: 4px;
}
.picker-item--header .picker-item__label { font-weight: 700; }

/* ---------- Date picker sheet ---------- */
.datepicker-sheet .sheet__actions { justify-content: space-between; }
.datepicker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 12px;
}
.datepicker__month-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-align: center;
}
.datepicker__navbtn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.datepicker__navbtn .ms { font-size: 18px; line-height: 1; }
.datepicker__wds {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding-bottom: 4px;
}
.datepicker__wd {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 0;
}
.datepicker__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding-bottom: 8px;
}
.datepicker__grid--months {
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 0;
}
.datepicker__cell {
  height: 38px;
  border-radius: 8px;
  background-color: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.datepicker__cell.is-muted    { color: var(--disabled); }
.datepicker__cell.is-today    { border: 1px solid var(--border-strong); }
.datepicker__cell.is-selected {
  background-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.datepicker__cell:not(.is-selected):active { background-color: rgba(255, 255, 255, 0.06); }
.datepicker__grid--months .datepicker__cell {
  height: 44px;
  font-weight: 600;
}
.field__textarea { resize: vertical; min-height: 80px; font-family: inherit; }

/* Toggle row */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px;
  margin-bottom: 13px;
}
.toggle-row__label { font-size: 13px; }
.toggle {
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.toggle__knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: left 0.15s;
}
.toggle.is-on { background: var(--accent); }
.toggle.is-on .toggle__knob { left: 18px; background: var(--on-accent); }

/* ---------- Action bar (Abbrechen + Speichern, always at bottom) ---------- */
.actionbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: var(--s-4);
  padding: 12px var(--screen-pad-x) calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  background: var(--bg-screen);
  border-top: 1px solid var(--border);
  z-index: 40;
}
.btn {
  flex: 1;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--text);
}
.btn--ghost { border: 1px solid var(--border-strong); color: var(--text-2); }
/* Knopf mit Symbol davor — sonst klebt das Icon am Text */
.btn { gap: 8px; }
.btn .ms { font-size: 18px; }

/* Was sich nicht rueckgaengig machen laesst: Loeschen von Instanz und
   eigenem Konto. Rot, aber nicht gefuellt — es soll auffallen, ohne wie
   der naechste Schritt auszusehen. */
.tt-danger-btn { color: var(--danger); border-color: var(--danger); }
.tt-danger-btn .ms { color: var(--danger); }
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.btn--danger {
  background: var(--danger);
  color: var(--on-accent);
  font-weight: 700;
}
.btn--block { flex: 1 1 100%; }

/* ---------- Bottom navigation (3 favorites + menu) ---------- */
.bottomnav {
  position: fixed;
  left: 14px; right: 14px;
  bottom: calc(14px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  height: 58px;
  background: var(--bg-nav);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-nav);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 30;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.bottomnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--nav-inactive);
  font-size: 9px;
  cursor: pointer;
  background: transparent;
  border: 0;
  font-family: inherit;
  padding: 4px 10px;
}
.bottomnav__item .ms { font-size: 21px; }
.bottomnav__item.is-active { color: var(--accent); font-weight: 600; }

/* ---------- Drawer (full nav, slides from left) ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 9, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 49;
}
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: 78%;
  max-width: 320px;
  background: var(--bg-drawer);
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
}
.drawer.is-open { transform: translateX(0); }

.drawer__header {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.drawer__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-tile);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}
.drawer__userbtn {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.drawer__user { flex: 1; min-width: 0; display: block; }
.drawer__name { font-size: 14px; font-weight: 600; display: block; }
.drawer__role { font-size: 11px; color: var(--muted); margin-top: 2px; display: block; }
.drawer__userchevron {
  font-size: 20px;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.drawer__userbtn.is-open .drawer__userchevron { transform: rotate(180deg); }
.drawer__usermenu {
  border-bottom: 1px solid var(--border);
  padding: var(--s-3) 0;
}
.drawer__close {
  background: transparent;
  border: 0;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px;
}
.drawer__close .ms { font-size: 20px; }

.drawer__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-3) 0 calc(var(--s-6) + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}
.navitem {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 12px var(--s-6);
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  width: 100%;
  text-align: start;
  cursor: pointer;
}
.navitem .ms { font-size: 20px; color: var(--text-2); }
.navitem__label { flex: 1; }
.navitem__chevron { color: var(--muted); }
.navitem.is-group { font-weight: 600; }
.navitem.is-active,
.navitem.is-active .ms { color: var(--accent); }
.navitem.is-child {
  padding-inline-start: calc(var(--s-6) + 26px);
  position: relative;
  font-size: 13px;
}
.navitem.is-child::before {
  content: '';
  position: absolute;
  left: calc(var(--s-6) + 10px);
  top: 0; bottom: 0;
  width: 1px;
  background: var(--hairline);
}

/* ---------- Bottom sheet (popup) ---------- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 9, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 59;
}
.sheet-overlay.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 16px var(--screen-pad-x) calc(20px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  z-index: 60;
  transform: translateY(100%);
  transition: transform 0.22s ease;
  max-height: 95vh;
  overflow: hidden;   /* internal .sheet__scroll handles scrolling */
  display: flex;
  flex-direction: column;
}
.sheet.is-open { transform: translateY(0); }
/* When content overflows the natural height, expand to (near) full-screen. */
.sheet--tall { height: 95vh; }

.sheet__handle {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: #3a3a3e;
  margin: 0 auto 12px;
  flex-shrink: 0;
}
.sheet__title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 14px;
  text-align: center;
  flex-shrink: 0;
}

/* Titelzeile mit Aktion rechts (z. B. „Aus Vorlage") */
.sheet__titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.sheet__title--bar {
  flex: 1;
  margin-bottom: 0;
  text-align: start;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet__titleaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background-color: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.sheet__titleaction .ms { font-size: 16px; }
.sheet__titleaction:active { background-color: rgba(255, 255, 255, 0.06); }

/* Scroll area between header + sticky action bar. `min-height: 0` is
   required for flex-basis:auto to allow shrinking below content size.
   `overflow-x: hidden` blocks stray horizontal scrollbars caused by e.g.
   nested inputs that overrun the container by a pixel because of border
   or box-shadow rounding. */
.sheet__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  /* Etwas Luft am Ende, damit die letzte Zeile auf iOS nicht unter dem
     Schwung des Scrollens verschwindet. */
  padding-bottom: 4px;
}

.sheet__actions {
  display: flex;
  gap: var(--s-4);
  margin-bottom: 14px;
  flex-shrink: 0;
  /* Die Leiste sitzt oben, direkt unter dem Titel. Die Trennlinie gehoert
     deshalb an ihre Unterkante — sie grenzt sie vom scrollenden Inhalt
     darunter ab. */
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-elevated);
}

/* ---------- Chipset (multi-select field) ---------- */
.chipset {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chipset__chip {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.chipset__chip.is-selected {
  font-weight: 700;
}

/* Color swatches (note popup) */
.swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.swatch.is-selected { border-color: var(--text); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  font-size: 13px;
  z-index: 70;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  max-width: calc(100% - 32px);
}
.toast--error { border-color: var(--danger); color: var(--danger); }

/* ---------- Login ---------- */
.login {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px calc(32px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  overflow: hidden;
}
/* Soft accent glow behind the brand block */
.login::before {
  content: '';
  position: absolute;
  top: -220px;
  left: 50%;
  width: 540px;
  height: 540px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(227, 179, 65, 0.13) 0%, transparent 65%);
  pointer-events: none;
}
.login__inner {
  position: relative;
  width: 100%;
  max-width: 360px;
}

.login__brand {
  text-align: center;
  margin-bottom: 26px;
  animation: login-rise 0.5s ease both;
}
.login__logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: var(--on-accent);
  /* icon_512.png bringt Kachel und Farben mit — kein zusätzlicher Hintergrund */
  background: transparent;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.login__logo .tt-logo { width: 100%; height: 100%; display: block; }
.login__title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
}
.login__subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}
.login__instance {
  color: var(--subtitle);
}

.login__card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  animation: login-rise 0.5s ease 0.08s both;
}

/* Login input group — icon + stacked label/input inside one focusable field */
.login-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-field:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--tint-accent);
}
.login-field__icon {
  font-size: 20px;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.login-field:focus-within .login-field__icon { color: var(--accent); }
.login-field__body {
  flex: 1;
  min-width: 0;
  display: block;
}
.login-field__label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 2px;
}
.login-field__input {
  display: block;
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
/* Keep Chrome's autofill from painting the field white/blue */
.login-field__input:-webkit-autofill,
.login-field__input:-webkit-autofill:hover,
.login-field__input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-card) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 9999s ease-out;
}
.login-field__eye {
  flex-shrink: 0;
  padding: 6px;
  color: var(--muted);
}
.login-field__eye .ms { font-size: 20px; }

.login__submit {
  position: relative;
  width: 100%;
  height: 50px;
  margin-top: 6px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.12s ease;
}
.login__submit:active {
  transform: scale(0.98);
}
.login__submit.is-loading {
  color: transparent;
  pointer-events: none;
}
.login__submit.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(19, 19, 22, 0.25);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.login__footer {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--disabled);
  animation: login-rise 0.5s ease 0.16s both;
}

/* Auswertung als Raster: Zeilen = Aufgaben, Spalten = Tage */
.tt-repgrid-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.tt-repgrid {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}

.tt-repgrid th,
.tt-repgrid td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
  min-width: 64px;
}

.tt-repgrid th {
  background: var(--bg-elevated);
  color: var(--text-2);
  font-weight: 700;
  font-size: 11.5px;
}

.tt-repgrid__task {
  text-align: left !important;
  position: sticky;
  left: 0;
  background: var(--bg-elevated);
  max-width: 220px;
  min-width: 140px;
  white-space: normal !important;
  font-weight: 600;
}

.tt-repgrid td.is-done { background: rgba(79, 155, 74, 0.10); }

.tt-repgrid__cell { line-height: 1.25; }
.tt-repgrid__time { font-weight: 700; color: var(--accent); margin-right: 4px; }
.tt-repgrid__who { color: var(--text-2); font-size: 11.5px; }

/* 9d-Ausbau: Warndreieck — verantwortliche Person heute abwesend */
.tt-absent-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}
.tt-absent-flag .ms { font-size: 15px; }

/* Links unter dem Login: Registrierung, Instanz wechseln */
.login__links {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 18px;
  animation: login-rise 0.5s ease 0.14s both;
}

.login__link {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 2px;
}
.login__link:hover { color: var(--text); }

/* Login-Screen: Instanz-/Registrierungs-Links als graue Buttons */
.login__links--buttons {
  flex-direction: column;
  gap: 8px;
}
.login__link--button {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-tile);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease;
}
.login__link--button:active { transform: scale(0.98); }

/* Hinweis statt Registrierung, Link zur Warteliste der Website (mobile/waitlist.js) */
.waitlist__text {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
.waitlist__perk {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(79, 155, 74, 0.10);
  border: 1px solid rgba(79, 155, 74, 0.35);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--text);
}
.waitlist__perk .ms { color: var(--subtitle); font-size: 20px; }
.waitlist__open {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Spinner ---------- */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 0;
}

/* Modal loader — full-screen blurred overlay with a centered spinner.
   Sits above every sheet / picker / toast to guarantee the user knows
   the app is working on an async request. */
.modal-loader {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.35);
  backdrop-filter: blur(4px) saturate(0.9);
  -webkit-backdrop-filter: blur(4px) saturate(0.9);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.18s ease;
}
.modal-loader.is-open { opacity: 1; }
.modal-loader .spinner {
  width: 34px;
  height: 34px;
  border-width: 3px;
  border-color: rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
}

.empty-state {
  text-align: center;
  padding: 32px var(--screen-pad-x);
  color: var(--muted);
  font-size: 13px;
}

/* ============================================================================
   Taskado — Aufgaben (Design "Todo App")
   ============================================================================ */

/* ---------- Bottom navigation mit FAB ---------- */
.bottomnav__fab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: -28px;
  background: transparent;
  border: 0;
  font-family: inherit;
  color: var(--nav-inactive);
  font-size: 9px;
  cursor: pointer;
  /* Ohne das übernimmt der Browser die Wischgeste als Scrollen und bricht
     sie mit pointercancel ab — dann kommt der Halbkreis nie zustande. */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.bottomnav__fab-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid var(--bg-screen);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.bottomnav__fab-circle .ms {
  font-size: 28px;
  color: var(--on-accent);
}

/* ---------- Aufgaben-Zeile ---------- */
.tt-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #3f3d38;
  background: transparent;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.tt-check .ms { font-size: 18px; }
.tt-check.is-done {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-screen);
}
.tt-row-done .row__title {
  text-decoration: line-through;
  color: var(--nav-inactive);
}
.tt-row-done .tt-prio { opacity: 0.5; }

.tt-prio {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.tt-prio--1 { background: var(--prio-high); }
.tt-prio--2 { background: var(--prio-mid); }
.tt-prio--3 { background: var(--prio-low); }
/* „Keine" — der Punkt bleibt, tritt aber zurueck */
.tt-prio--0 { background: var(--prio-none); }

/* ---------- Priorität: nur die Matrix ---------- */
/* Statt eines Auswahlmenüs ein Streifen: links das Quadrat der vier Felder,
   dahinter das gewählte Feld und wofür es steht. */
.tt-prio-pick {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.tt-prio-pick:active { transform: scale(0.995); border-color: var(--accent); }
.tt-prio-pick__body { min-width: 0; }
.tt-prio-pick__name { font-size: 14px; font-weight: 600; }
.tt-prio-pick__hint {
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}

/* Das Quadrat: die vier Felder der Matrix im Kleinen. Das aktive leuchtet,
   die anderen treten zurück. */
.tt-eisen-btn {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 34px;
  height: 34px;
}
.tt-eisen-btn__cell {
  border-radius: 2px;
  opacity: 0.28;
  transition: opacity 0.18s ease, box-shadow 0.18s ease;
}
.tt-eisen-btn__cell.is-on { opacity: 1; }

/* Inhalt eines uebergelegten Fensters (openOverlaySheet) */
.picker-body { padding-top: 4px; }

/* ---------- Die Matrix ---------- */
.tt-eisen-wrap {
  display: grid;
  /* Beschriftung links, darunter die waagerechte Achse */
  grid-template-columns: 74px 1fr;
  gap: 8px;
  align-items: stretch;
}
.tt-eisen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  /* Solange nichts gewaehlt ist, liegt kein Schleier darueber */
  perspective: 900px;
}

/* Beschriftung: waagerecht lesbar, je eine auf Hoehe ihrer Zeile */
.tt-eisen-axis--y {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
  text-align: end;
}
.tt-eisen-axis--y > span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.tt-eisen-axis--x {
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 11px;
  color: var(--muted);
}

.tt-eisen__cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  min-height: 112px;
  padding: 26px 12px 12px;
  border: 1px solid var(--border-strong);
  border: 1px solid color-mix(in srgb, var(--cell) 45%, transparent);
  border-radius: var(--radius-input);
  background: var(--bg-elevated);
  background: color-mix(in srgb, var(--cell) 14%, transparent);
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
  /* Gestaffeltes Einfahren: die Kacheln kippen aus der Tiefe herein */
  opacity: 0;
  transform: scale(0.72) translateY(26px) rotateX(24deg);
  transition:
    opacity 0.42s ease,
    transform 0.52s cubic-bezier(0.18, 1.12, 0.32, 1.28),
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.28s ease;
}
.tt-eisen.is-in .tt-eisen__cell {
  opacity: 1;
  transform: none;
  transition-delay: var(--delay, 0ms);
}
.tt-eisen__cell::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--cell);
  box-shadow: 0 0 10px var(--cell);
}
.tt-eisen__label { font-size: 15px; font-weight: 700; }
.tt-eisen__hint { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.tt-eisen__prio { font-size: 11px; color: var(--cell); font-weight: 700; }

/* Das gewaehlte Feld leuchtet */
.tt-eisen__cell.is-active {
  border-color: var(--cell);
  background: var(--bg-elevated);
  background: color-mix(in srgb, var(--cell) 30%, transparent);
  box-shadow:
    0 0 0 1px var(--cell),
    0 0 18px 2px color-mix(in srgb, var(--cell) 55%, transparent),
    0 8px 26px -6px color-mix(in srgb, var(--cell) 70%, transparent);
}
.tt-eisen.is-in .tt-eisen__cell.is-active { transform: scale(1.03); }

/* Die uebrigen treten beim Waehlen zurueck */
.tt-eisen__cell.is-dimmed { opacity: 0.35; }
.tt-eisen.is-in .tt-eisen__cell.is-dimmed { transform: scale(0.95); }

.tt-eisen__check {
  position: absolute;
  top: 9px;
  right: 10px;
  font-size: 19px !important;
  color: var(--cell);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 1.3, 0.4, 1.3);
}
.tt-eisen__cell.is-active .tt-eisen__check { opacity: 1; transform: none; }

/* Kurzer Puls beim Auswaehlen */
.tt-eisen__cell.is-picked { animation: tt-eisen-pick 0.34s ease; }
@keyframes tt-eisen-pick {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); }
  70%  { transform: scale(1.01); }
  100% { transform: scale(1.03); }
}

/* ---------- Status-Badge ---------- */
span.tt-badge--muted   { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
span.tt-badge--info    { background: rgba(96, 165, 250, 0.16);  color: var(--info-2); }
span.tt-badge--success { background: rgba(79, 155, 74, 0.16);   color: var(--accent); }
span.tt-badge--waiting { background: rgba(198, 122, 46, 0.16);  color: var(--prio-mid); }
span.tt-badge--danger  { background: rgba(192, 85, 47, 0.16);   color: var(--prio-high); }

/* Status auf der Karte: gerundet wie ein Tag, in derselben Farbwelt */
/* Statuszeile unter der Ueberschrift im Detail */
.tt-statusline { display: inline-flex; align-items: center; gap: 6px; }
.tt-tag--muted   { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.tt-tag--info    { background: rgba(96, 165, 250, 0.16);  color: var(--info-2); }
.tt-tag--success { background: rgba(79, 155, 74, 0.16);   color: var(--accent); }
.tt-tag--waiting { background: rgba(198, 122, 46, 0.16);  color: var(--prio-mid); }
.tt-tag--danger  { background: rgba(192, 85, 47, 0.16);   color: var(--prio-high); }

/* ---------- Fortschritt ---------- */
.tt-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.tt-progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}
.tt-range {
  width: 100%;
  margin: 10px 0 2px;
  accent-color: var(--accent);
}

.tt-section { margin-bottom: 18px; }
.tt-combo-pair { display: flex; gap: 10px; margin-bottom: 14px; }
.tt-combo-pair > * { flex: 1; min-width: 0; }

/* Deadline in der Übersicht wird orange, sobald sie gesetzt ist */
.kv__value.is-due { color: var(--prio-mid); }

/* ---------- Teilnehmer ---------- */
.tt-participant {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(96, 165, 250, 0.14);
  color: var(--text);
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  margin: 0 6px 6px 0;
  vertical-align: top;
}
.tt-participant .ms {
  font-size: 15px;
  color: var(--prio-high);
  cursor: pointer;
}
/* Profilfoto im Chip — ersetzt das Platzhalter-Icon */
.tt-participant__photo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  margin-inline-start: -3px;
}
.tt-participant__icon {
  color: var(--muted) !important;
  cursor: default !important;
  margin-inline-start: -2px;
}
.tt-participant__remove { color: var(--prio-high); }
.tt-add-chip {
  display: inline-flex;
  align-items: center;
  /* gleiche Ausrichtung und gleicher Zeilenabstand wie .tt-participant,
     sonst sitzt der Knopf rund 2px hoeher als die Chips daneben */
  vertical-align: top;
  margin: 0 6px 6px 0;
  gap: 5px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--muted);
  background: transparent;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  cursor: pointer;
}
.tt-add-chip .ms { font-size: 15px; }

/* ---------- Notizen ---------- */
.tt-note {
  background: var(--bg-card);
  border-inline-start: 3px solid var(--info);
  border-radius: 12px;
  padding: 12px 13px;
  margin-bottom: 10px;
}
.tt-note__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.tt-note__meta .ms {
  font-size: 17px;
  color: var(--prio-high);
  cursor: pointer;
}
.tt-note__content {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Zeiterfassung ---------- */
.tt-running {
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(79, 155, 74, 0.12);
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 12px;
}
.tt-running .ms { font-size: 21px; color: var(--accent); }
.tt-running__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tt-running__title { font-size: 13px; font-weight: 600; }
.tt-running__user { font-size: 11px; color: var(--muted); }
.tt-running__elapsed {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}
.tt-timesum {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 9px;
}
.tt-timesum__value { font-size: 12px; color: var(--text-2); }
.tt-time-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}
.tt-time-entry__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tt-time-entry__when { font-size: 13px; }
.tt-time-entry__who { font-size: 11px; color: var(--muted); }
.tt-time-entry__duration {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-2);
}
.tt-time-entry__duration.is-over { color: var(--prio-mid); }

/* ---------- Hinweisbox ---------- */
.tt-hint {
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.tt-hint--spaced { margin-top: 14px; }

/* ---------- Gestrichelter "Hinzufügen"-Button ---------- */
.tt-dashed {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

/* ---------- Leerer Zustand mit Logo ---------- */
.tt-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px var(--screen-pad-x);
  text-align: center;
}
.tt-empty__logo { opacity: 0.75; }
.tt-empty__logo .tt-logo { width: 64px; height: 64px; display: block; border-radius: 16px; }
.tt-empty__title { font-size: 16px; font-weight: 600; }
.tt-empty__text { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------- Listen-Picker (Kategorie-Baum) ---------- */
.picker-item__count {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.picker-item__flag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  flex-shrink: 0;
}

/* ---------- Detail-Kopf: Bearbeiten + Löschen exakt auf einer Linie ---------- */
.detail-top a,
.detail-top button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.detail-top a .ms,
.detail-top button .ms {
  font-size: 22px;
  line-height: 1;
}

/* ---------- Wisch-Gesten in der Aufgabenliste ---------- */
.tt-swipe {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
.tt-swipe__bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  opacity: 0;
  pointer-events: none;
}
/* Nach rechts wischen = erledigen (Hinweis links) */
.tt-swipe__bg--done {
  justify-content: flex-start;
  background: rgba(79, 155, 74, 0.14);
}
/* Nach links wischen = verschieben (Hinweis rechts) */
.tt-swipe__bg--defer {
  justify-content: flex-end;
  background: rgba(198, 122, 46, 0.14);
}
.tt-swipe__bg--defer .ms { font-size: 22px; color: var(--prio-mid); }
.tt-swipe__label {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  color: var(--prio-mid);
  white-space: nowrap;
}
.tt-swipe__label-title {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}
.tt-swipe__label-amount { font-size: 13px; font-weight: 700; }
.tt-swipe__label-day { font-size: 11.5px; opacity: 0.85; }
.tt-swipe__row {
  position: relative;
  background: var(--bg-screen);
  will-change: transform;
  /* beim Wischen darf kein Text markiert werden */
  user-select: none;
  -webkit-user-select: none;
}
.tt-swipe__row.is-animating { transition: transform 0.22s ease; }

/* Kreis, der sich beim Wischen schließt */
.tt-swipe__ring { width: 30px; height: 30px; flex: none; display: block; }
.tt-swipe__ring circle { fill: none; stroke-width: 3; stroke-linecap: round; }
.tt-swipe__ring .track { stroke: rgba(255, 255, 255, 0.14); }
.tt-swipe__ring .bar {
  stroke: var(--accent);
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.05s linear;
}
.tt-swipe__check {
  position: absolute;
  left: 20px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.tt-swipe__check .ms { font-size: 19px; color: var(--accent); }
.tt-swipe__bg--done.is-armed .tt-swipe__check { opacity: 1; transform: scale(1); }
.tt-swipe__bg--done.is-armed .tt-swipe__ring { opacity: 0.25; }

/* Ortsgebunden gesperrte Aufgabe: Schloss statt grünem Haken */
.tt-swipe__bg--done.is-qr-locked { background: rgba(255, 255, 255, 0.06); }
.tt-swipe__bg--done.is-qr-locked .tt-swipe__ring .bar { stroke: var(--muted); }
.tt-swipe__bg--done.is-qr-locked .tt-swipe__check .ms { color: var(--muted); }

/* Stufenanzeige beim Verschieben */
.tt-swipe__steps { display: flex; gap: 6px; }
.tt-swipe__step {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.tt-swipe__step.is-on { background: var(--prio-mid); border-color: var(--prio-mid); }

/* ---------- Listen & Vorlagen ---------- */
.tt-list-row-actions { display: flex; align-items: center; gap: 4px; }
/* Untertitel einer Liste — klein unter ihrem Namen */
.tt-list-sub {
  font-size: 11px;
  margin-top: 1px;
  color: var(--subtitle);
}
.tt-template-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Aufgaben als klar getrennte Karten ---------- */
.tt-swipe {
  border-radius: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.tt-swipe .tt-swipe__row {
  background: var(--bg-card);
  border-radius: 14px;
  border-bottom: 0;
  padding: 14px 16px;
  gap: 12px;
}
.tt-swipe .tt-swipe__row:last-of-type { border-bottom: 0; }

.tt-task .row__title { line-height: 1.35; }
/* Lange Aufgaben-Titel brechen auf eine zweite Zeile um, erst danach … */
.tt-task .row__title {
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.tt-task .row__subtitle { margin-top: 3px; }

/* Erledigte Karten treten zurück */
.tt-swipe:has(.tt-row-done) { background: var(--bg-elevated); }
.tt-swipe .tt-row-done { background: var(--bg-elevated); }

/* ---------- Zeilen-Aktionen (Icon-Buttons rechts in einer Zeile) ---------- */
.row-action {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.row-action:active { background: rgba(255, 255, 255, 0.06); }
.row-action .ms { font-size: 18px; }
.row-action.is-danger { color: var(--danger); }

/* ---------- Vorlagen-Positionen: sortieren + bearbeiten ---------- */
.tt-tplitem { gap: 8px; }
.tt-tplitem__order {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: none;
}
.tt-tplitem__order .row-action { padding: 0; height: 18px; }
.tt-tplitem__order .ms { font-size: 18px; }
.row-action.is-disabled { opacity: 0.25; pointer-events: none; }

/* ---------- Bottom-Nav: gleich breite Zellen, FAB exakt mittig ---------- */
.bottomnav { justify-content: space-between; padding: 0 6px; }
.bottomnav__item,
.bottomnav__fab {
  flex: 1 1 0;
  min-width: 0;
  padding-inline-start: 0;
  padding-inline-end: 0;
}
.bottomnav__item > span:last-child,
.bottomnav__fab > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Drawer öffnet von rechts ---------- */
.drawer {
  left: auto;
  right: 0;
  transform: translateX(100%);
}
.drawer.is-open { transform: translateX(0); }

/* ---------- Löschen-Button in der Sheet-Aktionsleiste (links) ---------- */
.btn--delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  padding-inline-start: 14px;
  padding-inline-end: 14px;
  background: transparent;
  border: 1px solid rgba(192, 85, 47, 0.45);
  color: var(--danger);
}
.btn--delete .ms { font-size: 18px; }
.btn--delete:active { background: rgba(192, 85, 47, 0.12); }

/* ---------- Laufende Zeiterfassung: Kopfzeile + Badge ---------- */
.runningbar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 46%;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(79, 155, 74, 0.16);
  border: 1px solid rgba(79, 155, 74, 0.4);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.runningbar[hidden] { display: none; }
/* Fest am oberen Rand und ueber dem Inhalt — sie braucht keine eigene Zeile,
   deshalb bekommt der Screen auch keinen Zusatzabstand mehr. */
.runningbar--fixed {
  position: fixed;
  top: calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 2px);
  left: 50%;
  transform: translateX(-50%);
  max-width: none;
  padding: 1px 10px;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
}
.runningbar__dots { display: inline-flex; align-items: center; gap: 3px; }

/* Zwei gestrichelte Knoepfe nebeneinander */
.tt-dashed-pair { display: flex; gap: 8px; margin-top: 4px; }
.tt-dashed-pair > .tt-dashed { flex: 1; margin: 0; }

/* Ein Formular ueber einem anderen (openSheet mit stack: true) */
.sheet-overlay.is-stacked { z-index: 90; }
.sheet.is-stacked { z-index: 91; }

/* Eigenes Farbraster — statt des Systemdialogs */
.tt-colorgrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
}
.tt-colorgrid__dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
/* Viele Farben auf einmal (Instanz-Kuerzel): enger und in mehr Spalten */
.tt-colorgrid--dense {
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}
.tt-colorgrid--dense .tt-colorgrid__dot { border-width: 1px; border-radius: 6px; }
.tt-colorgrid--dense .tt-colorgrid__dot .ms { font-size: 13px; }

/* Regler fuer die Deckkraft */
.tt-alpha-range {
  flex: 1;
  accent-color: var(--accent);
}

.tt-colorgrid__dot:active { transform: scale(0.92); }
.tt-colorgrid__dot.is-on {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg-elevated) inset;
}
.tt-colorgrid__dot .ms {
  font-size: 17px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ---------- Tags ---------- */
.tt-tagfield { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tt-tagchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.tt-tagchip__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tt-tagchip__x {
  display: inline-flex;
  padding: 0;
  margin-inline-end: -3px;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
}
.tt-tagchip__x .ms { font-size: 14px; }
/* Auf der Karte laufen sie neben dem Status */
.tt-task__tags { display: inline-flex; flex-wrap: wrap; gap: 4px; min-width: 0; }

/* ---------- Freigabe ---------- */
.tt-approval-who { margin-top: 9px; }
.tt-approvalbox {
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid var(--prio-mid);
  border-radius: var(--radius-card);
  background: rgba(198, 122, 46, 0.12);
}
.tt-approvalbox.is-rejected {
  border-color: var(--prio-high);
  background: rgba(192, 85, 47, 0.12);
}
.tt-approvalbox__head { display: flex; align-items: flex-start; gap: 10px; }
.tt-approvalbox__head .ms { font-size: 21px; color: var(--prio-mid); flex: none; }
.tt-approvalbox.is-rejected .tt-approvalbox__head .ms { color: var(--prio-high); }
.tt-approvalbox__title { font-size: 14px; font-weight: 700; }
.tt-approvalbox__meta { margin-top: 2px; font-size: 12px; color: var(--text-2); }
.tt-approvalbox__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.tt-approvalbox__actions > .btn { flex: 1; }

/* ---------- Kalender ---------- */
.tt-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.tt-cal__month { font-size: 15px; font-weight: 700; }
.tt-cal__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.tt-cal__wds {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 5px;
}
.tt-cal__wd {
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.tt-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.tt-cal__day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 46px;
  padding: 6px 2px 5px;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tt-cal__day.is-other { opacity: 0.35; }
.tt-cal__day.is-today { border-color: var(--accent); }
.tt-cal__day.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tt-cal__num { font-size: 13px; font-weight: 600; line-height: 1; }
.tt-cal__dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.tt-cal__dot { width: 5px; height: 5px; border-radius: 50%; }
.tt-cal__dot.is-done { opacity: 0.35; }
.tt-cal__more { font-size: 9px; color: var(--muted); line-height: 1; }
.tt-cal__day.is-active .tt-cal__more { color: rgba(255, 255, 255, 0.8); }

/* ---------- Smart Lists ---------- */
.tt-smartquery > .field { margin-bottom: 11px; }
.tt-smartquery > .field:last-child { margin-bottom: 0; }

/* Knopf rechts in der Suchleiste — oeffnet die Einschraenkungen */
.searchbar__action {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin: -4px -4px -4px 0;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.searchbar__action:active { background: var(--border-strong); color: var(--accent); }
.searchbar__action .ms { font-size: 19px; }

/* Vorschlaege beim Tippen einer neuen Aufgabe: Kuerzel links, Bedeutung
   rechts. Sitzt im selben Kasten wie die @-Auswahl. */
.tt-smartac__key {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--accent);
}
.tt-smartac__hint {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- Gespräch ---------- */
/* Ein Verlauf, keine Kartenliste: jeder Beitrag steht fuer sich, das Bild
   des Verfassers links davon. Eigene Beitraege sind eingerueckt und leicht
   eingefaerbt — mehr Unterschied braucht es nicht. */
.tt-talk { display: flex; flex-direction: column; }
.tt-talk__list { display: flex; flex-direction: column; gap: 12px; }

.tt-talk__row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.tt-talk__row.is-mine { flex-direction: row-reverse; }

.tt-talk__avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--border-strong);
}
.tt-talk__avatar--text {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.tt-talk__body {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 88%;
  padding: 9px 11px;
  border: 1px solid var(--hairline);
  border-radius: 13px;
  background: transparent;
}
.is-mine .tt-talk__body {
  border-color: var(--border-focus);
  background: var(--tint-accent);
}

.tt-talk__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.tt-talk__name { font-size: 12.5px; font-weight: 650; color: var(--text); }
.tt-talk__time { font-size: 11px; color: var(--muted); }

.tt-talk__text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Nur Emojis? Dann sprechen die Zeichen selbst — gross und ohne Drumherum */
.tt-talk__text--big {
  font-size: 34px;
  line-height: 1.15;
}

/* Worauf sich eine Antwort bezieht */
.tt-talk__quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 6px;
  padding: 5px 8px;
  border-inline-start: 2px solid var(--accent);
  border-radius: 0 7px 7px 0;
  background: rgba(255, 255, 255, 0.03);
}
.tt-talk__quote-name { font-size: 11px; font-weight: 650; color: var(--accent); }
.tt-talk__quote-text { font-size: 11.5px; color: var(--muted); }

/* Anhaenge */
.tt-talk__files {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.tt-talk__image {
  max-width: 190px;
  max-height: 190px;
  border-radius: 10px;
  cursor: pointer;
}
.tt-talk__file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.tt-talk__file .ms { font-size: 16px; color: var(--muted); }

/* ---------- Emojis ---------- */
/* Eine Schriftart und eine Groesse fuer alle Zeichen — sonst sieht dasselbe
   Emoji in der Auswahl anders aus als im Beitrag. Die Systemschriften stehen
   vorn, damit Windows, Android und iOS jeweils ihre eigene Fassung zeigen. */
.tt-emoji-char,
.tt-emoji__item {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji',
               'Android Emoji', sans-serif;
  font-size: 17px;
  line-height: 1.15;
  font-variant-emoji: emoji;
}

/* Die Auswahl selbst */
.tt-emoji { display: flex; flex-direction: column; gap: 9px; }
.tt-emoji__search { margin: 0; }

.tt-emoji__tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--hairline);
  scrollbar-width: none;
}
.tt-emoji__tabs::-webkit-scrollbar { display: none; }

.tt-emoji__tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tt-emoji__tab.is-on { border-bottom-color: var(--accent); color: var(--accent); }
.tt-emoji__tab .ms { font-size: 19px; }

.tt-emoji__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 2px;
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.tt-emoji__item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}
.tt-emoji__item:active { background: var(--border-strong); }

/* Reaktionen — kurze Antwort ohne Beitrag */
.tt-talk__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.tt-talk__reaction {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  line-height: 1.4;
  cursor: pointer;
}
.tt-talk__reaction.is-mine {
  border-color: var(--border-focus);
  background: var(--tint-accent);
}
.tt-talk__reaction:active { background: var(--border-strong); }
.tt-talk__reaction-emoji { font-size: 13px; }
.tt-talk__reaction-count { font-size: 11px; color: var(--muted); }
.tt-talk__reaction.is-mine .tt-talk__reaction-count { color: var(--accent); }
.tt-talk__reaction--add { padding: 3px 7px; color: var(--muted); }
.tt-talk__reaction--add .ms { font-size: 16px; }

/* Vorschlaege: noch niemand hat so reagiert — deshalb zurueckhaltender */
.tt-talk__reaction--quick {
  border-style: dashed;
  border-color: var(--hairline);
  opacity: 0.65;
}
.tt-talk__reaction--quick:active { opacity: 1; }

/* Eingabe */
.tt-talk__footer {
  position: sticky;
  bottom: 0;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  background: var(--bg-screen);
}
/* Im Sheet einer Notiz passt sich die Eingabe dem helleren Sheet an —
   sonst wirkt der Bereich wie ein dunkles Loch */
.picker-sheet .tt-talk__footer,
.sheet .tt-talk__footer { background: var(--bg-elevated); }
.tt-talk__input { display: flex; flex-direction: column; gap: 7px; }
.tt-talk__input .field { margin-bottom: 0; }

.tt-talk__buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tt-talk__attach,
.tt-talk__send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tt-talk__attach:active { background: var(--border-strong); }
.tt-talk__send {
  margin-inline-start: auto;
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}
.tt-talk__attach .ms, .tt-talk__send .ms { font-size: 18px; }

/* „Antwort an …" / „Bearbeiten …" ueber der Eingabe */
.tt-talk__context {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  padding: 6px 9px;
  border-inline-start: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.03);
}
.tt-talk__context .ms { font-size: 16px; color: var(--accent); }
.tt-talk__context-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--muted);
}
.tt-talk__context-x {
  flex: 0 0 auto;
  display: flex;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tt-talk__context-x .ms { font-size: 16px; color: var(--muted); }

/* ---------- Hilfe ---------- */
/* Kuerzel links, Erklaerung rechts. Die Kuerzel stehen in fester Breite
   nebeneinander, damit die Spalte beim Ueberfliegen eine Kante hat. */
.tt-help__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 22px 0 8px;
}
.tt-help__head:first-child { margin-top: 4px; }
.tt-help__icon { color: var(--accent); font-size: 21px; }
.tt-help__title { font-size: 16px; font-weight: 650; color: var(--text); }

.tt-help__intro {
  margin-bottom: 11px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}

.tt-help__example {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-input);
  background: var(--tint-accent);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  overflow-x: auto;
  white-space: nowrap;
}

.tt-help__table {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.tt-help__row {
  display: flex;
  gap: 11px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
}
.tt-help__row:last-child { border-bottom: 0; }

.tt-help__key {
  flex: 0 0 128px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
}
.tt-help__desc {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
}

.tt-help__notes {
  margin: 10px 0 0;
  padding-inline-start: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.tt-help__notes li { margin-bottom: 5px; }

/* Schmale Geraete: das Kuerzel bekommt eine eigene Zeile */
@media (max-width: 360px) {
  .tt-help__row { flex-direction: column; gap: 3px; }
  .tt-help__key { flex: 0 0 auto; }
}

/* Eine einzelne Bedingung — jede wird fuer sich hinzugefuegt und kann
   fuer sich wieder weg. Der Rahmen haelt Beschriftung und Wert zusammen,
   damit man bei mehreren sieht, was zusammengehoert. */
.tt-crit {
  padding: 9px 11px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: transparent;
}
.tt-crit__del {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tt-crit__del:active { background: var(--border-strong); }
.tt-crit__del .ms { font-size: 17px; }

.tt-crit__empty {
  padding: 13px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* Der Knopf, der die Auswahl oeffnet */
.tt-addcrit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin: 11px 0 0;
  padding: 11px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tt-addcrit:active { background: var(--border-strong); }
.tt-addcrit .ms { font-size: 19px; }

/* Aufgenommene Karte zur Seite geschoben: was passiert beim Loslassen.
   Der Hinweis haengt am Dokument, nicht an der Karte — er bleibt stehen,
   waehrend die Karte unter ihm wegwandert. */
.tt-dragaction {
  position: fixed;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 8px;
  /* Beide Hinweise gleich breit — sonst springt die Groesse je nach Text */
  width: min(146px, 44vw);
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.22s cubic-bezier(0.2, 1.1, 0.35, 1.2),
              border-color 0.18s ease, background 0.18s ease;
  pointer-events: none;
}
/* Sie kleben am Rand — nur die Innenseite ist gerundet */
.tt-dragaction.is-left {
  left: 0;
  border-inline-start: 0;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  transform: translate(-12px, -50%) scale(0.94);
}
.tt-dragaction.is-right {
  right: 0;
  border-inline-end: 0;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  transform: translate(12px, -50%) scale(0.94);
}
.tt-dragaction.is-open.is-left  { opacity: 1; transform: translate(0, -50%) scale(1); }
.tt-dragaction.is-open.is-right { opacity: 1; transform: translate(0, -50%) scale(1); }

/* Der Ring traegt das Symbol — gedaempft, solange die Strecke nicht reicht */
.tt-dragaction__ring {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px dashed var(--border-strong);
  color: var(--muted);
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.tt-dragaction__ring .ms { font-size: 16px; }

.tt-dragaction__body { display: flex; flex-direction: column; min-width: 0; }
.tt-dragaction__title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.tt-dragaction__hint {
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Ab der Schwelle: es zaehlt */
.tt-dragaction.is-armed {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-elevated));
}
.tt-dragaction.is-armed .tt-dragaction__ring {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  animation: tt-dragaction-pulse 1.1s ease-in-out infinite;
}
.tt-dragaction.is-armed .tt-dragaction__hint { color: var(--accent); }

@keyframes tt-dragaction-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 155, 74, 0.45); }
  50%      { box-shadow: 0 0 0 5px rgba(79, 155, 74, 0); }
}

/* Abhaengigkeiten: erfuellte Vorgaenger treten zurueck */
.tt-deprow.is-met { opacity: 0.6; }
.tt-deprow.is-met .row__title { text-decoration: line-through; }

/* Faellige Erinnerung — Hinweis am oberen Rand, fuehrt zur Aufgabe */
.tt-reminder {
  position: fixed;
  /* Unterhalb der Zeit-Pille, damit beide nebeneinander bestehen */
  top: calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 36px);
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 9px 8px 9px 13px;
  border-radius: var(--radius-pill);
  background: var(--prio-mid, #c67a2e);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.tt-reminder.is-open { opacity: 1; transform: translateX(-50%) translateY(0); }
.tt-reminder .ms { font-size: 19px; flex: none; }
.tt-reminder__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tt-reminder__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: 0.8;
  cursor: pointer;
}
.tt-reminder__close .ms { font-size: 17px; }

/* Pfad der geoeffneten Liste, klein unter ihrem Untertitel */
.screen__path { font-size: 11px; color: var(--muted); margin-top: 1px; }
/* Im Detail steht der Pfad zwischen Ueberschrift und Status */
.detail-titleblock .screen__path { margin: 3px 0 0; }

/* Verweis-Tag auf der Aufgaben-Kachel sass minimal zu hoch */
.row__title .tt-refchip { vertical-align: -1px; }

/* Im Eingabefeld sass das Tag dagegen 1px zu hoch */
.tt-var-editor .tt-varchip { vertical-align: -1px; }

/* Herkunft einer laufenden Erfassung: Liste und Projekt */
.tt-running__origin {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}
.tt-running__origin .ms { font-size: 13px; }
/* Quadrat in der Farbe der Liste — wie der Punkt bei der Prioritaet */
.runningbar__dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--muted);
  flex: none;
}
/* Die KI arbeitet an dieser Aufgabe — deutlich leuchtend, nicht als Schatten */
.runningbar__dot.is-ai {
  box-shadow:
    0 0 0 2px rgba(166, 120, 196, 1),
    0 0 6px 2px rgba(186, 140, 220, 0.95),
    0 0 12px 4px rgba(166, 120, 196, 0.6);
}
.runningbar .ms { font-size: 17px; }
.runningbar__label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.runningbar__time {
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  font-weight: 700;
}

.bottomnav__icon { position: relative; display: inline-flex; }
.bottomnav__badge {
  position: absolute;
  top: -5px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Erledigte Karten reagieren nicht auf Wischgesten */
.tt-swipe.is-locked { touch-action: auto; }

/* Kopf als Bezug für die mittig sitzende Zeit-Pille */
.apphdr, .detail-top { position: relative; }

/* ---------- Aufgaben-Karte: Icon, Marker, Abstand rechts ---------- */
.tt-swipe .tt-swipe__row { padding-inline-end: 20px; }
.tt-task__icon {
  font-size: 21px;
  color: var(--text-2);
  flex: none;
}
.tt-task__right {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}
/* Alle Merkmal-Symbole der Karte sind gleich gross; die Farbe setzt
   taskFlags() je Merkmal (dieselbe Quelle wie am Desktop). */
.tt-task__flag {
  font-size: 16px;
}

/* Icon- und Farbfeld im Formular */
.tt-iconfield__preview {
  font-size: 20px;
  color: var(--text-2);
  flex: none;
}
.tt-colordot {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  flex: none;
  border: 1px solid var(--border-strong);
}

/* ---------- Listenfarbe an der Aufgaben-Karte ---------- */
.tt-swipe--colored { border-inline-start: 3px solid var(--list-color); }

/* ---------- Drag & Drop im Sortiermodus ---------- */
.tt-swipe.is-dragging {
  position: relative;
  z-index: 5;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  border-color: var(--accent);
  opacity: 0.96;
}
/* Aufgenommen gehoert die Bewegung dem Ziehen — der Wisch-Hintergrund
   (Erledigen/Verschieben) bleibt dabei unsichtbar und die Zeile in Ruhe. */
.tt-swipe.is-dragging .tt-swipe__bg { opacity: 0 !important; }
.tt-swipe.is-dragging .tt-swipe__row { transform: none !important; }

/* Vorlagen in der Listenstruktur */
.tt-tree-parent { opacity: 0.85; }
.tt-tree-header { margin: 16px 0 6px; }

/* ---------- Erledigt-Schalter im Detail ---------- */
.tt-donerow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
}
.tt-donerow.is-done {
  background: rgba(79, 155, 74, 0.12);
  border-color: rgba(79, 155, 74, 0.4);
}
.tt-donerow__icon { font-size: 24px; color: var(--muted); flex: none; }
.tt-donerow.is-done .tt-donerow__icon { color: var(--accent); }
.tt-donerow__body { flex: 1; min-width: 0; }
.tt-donerow__label { font-size: 14px; font-weight: 600; }
.tt-donerow__meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
/* Startzeit-Sperre: der Schalter bleibt sichtbar, wirkt aber gesperrt */
.tt-donerow.is-locked { opacity: 0.65; }

.tt-toggle {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  flex: none;
  position: relative;
  transition: background 0.15s ease;
}
.tt-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.15s ease, background 0.15s ease;
}
.tt-toggle.is-on { background: rgba(79, 155, 74, 0.45); }
.tt-toggle.is-on .tt-toggle__knob { transform: translateX(18px); background: var(--accent); }

/* Griff zum Sortieren */
.tt-draghandle {
  font-size: 22px;
  color: var(--muted);
  flex: none;
  cursor: grab;
  touch-action: none;
  padding: 4px 2px;
}

/* ---------- Liste teilen: Zugriffsliste ---------- */
.tt-share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.tt-share-row:last-child { border-bottom: 0; }
.tt-share-row__icon {
  font-size: 20px;
  color: var(--muted);
  flex: none;
}
.tt-share-row__main { flex: 1; min-width: 0; }
.tt-share-row__name {
  font-size: 13px;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tt-share-seg { display: flex; gap: 6px; }
.tt-share-seg .chipset__chip { padding: 4px 10px; font-size: 11.5px; }
.tt-share-seg .chipset__chip.is-selected {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* ---------- Projekte ---------- */
.tt-task--project .row__title { font-weight: 700; }
.tt-task--project .tt-task__icon { color: var(--accent); }

.tt-note-card { margin-bottom: 12px; }
.tt-note-card__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.tt-note-card__icon { font-size: 20px; color: var(--accent); flex: none; }
.tt-note-card__title { font-size: 14px; font-weight: 600; }
.tt-note-card__meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tt-note-card__body {
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Rich-Text bringt seine Umbrueche im Markup mit — `pre-wrap` zaehlte sie
   ein zweites Mal und riss Luecken zwischen die Aufzaehlungspunkte. */
.tt-note-card__body.tt-richtext { white-space: normal; }

/* Klappbare Notiz: die Kopfzeile mit Titel und Datum bleibt stehen */
.tt-note-card__head.is-foldable { cursor: pointer; }

/* Das Datum rechts im Kopf — zugeklappt die wichtigste Angabe neben dem
   Titel, deshalb nicht in der Meta-Zeile versteckt */
.tt-note-card__date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

/* Fundstelle der Notiz-Suche */
.tt-hit {
  background: var(--accent);
  color: var(--on-accent, #131316);
  border-radius: 3px;
  padding: 0 1px;
}
.tt-note-card__fold {
  color: var(--muted);
  font-size: 20px;
  flex-shrink: 0;
  align-self: center;
}
.tt-note-card__people { margin-top: 10px; }
.tt-note-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

/* ---------- @-Editor ---------- */
.tt-mention-wrap { position: relative; }
.tt-mention-editor {
  min-height: 110px;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-field, rgba(255, 255, 255, 0.04));
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  outline: none;
}
.tt-mention-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}
.tt-mention {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px 1px 6px;
  margin: 0 2px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  white-space: nowrap;
  background: rgba(96, 165, 250, 0.16);
  color: var(--text);
}
.tt-mention .ms { font-size: 14px; }
.tt-mention--user    { background: rgba(96, 165, 250, 0.16); }
.tt-mention--task    { background: rgba(79, 155, 74, 0.18); }
.tt-mention--project { background: rgba(198, 122, 46, 0.18); }
.tt-mention--list    { background: rgba(255, 255, 255, 0.10); }
.tt-mention--customer { background: rgba(212, 161, 58, 0.20); }

.tt-mention-popup {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  z-index: 30;
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.tt-mention-popup.is-open { display: block; }
.tt-mention-popup__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.tt-mention-popup__item:last-child { border-bottom: 0; }
.tt-mention-popup__item:active { background: rgba(255, 255, 255, 0.06); }
/* Per Pfeiltasten markierter Vorschlag (Enter übernimmt) */
.tt-mention-popup__item.is-active { background: rgba(255, 255, 255, 0.09); }
.tt-mention-popup__item .ms { font-size: 17px; color: var(--muted); }
/* Profilfoto einer Person im Vorschlag */
.tt-mention-popup__photo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Profilfoto in der Team-Mitgliederliste */
.tt-member__photo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Profilfoto vor dem Namen in einer Combo-Zeile (z. B. Verantwortlich) */
.tt-combo__photo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: -5px;
  margin-inline-end: 6px;
}
.tt-mention-popup__empty { padding: 12px; font-size: 12px; color: var(--muted); }
/* Zusatz eines Treffers (z. B. Ort eines Kunden) */
.tt-mention-popup__sub { margin-inline-start: auto; font-size: 11px; color: var(--muted); }
/* Herkunfts-Instanz eines CRM-Treffers — steht vor dem Namen */
.tt-mention-popup__inst {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(126, 189, 245, 0.22);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Textfeld mit Variablen-Tags (Vorlagen) ---------- */
.tt-var-editor {
  min-height: 96px;
  max-height: 240px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-field, rgba(255, 255, 255, 0.04));
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  outline: none;
}
/* Einzeiliges Feld (Titel) — sieht aus wie ein normales Eingabefeld */
.tt-var-editor--single {
  min-height: 0;
  max-height: none;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  line-height: 1.9;
}
.tt-var-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}
.tt-var-editor:focus { border-color: var(--accent); }
.tt-var-hint { margin-top: 5px; font-size: 11px; color: var(--muted); }

.tt-varchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px 1px 6px;
  margin: 0 2px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  white-space: nowrap;
  background: rgba(166, 120, 196, 0.22);
  color: var(--text);
}
.tt-varchip .ms { font-size: 14px; }
/* Nur-Lese-Text mit Variablen-Tags (Beschreibung, Notiz) */
.tt-var-readonly { white-space: pre-wrap; font-size: 13px; line-height: 1.55; }
/* „Jetzt Aufgaben aus dieser Vorlage erstellen" am Ende des Vorlagen-Screens */
.tt-tpl-create {
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tt-tpl-create .ms { font-size: 19px; }

/* Ohne diese Regel bleibt „Abbrechen" sichtbar: .btn setzt display und
   ueberschreibt damit das hidden-Attribut. */
.sheet__actions .btn[hidden] { display: none !important; }

/* Text der Notiz in der kompakten Vorschau */
.tt-note-row__text {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
  max-height: 3.4em;
  overflow: hidden;
}
.tt-note-row__text .tt-mention { font-size: 11px; }

/* Reiter „Zeit", solange eine Erfassung laeuft */
.tab.is-running { color: var(--prio-mid, #c67a2e); font-weight: 700; }
/* Reiter mit Symbol statt Text („<>" fuer Abhaengigkeiten) */
.tab--icon { display: inline-flex; align-items: center; gap: 5px; }
.tab--icon .ms { font-size: 19px; }
.tab.is-running.is-active { border-bottom-color: var(--prio-mid, #c67a2e); }

/* Anhang-Ansicht in der App: Bild direkt, alles andere im iframe */
.tt-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.86);
  display: flex;
  flex-direction: column;
}
.tt-viewer__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #fff;
  flex: none;
}
.tt-viewer__name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-viewer__close {
  flex: none;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tt-viewer__img {
  flex: 1;
  min-height: 0;
  object-fit: contain;
  margin: 0 12px 16px;
}
.tt-viewer__frame {
  flex: 1;
  min-height: 0;
  border: 0;
  margin: 0 8px 12px;
  border-radius: 10px;
  background: #fff;
}

/* Laufende Zeiterfassung: gruen = eigene, lila = KI, Verlauf = beide */
.tt-swipe--running,
.tt-swipe--running-ai,
.tt-swipe--running-both { position: relative; }
.tt-swipe--running { border: 2px solid var(--ok, #4f9b4a) !important; }
.tt-swipe--running-ai { border: 2px solid #a678c4 !important; }
/* Beide gleichzeitig: der Rahmen laeuft von gruen nach lila */
.tt-swipe--running-both {
  border: 2px solid transparent !important;
  background-image:
    linear-gradient(var(--bg-card), var(--bg-card)),
    linear-gradient(100deg, #4f9b4a, #a678c4);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

/* Notiz-Titel sitzt sonst optisch zu hoch, der Untertitel zu tief */
.tt-task.tt-note-row .row__title { margin-top: 1px; }
.tt-note-row .row__subtitle { position: relative; top: -3px; }

/* Bearbeiten-Knoepfe in Listenzeilen etwas hoeher, damit der Untertitel
   darunter noch Platz hat */
.tt-list-row { align-items: flex-start; position: relative; }
.tt-list-row .tt-list-row-actions {
  position: absolute;
  top: 3px;
  right: 0;
  gap: 0;
}
.tt-list-row .row__main { min-width: 0; }
/* 3 Knoepfe a 34px — nur die Titelzeile weicht ihnen aus */
.tt-list-row .row__title { padding-inline-end: 106px; }
.tt-list-sub { white-space: normal; }
/* Die Inhaltszeile darf umbrechen und die volle Breite nutzen */
.tt-list-row .row__subtitle { white-space: normal; }

/* Verknuepfungs-Tag in Aufgaben (aus typisierten Vorlagen-Variablen) */
.tt-refchip { background: rgba(126, 189, 245, 0.20); }
.tt-refchip.is-link { cursor: pointer; }
/* Trennlinie zwischen zwei Abschnitten der Einstellungen */
.tt-settings-sep {
  height: 1px;
  background: var(--border);
  margin: 18px 0 14px;
}

/* Personen-Symbol als Profilfoto (Zeit-Zeilen, Freigaben, Teilnehmer …) */
.tt-photoicon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Profilfoto einer Person im Verweis-Tag */
.tt-refchip__photo {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: -3px;
}

/* CRM-Kürzel eines Verweises — kleines Etikett vor dem Namen */
.tt-refchip__inst {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(126, 189, 245, 0.28);
  margin-inline-end: 2px;
  white-space: nowrap;
}
.tt-refchip__go { font-size: 13px !important; opacity: 0.75; margin-inline-start: 1px; }
.tt-refchip.is-link:active { background: rgba(126, 189, 245, 0.34); }

/* Icon vor der Ueberschrift einer Detailseite */
.detail-titleblock__icon {
  font-size: 22px;
  color: var(--accent);
  flex: none;
  margin-inline-end: 8px;
  position: relative;
  top: 3px;
}

/* Icon der Seite, links neben der Ueberschrift */
.screen__title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.screen__titleicon { font-size: 21px; color: var(--accent); flex: none; }
.screen__title > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Feld-Kopfzeile: Beschriftung links, „+ Verknuepfung" rechts */
.field__labelrow {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  /* uebernimmt den Abstand, den sonst .field__label zum Eingabefeld haelt */
  margin-bottom: 5px;
}
.field__labelrow .field__label { margin-bottom: 0; }
.tt-reffield__add {
  margin: 0;
  padding: 4px 9px;
  font-size: 11px;
}
.tt-reffield__add .ms { font-size: 14px; }

/* Zeile einer Variablen: der Name sass optisch zu tief */
.tt-varrow .row__title { margin-top: -3px; }

/* Tag in der Überschrift der Vorlagen-Position mitskalieren */
.detail-titleblock__title .tt-varchip {
  font-size: 15px;
  vertical-align: 0;
}
.detail-titleblock__title .tt-varchip .ms { font-size: 17px; }

/* Neu erzeugte, noch unbearbeitete Aufgaben */
.tt-mention.is-link { cursor: pointer; }
.tt-mention__go { font-size: 13px !important; opacity: 0.75; margin-inline-start: 1px; }
.tt-mention.is-new { background: rgba(198, 122, 46, 0.22); }
.tt-mention__new { font-size: 13px; color: var(--prio-mid, #c67a2e); }
/* „->" im Protokoll: Aufgabe anlegen */
.tt-mention-popup__head {
  padding: 10px 12px 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tt-mention-popup__form {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}
.tt-mention-popup__input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.tt-mention-popup__input:focus { border-color: var(--accent); }
.tt-mention-popup__btn { flex: none; padding: 9px 14px; font-size: 13px; }

/* Untertitel der Aufgabenkarte: Status, Tags und Text. Passt nicht alles in
   eine Zeile, wird umgebrochen — der Titel rueckt dafuer etwas nach oben. */
.tt-task__sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 7px;
  margin-top: 4px;
  min-width: 0;
}
.tt-task__sub .row__subtitle { margin-top: 0; min-width: 0; }
.tt-task .row__title { margin-top: -2px; }
.tt-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  max-width: 46%;
  padding: 2px 8px 2px 6px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-tag .ms { font-size: 13px; flex: none; }
.tt-tag--project {
  background: rgba(96, 165, 250, 0.16);
  color: var(--text-2);
}
/* Der Status ist kurz — er wird nicht auf 46% gekappt wie die Verweis-Tags.
   Diese Regel muss NACH `.tt-tag` stehen, sonst gewinnt dort max-width. */
.tt-tag--status {
  padding: 2px 9px;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

/* Struktur-Tag: in welcher Liste die Aufgabe steckt */
.tt-tag--list {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

/* ---------- Rückfrage über einem Sheet ---------- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.confirm-overlay.is-open { opacity: 1; }
.confirm {
  position: fixed;
  z-index: 121;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%) scale(0.98);
  width: min(340px, calc(100vw - 48px));
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.confirm.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.confirm__title { font-size: 16px; font-weight: 700; text-align: center; }
.confirm__text {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
.confirm__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}
/* Alle drei Knöpfe gleich groß — auch der mit Rahmen */
.confirm__actions .btn {
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
  min-height: 46px;
  padding: 12px 16px;
  border: 1px solid transparent;
}

/* ---------- Anhänge an Notizen ---------- */
.tt-file-list { margin-top: 10px; }
.tt-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
}
.tt-file__thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  background: rgba(255, 255, 255, 0.06);
}
.tt-file__icon { font-size: 24px; color: var(--muted); flex: none; width: 44px; text-align: center; }
.tt-file__body { flex: 1; min-width: 0; }
.tt-file__name {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tt-file__meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tt-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ---------- QR ---------- */
.tt-scanner {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 60vh;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}
.tt-scanner__video { width: 100%; height: 100%; object-fit: cover; }
.tt-scanner__frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 62%;
  aspect-ratio: 1;
  border: 2px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
}
.tt-scanner__hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
  font-size: 12.5px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  padding: 0 16px;
}
.tt-scanner.is-unavailable { aspect-ratio: auto; min-height: 120px; }

.tt-scan-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--accent);
  background: rgba(79, 155, 74, 0.10);
}
.tt-scan-result .ms { font-size: 24px; color: var(--accent); }
.tt-scan-result__title { font-size: 14px; font-weight: 700; }
.tt-scan-result__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tt-scan-done { padding: 8px 14px; font-size: 12.5px; flex: none; }

.tt-qr-print { text-align: center; padding: 8px 0; }
.tt-qr-print__img {
  width: min(260px, 70vw);
  height: auto;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
}
.tt-qr-print__name { margin-top: 12px; font-size: 15px; font-weight: 700; }

.tt-qr-lock {
  text-align: center;
  padding: 34px 20px;
}
.tt-qr-lock__icon { font-size: 42px; color: var(--muted); }
.tt-qr-lock__title { margin-top: 12px; font-size: 15px; font-weight: 700; }
.tt-qr-lock__text {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* Projekt im Listen-Baum */
.tt-tree-project .row__title { font-weight: 700; }
.tt-tree-project { background: rgba(255, 255, 255, 0.02); }

/* Scannen-Knopf auf der Sperrseite — gut treffbar */
.tt-qr-lock__btn {
  margin-top: 20px;
  width: 100%;
  max-width: 320px;
  min-height: 52px;
  font-size: 15px;
  justify-content: center;
}

/* ---------- Benachrichtigungen ---------- */
.navitem__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-inline-start: auto;
  border-radius: 99px;
  background: var(--danger, #c0552f);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tt-notif__icon { font-size: 20px; color: var(--muted); flex: none; }
.tt-notif.is-unread .tt-notif__icon { color: var(--accent); }
.tt-notif.is-unread .row__title { font-weight: 800; }
.tt-notif__time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.tt-notif__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger, #c0552f);
  flex: none;
}
.bottomnav__badge.is-alert { background: var(--danger, #c0552f); color: #fff; }

/* ---------- Freie Notizen ---------- */
.tt-note-row__icon { color: var(--prio-mid, #c67a2e); margin-inline-start: 4px; }
.tt-note-row { padding-inline-start: 4px; }
.tt-swipe:has(.tt-note-row) { border-style: dashed; }

/* Wischziele am FAB: vier runde Ziele im Halbkreis über dem Knopf */
.fabhint {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}
/* Der Screen tritt zurück, je weiter gewischt wurde (--fab-progress 0…1) */
.fabhint__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  opacity: var(--fab-progress, 0);
}
.fabhint__opt {
  position: absolute;
  transform: translate(-50%, -50%);
  transition: opacity 0.08s linear;
  will-change: transform, opacity;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 76px;
  text-align: center;
}
.fabhint__circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.fabhint__circle { position: relative; }
.fabhint__circle > .ms { font-size: 26px; }
/* Plus an jedem Ziel */
.fabhint__plus {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}
.fabhint__opt.is-active .fabhint__plus {
  background: var(--on-accent);
  color: var(--accent);
}
.fabhint__label {
  font-size: 10px;
  color: var(--text-2);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.fabhint__opt.is-active .fabhint__circle {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.fabhint__opt.is-active .fabhint__label { color: var(--accent); font-weight: 700; }

/* ---------- Abonnement: aktive Glocke ---------- */
.tt-bell { color: var(--text-2); }
.tt-bell.is-on,
.tt-bell.is-on .ms { color: var(--bell, #e8c14a); }
.tt-task__bell { font-size: 16px; color: var(--bell, #e8c14a); }

/* Gespräch an der Karte: Sprechblase mit der Zahl der Beiträge */
.tt-task__talk {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.tt-task__talk .ms { font-size: 15px; }

/* Listen-Überschrift mit Symbol (Projekte-Seite) */
.tt-tree-header__icon {
  font-size: 15px;
  margin-inline-end: 5px;
  vertical-align: -2px;
  color: var(--accent);
}

/* ---------- Ziehen zum Neuladen ---------- */
/* Der Zeiger haengt am oberen Rand und wird vom Finger mitgezogen: --pull
   ist der zurueckgelegte Weg. Er liegt ueber allem, faengt aber keine
   Klicks ab. */
.pull-refresh {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  color: var(--muted);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-44px);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.pull-refresh .ms { font-size: 19px; }

/* Waehrend gezogen wird, folgt der Zeiger ohne Uebergang dem Finger */
.pull-refresh.is-pulling {
  opacity: 1;
  transform: translateY(calc(var(--pull, 0px) + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) - 34px));
  transition: none;
}
/* Weit genug gezogen: loslassen laedt neu */
.pull-refresh.is-ready {
  color: var(--accent);
  border-color: var(--accent);
}
.pull-refresh.is-ready .ms { transform: rotate(180deg); }
.pull-refresh .ms { transition: transform 0.2s ease; }

.pull-refresh.is-loading {
  opacity: 1;
  transform: translateY(calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 12px));
  color: var(--accent);
  border-color: var(--accent);
}
.pull-refresh.is-loading .ms { animation: pull-spin 0.9s linear infinite; }

@keyframes pull-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pull-refresh.is-loading .ms { animation: none; }
}

/* Klappbare Kopfzeile: Pfeil, Symbol, Name und Zahl stehen nebeneinander.
   Der Name kommt als eigener Block (buildReferenceText) und wuerde sonst
   umbrechen. Die Basis-Klasse bleibt unberuehrt — sie traegt auch die
   Kopfzeilen im Listen-Screen. */
.tt-tree-header--fold {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}
.tt-tree-header--fold > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Pfeil zum Auf- und Zuklappen einer Liste in der Projekt-Uebersicht.
   Er sitzt VOR dem Listensymbol und ist ein eigener Knopf — der Rest der
   Zeile fuehrt weiter in die Liste. */
.tt-tree-header__toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin-inline-end: 4px;
  vertical-align: -3px;
  line-height: 1;
}
.tt-tree-header__toggle .ms { font-size: 17px; }
.tt-tree-header__toggle:hover { color: var(--text-2); }

/* Zugeklappt: wie viele Projekte darin stecken */
.tt-tree-header__count {
  margin-inline-start: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2, rgba(255, 255, 255, 0.08));
  color: var(--muted);
  font-size: 11px;
}

/* ---------- Zeit: Auswertung ---------- */
.tt-stats { display: flex; gap: 8px; }
.tt-stat {
  flex: 1;
  min-width: 0;
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center;
}
.tt-stat.is-strong { border-color: var(--accent); background: rgba(79, 155, 74, 0.10); }
.tt-stat__value { font-size: 16px; font-weight: 700; }
.tt-stat.is-strong .tt-stat__value { color: var(--accent); }
.tt-stat__label { font-size: 10.5px; color: var(--muted); margin-top: 3px; }

.tt-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 108px;
  padding: 6px 0 0;
}
.tt-chart__col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.tt-chart__barwrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.tt-chart__bar {
  width: 100%;
  border-radius: 4px 4px 2px 2px;
  background: var(--accent);
  min-height: 3px;
}
.tt-chart__bar.is-empty { background: rgba(255, 255, 255, 0.10); }
.tt-chart__col.is-today .tt-chart__bar { background: var(--bell, #e8c14a); }
.tt-chart__day { font-size: 9.5px; color: var(--muted); margin-top: 5px; }
.tt-chart__col.is-today .tt-chart__day { color: var(--bell, #e8c14a); font-weight: 700; }

.tt-toprow { padding: 9px 0; border-bottom: 1px solid var(--border); }
.tt-toprow:last-child { border-bottom: 0; }
.tt-toprow__head { display: flex; align-items: center; gap: 9px; }
.tt-toprow__icon { font-size: 18px; color: var(--muted); flex: none; }
.tt-toprow__main { flex: 1; min-width: 0; }
.tt-toprow__title {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tt-toprow__meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tt-toprow__value { font-size: 12.5px; font-weight: 700; flex: none; }
.tt-toprow__value.is-over { color: var(--prio-high, #c0552f); }
.tt-toprow__track {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  margin-top: 7px;
  overflow: hidden;
}
.tt-toprow__fill { height: 100%; border-radius: 99px; background: var(--accent); }
.tt-toprow__fill.is-over { background: var(--prio-high, #c0552f); }
.tt-time-entry__icon { font-size: 18px; color: var(--muted); flex: none; margin-inline-end: 8px; }

/* ---------- Zeit-Analyse ---------- */
.tt-an-chips { margin: 10px 0 0; }
.tt-an-nav { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; }
.tt-an-nav__label {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.tt-an-nav__range { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.tt-an-nav__range .tt-an-date { flex: 1; min-width: 0; }
.tt-an-date { max-width: 180px; padding: 6px 8px; font-size: 13px; }
.tt-an-who { margin: 10px 0 0; justify-content: flex-start; }
.tt-an-group { cursor: pointer; }
.tt-an-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tt-an-filters .tt-an-who { margin: 0; min-width: 0; }
.tt-an-filters .field__combo-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-an-who.is-set { border-color: var(--accent); }

/* ---------- Zeit-Auswertung: Dashboard ---------- */
/* Kategorie-Farben für dunkle Flächen (geprüft: CVD, Kontrast) */
.tt-dash__grid, .tt-donut {
  --tt-s1: #3987e5;
  --tt-s2: #d95926;
  --tt-s3: #199e70;
  --tt-s4: #c98500;
  --tt-s5: #d55181;
  --tt-other: #5d5b54;
}
.tt-dash__reset {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 4px 0;
  background: none; border: 0; color: var(--text-2);
  font: inherit; font-size: 12px; cursor: pointer;
}
.tt-dash__reset .ms { font-size: 16px; }
.tt-dash__kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 14px 0 10px;
}
.tt-dash__kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  min-width: 0;
}
.tt-dash__kpi.is-hero { border-color: rgba(79, 155, 74, 0.45); background: var(--tint-accent); }
.tt-dash__kpi-value { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.15; }
.tt-dash__kpi.is-hero .tt-dash__kpi-value { font-size: 24px; }
.tt-dash__kpi-label { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.tt-dash__kpi-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.tt-dash__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.tt-dash__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  min-width: 0;
  margin-top: 12px;
}
.tt-dash__grid .tt-dash__card { margin-top: 0; }
.tt-dash__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tt-dash__title { font-size: 13px; font-weight: 700; color: var(--text); }
.tt-dash__sum { font-size: 11.5px; color: var(--muted); }
.tt-dash__more {
  margin-top: 8px; padding: 4px 0; background: none; border: 0;
  color: var(--accent); font: inherit; font-size: 12px; cursor: pointer;
}

/* Verlauf: gestapelte Säulen */
.tt-chart { position: relative; height: 150px; }
.tt-chart__grid {
  position: absolute; inset: 0;
  border-top: 1px dashed var(--hairline);
  border-bottom: 1px solid var(--border-strong);
  pointer-events: none;
}
.tt-chart__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.tt-chart__col {
  flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: row; align-items: flex-end; justify-content: center;
  cursor: pointer; border-radius: 4px 4px 0 0;
}
.tt-chart__col.is-hover { background: rgba(255, 255, 255, 0.04); }
.tt-chart__stack {
  width: 100%; max-width: 26px;
  display: flex; flex-direction: column; gap: 2px;
}
.tt-chart__stack > :first-child { border-radius: 4px 4px 0 0; }
.tt-chart__seg { min-height: 2px; }
.tt-chart__seg.is-own { background: var(--accent); }
.tt-chart__seg.is-ai { background: var(--ai); }
.tt-chart__axis { display: flex; gap: 2px; margin-top: 5px; }
.tt-chart__tick {
  flex: 1 1 0; min-width: 0; text-align: center;
  font-size: 10px; color: var(--muted); white-space: nowrap; overflow: visible;
}
.tt-chart__tip {
  position: absolute; top: 4px; transform: translateX(-50%);
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 7px 9px;
  font-size: 11.5px; color: var(--text-2); line-height: 1.45;
  pointer-events: none; white-space: nowrap; z-index: 2;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.tt-chart__tip-title { color: var(--text); font-weight: 700; }

/* Ring nach Kunde */
.tt-donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tt-donut__chart { position: relative; width: 140px; height: 140px; flex: none; }
.tt-donut__svg { width: 100%; height: 100%; display: block; }
.tt-donut__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.tt-donut__total { font-size: 16px; font-weight: 800; color: var(--text); }
.tt-donut__caption { font-size: 10.5px; color: var(--muted); }
.tt-donut__legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 6px; }
.tt-donut__row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.tt-donut__row.is-link { cursor: pointer; }
.tt-donut__name { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-donut__val { color: var(--text-2); font-weight: 700; }
.tt-donut__pct { color: var(--muted); width: 38px; text-align: right; }
.tt-donut__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tt-donut__slice.is-s1 { stroke: var(--tt-s1); } .tt-donut__dot.is-s1 { background: var(--tt-s1); }
.tt-donut__slice.is-s2 { stroke: var(--tt-s2); } .tt-donut__dot.is-s2 { background: var(--tt-s2); }
.tt-donut__slice.is-s3 { stroke: var(--tt-s3); } .tt-donut__dot.is-s3 { background: var(--tt-s3); }
.tt-donut__slice.is-s4 { stroke: var(--tt-s4); } .tt-donut__dot.is-s4 { background: var(--tt-s4); }
.tt-donut__slice.is-s5 { stroke: var(--tt-s5); } .tt-donut__dot.is-s5 { background: var(--tt-s5); }
.tt-donut__slice.is-other { stroke: var(--tt-other); } .tt-donut__dot.is-other { background: var(--tt-other); }

/* Ranglisten */
.tt-rank { padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.tt-rank:last-of-type { border-bottom: 0; }
.tt-rank.is-link { cursor: pointer; }
.tt-rank__head { display: flex; align-items: center; gap: 9px; }
.tt-rank__icon { font-size: 18px; color: var(--muted); flex: none; }
.tt-rank__main { flex: 1; min-width: 0; }
.tt-rank__name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-rank__meta { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-rank__val { text-align: right; font-size: 12.5px; font-weight: 700; color: var(--text); flex: none; }
.tt-rank__pct { font-size: 10.5px; font-weight: 400; color: var(--muted); }
.tt-rank__track { height: 6px; margin-top: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.tt-rank__bar { height: 100%; display: flex; gap: 2px; border-radius: 99px; overflow: hidden; }
.tt-rank__bar .tt-chart__seg { min-height: 0; }

/* ---------- Zweite Schiene: passive Zeit (KI) ---------- */
:root { --ai: #7aa7e8; }
.tt-stat--ai { border-color: rgba(122, 167, 232, 0.5); background: rgba(122, 167, 232, 0.10); }
.tt-stat--ai .tt-stat__value { color: var(--ai); }

.tt-running--ai { border-color: rgba(122, 167, 232, 0.5); background: rgba(122, 167, 232, 0.10); }
.tt-running--ai > .ms { color: var(--ai); }

.tt-time-entry.is-ai .tt-time-entry__icon { color: var(--ai); }

.tt-chart__bar { position: relative; overflow: hidden; }
.tt-chart__ai {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  background: var(--ai);
}

.tt-split { margin-top: 12px; }
.tt-split__bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.tt-split__own { background: var(--accent); }
.tt-split__ai { background: var(--ai); }
.tt-split__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted);
}
.tt-split__key { display: inline-flex; align-items: center; gap: 5px; }
.tt-split__dot { width: 8px; height: 8px; border-radius: 50%; }
.tt-split__dot--own { background: var(--accent); }
.tt-split__dot--ai { background: var(--ai); }

/* ---------- Mehrere Timer gleichzeitig ---------- */
/* Erfassungen anderer Personen laufen mit, sind aber zurückgenommen
   dargestellt — sie gehören nicht mir und lassen sich nicht schalten. */
.tt-running.is-foreign { opacity: 0.82; border-style: dashed; }
.tt-running.is-foreign .tt-running__title { font-weight: 500; }

/* Balken der Beitragsliste: KI-Anteile in der Farbe der passiven Schiene */
.tt-toprow__fill.is-ai { background: var(--ai); }

/* ---------- Ansichten: Umschalter, Kanban-Board, Eisenhower-Matrix ---------- */

/* Umschalter Liste / Board / Matrix — sitzt über den Karten */
/* Ansicht-Umschalter: kompakte Icon-Pille in der Filter-Zeile */
.tt-viewtoggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.tt-viewtoggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 25px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tt-viewtoggle__btn .ms { font-size: 16px; }
.tt-viewtoggle__btn.is-on {
  background: var(--accent);
  color: var(--on-accent);
}

/* Kanban-Board: eine Spalte im Fokus, die Nachbarspalte lugt herein */
.tt-board { display: flex; flex-direction: column; gap: 10px; }

.tt-board__chips {
  display: flex;
  gap: 6px;
  padding-bottom: 2px;
}
.tt-board__chip {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 0;
  border-radius: var(--radius-pill);
  background: var(--bg-tile);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
}
.tt-board__chip .ms { font-size: 16px; }
.tt-board__chip.is-on {
  font-weight: 700;
  color: var(--col);
  border-color: color-mix(in srgb, var(--col) 40%, transparent);
  background: color-mix(in srgb, var(--col) 16%, transparent);
}

.tt-board__stage {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
/* Die Peek-Spalten reichen bis an den Bildschirmrand — das macht die
   Wischbarkeit sichtbar */
.tt-board__stage.has-next { margin-inline-end: -14px; }
.tt-board__stage.has-prev { margin-inline-start: -14px; }

.tt-board__focus {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--bg-elevated);
  border: 1px solid color-mix(in srgb, var(--col) 30%, var(--border));
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tt-board__head {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--hairline);
}
.tt-board__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--col, var(--muted));
}
.tt-board__title { flex: 1; font-size: 14px; font-weight: 700; color: var(--text); }
.tt-board__count { font-size: 11px; color: var(--muted); }
.tt-board__cards {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tt-board__empty { padding: 18px 4px; text-align: center; font-size: 13px; color: var(--muted); }
.tt-board__add {
  margin: 2px 12px 12px;
  padding: 11px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

/* Die hereinlugende Nachbarspalte — ein Tipp blaettert dorthin */
.tt-board__peek {
  flex: none;
  width: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-start-start-radius: 18px;
  border-end-start-radius: 18px;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  border-inline-end: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 13px 0 10px;
  gap: 10px;
  cursor: pointer;
  color: var(--muted);
}
.tt-board__peek.is-before {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  border-start-end-radius: 18px;
  border-end-end-radius: 18px;
  border-inline-end: 1px solid var(--border);
  border-inline-start: none;
}
.tt-board__peek .tt-board__dot { background: var(--col); }
.tt-board__peektitle {
  font-size: 11px;
  font-weight: 600;
  writing-mode: vertical-rl;
  letter-spacing: 0.06em;
  white-space: nowrap;
  max-height: 240px;
  overflow: hidden;
}
.tt-board__peekchev { margin-top: auto; font-size: 18px; color: var(--disabled); }

.tt-board__dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 2px 0 8px;
}
.tt-board__pagedot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--disabled);
  transition: width 0.2s ease, background 0.2s ease;
}
.tt-board__pagedot.is-on { width: 18px; }

/* Karte auf dem Board: Wischen rueckt den Status vor/zurueck, der farbige
   Untergrund zeigt das Ziel vor dem Loslassen */
.tt-bcard {
  position: relative;
  border-radius: 14px;
  touch-action: pan-y;
}
.tt-bcard__bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: color-mix(in srgb, var(--col) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--col) 40%, transparent);
  color: var(--col);
  font-size: 12.5px;
  font-weight: 700;
}
.tt-bcard__bg--prev { justify-content: flex-end; }
.tt-bcard__bg .ms { font-size: 20px; }
.tt-bcard__inner {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
}
.tt-bcard__inner.is-anim { transition: transform 0.2s ease; }
.tt-bcard__name { display: flex; gap: 9px; align-items: flex-start; }
.tt-bcard__prio {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-top: 5px;
}
.tt-bcard__title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  overflow-wrap: anywhere;
}
.tt-bcard__track {
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  overflow: hidden;
}
.tt-bcard__fill { height: 100%; background: var(--accent); }
.tt-bcard__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.tt-bcard__due.is-late { color: var(--danger); font-weight: 600; }
.tt-bcard__path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Eisenhower-Matrix: vier Quadranten, Farbe wie der Prioritäts-Picker */
.tt-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tt-matrix__cell {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-top: 3px solid var(--cell);
  border-radius: var(--radius-card);
  padding: 10px;
  min-height: 110px;
}
.tt-matrix__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.tt-matrix__label { font-size: 13px; font-weight: 700; color: var(--cell); }
.tt-matrix__count { font-size: 12px; color: var(--muted); }
.tt-matrix__hint { margin: 2px 0 8px; font-size: 11px; color: var(--muted); }
.tt-matrix__cards { display: flex; flex-direction: column; gap: 6px; }
.tt-matrix__empty { text-align: center; font-size: 13px; color: var(--muted); padding: 8px 0; }

/* Karte im Quadranten — schlank, die Fahne ordnet neu ein */
.tt-mcard {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 30px 7px 9px;
  cursor: pointer;
}
.tt-mcard__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.tt-mcard__due { margin-top: 2px; font-size: 11px; color: var(--muted); }
.tt-mcard__due.is-late { color: var(--danger); font-weight: 600; }
.tt-mcard__prio {
  position: absolute;
  top: 4px;
  right: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 7px;
}
.tt-mcard__prio:active { background: var(--bg-tile); color: var(--text); }
.tt-mcard__prio .ms { font-size: 16px; }

/* ---------- KI-Erfassung ---------- */

/* Diktier-Knopf — pulsiert, solange zugehört wird */
.tt-ai-mic { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: center; }
.tt-ai-mic.is-listening {
  border-color: var(--danger);
  color: var(--danger);
}
.tt-ai-mic.is-listening .ms { animation: tt-ai-pulse 1.1s ease-in-out infinite; }
@keyframes tt-ai-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Vorschlagsliste — Antippen wählt ab */
.tt-ai-rows { display: flex; flex-direction: column; gap: 8px; }
.tt-ai-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  opacity: 0.45;
}
.tt-ai-row.is-on { opacity: 1; border-color: var(--border-focus); }
.tt-ai-row__check { flex-shrink: 0; font-size: 20px; color: var(--muted); margin-top: 1px; }
.tt-ai-row.is-on .tt-ai-row__check { color: var(--accent); }
.tt-ai-row__body { flex: 1; min-width: 0; }
.tt-ai-row__name { font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.tt-ai-row__desc { margin-top: 2px; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.tt-ai-row__meta { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* ---------- Papierkorb ---------- */
.tt-trash-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
}
.tt-trash-row__icon { flex-shrink: 0; font-size: 20px; color: var(--muted); }
.tt-trash-row__body { flex: 1; min-width: 0; }
.tt-trash-row__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.tt-trash-row__meta { margin-top: 2px; font-size: 12px; color: var(--muted); }

/* ---------- Diktat (Mikrofon an Text-Feldern) ---------- */
.dictate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  flex-shrink: 0;
}
.dictate-btn .ms { font-size: 19px; }
.dictate-btn.is-listening { color: var(--danger); }
.dictate-btn.is-listening .ms { animation: tt-ai-pulse 1.1s ease-in-out infinite; }

/* Einzeiliges Feld: Mikrofon rechts mittig, Platz im Feld freihalten */
.field__speech { position: relative; }
.field__speech .field__input,
.field__speech .field__textarea { width: 100%; padding-inline-end: 42px; }
.field__speech .dictate-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
}
/* Mehrzeiliges Feld: oben ausrichten statt mittig */
.field__speech--area .dictate-btn { top: 8px; transform: none; }

/* Pegelanzeige beim Diktieren: fuenf Balken statt des Mikrofon-Symbols.
   Ohne sie sieht man dem Knopf nicht an, ob wirklich aufgenommen wird. */
.dictate-wave {
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 19px;
  height: 19px;
}
.dictate-btn.is-listening .ms { display: none; }
.dictate-btn.is-listening .dictate-wave { display: flex; }

.dictate-wave i {
  width: 2px;
  height: var(--h, 30%);
  border-radius: 1px;
  background: currentColor;
  /* Solange kein Pegel gemessen wird (Zugriff abgelehnt, kein Web Audio),
     laufen die Balken gleichmaessig weiter — der Knopf sieht dann trotzdem
     nach „laeuft" aus. */
  animation: tt-dictate-wave 0.9s ease-in-out infinite;
  transition: height 80ms linear;
}
.dictate-wave i:nth-child(2) { animation-delay: 0.15s; }
.dictate-wave i:nth-child(3) { animation-delay: 0.30s; }
.dictate-wave i:nth-child(4) { animation-delay: 0.45s; }
.dictate-wave i:nth-child(5) { animation-delay: 0.60s; }

/* Sobald ein echter Pegel anliegt, gibt --h die Hoehe vor */
.dictate-btn.has-level .dictate-wave i { animation: none; }

@keyframes tt-dictate-wave {
  0%, 100% { height: 25%; }
  50%      { height: 95%; }
}

@media (prefers-reduced-motion: reduce) {
  .dictate-wave i { animation: none; height: var(--h, 55%); }
}

/* @-Editor (Name/Beschreibung): Mikrofon oben rechts im Feld */
.tt-mention-wrap.has-mic { position: relative; }
.tt-mention-wrap.has-mic .tt-var-editor,
.tt-mention-wrap.has-mic .tt-mention-editor { padding-inline-end: 40px; }
.tt-mention-wrap.has-mic > .dictate-btn {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* ---------- Rich Text (Beschreibungen) ---------- */
.tt-richbar {
  display: flex;
  gap: 4px;
  width: max-content;
  padding: 4px;
  margin-bottom: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.tt-richbar__btn {
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 5px 7px;
  border-radius: 7px;
  cursor: pointer;
}
.tt-richbar__btn:active { background: var(--bg-tile); color: var(--text); }
.tt-richbar__btn .ms { font-size: 18px; }

/* Mit Formatier-Leiste rutscht das Mikrofon unter sie */
.tt-mention-wrap.has-richbar > .dictate-btn { top: 48px; }

/* Anzeige gespeicherter Rich-Text-Beschreibungen */
.tt-richtext p  { margin: 0 0 6px; }
.tt-richtext ul,
.tt-richtext ol { margin: 6px 0; padding-inline-start: 22px; }
.tt-richtext b,
.tt-richtext strong { font-weight: 700; }

/* Dasselbe schon beim Schreiben — ohne das haetten die Aufzaehlungen im
   Feld weder Einrueckung noch Punkte, und man saehe erst nach dem
   Speichern, was man gebaut hat. */
.tt-mention-editor p,
.tt-var-editor p { margin: 0 0 6px; }
.tt-mention-editor ul,
.tt-mention-editor ol,
.tt-var-editor ul,
.tt-var-editor ol { margin: 6px 0; padding-inline-start: 22px; }
.tt-mention-editor b,
.tt-mention-editor strong,
.tt-var-editor b,
.tt-var-editor strong { font-weight: 700; }

/* ---------- RTL (Arabisch, Hebräisch) ---------- */
/* Kalender-Export-Knopf in der Fristen-Zeile */
.tt-ics-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-inline-start: 8px;
  border: none;
  border-radius: 50%;
  background: var(--bg-tile);
  color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}
.tt-ics-btn .ms { font-size: 17px; }

/* ── Statistiken & Gamification ─────────────────────────────────────── */

.tt-stats-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 2px 12px;
}
.tt-lvlring { width: 96px; height: 96px; flex: 0 0 auto; }
.tt-lvlring__track { fill: none; stroke: var(--border-strong); stroke-width: 8; }
.tt-lvlring__fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}
.tt-lvlring__num {
  fill: var(--text);
  font-size: 30px;
  font-weight: 700;
  text-anchor: middle;
}
.tt-lvlring__label {
  fill: var(--muted);
  font-size: 11px;
  text-anchor: middle;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tt-stats-head__xp { font-size: 19px; font-weight: 700; }
.tt-stats-head__next { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tt-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-tile);
  color: var(--muted);
  font-size: 13px;
}
.tt-streak.is-hot { color: var(--prio-mid); }
.tt-streak__flame { font-size: 18px; }
.tt-streak__days { font-weight: 600; }
.tt-streak__best { color: var(--muted); }

/* Heatmap */
.tt-heatmap { overflow-x: auto; padding: 4px 0; }
.tt-heatmap__grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(7, 14px);
  gap: 3px;
  min-width: 260px;
}
.tt-heatmap__cell {
  border-radius: 3px;
  background: var(--bg-tile);
}
.tt-heatmap__cell.is-l1 { background: rgba(79, 155, 74, 0.30); }
.tt-heatmap__cell.is-l2 { background: rgba(79, 155, 74, 0.50); }
.tt-heatmap__cell.is-l3 { background: rgba(79, 155, 74, 0.75); }
.tt-heatmap__cell.is-l4 { background: var(--accent); }
.tt-heatmap__cell.is-future { opacity: 0.25; }

/* Wochenvergleich */
.tt-weekrow { padding: 6px 0; }
.tt-weekrow__head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.tt-weekrow__delta { color: var(--muted); }
.tt-weekrow__track {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-tile);
  overflow: hidden;
}
.tt-weekrow__fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.tt-weekrow__fill.is-done { background: var(--accent); }
.tt-weekrow__fill.is-added { background: var(--info); }
.tt-weekrow__fill.is-postponed { background: var(--prio-mid); }

/* Puenktlichkeits-Donut */
.tt-punct { display: flex; align-items: center; gap: 16px; padding: 12px 14px; }
.tt-donut { width: 84px; height: 84px; flex: 0 0 auto; }
.tt-donut__late { fill: none; stroke: var(--danger); stroke-width: 9; opacity: 0.45; }
.tt-donut__ontime { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; }
.tt-donut__num { fill: var(--text); font-size: 18px; font-weight: 700; text-anchor: middle; }
.tt-punct__body { font-size: 14px; line-height: 1.6; }

/* Schaetz-Zeilen */
.tt-estrow { padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.tt-estrow:last-child { border-bottom: none; }
.tt-estrow__name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-estrow__nums { font-size: 12px; color: var(--muted); margin-top: 1px; }
.tt-estrow__nums.is-hit { color: var(--accent); }
.tt-estrow__nums.is-over { color: var(--danger); }

/* Abzeichen-Regal */
.tt-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tt-badge {
  padding: 12px 8px;
  border-radius: var(--radius-card);
  background: var(--bg-tile);
  text-align: center;
  opacity: 0.45;
  filter: grayscale(1);
}
.tt-badge.is-earned {
  opacity: 1;
  filter: none;
  background: var(--tint-accent);
  border: 1px solid var(--border-focus);
}
.tt-badge__icon { font-size: 28px; color: var(--accent); }
.tt-badge__title { font-size: 12px; font-weight: 600; margin-top: 4px; }
.tt-badge__hint { font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.3; }

/* Stunden-Balken */
.tt-hours {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 90px;
}
.tt-hours__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  position: relative;
}
.tt-hours__bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  opacity: 0.85;
  min-height: 2px;
}
.tt-hours__label {
  position: absolute;
  bottom: -16px;
  font-size: 9px;
  color: var(--muted);
}
.tt-hours { margin-bottom: 18px; }

/* ── fx: Effekt-Fundament ───────────────────────────────────────────── */

@keyframes fx-pulse-kf {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.fx-pulse { animation: fx-pulse-kf 0.3s ease; }

@keyframes fx-pop-kf {
  0% { transform: scale(1); }
  35% { transform: scale(1.15); }
  70% { transform: scale(0.96); }
  100% { transform: scale(1); }
}
.fx-pop { animation: fx-pop-kf 0.28s ease; }

@keyframes fx-shake-kf {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.fx-shake { animation: fx-shake-kf 0.35s ease; }

/* Karte setzt sich aus vier Vierteln wieder zusammen */
@keyframes fx-reassemble-kf {
  0% { transform: scale(0.85); opacity: 0; filter: blur(3px); }
  60% { transform: scale(1.03); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); }
}
.fx-reassemble { animation: fx-reassemble-kf 0.28s ease; }

/* Neue Karte materialisiert mit Licht-Schimmer */
@keyframes fx-materialize-kf {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fx-shimmer-kf {
  0% { transform: translateX(-110%) skewX(-18deg); }
  100% { transform: translateX(220%) skewX(-18deg); }
}
.fx-materialize {
  animation: fx-materialize-kf 0.26s ease;
  position: relative;
  overflow: hidden;
}
.fx-materialize::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.10), transparent);
  animation: fx-shimmer-kf 0.65s ease 0.1s both;
  pointer-events: none;
}

/* Knuell-und-Flug beim Loeschen */
@keyframes fx-crumple-kf {
  0% { transform: scale(1) rotate(0); opacity: 1; filter: none; }
  60% { transform: scale(0.6) rotate(-5deg); opacity: 0.8; filter: contrast(0.6); }
  100% { transform: scale(0.15) rotate(8deg) translateY(40px); opacity: 0; }
}
.fx-crumple { animation: fx-crumple-kf 0.45s ease forwards; }

/* Geister-Element fuer flyTo */
.fx-ghost {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 700;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

/* Schwebender Text (+XP) */
@keyframes fx-float-kf {
  0% { transform: translate(-50%, 0) scale(0.8); opacity: 0; }
  20% { transform: translate(-50%, -12px) scale(1.05); opacity: 1; }
  100% { transform: translate(-50%, -52px) scale(1); opacity: 0; }
}
.fx-float {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  animation: fx-float-kf 1.25s ease forwards;
}
.fx-float--badge { color: var(--subtitle); font-size: 15px; }

/* Kreiswelle beim Sprachwechsel */
@keyframes fx-wave-kf {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
.fx-wave {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  width: 250vmax;
  height: 250vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 155, 74, 0.35) 0%, rgba(20, 20, 22, 0.9) 70%);
  animation: fx-wave-kf 0.8s ease-out forwards;
}

/* Level-Up-Vollbild-Moment */
@keyframes fx-levelup-num-kf {
  0% { transform: scale(2.6); opacity: 0; }
  55% { transform: scale(0.92); opacity: 1; }
  75% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes fx-levelup-burst-kf {
  0% { transform: scale(0.2); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}
.fx-levelup {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(10, 10, 12, 0.55);
  transition: opacity 0.35s ease;
}
.fx-levelup.is-out { opacity: 0; }
.fx-levelup__burst {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 165, 77, 0.5), transparent 65%);
  animation: fx-levelup-burst-kf 0.9s ease-out forwards;
}
.fx-levelup__num {
  font-size: 96px;
  font-weight: 800;
  color: var(--subtitle);
  text-shadow: 0 4px 30px rgba(201, 165, 77, 0.6);
  animation: fx-levelup-num-kf 0.7s cubic-bezier(0.3, 1.4, 0.4, 1) both;
}
.fx-levelup__label {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Bottom-Nav: aktives Icon huepft (Klasse setzt index_mobile.js) */
.bottomnav__item .bottomnav__icon { transition: transform 0.15s ease; }

/* FAB-Kreuz dreht beim Oeffnen der Ziele */
.bottomnav__fab-circle { transition: transform 0.25s ease; }
.bottomnav__fab.is-fab-open .bottomnav__fab-circle { transform: rotate(45deg); }

/* Drawer-Eintraege kaskadieren beim Oeffnen — mit leichtem Ueberschwingen */
@keyframes fx-drawer-kf {
  0% { transform: translateX(-34px); opacity: 0; }
  70% { transform: translateX(5px); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}
[dir="rtl"] .drawer.is-open .fx-cascade { animation-name: fx-drawer-rtl-kf; }
@keyframes fx-drawer-rtl-kf {
  0% { transform: translateX(34px); opacity: 0; }
  70% { transform: translateX(-5px); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}
.drawer.is-open .fx-cascade {
  animation: fx-drawer-kf 0.45s ease-out both;
}

/* Systemvorgabe „Animationen reduzieren" — eine bewusste App-Wahl
   (data-fx="on"/"subtle", gesetzt von mobile/fx.js) gewinnt dagegen. */
@media (prefers-reduced-motion: reduce) {
  html:not([data-fx="on"]):not([data-fx="subtle"]) .fx-pulse,
  html:not([data-fx="on"]):not([data-fx="subtle"]) .fx-pop,
  html:not([data-fx="on"]):not([data-fx="subtle"]) .fx-reassemble,
  html:not([data-fx="on"]):not([data-fx="subtle"]) .fx-materialize,
  html:not([data-fx="on"]):not([data-fx="subtle"]) .fx-crumple,
  html:not([data-fx="on"]):not([data-fx="subtle"]) .fx-float,
  html:not([data-fx="on"]):not([data-fx="subtle"]) .fx-wave,
  html:not([data-fx="on"]):not([data-fx="subtle"]) .fx-levelup__num,
  html:not([data-fx="on"]):not([data-fx="subtle"]) .fx-levelup__burst,
  html:not([data-fx="on"]):not([data-fx="subtle"]) .drawer.is-open .fx-cascade {
    animation: none !important;
  }
  html:not([data-fx="on"]):not([data-fx="subtle"]) .fx-materialize::after { display: none; }
}

/* Laufende Zeiterfassung atmet im Sekundentakt */
@keyframes fx-breathe-kf {
  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); }
}
.tt-swipe--running { animation: fx-breathe-kf 2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  html:not([data-fx="on"]):not([data-fx="subtle"]) .tt-swipe--running { animation: none; }
}

/* Sprechblase einer Notiz mit laufender Diskussion — dieselbe Signalfarbe
   wie die Glocke oben, mit sanftem Puls, damit man sie findet */
@keyframes tt-talk-live-kf {
  0%, 100% { text-shadow: 0 0 4px rgba(232, 193, 74, 0.35); }
  50% { text-shadow: 0 0 11px rgba(232, 193, 74, 0.75); }
}
.tt-talk-live,
.tt-talk-live .ms {
  color: var(--bell, #e8c14a);
}
.tt-talk-live .ms {
  animation: tt-talk-live-kf 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  html:not([data-fx="on"]):not([data-fx="subtle"]) .tt-talk-live .ms { animation: none; }
}

/* Drift-Geist: Kalender-Chip segelt beim Verschieben davon */
.fx-ghost--drift {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-tile);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-weight: 600;
}
.fx-ghost--drift .ms {
  font-size: 16px;
  color: var(--info-2);
}

/* Auswertungen: Nachweis-Zeilen mit Erledigt-Haken */
.tt-report__icon { font-size: 20px; color: var(--muted); margin-inline-end: 4px; }
.tt-report__sum {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
}
.tt-report__sum .ms { font-size: 19px; color: var(--accent); }
.tt-report__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  cursor: pointer;
}
.tt-report__check { font-size: 20px; color: var(--disabled); margin-top: 1px; }
.tt-report__row.is-done .tt-report__check { color: var(--accent); }
.tt-report__body { flex: 1; min-width: 0; }
.tt-report__name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.tt-report__row.is-done .tt-report__name { color: var(--text-2); }
.tt-report__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Freigabe-Kennzeichen auf der Karte + Stimmen der Freigabe-Runde */
.tt-approval-people { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-approvalbox__votes {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 9px;
  font-size: 13px;
}
.tt-approvalbox__vote { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.tt-approvalbox__vote .ms { font-size: 17px; }
.tt-approvalbox__vote.is-approved { color: var(--accent); }
.tt-approvalbox__vote.is-rejected { color: var(--danger); }

/* Auswertung: Donut + Tages-Verlauf */
.tt-report__charts {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 4px;
}
.tt-report__donut { width: 74px; height: 74px; flex: none; }
.tt-report__donut-track { fill: none; stroke: var(--border-strong); stroke-width: 8; }
.tt-report__donut-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
}
.tt-report__donut-num { fill: var(--text); font-size: 16px; font-weight: 700; text-anchor: middle; }
.tt-report__charts-body { flex: 1; min-width: 0; }
.tt-report__sumline { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.tt-report__trend {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 52px;
}
.tt-report__trendcol {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
}
.tt-report__trendbar {
  width: 100%;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--border-strong);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.tt-report__trendfill { background: var(--accent); }
.tt-report__trendlabel { font-size: 9px; color: var(--muted); }

/* dir="rtl" setzt mobile/i18n.js am <html>. Flexbox und Grid spiegeln von
   selbst — hier stehen nur absolut positionierte Elemente und Icons, die
   eine Richtung zeigen. */
[dir="rtl"] .drawer {
  left: auto;
  right: 0;
  transform: translateX(100%);
}
[dir="rtl"] .drawer.is-open { transform: translateX(0); }

[dir="rtl"] .tt-mcard { padding: 7px 9px 7px 30px; }
[dir="rtl"] .tt-mcard__prio { right: auto; left: 4px; }

/* Die Pfeile der Board-Karten zeigen zur Nachbarspalte — unter RTL gespiegelt */
[dir="rtl"] .tt-board__peekchev { transform: scaleX(-1); }

/* Absolut positionierte Mikrofon-Knoepfe: right ist physisch, hier gespiegelt */
[dir="rtl"] .field__speech .dictate-btn { right: auto; left: 8px; }
[dir="rtl"] .tt-mention-wrap.has-mic > .dictate-btn { right: auto; left: 6px; }

/* Richtungs-Icons unter RTL spiegeln: Zurueck-Pfeil, Zeilen-Chevrons und die
   Monatsnavigation des Datums-Waehlers. Der Kalender blaettert weiter
   vorwaerts/rueckwaerts in Leserichtung. */
[dir="rtl"] .apphdr__back .ms,
[dir="rtl"] .row__chevron,
[dir="rtl"] .datepicker__navbtn .ms { transform: scaleX(-1); }

/* Nachrichtenfeld im Gespraech: kompakt starten, mit dem Text wachsen */
.tt-talk__footer .tt-var-editor {
  min-height: 42px;
  max-height: 180px;
}

/* Status-/Typ-Pillen — steht bewusst NACH den Statistik-Abzeichen
   (.tt-badge im Abzeichen-Regal), die sonst Padding & Co. uebersteuern */
span.tt-badge--muted,
span.tt-badge--info,
span.tt-badge--success,
span.tt-badge--waiting,
span.tt-badge--danger {
  display: inline-block;
  padding: 1px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 1;
  filter: none;
  text-align: start;
}

/* ── 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);
}

/* ---------- Habit Tracker ---------- */
.tt-habits-host[hidden],
.tt-habit-wrap[hidden] { display: none !important; }

.tt-habits-host { margin: 0 0 14px; }
.tt-habits { padding: 12px 14px 4px; }
.tt-habits.is-collapsed { padding-bottom: 12px; }
.tt-habits__titles { cursor: pointer; }
.tt-habits__head { display: flex; align-items: center; gap: 10px; }
.tt-habits__icon { color: var(--accent); font-size: 22px; flex: none; }
.tt-habits__titles { flex: 1; min-width: 0; }
.tt-habits__title { font-size: 15px; font-weight: 650; }
.tt-habits__meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.tt-habits__btn {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-tile);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.tt-habits__btn .ms { font-size: 18px; }
.tt-habits__btn:hover { color: var(--text); }
.tt-habits__bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 0 2px;
  overflow: hidden;
}
.tt-habits__fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.tt-habits__fill.is-full { box-shadow: 0 0 10px var(--accent); }
.tt-habits__empty {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  text-align: start;
  cursor: pointer;
}
.tt-habits__empty .ms { color: var(--accent); }

/* Eine Gewohnheit: Häkchen | Name + Serie | Personen, darunter 7 Tage */
.tt-habit {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  column-gap: 11px;
  row-gap: 7px;
  align-items: center;
  padding: 11px 0;
}
.tt-habit + .tt-habit { border-top: 1px solid var(--hairline); }
.tt-habit__check {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--habit-color, var(--accent));
  background: transparent;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.tt-habit__check .ms { font-size: 22px; font-weight: 700; }
.tt-habit__check:active { transform: scale(0.92); }
.tt-habit__check.is-done { background: var(--habit-color, var(--accent)); color: var(--on-accent); }
.tt-habit__check.is-count,
.tt-habit__check.is-count.is-done { border: 0; background: transparent; }
.tt-habit__ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.tt-habit__ring-track { fill: none; stroke: rgba(255, 255, 255, 0.10); stroke-width: 3.5; }
.tt-habit__ring-fill {
  fill: none;
  stroke: var(--habit-color, var(--accent));
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dasharray 0.3s ease;
}
.tt-habit__count { position: relative; font-size: 12px; font-weight: 700; color: var(--text); }
.tt-habit__count .ms { font-size: 20px; color: var(--habit-color, var(--accent)); }
/* Haken im erledigten Kreis optisch mittig */
.tt-habit__check.is-done .ms { position: relative; top: 2px; }
.tt-habit__main { grid-column: 2; grid-row: 1; min-width: 0; cursor: pointer; }
.tt-habit__title { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; font-weight: 600; }
.tt-habit__icon { font-size: 18px; flex: none; }
.tt-habit__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-habit.is-done .tt-habit__name { color: var(--text-2); }
.tt-habit.is-free .tt-habit__main { opacity: 0.6; }
.tt-habit__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.tt-habit__sub > span { display: inline-flex; align-items: center; gap: 3px; }
.tt-habit__sub .ms { font-size: 14px; }
.tt-habit__streak { color: var(--prio-mid); font-weight: 600; }
.tt-habit__side { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 6px; }
.tt-habit__people { display: flex; }
.tt-habit__avatar {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  background: var(--bg-tile);
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
}
.tt-habit__people .tt-habit__avatar + .tt-habit__avatar { margin-inline-start: -8px; }
.tt-toprow__head .tt-habit__avatar { border-color: transparent; }
.tt-habit__minus {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tt-habit__minus .ms { font-size: 16px; }
.tt-habit__dots { grid-column: 2 / span 2; grid-row: 2; display: flex; gap: 5px; }
.tt-habit__dot {
  flex: 1;
  max-width: 34px;
  height: 22px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--muted);
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tt-habit__dot:disabled { cursor: default; }
.tt-habit__dot-label { font-size: 9.5px; font-weight: 600; text-transform: uppercase; }
.tt-habit__dot.is-free { border-style: dashed; opacity: 0.45; }
.tt-habit__dot.is-partial {
  background: rgba(79, 155, 74, 0.30);
  background: color-mix(in srgb, var(--habit-color, var(--accent)) 35%, transparent);
}
.tt-habit__dot.is-done {
  background: var(--habit-color, var(--accent));
  border-color: transparent;
  color: var(--on-accent);
}
.tt-habit__dot.is-today { outline: 1px solid var(--text-2); outline-offset: 1px; }

@media (min-width: 900px) {
  .tt-habit { grid-template-columns: 38px minmax(0, 1fr) auto auto; }
  .tt-habit__check { grid-row: 1; align-self: center; }
  .tt-habit__dots { grid-column: 3; grid-row: 1; width: 250px; }
  .tt-habit__side { grid-column: 4; min-width: 28px; }
}

/* Übersicht */
.tt-habit-card { padding: 12px 14px 2px; margin-bottom: 10px; }
.tt-habit-card__head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.tt-habit-card__icon { font-size: 24px; flex: none; }
.tt-habit-card__chev { color: var(--muted); flex: none; }
.tt-habit-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.tt-habit-card .tt-habit { border-top: 1px solid var(--hairline); margin-top: 8px; }
.tt-habit-stat { background: var(--bg-tile); border-radius: 11px; padding: 8px 10px; }
.tt-habit-stat__value { display: flex; align-items: center; gap: 3px; font-size: 17px; font-weight: 700; }
.tt-habit-stat__label { font-size: 11px; color: var(--muted); margin-top: 1px; }
.tt-habit-stat__flame { font-size: 17px; color: var(--muted); }
.tt-habit-stat__flame.is-hot { color: var(--prio-mid); }
.tt-habits-off { margin-bottom: 12px; }

/* Auswertung */
.tt-habit-kpis { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) {
  .tt-habit-kpis { grid-template-columns: repeat(4, 1fr); }
}
.tt-habit-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.card.tt-heatmap { padding: 12px 14px; }
.tt-habit-trend { display: flex; align-items: flex-end; gap: 6px; height: 130px; }
.tt-habit-trend__col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tt-habit-trend__track {
  flex: 1;
  width: 100%;
  max-width: 26px;
  display: flex;
  align-items: flex-end;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.tt-habit-trend__bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: rgba(79, 155, 74, 0.55);
  transition: height 0.3s ease;
}
.tt-habit-trend__bar.is-full { background: var(--accent); }
.tt-habit-trend__label { height: 12px; margin-top: 5px; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.tt-habit-rank { width: 20px; flex: none; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.tt-habit-rank.is-first { color: var(--subtitle); }
.tt-habit-person--me .tt-toprow__title { font-weight: 700; }

/* Formular */
.tt-habit-seg { flex-wrap: wrap; }
.tt-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
}
.tt-stepper__btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: var(--bg-tile);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tt-stepper__value {
  width: 64px;
  min-width: 44px;
  padding: 6px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.tt-stepper__value:focus { outline: none; background: var(--bg-tile); }
.tt-stepper__value::-webkit-outer-spin-button,
.tt-stepper__value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Sortiermodus der Übersicht — Abstand 10px, damit enableDragSort richtig tauscht */
.tt-habit-sortrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
}
.tt-habit-sortrow.is-dragging {
  position: relative;
  z-index: 5;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  border-color: var(--accent);
  opacity: 0.96;
}

/* Kreis gedrückt halten öffnet das Mengen-Fenster — kein Kontextmenü, keine Markierung */
.tt-habit__check { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* Tag „2 Gewohnheiten offen" rechts neben der Meta-Zeile */
.tt-meta--habits { display: flex; align-items: center; gap: 8px; }
.tt-meta--habits .tt-habits-tag { margin-inline-start: auto; }
.tt-habits-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-tile);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.tt-habits-tag[hidden] { display: none; }
.tt-habits-tag .ms { font-size: 15px; color: var(--accent); }
.tt-habits-tag.is-done { color: var(--muted); }

/* Tagesauswahl im Mengen-Fenster: sieben gleich breite Felder, die beim
   Auswählen weder Breite noch Schriftstärke ändern — sonst springen sie */
.tt-habit-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.tt-habit-days .chipset__chip,
.tt-habit-days .chipset__chip.is-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 6px 2px;
  border-width: 1px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
}
.tt-habit-days__wd {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
}
.tt-habit-days__num { font-size: 14px; font-weight: 700; }

/* Startseite: erledigte Gewohnheit gleitet nach kurzer Pause hinaus */
.tt-habit { transition: opacity 0.25s ease, transform 0.25s ease; }
.tt-habit.is-leaving { opacity: 0; transform: translateX(28px); }

/* Erfolgs-Kachel, wenn heute nichts mehr offen ist */
.tt-habits__success {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  padding: 14px;
  border-radius: 12px;
  background: var(--tint-accent);
  border: 1px solid var(--border-focus);
}
.tt-habits__success-icon { font-size: 34px; color: var(--accent); flex: none; }
.tt-habits__success-main { min-width: 0; }
.tt-habits__success-title { font-size: 15px; font-weight: 700; }
.tt-habits__success-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ============================================================================
   Ladebildschirm
   Quelle: Claude-Design „Taskado Splash" (Taskado Splash.dc.html)

   Liegt im Body von index_mobile.php und ist damit sichtbar, bevor das
   ES-Modul geladen ist. index_mobile.js blendet ihn aus, sobald die erste
   Ansicht steht.

   Ablauf im 5-s-Takt:
     0–46 %   Ideen fliegen ein (Flug 1 s, gestaffelt bis 1.25 s)
     48–58 %  Knoten leuchten
     56–70 %  Puls läuft
     68–80 %  Scheibe springt, Häkchen zeichnet
     72–94 %  Feier (Ring + Partikel)
     74–96 %  Glitzerstaub · Konfetti
     96–100 % Reset

   Eigenes Präfix `tts-`: `.tt-check` ist in dieser Datei schon der Abhak-Kreis
   der Aufgabenliste.
   ========================================================================= */

#splash {
  /* Länge eines Durchlaufs — die einzige Stelle, an der das Tempo steht.
     index_mobile.js und index_desktop.js lesen sie von hier ab. */
  --tts-dur: 3s;

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-screen);
  transition: opacity .4s ease-out;

  /* Eigene Ebene, damit die Blende auf der Grafikkarte läuft und nicht bei
     jedem Bild die ganze Fläche neu gezeichnet werden muss. */
  will-change: opacity;
}

#splash.is-gone { opacity: 0; pointer-events: none; }

/* Beim Ausblenden steht das Bild still.
   Vorher lief die Animation weiter: rund siebzig Elemente mussten während der
   Blende Bild für Bild neu gezeichnet werden — und genau in diesem Moment
   baut nebenan die erste Ansicht auf. Das Ergebnis war ein sichtbares Stocken.
   Angehalten ist es nur noch eine Überblendung eines Standbilds.
   Auffällig ist das nicht: An dieser Stelle steht das Häkchen und die Feier
   ist ohnehin vorbei. */
#splash.is-gone,
#splash.is-gone * { animation-play-state: paused !important; }

/* Warmer Schein hinter dem Zeichen */
#splash .tts-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 540px;
  height: 540px;
  transform: translate(-50%, -58%);
  background: radial-gradient(circle, rgba(227, 179, 65, .13) 0%, transparent 65%);
  pointer-events: none;
}

#splash svg {
  position: relative;
  width: min(38vw, 190px);
  height: min(38vw, 190px);
  overflow: visible;
}

.tts-dust  { opacity: 0; transform-box: fill-box; transform-origin: center; animation: tts-dust var(--tts-dur) cubic-bezier(.1,.8,.3,1) infinite; animation-delay: var(--d); }
.tts-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tts-confetti i { position: absolute; top: -20px; width: var(--w); height: var(--h); border-radius: 2px; opacity: 0;
                 animation: tts-confetti var(--tts-dur) cubic-bezier(.3,.4,.6,1) infinite; animation-delay: var(--d); }
.tts-idea  { opacity: 0; transform-box: fill-box; transform-origin: center;
            animation: tts-idea var(--tts-dur) cubic-bezier(.2,.7,.2,1) infinite; animation-delay: var(--d); }
.tts-node  { transform-box: fill-box; transform-origin: center; animation: tts-node var(--tts-dur) cubic-bezier(.4,0,.2,1) infinite; }
.tts-node--r { animation-delay: .06s; }
.tts-pulse { stroke-dasharray: 18 100; stroke-dashoffset: 18; opacity: 0; animation: tts-pulse var(--tts-dur) cubic-bezier(.55,0,.45,1) infinite; }
.tts-pulse--r { animation-delay: .06s; }
.tts-disc  { transform-box: fill-box; transform-origin: center; animation: tts-disc var(--tts-dur) cubic-bezier(.34,1.56,.64,1) infinite; }
.tts-check { stroke-dasharray: 100; stroke-dashoffset: 100; animation: tts-check var(--tts-dur) ease-out infinite; }
.tts-ring  { opacity: 0; transform-box: fill-box; transform-origin: center; animation: tts-ring var(--tts-dur) cubic-bezier(.2,.7,.2,1) infinite; }
.tts-ring--2 { animation-delay: .07s; animation-timing-function: cubic-bezier(.1,.9,.2,1); }
.tts-dust--star { animation-name: tts-dust-star; }
.tts-burst { opacity: 0; transform-box: fill-box; transform-origin: center; animation: tts-burst var(--tts-dur) cubic-bezier(.2,.8,.3,1) infinite; }

@keyframes tts-idea {
  0%      { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.15) rotate(-14deg); }
  3%      { opacity: 1; }
  20%     { opacity: 1; transform: translate(0, 0) scale(.4) rotate(0deg); }
  24%,100%{ opacity: 0; transform: translate(0, 0) scale(.08) rotate(0deg); }
}
@keyframes tts-node {
  0%,18%  { stroke: #4f9b4a; transform: scale(1); }
  21%     { transform: scale(1.07); }          /* Idee 1 landet (1.0 s) */
  26%     { transform: scale(1); }
  31%     { transform: scale(1.07); }          /* Idee 2 (1.5 s) */
  36%     { transform: scale(1); }
  41%     { transform: scale(1.07); }          /* Idee 3 (2.0 s) */
  46%     { stroke: #4f9b4a; transform: scale(1); }
  52%     { stroke: #b9f2a8; transform: scale(1.18); }
  60%,100%{ stroke: #4f9b4a; transform: scale(1); }
}
@keyframes tts-pulse {
  0%,55%  { stroke-dashoffset: 18;   opacity: 0; }
  58%     { opacity: 1; }
  69%     { stroke-dashoffset: -100; opacity: 1; }
  72%,100%{ stroke-dashoffset: -100; opacity: 0; }
}
@keyframes tts-disc {
  0%,67%  { transform: scale(1); fill: #c67a2e; }
  73%     { transform: scale(1.24); fill: #f0a848; }
  84%     { transform: scale(1); fill: #e3993d; }
  95%,100%{ transform: scale(1); fill: #c67a2e; }
}
@keyframes tts-check {
  0%,68%  { stroke-dashoffset: 100; }
  78%,94% { stroke-dashoffset: 0; }
  99%,100%{ stroke-dashoffset: 100; }
}
@keyframes tts-ring {
  0%,70%  { opacity: 0; transform: scale(1); }
  73%     { opacity: .9; }
  80%     { transform: scale(2.2) rotate(8deg); }
  93%,100%{ opacity: 0; transform: scale(3.1) rotate(14deg); }
}
@keyframes tts-burst {
  0%,70%  { opacity: 0; transform: scale(.4) rotate(0deg); }
  74%     { opacity: 1; }
  94%,100%{ opacity: 0; transform: scale(1.8) rotate(25deg); }
}
@keyframes tts-dust {
  0%,72%  { opacity: 0; transform: translate(0,0) scale(.3); }
  75%     { opacity: 1; transform: translate(calc(var(--tx) * .55), calc(var(--ty) * .55)) scale(1.8); }
  79%     { opacity: .3; }   /* Glitzern */
  82%     { opacity: 1; transform: translate(calc(var(--tx) * .8), calc(var(--ty) * .8)) scale(1.2); }
  85%     { opacity: .2; }
  88%     { opacity: 1; }
  91%     { opacity: .3; }
  94%     { opacity: .9; }
  98%,100%{ opacity: 0; transform: translate(var(--tx), calc(var(--ty) + 80px)) scale(.3); }
}
/* Konfetti im 5-s-Takt: fällt ab 74 % (3.7 s), --d versetzt bis 0.9 s, --dur (0.75–1) streckt den Fall */
@keyframes tts-confetti {
  0%,73%  { opacity: 0; transform: translate(0,0) rotate(0deg) scale(var(--dur)); }
  76%     { opacity: 1; }
  99%     { opacity: 1; transform: translate(var(--dx), 900px) rotate(var(--r)) scale(var(--dur)); }
  100%    { opacity: 0; transform: translate(var(--dx), 900px) rotate(var(--r)) scale(var(--dur)); }
}
@keyframes tts-dust-star {
  0%,72%  { opacity: 0; transform: translate(0,0) scale(0) rotate(0deg); }
  76%     { opacity: 1; transform: translate(calc(var(--tx) * .6), calc(var(--ty) * .6)) scale(1.4) rotate(45deg); }
  81%     { opacity: .2; transform: translate(calc(var(--tx) * .75), calc(var(--ty) * .75)) scale(.6) rotate(90deg); }
  86%     { opacity: 1; transform: translate(calc(var(--tx) * .9), calc(var(--ty) * .9)) scale(1.2) rotate(135deg); }
  91%     { opacity: .3; transform: translate(var(--tx), var(--ty)) scale(.5) rotate(180deg); }
  97%,100%{ opacity: 0; transform: translate(var(--tx), calc(var(--ty) + 60px)) scale(0) rotate(220deg); }
}

/* ── Mitarbeiter-Kacheln (Startseite der Aufgaben) ────────────────────────
   Je Person eine Kachel: der Ring sind die offenen Aufgaben, der farbige
   Bogen darin ist, was bis heute fällig ist. Waagerecht scrollbar, damit
   auch ein großes Team in eine Zeile passt. Die Maße hier sind die der
   mobilen Ansicht — auf dem Desktop fällt alles eine Stufe größer aus
   (siehe style_desktop.css). */
.tt-staff-host { margin: 4px 0 14px; }
.tt-staff__eyebrow { margin-bottom: 7px; }
.tt-staff__row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.tt-staff {
  flex: 0 0 auto;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font: inherit;
}
.tt-staff:hover { border-color: var(--accent); }
.tt-staff.is-due { border-color: rgba(192, 85, 47, 0.55); }

/* Der Ring gibt die Größe vor — Bild und Zeichnung hängen in Prozent daran */
.tt-staff__ring { position: relative; width: 52px; height: 52px; flex: 0 0 auto; }
.tt-staff__chart { width: 100%; height: 100%; display: block; }
.tt-staff__track { fill: none; stroke: var(--accent); stroke-width: 5; opacity: 0.45; }
.tt-staff__due { fill: none; stroke: var(--danger); stroke-width: 5; stroke-linecap: round; }
.tt-staff__avatar {
  position: absolute;
  top: 15.625%;
  left: 15.625%;
  width: 68.75%;
  height: 68.75%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.tt-staff__avatar--text .ms { font-size: 18px; }

.tt-staff__name {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tt-staff__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 10px;
  color: var(--muted);
}
.tt-staff__duetext { color: var(--danger); font-weight: 600; }
/* Eine Liste statt einer Person: ihr Symbol in ihrer Farbe. Die Farbe setzt
   die Kachel selbst, hier steht nur der Rückfall. */
.tt-staff__avatar--list { color: var(--accent); }
.tt-staff__avatar--list .ms { font-size: 20px; }

/* Light-Ansicht: seltene Formularfelder bleiben zu, bis man sie ueber
   „+ Feld hinzufügen“ aufklappt (applyLightExtras in todo.js) */
.sheet__scroll [data-extra][hidden] { display: none !important; }

/* Light-Ansicht: leere Startseite mit den ersten Schritten
   (buildLightStartSteps in todo.js) */
.tt-lightstart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px var(--screen-pad-x, 16px);
  text-align: center;
  max-width: 460px;
  margin: 0 auto;
}
.tt-lightstep {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tt-lightstep:hover { border-color: var(--accent); }
.tt-lightstep__no {
  width: 26px; height: 26px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700;
}
.tt-lightstep__icon { color: var(--accent); flex-shrink: 0; }
.tt-lightstep__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tt-lightstep__title { font-size: 15px; font-weight: 600; }
.tt-lightstep__sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
