/* Larooms Eingang – Gestaltung
   Marke: Salbei #617455, Sand #F4EDE2, Tinte #1B1916, Schrift Manrope (Titel) und
   Hanken Grotesk (Text), lokal eingebunden. Bild: ein Posteingang auf Papier –
   Karten wie Laufzettel, die Vorgangsnummer als Stempel. */

@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('/fonts/hanken-grotesk-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('/fonts/hanken-grotesk-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light dark;
  --salbei: #617455; --salbei-tief: #4C5C43; --salbei-hell: #E3E8DA; --salbei-dunst: #EEF1E8;
  --sand: #F4EDE2; --sand-tief: #E8DFD3; --sand-rand: #D8CBB6; --papier: #FBF8F3;
  --tinte: #1B1916; --tinte-2: #423B31; --tinte-3: #7A7160; --tinte-4: #A39885;
  --rost: #B4543C; --rost-hell: #F3DDD5; --honig: #C0883E; --honig-hell: #F6E8D2; --blau: #3E6A8A; --blau-hell: #E1E9EF;

  --bg: var(--sand);
  --flaeche: #FFFDF9;
  --flaeche-2: var(--papier);
  --flaeche-druck: var(--sand-tief);
  --text: var(--tinte);
  --text-2: var(--tinte-2);
  --text-3: var(--tinte-3);
  --rand: var(--sand-rand);
  --rand-leise: #E6DCCC;
  --akzent: var(--salbei);
  --akzent-text: #FFFFFF;
  --akzent-hell: var(--salbei-hell);
  --p1: var(--rost); --p2: var(--honig); --p3: var(--salbei); --p4: #CBBBA2;
  --rot: var(--rost); --rot-hell: var(--rost-hell);
  --schatten: 0 1px 0 rgba(27, 25, 22, .04), 0 6px 18px -12px rgba(27, 25, 22, .28);
  --kopf-bg: rgba(244, 237, 226, .9);
  --live: #4E8A3A;

  --r-s: 8px; --r-m: 12px; --r-l: 16px;
  --titel: 'Manrope', system-ui, sans-serif;
  --text-schrift: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --leiste-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151311;
    --flaeche: #211E1A;
    --flaeche-2: #1B1916;
    --flaeche-druck: #2C2823;
    --text: #F4EDE2;
    --text-2: #D9CFC0;
    --text-3: #A39885;
    --rand: #3A342D;
    --rand-leise: #2E2924;
    --akzent: #8FA382;
    --akzent-text: #151311;
    --akzent-hell: #2C3427;
    --p1: #D9775E; --p2: #D7A35E; --p3: #8FA382; --p4: #5A5247;
    --rot: #E08A72; --rot-hell: #3A231D;
    --salbei-dunst: #232A20;
    --honig-hell: #3A2E1D; --blau-hell: #1E2A33; --blau: #8DB3CF;
    --schatten: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 22px -14px rgba(0, 0, 0, .8);
    --kopf-bg: rgba(21, 19, 17, .88);
    --live: #8FCB6E;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--text-schrift);
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--akzent); }
h1, h2, h3 { font-family: var(--titel); margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.boot { min-height: 100vh; display: grid; place-items: center; font-family: var(--titel); font-weight: 800; color: var(--text-3); letter-spacing: -.02em; }

/* ---------- Kopf ---------- */
.kopf {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--kopf-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rand-leise);
}
.marke { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--text); }
.marke-wort { font-family: var(--titel); font-weight: 800; letter-spacing: -.035em; font-size: 20px; }
.marke-zusatz { font-family: var(--titel); font-weight: 600; font-size: 14px; color: var(--akzent); padding-left: 8px; border-left: 2px solid var(--akzent); line-height: 1; }
.marke-wort.gross { font-size: 38px; display: block; line-height: 1; }
.marke-zusatz.gross { font-size: 20px; display: inline-block; margin-top: 8px; padding-left: 10px; }
.kopf-rechts { display: flex; align-items: center; gap: 10px; }

.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 4px 9px; border-radius: 99px; background: var(--flaeche-druck); font-variant-numeric: tabular-nums; }
.live-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--tinte-4); }
.live-live .live-punkt { background: var(--live); box-shadow: 0 0 0 0 var(--akzent); animation: puls 2.4s infinite; }
.live-abfrage .live-punkt { background: var(--honig); }
@keyframes puls { 0% { box-shadow: 0 0 0 0 rgba(97, 116, 85, .5); } 70% { box-shadow: 0 0 0 7px rgba(97, 116, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(97, 116, 85, 0); } }
@media (prefers-reduced-motion: reduce) { .live-live .live-punkt { animation: none; } }

.avatar {
  --farbe: var(--salbei);
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; flex-shrink: 0;
  background: var(--farbe); color: #fff; text-decoration: none;
  font-family: var(--titel); font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.avatar.gross { width: 52px; height: 52px; font-size: 18px; }

/* ---------- Inhalt ---------- */
main#inhalt { max-width: 760px; margin: 0 auto; padding: 18px 16px calc(var(--leiste-h) + 64px + env(safe-area-inset-bottom)); outline: none; }
.seitenkopf { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 16px; }
.seitenkopf-text { flex: 1; min-width: 0; }
.seitenkopf h1 { font-weight: 800; font-size: 30px; letter-spacing: -.035em; line-height: 1.08; overflow-wrap: anywhere; }
.unter { margin: 4px 0 0; color: var(--text-3); font-size: 14px; }
.zurueck { width: 40px; height: 40px; margin: -2px 0 0 -8px; display: grid; place-items: center; border-radius: 50%; color: var(--text); flex-shrink: 0; }
.zurueck:active { background: var(--flaeche-druck); }
.abschnitt { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 24px 0 8px; }
.leise { color: var(--text-3); font-size: 14px; margin: 6px 0 12px; }

/* ---------- Suche + Filter ---------- */
.suchzeile { position: relative; display: flex; gap: 8px; margin-bottom: 12px; }
.such-symbol { position: absolute; left: 13px; top: 13px; color: var(--text-3); pointer-events: none; }
.such-symbol .ic { width: 20px; height: 20px; }
.suchfeld { flex: 1; min-width: 0; height: 46px; padding: 0 12px 0 42px; border-radius: var(--r-m); border: 1px solid var(--rand); background: var(--flaeche); font-size: 16px; }
.suchfeld:focus, input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 1px; border-color: transparent; }
.knopf-symbol { position: relative; width: 46px; height: 46px; display: inline-grid; place-items: center; border-radius: var(--r-m); border: 1px solid var(--rand); background: var(--flaeche); color: var(--text-2); cursor: pointer; flex-shrink: 0; }
.knopf-symbol.an { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.knopf-symbol:disabled { opacity: .5; }
.filter { background: var(--flaeche); border: 1px solid var(--rand-leise); border-radius: var(--r-l); padding: 12px; margin-bottom: 14px; }
.filter-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .filter-raster { grid-template-columns: 1fr; } }

.zahl { position: absolute; top: -5px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--akzent); color: var(--akzent-text); font-size: 11px; font-weight: 800; display: grid; place-items: center; font-family: var(--titel); line-height: 1; }
.zahl.warn { background: var(--rot); color: #fff; }
.zahl.klein { top: -6px; right: -6px; }

/* ---------- Karten (Laufzettel) ---------- */
.liste { display: grid; gap: 10px; }
.karte {
  position: relative; display: block; text-decoration: none; color: var(--text);
  background: var(--flaeche); border: 1px solid var(--rand-leise); border-radius: var(--r-l);
  padding: 12px 14px 12px 20px; box-shadow: var(--schatten);
  transition: transform .12s ease, background .12s ease;
}
.karte:active { transform: scale(.99); background: var(--flaeche-2); }
.streifen { position: absolute; left: 7px; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--p3); }
.prio-1 .streifen { background: var(--p1); width: 5px; }
.prio-2 .streifen { background: var(--p2); }
.prio-4 .streifen { background: var(--p4); }
.karte-kopf { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.nummer { font-family: var(--titel); font-weight: 600; font-size: 12.5px; letter-spacing: .04em; color: var(--text-3); font-variant-numeric: tabular-nums; }
.karte-titel { font-family: var(--titel); font-weight: 800; font-size: 17px; letter-spacing: -.015em; line-height: 1.25; margin-top: 6px; overflow-wrap: anywhere; }
.karte-auszug { color: var(--text-3); font-size: 14px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.karte-fuss { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.status-erledigt .karte-titel, .status-abgelehnt .karte-titel { color: var(--text-3); }
.status-abgelehnt .karte-titel { text-decoration: line-through; text-decoration-thickness: 1px; }

.kanal { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 28px; height: 28px; border-radius: 50%; background: var(--flaeche-druck); color: var(--text-2); flex-shrink: 0; }
.kanal .ic { width: 16px; height: 16px; stroke-width: 2; }
.kanal-telefon { background: var(--blau-hell); color: var(--blau); }
.kanal-post { background: var(--honig-hell); color: var(--honig); }
.kanal-mail { background: var(--salbei-dunst); color: var(--akzent); }
.kanal-whatsapp { background: var(--salbei-dunst); color: #2F7A6B; }

.status-pill { margin-left: auto; font-size: 11px; font-weight: 800; font-family: var(--titel); text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 99px; white-space: nowrap; background: var(--flaeche-druck); color: var(--text-2); }
.s-neu { background: var(--akzent-hell); color: var(--akzent); }
.s-in_arbeit { background: var(--blau-hell); color: var(--blau); }
.s-wartet { background: var(--honig-hell); color: var(--honig); }
.s-erledigt { background: var(--salbei-dunst); color: var(--text-3); }
.s-abgelehnt { background: var(--flaeche-druck); color: var(--text-3); }
.prio-text { font-size: 11px; font-weight: 800; font-family: var(--titel); text-transform: uppercase; letter-spacing: .06em; }
.prio-text.p1 { color: var(--p1); }
.prio-text.p2 { color: var(--p2); }
.person-punkt { --farbe: var(--salbei); width: 26px; height: 26px; border-radius: 50%; background: var(--farbe); color: #fff; display: grid; place-items: center; font-family: var(--titel); font-weight: 800; font-size: 10.5px; flex-shrink: 0; box-shadow: 0 0 0 2px var(--flaeche); }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); background: var(--flaeche-2); border: 1px solid var(--rand-leise); border-radius: 99px; padding: 3px 9px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.chip .ic { width: 14px; height: 14px; }
.chip.rot, .rot { color: var(--rot); }
.chip.rot { background: var(--rot-hell); border-color: transparent; font-weight: 600; }
.chip-link b { color: var(--akzent); }
.chip-knopf { cursor: pointer; padding: 7px 12px; font-weight: 600; }
.chip-knopf:active { background: var(--akzent-hell); }
.chip-reihe { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.punkt { --farbe: var(--salbei); display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--farbe); margin-right: 6px; vertical-align: 1px; flex-shrink: 0; }

/* ---------- Leere Zustände ---------- */
.leer { text-align: center; padding: 42px 16px; color: var(--text-3); }
.leer-bild { width: 120px; height: 80px; fill: none; stroke: var(--rand); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin: 0 auto 10px; display: block; }
.leer-titel { font-family: var(--titel); font-weight: 800; font-size: 19px; color: var(--text-2); margin: 0; letter-spacing: -.02em; }
.leer-text { margin: 6px 0 16px; font-size: 14px; }

/* ---------- Ordner ---------- */
.kacheln-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.kachel-klein { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--r-l); background: var(--flaeche); border: 1px solid var(--rand-leise); color: var(--text); text-decoration: none; font-weight: 600; min-height: 56px; }
.kachel-klein .ic { color: var(--akzent); }
.ordner-liste { background: var(--flaeche); border: 1px solid var(--rand-leise); border-radius: var(--r-l); overflow: hidden; margin-bottom: 16px; }
.ordner-block + .ordner-block, .ordner-liste > a + a { border-top: 1px solid var(--rand-leise); }
.ordner-zeile { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: var(--text); text-decoration: none; min-height: 60px; }
.ordner-zeile:active { background: var(--flaeche-2); }
.tiefe-1 { padding-left: 34px; } .tiefe-2 { padding-left: 54px; } .tiefe-3 { padding-left: 74px; } .tiefe-4 { padding-left: 94px; }
.ordner-symbol { color: var(--akzent); }
.ordner-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ordner-titel { font-family: var(--titel); font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ordner-besitzer { font-size: 13px; color: var(--text-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ordner-zahlen { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.zahl-offen { font-family: var(--titel); font-weight: 800; font-size: 18px; min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.zahl-offen.null { color: var(--tinte-4); }
.zahl-ueber { font-size: 11.5px; font-weight: 600; color: var(--rot); background: var(--rot-hell); border-radius: 99px; padding: 1px 7px; white-space: nowrap; }
.ordner-info { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.ordner-aktionen { display: flex; gap: 6px; }
.ordner-aktionen .knopf-symbol { width: 38px; height: 38px; }
.ordner-bearbeiten { padding: 4px 14px 16px; background: var(--flaeche-2); }
.unterordner-zeile { display: flex; gap: 8px; margin-top: 12px; }
.unterordner-zeile input { flex: 1; min-width: 0; }
.archiv-zeile { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--rand-leise); }

/* ---------- Detail ---------- */
.detail-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stempel {
  font-family: var(--titel); font-weight: 800; font-size: 14px; letter-spacing: .08em; font-variant-numeric: tabular-nums;
  color: var(--akzent); border: 2px dashed var(--akzent); border-radius: 8px; padding: 4px 10px;
  transform: rotate(-1.5deg); background: var(--salbei-dunst);
}
.detail-kopf .kanal { width: auto; padding: 0 10px 0 8px; height: 30px; border-radius: 99px; margin-left: auto; font-size: 13px; font-weight: 600; }
.detail-titel { font-weight: 800; font-size: 26px; letter-spacing: -.03em; line-height: 1.15; padding-left: 14px; border-left: 5px solid var(--p3); overflow-wrap: anywhere; }
.detail-titel.prio-1 { border-color: var(--p1); } .detail-titel.prio-2 { border-color: var(--p2); } .detail-titel.prio-4 { border-color: var(--p4); }
.detail > .unter { margin: 8px 0 14px; }

.status-leiste { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px 6px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.status-leiste::-webkit-scrollbar { display: none; }
.status-knopf { flex-shrink: 0; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--rand); background: var(--flaeche); font-family: var(--titel); font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; color: var(--text-2); }
.status-knopf.aktiv { border-color: transparent; font-weight: 800; }
.status-knopf.aktiv.s-neu { background: var(--akzent); color: var(--akzent-text); }
.status-knopf.aktiv.s-in_arbeit { background: var(--blau); color: #fff; }
.status-knopf.aktiv.s-wartet { background: var(--honig); color: #fff; }
.status-knopf.aktiv.s-erledigt { background: var(--tinte-2); color: #fff; }
.status-knopf.aktiv.s-abgelehnt { background: var(--tinte-3); color: #fff; }
.status-knopf:disabled { opacity: .55; }

.block { background: var(--flaeche); border: 1px solid var(--rand-leise); border-radius: var(--r-l); padding: 16px; margin-bottom: 12px; }
.block h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 12px; }
.block.hinweis { background: var(--salbei-dunst); border-color: transparent; }
.block.hinweis p { margin: 6px 0 0; color: var(--text-2); }
.info { display: grid; grid-template-columns: max-content 1fr; gap: 9px 16px; margin: 0; }
.info-zeile { display: contents; }
.info dt { color: var(--text-3); font-size: 14px; }
.info dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.prio-marke { display: inline-flex; align-items: center; gap: 6px; }
.prio-marke::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--p3); }
.prio-marke.p1::before { background: var(--p1); } .prio-marke.p2::before { background: var(--p2); } .prio-marke.p4::before { background: var(--p4); }
.fliesstext { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.hinweis-band { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--honig-hell); color: var(--text); border-radius: var(--r-m); padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }

.anhang-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 12px; }
.anhang-bild { display: block; aspect-ratio: 1; border-radius: var(--r-m); overflow: hidden; background: var(--flaeche-druck); }
.anhang-bild img { width: 100%; height: 100%; object-fit: cover; }
.anhang-datei { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px; aspect-ratio: 1; padding: 10px; border-radius: var(--r-m); background: var(--flaeche-2); border: 1px solid var(--rand-leise); color: var(--text); text-decoration: none; font-size: 12.5px; overflow: hidden; }
.anhang-datei span { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.anhang-datei small { color: var(--text-3); }
.anhang-datei audio { width: 100%; }

.verlauf { list-style: none; margin: 0; padding: 0; position: relative; }
.verlauf::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--rand-leise); }
.verlauf-eintrag { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.verlauf-eintrag:last-child { padding-bottom: 0; }
.verlauf-symbol { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--flaeche-druck); color: var(--text-3); flex-shrink: 0; z-index: 1; box-shadow: 0 0 0 3px var(--flaeche); }
.verlauf-symbol .ic { width: 16px; height: 16px; }
.art-kommentar .verlauf-symbol { background: var(--akzent); color: var(--akzent-text); }
.art-eingang .verlauf-symbol { background: var(--honig-hell); color: var(--honig); }
.art-antwort .verlauf-symbol { background: var(--blau-hell); color: var(--blau); }
.verlauf-inhalt { flex: 1; min-width: 0; padding-top: 5px; }
.verlauf-kopf { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-3); }
.verlauf-wer { font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; }
.verlauf-wer.system { font-weight: 400; color: var(--text-3); }
.verlauf-text { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.art-kommentar .verlauf-text { background: var(--flaeche-2); border: 1px solid var(--rand-leise); border-radius: 4px var(--r-m) var(--r-m) var(--r-m); padding: 8px 11px; margin-top: 4px; }
.art-system .verlauf-text, .art-status .verlauf-text, .art-zuweisung .verlauf-text, .art-anhang .verlauf-text { color: var(--text-2); font-size: 14px; }

.kommentar-box {
  position: sticky; bottom: calc(var(--leiste-h) + 34px + env(safe-area-inset-bottom)); z-index: 10;
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--r-l); padding: 8px; box-shadow: 0 10px 30px -14px rgba(27, 25, 22, .45);
}
.kommentar-box textarea { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; padding: 9px 6px; min-height: 44px; max-height: 40vh; field-sizing: content; }
.kommentar-box textarea:focus { outline: none; }
.kommentar-box .knopf { min-height: 44px; padding: 0 14px; }

/* ---------- Formulare ---------- */
.formular { display: block; }
.feld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.feld > span { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.feld small { color: var(--text-3); font-size: 12.5px; }
.pflicht { color: var(--rot); }
input[type=text], input[type=tel], input[type=email], input[type=url], input[type=number], input[type=password], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 13px; border-radius: var(--r-m); border: 1px solid var(--rand);
  background: var(--flaeche); font-size: 16px; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { resize: vertical; line-height: 1.45; }
input[type=date], input[type=datetime-local] { min-width: 0; }
.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 420px) { .zwei-spalten { grid-template-columns: 1fr; } }
.schalter-zeile { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.schalter-zeile input { width: 22px; height: 22px; accent-color: var(--salbei); flex-shrink: 0; }
.schalter-liste { display: grid; margin-bottom: 10px; }
.fehler-text { color: var(--rot); font-weight: 600; min-height: 1.2em; margin: 0 0 10px; font-size: 14px; }

.prio-gruppe { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.prio-wahl { min-height: 46px; border-radius: var(--r-m); border: 1px solid var(--rand); background: var(--flaeche); font-family: var(--titel); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text-2); border-top: 4px solid var(--p3); padding: 0 4px; }
.prio-wahl.p1 { border-top-color: var(--p1); } .prio-wahl.p2 { border-top-color: var(--p2); } .prio-wahl.p4 { border-top-color: var(--p4); }
.prio-wahl.an { background: var(--tinte); color: var(--sand); border-color: var(--tinte); font-weight: 800; }
.prio-wahl.p1.an { background: var(--p1); border-color: var(--p1); color: #fff; }
@media (prefers-color-scheme: dark) { .prio-wahl.an { background: var(--text); color: var(--bg); border-color: var(--text); } }

.farb-gruppe { display: flex; flex-wrap: wrap; gap: 8px; }
.farbe { --farbe: var(--salbei); width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--flaeche); background: var(--farbe); box-shadow: 0 0 0 1px var(--rand); cursor: pointer; }
.farbe.an { box-shadow: 0 0 0 3px var(--text); }

.wahl-gruppe { display: grid; gap: 8px; }
.wahl-karte { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--rand); border-radius: var(--r-m); cursor: pointer; }
.wahl-karte input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--salbei); }
.wahl-karte span { display: flex; flex-direction: column; }
.wahl-karte small { color: var(--text-3); }
.wahl-karte:has(input:checked) { border-color: var(--akzent); background: var(--salbei-dunst); }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-m); border: 1px solid var(--akzent);
  background: var(--akzent); color: var(--akzent-text); text-decoration: none; cursor: pointer;
  font-family: var(--titel); font-weight: 800; font-size: 15px; letter-spacing: -.005em;
  transition: transform .1s ease, opacity .1s ease;
}
.knopf:active { transform: translateY(1px); }
.knopf:disabled { opacity: .55; cursor: progress; }
.knopf.zweit { background: transparent; color: var(--akzent); }
.knopf.gross { width: 100%; min-height: 56px; font-size: 17px; margin-top: 6px; }
.knopf.breit { width: 100%; margin-top: 8px; }
.knopf-text { background: none; border: 0; color: var(--akzent); font-weight: 600; cursor: pointer; padding: 10px 4px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 15px; }
.knopf-text .ic { width: 18px; height: 18px; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.block > .knopf-reihe:first-child { margin-top: 0; }

/* ---------- Neu ---------- */
.kacheln { display: grid; gap: 12px; }
.kachel { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: var(--r-l); background: var(--flaeche); border: 1px solid var(--rand-leise); color: var(--text); text-decoration: none; box-shadow: var(--schatten); min-height: 92px; }
.kachel:first-child { background: var(--salbei); border-color: var(--salbei); color: #fff; }
.kachel:first-child .kachel-text span { color: rgba(255, 255, 255, .82); }
.kachel:first-child .kachel-symbol { background: rgba(255, 255, 255, .16); color: #fff; }
.kachel:active { transform: scale(.99); }
.kachel-symbol { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--akzent-hell); color: var(--akzent); flex-shrink: 0; }
.kachel-symbol .ic { width: 28px; height: 28px; }
.kachel-text { display: flex; flex-direction: column; gap: 3px; }
.kachel-text b { font-family: var(--titel); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.kachel-text span { color: var(--text-3); font-size: 14px; }

.datei-liste { display: grid; gap: 8px; margin: 12px 0 16px; }
.datei { display: grid; grid-template-columns: 52px 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 0 10px; background: var(--flaeche); border: 1px solid var(--rand-leise); border-radius: var(--r-m); padding: 6px; }
.datei img, .datei .datei-symbol { grid-row: span 2; width: 52px; height: 52px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: var(--flaeche-druck); color: var(--text-3); }
.datei-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datei small { color: var(--text-3); font-size: 12px; grid-column: 2; }
.datei .knopf-symbol { grid-row: 1 / span 2; grid-column: 3; width: 40px; height: 40px; border: 0; background: transparent; }

/* ---------- Mehr ---------- */
.profil { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--flaeche); border: 1px solid var(--rand-leise); border-radius: var(--r-l); margin-bottom: 12px; }
.profil b { display: block; font-family: var(--titel); font-weight: 800; font-size: 19px; }
.profil small { color: var(--text-3); }
.menue { background: var(--flaeche); border: 1px solid var(--rand-leise); border-radius: var(--r-l); overflow: hidden; margin-bottom: 12px; }
.menue-zeile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 58px; color: var(--text); text-decoration: none; }
.menue-zeile + .menue-zeile { border-top: 1px solid var(--rand-leise); }
.menue-zeile .ic { color: var(--akzent); }
.menue-zeile span { display: flex; flex-direction: column; }
.menue-zeile small { color: var(--text-3); font-size: 13px; }
.menue-zeile:active { background: var(--flaeche-2); }
.fusszeile { text-align: center; color: var(--text-3); font-size: 12.5px; margin-top: 22px; }
.personen-liste { background: var(--flaeche); border: 1px solid var(--rand-leise); border-radius: var(--r-l); overflow: hidden; margin-bottom: 14px; }
.person-zeile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); text-decoration: none; }
.person-zeile + .person-zeile { border-top: 1px solid var(--rand-leise); }
.person-zeile.inaktiv { opacity: .55; }
.person-zeile.gewaehlt { background: var(--salbei-dunst); }
.person-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-name small { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.protokoll { list-style: none; padding: 0; margin: 0 0 12px; font-size: 14px; }
.protokoll li { display: flex; gap: 12px; padding: 6px 0; border-top: 1px solid var(--rand-leise); }
.protokoll time { color: var(--text-3); min-width: 92px; }
.kanal-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.kanal-liste li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.kanal-liste small { grid-column: 1 / -1; color: var(--text-3); }
.kanal-liste .status-pill { margin-left: 0; }

/* ---------- Untere Leiste ---------- */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--leiste-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
  background: var(--flaeche); border-top: 1px solid var(--rand-leise);
}
.leiste-punkt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--leiste-h); color: var(--text-3); text-decoration: none; font-size: 11.5px; font-weight: 600; }
.leiste-symbol { position: relative; display: grid; place-items: center; width: 44px; height: 30px; border-radius: 99px; }
.leiste-punkt.aktiv { color: var(--text); }
.leiste-punkt.aktiv .leiste-symbol { background: var(--akzent-hell); color: var(--akzent); }
.leiste-neu .leiste-symbol { width: 54px; height: 54px; margin-top: -26px; border-radius: 18px; background: var(--akzent); color: var(--akzent-text); box-shadow: 0 8px 20px -8px rgba(76, 92, 67, .8), 0 0 0 4px var(--bg); }
.leiste-neu .leiste-symbol .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.leiste-neu.aktiv .leiste-symbol { background: var(--salbei-tief); color: #fff; }
@media (prefers-color-scheme: dark) { .leiste-neu.aktiv .leiste-symbol { background: var(--akzent); color: var(--akzent-text); } }
@media (min-width: 760px) { .leiste { left: 50%; right: auto; width: 560px; transform: translateX(-50%); bottom: 14px; border: 1px solid var(--rand-leise); border-radius: 22px; box-shadow: var(--schatten); height: var(--leiste-h); padding-bottom: 0; } }

/* ---------- Anmeldung / Erster Start ---------- */
.tor { min-height: 100vh; min-height: 100dvh; max-width: 460px; margin: 0 auto; padding: calc(36px + env(safe-area-inset-top)) 16px 40px; display: flex; flex-direction: column; gap: 24px; }
.marken-kopf { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; padding: 0 4px; }
.marken-symbol { width: 72px; height: 72px; border-radius: 22px; background: var(--salbei); color: #fff; display: grid; place-items: center; box-shadow: var(--schatten); }
.marken-symbol .ic { width: 38px; height: 38px; stroke-width: 1.7; }
.marken-unter { grid-column: 1 / -1; margin: 0; color: var(--text-3); font-size: 15px; }
.tor-karte { background: var(--flaeche); border: 1px solid var(--rand-leise); border-radius: 22px; padding: 22px 18px; box-shadow: var(--schatten); }
.tor-karte h1 { font-weight: 800; font-size: 24px; letter-spacing: -.03em; margin-bottom: 14px; }
.namen { display: grid; gap: 8px; }
.name-knopf { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 14px; border-radius: var(--r-l); border: 1px solid var(--rand-leise); background: var(--flaeche-2); cursor: pointer; text-align: left; font-family: var(--titel); font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.name-knopf:active { background: var(--akzent-hell); }
.name-knopf.zuletzt { border-color: var(--akzent); }
.gewaehlt-name { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-family: var(--titel); font-size: 19px; }
.pin-eingabe { font-size: 28px !important; letter-spacing: .5em; text-align: center; font-family: var(--titel) !important; font-weight: 800; }

/* ---------- Hinweis ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  top: calc(66px + env(safe-area-inset-top));
  max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 14px;
  background: var(--tinte); color: var(--sand); font-weight: 600; font-size: 15px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5);
}
.toast.fehler { background: var(--rost); color: #fff; }
@media (prefers-color-scheme: dark) { .toast { background: var(--sand); color: var(--tinte); } .toast.fehler { background: var(--rost); color: #fff; } }

/* ---------- KI-Vorschlag (EIN11) ----------
   Deutlich als Vorschlag: gestrichelter blauer Rahmen, Marke „KI-Vorschlag“ –
   anders als alles, was Menschen eingetragen haben. */
.ki-box { border: 1.5px dashed var(--blau); background: var(--blau-hell); }
.ki-box.ki-aus { border: 1px solid var(--rand-leise); background: var(--flaeche); padding: 10px 16px; }
.ki-box.ki-aus .ki-kopf { margin-bottom: 4px; }
.ki-box.ki-aus .ki-marke { background: var(--tinte-4); }
.ki-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.ki-marke { font-family: var(--titel); font-weight: 800; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--flaeche); background: var(--blau); border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
.ki-marke.klein { font-size: 10px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.ki-hinweis { font-size: 13px; color: var(--text-2); }
.ki-meta { font-size: 12px; color: var(--text-3); margin: 0 0 6px; }
.ki-kurz { margin: 0 0 10px; overflow-wrap: anywhere; }
.ki-status { margin: 2px 0; color: var(--text-2); font-size: 14px; }
.ki-chips { margin: 0 0 6px; }
.ki-chip { background: var(--blau-hell); border-color: var(--blau); color: var(--blau); }
.ki-begruendung { margin: 0 0 6px; }
.ki-info { margin-top: 8px; }
.ki-abschnitt { margin-top: 14px; }
.ki-abschnitt h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 6px; }
.ki-liste, .ki-aufgaben { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ki-liste li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; overflow-wrap: anywhere; }
.ki-liste .knopf-text { padding: 4px 0; font-size: 14px; }
.ki-datum { font-weight: 600; font-variant-numeric: tabular-nums; }
.ki-aufgaben li { background: var(--flaeche); border: 1px solid var(--rand-leise); border-radius: var(--r-m); padding: 10px 12px; display: grid; gap: 6px; justify-items: start; overflow-wrap: anywhere; }
.ki-aufgaben li > * { max-width: 100%; }
.ki-aufgaben p { margin: 0; }
.knopf.klein { min-height: 40px; padding: 0 14px; font-size: 14px; }
.karte-ki { font-size: 14px; color: var(--text-2); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
