/* fryday — Monday-Aufbau in proMOTION dark glass.
   Statusfarben bleiben bunt (Information), Icons monochrom (Hausregel). */

:root {
  --bg:        #0a0a0c;
  --bg-erhoben:#121216;
  --glass:     rgba(255,255,255,0.05);
  --glass-rand:rgba(255,255,255,0.10);
  --glass-hell:rgba(255,255,255,0.08);
  --text:      #f4f4f6;
  --text-dim:  rgba(255,255,255,0.55);
  --text-leise:rgba(255,255,255,0.35);
  --accent:    #CD1F2A;
  --accent-grad: linear-gradient(135deg,#E8263A,#CD1F2A);
  --accent-soft: rgba(205,31,42,0.14);
  --gruen:  #00c875;
  --gelb:   #fdab3d;
  --rot:    #e2445c;
  --grau:   #797e93;
  --radius: 12px;
  --schatten: 0 18px 50px rgba(0,0,0,0.5);
  --nav-hoehe: 62px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; color-scheme: dark; background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100dvh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; color: inherit; }
input::placeholder { color: var(--text-leise); }
svg { display: block; }
[hidden] { display: none !important; }

/* ── Grundraster ─────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100dvh; }
.haupt { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Seitenleiste ────────────────────────────────────────────────────── */
.seitenleiste {
  width: 264px; flex: 0 0 264px;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px calc(16px + env(safe-area-inset-bottom));
  border-right: 1px solid var(--glass-rand);
  background: rgba(255,255,255,0.025);
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.marke { display: flex; align-items: baseline; gap: 10px; padding: 0 8px; }
.marke-wort { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.marke-punkt { color: var(--accent); }
.marke-demo {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--glass-rand);
  border-radius: 999px; padding: 2px 8px;
}
.knopf-primaer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent-grad); color: #fff; font-weight: 700; font-size: 14.5px;
  border-radius: 10px; padding: 12px 16px; width: 100%;
  box-shadow: 0 8px 22px rgba(205,31,42,0.35);
  transition: transform .12s, box-shadow .12s;
}
.knopf-primaer:active { transform: scale(0.97); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-titel {
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--text-leise); padding: 16px 10px 6px;
}
.nav-punkt {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 10px; border-radius: 9px; font-size: 14.5px; font-weight: 500;
  color: var(--text-dim); transition: background .12s, color .12s;
}
.nav-punkt:hover { background: var(--glass); color: var(--text); }
.nav-punkt.aktiv { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav-punkt.aktiv .nav-ic { color: var(--accent); }
.nav-ic { display: flex; color: var(--text-leise); }
.nav-punkt.aktiv .nav-ic, .nav-punkt:hover .nav-ic { color: currentColor; }
.nav-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 999px;
  min-width: 19px; height: 19px; display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.nav-extern { margin-left: auto; color: var(--text-leise); display: flex; }
.seitenleiste-fuss {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--glass-rand); padding-top: 14px;
}
.fuss-name { font-size: 13.5px; font-weight: 600; }
.fuss-sub { font-size: 11.5px; color: var(--text-dim); }

/* ── Avatare ─────────────────────────────────────────────────────────── */
.avatar {
  width: 30px; height: 30px; border-radius: 999px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  border: 2px solid var(--bg);
}
.avatar[data-farbe="0"] { background: #CD1F2A; }
.avatar[data-farbe="1"] { background: #579bfc; }
.avatar[data-farbe="2"] { background: #00a065; }
.avatar[data-farbe="3"] { background: #a25ddc; }
.avatar[data-farbe="4"] { background: #fd7e50; }
.avatar[data-farbe="5"] { background: #2b76e5; }
.avatar-reihe { display: flex; }
.avatar-reihe .avatar + .avatar { margin-left: -8px; }

/* ── Kopfzeile ───────────────────────────────────────────────────────── */
.kopf {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 26px 14px;
  padding-top: calc(18px + env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(var(--bg) 82%, transparent);
}
.kopf-titel { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.kopf-sub { font-size: 12.5px; color: var(--text-dim); }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.kopf-knopf {
  width: 40px; height: 40px; border-radius: 10px; position: relative;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); border: 1px solid transparent;
  transition: background .12s, color .12s;
}
.kopf-knopf:hover { background: var(--glass); color: var(--text); }
.kopf-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; min-width: 16px; height: 16px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}
.kopf-zurueck {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); background: var(--glass);
}
.suchfeld {
  display: flex; align-items: center; gap: 8px;
  background: var(--glass); border: 1px solid var(--glass-rand);
  border-radius: 10px; padding: 9px 13px; width: 260px;
  transition: border-color .12s;
}
.suchfeld:focus-within { border-color: rgba(205,31,42,0.5); }
.suchfeld input { flex: 1; background: none; border: 0; outline: none; font-size: 13.5px; min-width: 0; }
.suchfeld input::-webkit-search-cancel-button { display: none; }
.suchfeld-ic { color: var(--text-leise); display: flex; }

/* ── Inhalt ──────────────────────────────────────────────────────────── */
.inhalt { flex: 1; padding: 4px 26px calc(40px + env(safe-area-inset-bottom)); }

/* ── Gruppen + Tabelle (Desktop) ─────────────────────────────────────── */
.gruppe { margin-bottom: 26px; }
.gruppe-kopf {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 4px; cursor: pointer; user-select: none;
}
.gruppe-kopf .pfeil { display: flex; color: var(--text-dim); transition: transform .15s; }
.gruppe.zu .pfeil { transform: rotate(-90deg); }
.gruppe-name { font-size: 15px; font-weight: 700; }
.gruppe-anzahl { font-size: 12.5px; color: var(--text-dim); }
.gruppe[data-ton="aktiv"] .gruppe-name { color: #ff8891; }
.gruppe[data-ton="fertig"] .gruppe-name { color: var(--text-dim); }
.gruppe.zu .tabelle, .gruppe.zu .karten { display: none; }

.tabelle {
  border: 1px solid var(--glass-rand); border-radius: var(--radius);
  background: var(--glass); overflow: hidden;
  /* Schmaler als die Spaltensumme? Dann scrollt die Tabelle selbst —
     vorher wurde die Kommentar-Spalte auf 13-Zoll-Geraeten abgeschnitten. */
  overflow-x: auto;
}
.tkopf, .zeile {
  display: grid;
  grid-template-columns: 34px minmax(240px, 1.6fr) 150px 170px 96px 132px 110px 64px;
  align-items: center;
  min-width: 996px;
}
.tkopf {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.4px; color: var(--text-dim);
  border-bottom: 1px solid var(--glass-rand); padding: 9px 0;
}
.tkopf > div { padding: 0 10px; }
.zeile { border-bottom: 1px solid rgba(255,255,255,0.05); transition: background .1s; }
.zeile:last-child { border-bottom: 0; }
.zeile:hover { background: var(--glass-hell); }
.zelle { padding: 11px 10px; min-width: 0; font-size: 13.5px; }
.zelle-klick { cursor: pointer; }

.aufklapp {
  width: 34px; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-leise); transition: color .12s;
}
.aufklapp:hover { color: var(--text); }
.aufklapp .pfeil { display: flex; transition: transform .15s; }
.aufklapp.offen .pfeil { transform: rotate(90deg); }

.p-name { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.p-kuerzel {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
  border-radius: 7px; padding: 5px 7px; color: #fff;
}
/* display:block, sonst greifen nowrap+ellipsis nicht (inline-Elemente)
   und der Kundenname laeuft unter die Status-Pill. */
.p-titel { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub { display: block; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Status-Pill — bunt wie bei Monday, volle Zellenbreite */
.pill {
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px; color: #fff; font-size: 12px; font-weight: 700;
  padding: 7px 8px; width: 100%; white-space: nowrap; overflow: hidden;
  cursor: default; text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.pill.klickbar { cursor: pointer; transition: filter .1s; }
.pill.klickbar:active { filter: brightness(1.15); }

/* Zeitraum-Balken */
.zeitraum { display: flex; flex-direction: column; gap: 4px; }
.zeitraum-balken {
  height: 7px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden;
}
.zeitraum-fuellung { height: 100%; border-radius: 999px; background: var(--accent-grad); }
.zeitraum-text { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

/* Dreh-Ampel */
.ampel { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; }
.ampel-punkt { width: 9px; height: 9px; border-radius: 999px; flex: 0 0 auto; }

/* Fortschritt (Battery) */
.batterie { display: flex; align-items: center; gap: 8px; }
.batterie-huelle {
  flex: 1; height: 16px; border-radius: 5px; overflow: hidden;
  background: rgba(255,255,255,0.10); display: flex;
}
.batterie-fuellung { background: var(--gruen); height: 100%; transition: width .3s; }
.batterie-text { font-size: 11px; font-weight: 700; color: var(--text-dim); min-width: 30px; text-align: right; }

/* Kommentar-Indikator */
.komm {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 36px; border-radius: 9px; margin: 0 auto;
  color: var(--text-leise); cursor: pointer; transition: background .12s, color .12s;
}
.komm:hover { background: var(--glass-hell); color: var(--text); }
.komm.hat { color: var(--text-dim); }
.komm.neu { color: var(--accent); }
.komm-zahl { font-size: 10.5px; font-weight: 700; margin-left: 3px; }
.komm-badge {
  position: absolute; top: 1px; right: 1px;
  background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 800;
  border-radius: 999px; min-width: 15px; height: 15px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Unteraufgaben (Desktop, eingerückt) ─────────────────────────────── */
.unterbereich { background: rgba(0,0,0,0.25); border-bottom: 1px solid rgba(255,255,255,0.05); }
.u-zeile {
  display: grid;
  grid-template-columns: 54px minmax(200px, 1.6fr) 130px 150px 100px 76px 64px 64px;
  align-items: center; border-bottom: 1px solid rgba(255,255,255,0.04);
  min-width: 996px;
}
.u-zeile:last-child { border-bottom: 0; }
.u-zeile .zelle { padding: 9px 10px; font-size: 13px; }
.u-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-strich { display: flex; justify-content: flex-end; padding-right: 6px; color: var(--text-leise); }

.fehler-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; color: #fff;
  border-radius: 6px; padding: 3px 7px;
}
.karte.still { cursor: default; }
.karte.still:active { transform: none; }

/* Tage-offen-Punkt */
.offen-punkt { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.offen-punkt i { width: 8px; height: 8px; border-radius: 999px; display: block; }

/* ── Karten (Mobil) ──────────────────────────────────────────────────── */
.karten { display: none; flex-direction: column; gap: 10px; }
.karte {
  background: var(--glass); border: 1px solid var(--glass-rand);
  border-radius: 14px; padding: 14px; cursor: pointer;
  transition: transform .1s, background .12s;
}
.karte:active { transform: scale(0.985); }
.karte-kopf { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.karte-titel { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; }
.karte-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.karte-pill {
  border-radius: 6px; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px;
}
.karte-fuss { display: flex; align-items: center; gap: 12px; }
.karte-fuss .batterie { flex: 1; }
.karte-fuss .avatar { width: 26px; height: 26px; font-size: 10px; }

.segment {
  display: flex; background: var(--glass); border: 1px solid var(--glass-rand);
  border-radius: 11px; padding: 3px; margin-bottom: 14px;
}
.segment button {
  flex: 1; padding: 9px 8px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  color: var(--text-dim);
}
.segment button.aktiv { background: var(--accent-grad); color: #fff; }

/* ── Detail (Drawer Desktop / Vollbild Mobil) ────────────────────────── */
.drawer-schleier {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 60;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(660px, 100%);
  background: var(--bg-erhoben); border-left: 1px solid var(--glass-rand);
  box-shadow: var(--schatten); overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 24px calc(30px + env(safe-area-inset-bottom));
  animation: drawer-rein .18s ease-out;
}
@keyframes drawer-rein { from { transform: translateX(24px); opacity: 0; } }
.d-kopf { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.d-kopf .p-kuerzel { margin-top: 3px; }
.d-titel { font-size: 19px; font-weight: 800; line-height: 1.25; }
.d-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.d-zu { margin-left: auto; }
.d-meta {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px; margin: 16px 0;
}
.d-meta-feld {
  background: var(--glass); border: 1px solid var(--glass-rand);
  border-radius: 10px; padding: 9px 11px;
}
.d-meta-name { font-size: 10.5px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-leise); margin-bottom: 4px; }
.d-meta-wert { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; min-height: 22px; }
.d-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.d-link {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--glass-rand); background: var(--glass);
  border-radius: 9px; padding: 8px 12px; font-size: 12.5px; font-weight: 600;
  color: var(--text-dim); transition: color .12s, background .12s;
}
.d-link:hover { color: var(--text); background: var(--glass-hell); }
.d-abschnitt { font-size: 13px; font-weight: 700; letter-spacing: 0.3px; margin: 20px 0 10px; display: flex; align-items: center; gap: 8px; }
.d-abschnitt .zahl { color: var(--text-dim); font-weight: 600; }

.d-phase-block { margin-bottom: 12px; }
.d-phase-name { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.d-phase-name i { width: 8px; height: 8px; border-radius: 3px; display: block; }
.d-aufgabe {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass); border: 1px solid var(--glass-rand);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 6px;
}
.d-aufgabe-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; }
.d-aufgabe-unter { font-size: 11px; color: var(--text-dim); margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-aufgabe .pill { width: auto; padding: 6px 10px; font-size: 11px; flex: 0 0 auto; }
.d-aufgabe .avatar { width: 26px; height: 26px; font-size: 10px; }
.d-aufgabe .komm { width: 34px; height: 32px; }

/* Kommentare */
.k-faden { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.k-eintrag { display: flex; gap: 10px; }
.k-blase {
  flex: 1; background: var(--glass); border: 1px solid var(--glass-rand);
  border-radius: 12px; padding: 10px 13px;
}
.k-eintrag.neu .k-blase { border-color: rgba(205,31,42,0.45); background: var(--accent-soft); }
.k-kopf { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.k-name { font-size: 12.5px; font-weight: 700; }
.k-zeit { font-size: 11px; color: var(--text-leise); }
.k-neu-marke { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--accent); text-transform: uppercase; }
.k-text { font-size: 13.5px; line-height: 1.5; }
.k-text .mention { color: #7fb0ff; font-weight: 600; }
.k-schreiben {
  display: flex; gap: 9px; align-items: flex-end; margin-top: 14px;
  position: sticky; bottom: 0; background: var(--bg-erhoben);
  padding: 8px 0 calc(2px + env(safe-area-inset-bottom));
}
.k-schreiben input {
  flex: 1; background: var(--glass); border: 1px solid var(--glass-rand);
  border-radius: 11px; padding: 12px 14px; outline: none; font-size: 16px;
}
.k-schreiben input:focus { border-color: rgba(205,31,42,0.5); }
.k-senden {
  width: 44px; height: 44px; border-radius: 11px; flex: 0 0 auto;
  background: var(--accent-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ── Suche ───────────────────────────────────────────────────────────── */
.suche-ueberlagerung {
  position: fixed; inset: 0; z-index: 80; background: rgba(6,6,8,0.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; justify-content: center; padding: 8vh 16px 16px;
}
.suche-kasten {
  width: min(640px, 100%); max-height: 100%;
  background: var(--bg-erhoben); border: 1px solid var(--glass-rand);
  border-radius: 16px; box-shadow: var(--schatten);
  display: flex; flex-direction: column; overflow: hidden;
  align-self: flex-start;
}
.suche-kopf {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--glass-rand);
}
/* 16px, sonst zoomt iOS beim Fokussieren in die Seite hinein. */
.suche-kopf input { flex: 1; background: none; border: 0; outline: none; font-size: 16px; }
.suche-kopf input::-webkit-search-cancel-button { display: none; }
.suche-ergebnisse { overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.s-gruppe { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-leise); padding: 12px 10px 5px; }
.s-treffer {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px; border-radius: 10px; transition: background .1s;
}
.s-treffer:hover { background: var(--glass); }
.s-treffer-text { flex: 1; min-width: 0; }
.s-treffer-name { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-treffer-sub { display: block; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-leer { padding: 30px; text-align: center; color: var(--text-dim); font-size: 13.5px; }

/* ── Mitteilungen ────────────────────────────────────────────────────── */
.glocke-feld {
  position: fixed; z-index: 70; top: 64px; right: 22px;
  width: min(400px, calc(100vw - 24px));
  background: var(--bg-erhoben); border: 1px solid var(--glass-rand);
  border-radius: 14px; box-shadow: var(--schatten);
  overflow: hidden; animation: drawer-rein .15s ease-out;
}
.g-kopf { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--glass-rand); font-weight: 700; font-size: 14px; }
.g-lesen { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.g-lesen:hover { color: var(--text); }
.g-liste { max-height: 55vh; overflow-y: auto; overscroll-behavior: contain; }
.g-eintrag {
  display: flex; gap: 10px; width: 100%; text-align: left;
  padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background .1s; align-items: flex-start;
}
.g-eintrag:hover { background: var(--glass); }
.g-eintrag:last-child { border-bottom: 0; }
.g-punkt { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); margin-top: 6px; flex: 0 0 auto; }
.g-eintrag.gelesen .g-punkt { background: transparent; }
.g-text { font-size: 13px; line-height: 1.45; }
.g-eintrag.gelesen .g-text { color: var(--text-dim); }
.g-zeit { font-size: 11px; color: var(--text-leise); margin-top: 2px; }

/* ── Werkzeuge-Seite ─────────────────────────────────────────────────── */
.tools-raster {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px; margin-top: 6px;
}
.tool-kachel {
  display: flex; align-items: center; gap: 13px;
  background: var(--glass); border: 1px solid var(--glass-rand);
  border-radius: 14px; padding: 16px;
  transition: background .12s, transform .1s;
}
.tool-kachel:hover { background: var(--glass-hell); }
.tool-kachel:active { transform: scale(0.98); }
.tool-ic {
  width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.tool-name { font-size: 14.5px; font-weight: 700; }
.tool-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.tool-kachel .nav-extern { align-self: flex-start; }

/* ── Anfragen ────────────────────────────────────────────────────────── */
.anfrage-tabelle .tkopf, .anfrage-tabelle .zeile {
  grid-template-columns: minmax(240px, 1.8fr) 170px 100px 110px 110px 90px;
}
.prio-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700;
}
.prio-pill i { width: 8px; height: 8px; border-radius: 3px; display: block; }
.a-notiz { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-schleier {
  position: fixed; inset: 0; z-index: 90; background: rgba(6,6,8,0.8);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  width: min(460px, 100%); background: var(--bg-erhoben);
  border: 1px solid var(--glass-rand); border-radius: 16px;
  box-shadow: var(--schatten); padding: 20px;
  max-height: calc(100dvh - 32px); overflow-y: auto;
}
.modal-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-kopf h2 { font-size: 17px; font-weight: 800; }
.feld { display: block; margin-bottom: 12px; }
.feld span { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.feld input {
  width: 100%; background: var(--glass); border: 1px solid var(--glass-rand);
  border-radius: 10px; padding: 11px 13px; outline: none; font-size: 16px;
  color-scheme: dark;
}
.feld input:focus { border-color: rgba(205,31,42,0.5); }
.modal-hinweis { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin: 4px 0 14px; }

/* ── Untere Navigation (Mobil) ───────────────────────────────────────── */
.unten-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(14,14,18,0.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--glass-rand);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  grid-template-columns: 1fr 1fr 72px 1fr 1fr;
  align-items: center;
}
.unten-punkt {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 10px; color: var(--text-leise);
  font-size: 10px; font-weight: 600; position: relative;
  min-height: 48px; justify-content: center;
}
.unten-punkt.aktiv { color: var(--text); }
.unten-punkt.aktiv .u-ic { color: var(--accent); }
.u-ic { display: flex; position: relative; }
.u-badge {
  position: absolute; top: -5px; right: -9px;
  background: var(--accent); color: #fff; font-size: 9px; font-weight: 800;
  border-radius: 999px; min-width: 15px; height: 15px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}
.unten-plus {
  width: 56px; height: 56px; border-radius: 999px; margin: 0 auto;
  background: var(--accent-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(205,31,42,0.45);
  transform: translateY(-10px);
  transition: transform .12s;
}
.unten-plus:active { transform: translateY(-10px) scale(0.94); }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast-halter {
  position: fixed; z-index: 100; left: 50%; transform: translateX(-50%);
  bottom: 24px;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  background: var(--bg-erhoben); border: 1px solid var(--glass-rand);
  border-radius: 11px; padding: 11px 16px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--schatten); display: flex; align-items: center; gap: 9px;
  animation: toast-rein .2s ease-out;
}
.toast .ic { color: var(--gruen); display: flex; }
.toast.blitz .ic { color: var(--gelb); }
@keyframes toast-rein { from { transform: translateY(8px); opacity: 0; } }

/* ── Leer-Zustand ────────────────────────────────────────────────────── */
.leer { padding: 40px 20px; text-align: center; color: var(--text-dim); font-size: 13.5px; }

/* ══ Mobil ═══════════════════════════════════════════════════════════── */
@media (max-width: 900px) {
  .seitenleiste { display: none; }
  .unten-nav { display: grid; }
  .inhalt { padding: 2px 14px calc(var(--nav-hoehe) + 30px + env(safe-area-inset-bottom)); }
  .kopf { padding: 14px 14px 10px; padding-top: calc(14px + env(safe-area-inset-top)); }
  .kopf-titel { font-size: 20px; }
  .suchfeld { display: none; }             /* Suche hat unten den eigenen Tab */
  .tabelle { display: none; }              /* Mobil: Karten statt Tabelle */
  .karten { display: flex; }
  .drawer { width: 100%; border-left: 0; animation: hoch-rein .2s ease-out; }
  @keyframes hoch-rein { from { transform: translateY(16px); opacity: 0; } }
  .glocke-feld { top: auto; bottom: calc(var(--nav-hoehe) + 10px + env(safe-area-inset-bottom)); right: 12px; left: 12px; width: auto; }
  .d-meta { grid-template-columns: 1fr 1fr; }
  .suche-ueberlagerung { padding: 0; }
  .suche-kasten { border-radius: 0; border: 0; height: 100dvh; max-height: none; width: 100%; }
  .suche-kopf { padding-top: calc(14px + env(safe-area-inset-top)); }
  .tools-raster { grid-template-columns: 1fr; }
  /* Die Desktop-Gruppenkoepfe sind mobil tote Zeilen unter den Karten. */
  .gruppe-kopf { display: none; }
  /* Meistgenutzte Tipp-Ziele auf Daumengroesse. */
  .d-aufgabe .pill { min-height: 44px; }
  .d-aufgabe .komm, [data-faden] .komm { width: 44px; height: 44px; }
  .toast-halter { bottom: calc(var(--nav-hoehe) + 18px + env(safe-area-inset-bottom)); }
}
@media (min-width: 901px) {
  .karten { display: none; }
  /* Der Segment-Schalter gehoert zur Kartenansicht — auf dem Desktop
     uebernehmen die aufklappbaren Gruppen dieselbe Aufgabe. */
  .nur-mobil-halter { display: none; }
}

/* Weniger Bewegung, wenn das System es wünscht */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
