
/* ==========================================================
   Finor Kunden-App – Styles
   Farben = Finor-Markenfarben (aus Logo & Flyer). Hier zentral änderbar.
   ========================================================== */
:root {
  --primaer: #005e1d;          /* Finor-Grün (Logo) */
  --primaer-dunkel: #00461a;
  --primaer-hell: #e5efe8;     /* zarte Grün-Fläche */
  --primaer-text: #ffffff;     /* Text auf Grün */
  --akzent: #217e64;           /* Finor Akzent-Grün (Flyer) */
  --schiefer: #375344;         /* Finor Graugrün (Flyer) */
  --hintergrund: #f2f2f2;      /* Finor Hellgrau (Flyer) */
  --flaeche: #ffffff;
  --text: #17201a;
  --text-leise: #5d6b62;
  --linie: #dfe4e0;
  --gefahr: #b3261e;
  --gefahr-hell: #fbe9e7;
  --warnung: #9a5b00;
  --warnung-hell: #fff3dc;
  --info: #1f5f8b;
  --info-hell: #e4f0f8;

  --radius: 14px;
  --radius-klein: 10px;
  --schatten: 0 1px 2px rgba(0, 40, 15, .06), 0 2px 8px rgba(0, 40, 15, .06);
  --tabbar-h: 64px;
  --topbar-h: 56px;
  --safe-unten: env(safe-area-inset-bottom, 0px);
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--hintergrund);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 4px;
  padding: 0 8px 0 12px;
  background: var(--primaer); color: var(--primaer-text);
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.topbar-titel { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.topbar-titel .titel-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-titel small { display: block; font-weight: 400; font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-aktion { display: flex; gap: 4px; }
.icon-btn {
  width: 44px; height: 44px; border: 0; background: transparent; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
}
.icon-btn:active { background: rgba(255,255,255,.15); }
.icon-btn svg, .tab svg, .btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Logo-Platzhalter */
.logo-mini { display: flex; align-items: center; gap: 8px; }
.logo-mini svg { width: 40px; height: 22px; }
.logo-mini img { height: 32px; width: auto; border-radius: 6px; background: #fff; padding: 2px; }
.logo-svg path { fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.logo-svg .stern { fill: currentColor; stroke: none; }
.logo-wort { font-weight: 800; letter-spacing: .2px; line-height: 1.05; }
.logo-wort span { display: block; font-weight: 400; font-size: .62em; opacity: .9; }

/* ---------- Ladezustände ---------- */
.ladebalken {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; height: 3px; z-index: 30;
  background: linear-gradient(90deg, transparent, var(--akzent), transparent);
  background-size: 50% 100%; background-repeat: no-repeat;
  animation: lade 1s linear infinite; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.ladebalken.an { opacity: 1; }
@keyframes lade { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.start-lader { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 50vh; color: var(--text-leise); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--primaer-hell); border-top-color: var(--primaer); border-radius: 50%; animation: dreh .8s linear infinite; }
.spinner.klein { width: 18px; height: 18px; border-width: 2px; }
@keyframes dreh { to { transform: rotate(360deg); } }
.skelett { background: linear-gradient(90deg, #e9ecea 25%, #f4f6f4 50%, #e9ecea 75%); background-size: 200% 100%; animation: glanz 1.2s infinite; border-radius: 8px; }
@keyframes glanz { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Layout ---------- */
.inhalt {
  max-width: 720px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-unten) + 24px);
}
body.ohne-tabs .inhalt { padding-bottom: calc(var(--safe-unten) + 32px); }
.abschnitt-titel { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-leise); margin: 22px 4px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.abschnitt-titel:first-child { margin-top: 4px; }
h1.seiten-titel { font-size: 24px; margin: 4px 4px 14px; line-height: 1.2; }
.leise { color: var(--text-leise); }
.klein { font-size: 14px; }
.mini { font-size: 12px; }
.zeile { display: flex; align-items: center; gap: 10px; }
.zeile.zwischen { justify-content: space-between; }
.wachsen { flex: 1; min-width: 0; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }

/* ---------- Karten ---------- */
.karte {
  background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 16px; margin-bottom: 12px;
}
.karte.tippbar { cursor: pointer; transition: transform .08s; }
.karte.tippbar:active { transform: scale(.985); }
.karte-hero { background: var(--primaer); color: var(--primaer-text); position: relative; overflow: hidden; }
.karte-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.07); }
.karte-hero .label { opacity: .85; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.karte-hero .gross { font-size: 24px; font-weight: 800; margin: 6px 0 2px; line-height: 1.2; }
.karte-hero .relativ { display: inline-block; margin-top: 10px; background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.kachel { background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten); padding: 14px; min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; border: 0; text-align: left; width: 100%; }
.kachel .zahl { font-size: 30px; font-weight: 800; color: var(--primaer); line-height: 1; }
.kachel .titel { font-size: 13px; color: var(--text-leise); font-weight: 600; }

/* ---------- Listen ---------- */
.liste { background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; margin-bottom: 12px; }
.listen-eintrag {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 60px;
  border-bottom: 1px solid var(--linie); background: var(--flaeche); width: 100%; border-left: 0; border-right: 0; border-top: 0; text-align: left;
}
.listen-eintrag:last-child { border-bottom: 0; }
button.listen-eintrag:active, .listen-eintrag.tippbar:active { background: #f5f7f5; }
.listen-eintrag .titel { font-weight: 600; }
.listen-eintrag .unter { font-size: 14px; color: var(--text-leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevron { width: 20px; height: 20px; flex: none; color: #a7b3ab; }
.chevron path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.datum-block { width: 52px; flex: none; text-align: center; border-radius: 12px; background: var(--primaer-hell); color: var(--primaer); padding: 6px 0; }
.datum-block .tag { font-size: 20px; font-weight: 800; line-height: 1.1; }
.datum-block .monat { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.datum-block.grau { background: #eef0ee; color: var(--text-leise); }
.datum-block.rot { background: var(--gefahr-hell); color: var(--gefahr); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.4; }
.badge-geplant { background: #e8eeea; color: var(--schiefer); }
.badge-erledigt { background: var(--primaer-hell); color: var(--primaer); }
.badge-ausgefallen { background: var(--gefahr-hell); color: var(--gefahr); }
.badge-offen { background: var(--warnung-hell); color: var(--warnung); }
.badge-in-arbeit { background: var(--info-hell); color: var(--info); }
.badge-wunsch { background: #eef4f2; color: var(--akzent); }
.badge-mangel { background: var(--gefahr-hell); color: var(--gefahr); }
.badge-gesperrt { background: #eceeed; color: #6b6f6c; }
.zaehler { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gefahr); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.zaehler.gelb { background: #e19a00; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: 12px; border: 0;
  background: var(--primaer); color: var(--primaer-text); font-weight: 700; font-size: 16px;
  transition: filter .1s, transform .08s; text-decoration: none;
}
.btn:active { transform: scale(.98); filter: brightness(.92); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.voll { width: 100%; }
.btn.zweit { background: var(--primaer-hell); color: var(--primaer); }
.btn.rahmen { background: var(--flaeche); color: var(--primaer); box-shadow: inset 0 0 0 1.5px var(--primaer); }
.btn.gefahr { background: var(--gefahr); color: #fff; }
.btn.gefahr-leise { background: var(--gefahr-hell); color: var(--gefahr); }
.btn.klein { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.klein svg { width: 18px; height: 18px; }
.btn-reihe { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-reihe > .btn { flex: 1; padding: 0 12px; white-space: nowrap; }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + var(--safe-unten) + 18px); z-index: 15;
  width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--primaer); color: #fff;
  box-shadow: 0 6px 18px rgba(0, 70, 26, .35); display: flex; align-items: center; justify-content: center;
}
.fab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.link-btn { background: none; border: 0; color: var(--primaer); font-weight: 700; padding: 8px 4px; font-size: 14px; }

/* ---------- Segment-Umschalter ---------- */
.segmente { display: flex; background: #e4e8e5; border-radius: 12px; padding: 3px; margin-bottom: 14px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.segmente::-webkit-scrollbar { display: none; }
.segmente button { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--text-leise); white-space: nowrap; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.segmente button.aktiv { background: var(--flaeche); color: var(--primaer); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + var(--safe-unten)); padding-bottom: var(--safe-unten);
  background: rgba(255,255,255,.97); border-top: 1px solid var(--linie);
  display: flex; justify-content: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tab {
  flex: 1; min-width: 0; max-width: 160px; border: 0; background: transparent; color: #7c8a81;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; position: relative; padding: 0 1px;
}
.tab span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 430px) { .tabbar .tab:nth-child(6) ~ .tab, .tabbar .tab { font-size: 10px; letter-spacing: -.1px; } .tabbar .tab svg { width: 22px; height: 22px; } }
.tab.aktiv { color: var(--primaer); }
.tab.aktiv svg { stroke-width: 2.4; }
.tab .zaehler { position: absolute; top: 6px; left: calc(50% + 6px); height: 18px; min-width: 18px; font-size: 11px; padding: 0 5px; }

/* ---------- Formulare ---------- */
.feld { margin-bottom: 14px; }
.feld label, .feld .label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px 2px; color: var(--schiefer); }
.eingabe, select.eingabe, textarea.eingabe {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--linie); background: var(--flaeche); font-size: 16px; outline: none;
  -webkit-appearance: none; appearance: none;
}
select.eingabe { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%235d6b62' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }
textarea.eingabe { min-height: 96px; resize: vertical; }
.eingabe:focus { border-color: var(--primaer); box-shadow: 0 0 0 3px rgba(0, 94, 29, .14); }
.zwei-spalten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.schalter-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.schalter-zeile:last-child { border-bottom: 0; }
.schalter { position: relative; width: 52px; height: 32px; flex: none; }
.schalter input { opacity: 0; width: 0; height: 0; position: absolute; }
.schalter span { position: absolute; inset: 0; background: #cdd4cf; border-radius: 16px; transition: .2s; }
.schalter span::before { content: ""; position: absolute; width: 26px; height: 26px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.schalter input:checked + span { background: var(--primaer); }
.schalter input:checked + span::before { transform: translateX(20px); }
.hinweis { background: var(--primaer-hell); color: var(--schiefer); padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.hinweis.warn { background: var(--warnung-hell); color: var(--warnung); }

/* ---------- Checkliste ---------- */
.bereich { margin-bottom: 14px; }
.bereich-kopf { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; }
.bereich-kopf h3 { margin: 0; font-size: 16px; color: var(--primaer); }
.check-eintrag { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--linie); align-items: flex-start; background: var(--flaeche); }
.check-eintrag:last-child { border-bottom: 0; }
.haken { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid #c5cec8; display: flex; align-items: center; justify-content: center; background: #fff; margin-top: -2px; }
.haken svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.haken.an { background: var(--primaer); border-color: var(--primaer); }
.haken.an svg { opacity: 1; }
.haken.nein { border-color: var(--gefahr); background: var(--gefahr-hell); }
.haken.nein svg { opacity: 1; stroke: var(--gefahr); }
.check-text { flex: 1; min-width: 0; }
.check-text .aufgabe { font-weight: 500; }
.check-text .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; }
.rhythmus { font-size: 11.5px; font-weight: 700; color: var(--akzent); background: #edf5f2; padding: 2px 8px; border-radius: 999px; }
.kommentar { font-size: 14px; color: var(--schiefer); background: #f5f7f5; border-left: 3px solid var(--akzent); padding: 6px 10px; border-radius: 0 8px 8px 0; margin-top: 6px; white-space: pre-wrap; }
.inaktiv .aufgabe { text-decoration: line-through; color: var(--text-leise); }

/* Admin: abhakbare Zeilen */
.abhaken { width: 100%; text-align: left; border: 0; background: var(--flaeche); display: flex; gap: 14px; align-items: center; padding: 14px 16px; min-height: 64px; }
.abhaken .haken { width: 34px; height: 34px; margin: 0; }
.abhaken .haken svg { width: 20px; height: 20px; }
.abhaken:active { background: #f3f6f4; }
.check-wrap { border-bottom: 1px solid var(--linie); }
.check-wrap:last-child { border-bottom: 0; }
.check-wrap .kommentar-feld { padding: 0 16px 12px 64px; }
.kommentar-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: #8a978f; display: flex; align-items: center; justify-content: center; }
.kommentar-btn.hat { color: var(--akzent); background: #edf5f2; }
.kommentar-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fortschritt { height: 8px; background: #e3e8e4; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.fortschritt > div { height: 100%; background: var(--primaer); border-radius: 4px; transition: width .25s; }
.sortier-btns { display: flex; gap: 2px; flex: none; }
.sortier-btns button { width: 38px; height: 38px; border: 0; border-radius: 10px; background: #f0f3f1; color: var(--schiefer); display: flex; align-items: center; justify-content: center; }
.sortier-btns button:disabled { opacity: .35; }
.sortier-btns svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Fotos ---------- */
.foto-raster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.foto-kachel { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e5e9e6; border: 0; padding: 0; }
.foto-kachel img { width: 100%; height: 100%; object-fit: cover; }
.foto-kachel .weg { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.foto-kachel.laedt { display: flex; align-items: center; justify-content: center; }
.foto-neu { aspect-ratio: 1; border-radius: 10px; border: 2px dashed #b8c4bc; background: #f8faf8; color: var(--primaer); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 700; cursor: pointer; }
.foto-neu svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.foto-neu input { display: none; }
img[data-foto]:not([src]) { visibility: hidden; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.chat-tag { text-align: center; font-size: 12px; color: var(--text-leise); font-weight: 600; margin: 12px 0 4px; }
.blase { max-width: 84%; padding: 10px 13px; border-radius: 18px; box-shadow: 0 1px 1px rgba(0,0,0,.05); word-wrap: break-word; white-space: pre-wrap; position: relative; }
.blase.ich { align-self: flex-end; background: var(--primaer); color: #fff; border-bottom-right-radius: 6px; }
.blase.andere { align-self: flex-start; background: var(--flaeche); border-bottom-left-radius: 6px; }
.blase .zeit { font-size: 11px; opacity: .7; margin-top: 4px; text-align: right; display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.blase .kopf { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.blase.ich .badge-wunsch, .blase.ich .badge-mangel { background: rgba(255,255,255,.2); color: #fff; }
.blase .foto-kachel { width: 220px; max-width: 100%; aspect-ratio: 4/3; margin: 2px 0 4px; }
.status-wahl { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.status-wahl button { border: 1.5px solid var(--linie); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--text-leise); min-height: 34px; }
.status-wahl button.aktiv.offen { border-color: var(--warnung); color: var(--warnung); background: var(--warnung-hell); }
.status-wahl button.aktiv.in-arbeit { border-color: var(--info); color: var(--info); background: var(--info-hell); }
.status-wahl button.aktiv.erledigt { border-color: var(--primaer); color: var(--primaer); background: var(--primaer-hell); }

.composer {
  position: fixed; left: 0; right: 0; z-index: 18;
  bottom: calc(var(--tabbar-h) + var(--safe-unten));
  background: rgba(255,255,255,.98); border-top: 1px solid var(--linie);
  padding: 8px 12px 10px;
}
body.ohne-tabs .composer { bottom: 0; padding-bottom: calc(10px + var(--safe-unten)); }
.composer-innen { max-width: 720px; margin: 0 auto; }
.typ-wahl { display: flex; gap: 6px; margin-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.typ-wahl button { border: 1.5px solid var(--linie); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--text-leise); min-height: 34px; }
.typ-wahl button.aktiv { border-color: var(--primaer); background: var(--primaer-hell); color: var(--primaer); }
.typ-wahl button.aktiv.mangel { border-color: var(--gefahr); background: var(--gefahr-hell); color: var(--gefahr); }
.composer-zeile { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 46px; max-height: 140px; padding: 11px 14px; border-radius: 23px; border: 1.5px solid var(--linie); resize: none; outline: none; font-size: 16px; line-height: 1.35; }
.composer textarea:focus { border-color: var(--primaer); }
.rund-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; flex: none; display: flex; align-items: center; justify-content: center; background: var(--primaer-hell); color: var(--primaer); }
.rund-btn.senden { background: var(--primaer); color: #fff; }
.rund-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rund-btn input { display: none; }
.anhang-vorschau { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.anhang-vorschau img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.chat-platz { height: 150px; }
body.ohne-tabs .chat-platz { height: 100px; }

/* ---------- Overlays (Bottom-Sheet, Dialog, Lightbox) ---------- */
.hintergrund-dimm { position: fixed; inset: 0; background: rgba(10, 25, 15, .45); z-index: 50; opacity: 0; transition: opacity .2s; }
.hintergrund-dimm.an { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-height: 92vh; display: flex; flex-direction: column;
  background: var(--hintergrund); border-radius: 20px 20px 0 0;
  transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
  max-width: 720px; margin: 0 auto;
}
.sheet.an { transform: translateY(0); }
.sheet-griff { width: 40px; height: 5px; border-radius: 3px; background: #c9d0cb; margin: 8px auto 0; }
.sheet-kopf { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 18px; }
.sheet-kopf h2 { font-size: 18px; margin: 0; }
.sheet-kopf .icon-btn { color: var(--text-leise); }
.sheet-inhalt { overflow-y: auto; padding: 4px 16px calc(20px + var(--safe-unten)); -webkit-overflow-scrolling: touch; }
.dialog { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.95); z-index: 52; background: #fff; border-radius: 18px; padding: 20px; width: calc(100% - 48px); max-width: 380px; opacity: 0; transition: .18s; }
.dialog.an { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.dialog h3 { margin: 0 0 8px; font-size: 18px; }
.dialog p { margin: 0 0 18px; color: var(--text-leise); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .icon-btn { position: absolute; top: 10px; right: 10px; color: #fff; background: rgba(255,255,255,.12); }
.lightbox .spinner { position: absolute; border-color: rgba(255,255,255,.2); border-top-color: #fff; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--topbar-h) + 12px); z-index: 70;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  background: #1f2a23; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px;
  max-width: calc(100% - 32px); width: max-content; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: .22s;
}
.toast.an { opacity: 1; transform: translate(-50%, 0); }
.toast.fehler { background: var(--gefahr); }

/* ---------- Leer- & Fehlerzustände ---------- */
.leer { text-align: center; padding: 32px 20px; color: var(--text-leise); }
.leer svg { width: 48px; height: 48px; fill: none; stroke: #b3c0b7; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px; }
.leer .titel { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.fehler-box { background: var(--gefahr-hell); color: var(--gefahr); border-radius: var(--radius); padding: 18px; text-align: center; }
.fehler-box .btn { margin-top: 12px; }

.fehlerseite { max-width: 420px; margin: 0 auto; padding: 64px 24px; text-align: center; }
.fehler-logo { color: var(--primaer); display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 28px; }
.fehler-logo .logo-svg { width: 120px; height: 64px; }
.fehler-logo .logo-wort { font-size: 30px; }
.fehler-logo img { max-width: 200px; }
.fehlerseite h1 { font-size: 22px; margin: 0 0 8px; }
.fehlerseite p { color: var(--text-leise); }

/* Datenschutz */
details.datenschutz { background: var(--flaeche); border-radius: var(--radius); padding: 0 16px; box-shadow: var(--schatten); margin-top: 20px; }
details.datenschutz summary { padding: 14px 0; font-weight: 600; cursor: pointer; color: var(--schiefer); list-style: none; display: flex; justify-content: space-between; }
details.datenschutz summary::-webkit-details-marker { display: none; }
details.datenschutz summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--text-leise); }
details.datenschutz[open] summary::after { content: "–"; }
details.datenschutz p { font-size: 14px; color: var(--text-leise); margin: 0 0 12px; }
details.datenschutz a { color: var(--primaer); font-weight: 600; overflow-wrap: anywhere; }
.fusszeile { text-align: center; font-size: 12px; color: var(--text-leise); margin-top: 18px; }

.link-feld { display: flex; gap: 8px; }
.link-feld input { flex: 1; min-width: 0; font-size: 13px; background: #f5f7f5; }

.kopf-icon { width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--primaer-hell); color: var(--primaer); display: inline-flex; align-items: center; justify-content: center; }
.kopf-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mat-check { border: 0; background: transparent; padding: 8px; display: flex; flex: none; }
.mat-check .haken { width: 32px; height: 32px; margin: 0; }
.mat-check .haken svg { width: 18px; height: 18px; }
.mat-zeile .check-text { padding: 4px 0; }
.chip-reihe { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-reihe button { border: 1.5px solid var(--linie); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--schiefer); min-height: 34px; }
.chip-reihe button:active { background: var(--primaer-hell); }
.tag-wahl { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.tag-wahl button { min-height: 48px; border-radius: 12px; border: 1.5px solid var(--linie); background: #fff; font-weight: 700; color: var(--text-leise); padding: 0; }
.tag-wahl button.aktiv { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.tag-zeit { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tag-zeit b { width: 96px; flex: none; }
.tag-zeit .eingabe { min-height: 44px; padding: 8px 12px; }
.serie-karte { border-left: 4px solid var(--primaer); }
.serie-karte .tage { font-weight: 800; font-size: 17px; color: var(--primaer); }
.vorschau-termine { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vorschau-termine span { background: #fff; border-radius: 8px; padding: 3px 8px; font-size: 12.5px; font-weight: 600; color: var(--schiefer); }

.chip-reihe button.aktiv { border-color: var(--primaer); background: var(--primaer-hell); color: var(--primaer); }
details.crm-block { background: var(--flaeche); border-radius: var(--radius); padding: 0 16px; margin-bottom: 14px; box-shadow: var(--schatten); }
details.crm-block summary { padding: 14px 0; font-weight: 700; color: var(--schiefer); cursor: pointer; }
details.crm-block[open] summary { margin-bottom: 4px; }

/* ---------- Formular im Stil des Preisrechners ---------- */
.wiz-fortschritt { margin: 0 0 18px; }
.wiz-fortschritt .zeile { margin-bottom: 8px; }
.wiz-balken { height: 10px; background: #d9e7dd; border-radius: 99px; overflow: hidden; }
.wiz-balken span { display: block; height: 100%; background: var(--primaer); border-radius: 99px; transition: width .25s ease; }
.wiz-frage { color: var(--primaer); font-size: 1.35rem; line-height: 1.3; margin: 0 0 14px; }
.lead { color: var(--text-leise); margin: -6px 0 16px; }
.wiz-platz { height: 90px; }
.wiz-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 18; background: rgba(255,255,255,.98); border-top: 1px solid var(--linie); padding: 10px 16px calc(10px + var(--safe-unten)); }
.wiz-nav-innen { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; }
.wiz-nav-innen .btn { flex: 1; }
.wiz-nav-innen .btn.zweit { flex: 0 0 34%; }
.wahl-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wahl-raster.eins { grid-template-columns: 1fr; }
.wahl-raster.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wahl-kachel { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; overflow-wrap: anywhere; hyphens: auto; min-height: 56px; padding: 10px 14px; text-align: left; border: 2px solid #6b8f76; border-radius: 10px; background: #fff; font-size: 15px; line-height: 1.3; color: var(--text); }
.wahl-kachel.aktiv { border-color: var(--primaer); background: #f0f5f1; }
.wahl-kachel .kopf-icon { width: 38px; height: 38px; }
.wahl-kachel .radio, .wahl-kachel .check { flex: 0 0 22px; height: 22px; border: 2px solid #6b8f76; border-radius: 50%; background: #fff; }
.wahl-kachel .check { border-radius: 6px; }
.wahl-kachel.aktiv .radio { border-color: var(--primaer); background: var(--primaer); box-shadow: inset 0 0 0 4px #fff; }
.wahl-kachel.aktiv .check { border-color: var(--primaer); background: var(--primaer) no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='2.5'/%3E%3C/svg%3E"); }
.wahl-raster.drei .wahl-kachel { justify-content: center; text-align: center; }
.pos-karte { background: var(--flaeche); border: 1px solid #b3cfbb; border-radius: 12px; padding: 10px 12px 12px; margin-bottom: 10px; }
.pos-karte .eingabe { margin-top: 8px; min-height: 46px; }
.pos-karte .klein-eingabe { font-size: 14px; min-height: 40px; padding: 8px 12px; }
.pos-zahlen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; align-items: end; }
.pos-zahlen label { font-size: 12px; font-weight: 600; color: var(--schiefer); }
.pos-betrag { text-align: right; padding-bottom: 12px; }
.pos-betrag b { display: block; font-size: 15px; }
.summen-box { background: #f0f5f1; border: 1px solid #b3cfbb; border-radius: 12px; padding: 12px 14px; margin: 14px 0; }
.summen-box .zeile { padding: 2px 0; }
.summen-box .gesamt { font-weight: 800; font-size: 18px; color: var(--primaer); border-top: 1px solid #b3cfbb; margin-top: 6px; padding-top: 8px; }
.vorschau-rahmen { background: #8a8f8b; border-radius: 10px; padding: 8px; }
.vorschau-rahmen iframe { width: 100%; height: 70vh; border: 0; background: #fff; border-radius: 4px; }

.anmeldung { max-width: 420px; margin: 6vh auto 0; }

.a4-rahmen { background: #8a8f8b; border-radius: 10px; padding: 8px; overflow: hidden; position: relative; }
.a4-blatt { width: 794px; height: 1123px; transform-origin: top left; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.a4-blatt iframe { width: 794px; height: 1123px; border: 0; display: block; background: #fff; }

.install-hinweis { border: 1.5px solid #b3cfbb; }

@media (min-width: 560px) {
  .foto-raster { grid-template-columns: repeat(4, 1fr); }
  .kacheln { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- nur Web-App ---------- */
body.web .topbar { padding-top: env(safe-area-inset-top, 0px); height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); }
body.web .ladebalken { top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); }
body.web .toast { top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 12px); }
body.web .sheet { max-height: calc(100vh - env(safe-area-inset-top, 0px) - 12px); }
