:root { --bg: #f6f5f1; --karte: #ffffff; --ink: #18211c; --muted: #6b756f; --line: #dcdcd4; --akzent: #3d6b4f; --akzent-ink: #ffffff; --rot: #b3392c; --gruen: #2f7d4f; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #121915; --karte: #1b2520; --ink: #eef1ec; --muted: #9aa69f; --line: #2c3a33; --akzent: #7fbf97; --akzent-ink: #0f1712; --rot: #e0685a; --gruen: #7fd3a0; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.wurzel { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
.lade { margin: 40vh auto 0; text-align: center; color: var(--muted); }

/* Seitenwechsel: alte Seite kurz hinaus, neue weich herein */
.seite { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 1; transform: none; transition: opacity .24s ease, transform .24s ease; }
.seite.rein { opacity: 0; transform: translateX(18px); }
.seite.raus { opacity: 0; transform: translateX(-14px); transition-duration: .12s; }

/* Anmeldung */
.mitte { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 28px) 20px 28px; }
.box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.marke { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.punkt { width: 38px; height: 38px; border-radius: 50%; background: var(--akzent); color: var(--akzent-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.marke b { font-size: 1.05rem; }
h1 { font-size: 1.45rem; line-height: 1.2; margin: 6px 0 0; }
.text { margin: 0; color: var(--muted); }
.schritte { display: flex; gap: 6px; margin: 2px 0 4px; }
.schritte i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.schritte i.an { background: var(--akzent); }
label { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=time] { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--karte); color: var(--ink); font-size: 1rem; }
input:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
.code-in { letter-spacing: .35em; text-align: center; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.knopf { width: 100%; padding: 14px 16px; border-radius: 14px; background: var(--akzent); color: var(--akzent-ink); font-weight: 600; transition: opacity .3s ease; }
.knopf[disabled] { opacity: .45; }
.knopf.leer { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.link { color: var(--muted); text-decoration: underline; align-self: center; padding: 6px; }
.fehler { min-height: 1.4em; margin: 0; color: var(--rot); font-size: .92rem; opacity: 0; transition: opacity .3s ease; }
.fehler.an { opacity: 1; }
.hinweis { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--karte); border: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.qr { align-self: center; width: 200px; height: 200px; background: #fff; border-radius: 12px; padding: 6px; }
.geheim { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; word-break: break-all; text-align: center; padding: 10px; border-radius: 10px; background: var(--karte); border: 1px dashed var(--line); user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.codes span { padding: 9px 6px; text-align: center; border-radius: 10px; background: var(--karte); border: 1px solid var(--line); user-select: all; }
.agb { max-height: 38vh; overflow-y: auto; padding: 12px 14px; border-radius: 12px; background: var(--karte); border: 1px solid var(--line); font-size: .92rem; }
.agb p { margin: 0 0 8px; }
.wahl { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; color: var(--ink); flex-direction: row; }
.wahl input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--akzent); }

/* PIN */
.pin { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; }
.dots { display: flex; gap: 14px; margin: 16px 0 4px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); transition: background .2s ease; }
.dots i.an { background: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; margin-top: 10px; }
.pad button { width: 72px; height: 72px; border-radius: 50%; background: var(--karte); border: 1px solid var(--line); font-size: 1.5rem; }
.pad button:active { background: var(--line); }
.pad .frei { visibility: hidden; }

/* App */
.kopf { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; }
.zurueck { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--karte); border: 1px solid var(--line); font-size: 1.2rem; line-height: 1; transition: opacity .3s ease; }
.zurueck[disabled] { opacity: .3; }
.kopf h2 { margin: 0; font-size: 1.15rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.blatt { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px clamp(16px, 3.5vw, 40px) 18px; opacity: 1; transform: none; transition: opacity .24s ease, transform .24s ease; }
.blatt.rein { opacity: 0; transform: translateX(18px); }
.blatt.raus { opacity: 0; transform: translateX(-14px); transition-duration: .12s; }
.tabs { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--bg); padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 6px); }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: .72rem; color: var(--muted); border-radius: 10px; transition: color .3s ease; }
.tabs button b { font-size: 1.15rem; font-weight: 400; line-height: 1; }
.tabs button.an { color: var(--akzent); font-weight: 600; }
.karte { background: var(--karte); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 0 0 10px; }
.karte h3 { margin: 0 0 6px; font-size: 1rem; }
.karte ul { margin: 0; padding-left: 18px; }
.karte li { margin: 3px 0; }
.karte p { margin: 4px 0; }
.klein { font-size: .82rem; color: var(--muted); }
.zeile { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 2px; border-top: 1px solid var(--line); }
.zeile:first-child { border-top: 0; }
.zeile .zt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.zeile .zt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rot { color: var(--rot); }
.leer-text { color: var(--muted); text-align: center; margin: 18vh 0 0; }
.bild { width: 100%; border-radius: 14px; }
pre.txt { white-space: pre-wrap; word-break: break-word; font: inherit; margin: 0; }

/* Chat */
.chat { display: flex; flex-direction: column; height: 100%; padding: 0; overflow: hidden; }
.verlauf { flex: 1; overflow-y: auto; padding: 6px clamp(16px, 3.5vw, 40px) 10px; display: flex; flex-direction: column; gap: 8px; }
.blase { max-width: 84%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; opacity: 1; transform: none; transition: opacity .35s ease, transform .35s ease; }
.blase.neu { opacity: 0; transform: translateY(6px); }
.blase.kunde { align-self: flex-end; background: var(--akzent); color: var(--akzent-ink); border-bottom-right-radius: 5px; }
.blase.mai { align-self: flex-start; background: var(--karte); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.blase.hinweis { align-self: center; background: transparent; color: var(--muted); font-size: .85rem; text-align: center; }
.blase.denkt { color: var(--muted); font-style: italic; }
.ki { align-self: center; font-size: .78rem; color: var(--muted); margin: 2px 0 6px; text-align: center; }
.eingabe { flex: none; display: flex; gap: 8px; padding: 8px clamp(16px, 3.5vw, 40px) 10px; border-top: 1px solid var(--line); }
.eingabe input { flex: 1; }
.eingabe button { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--akzent); color: var(--akzent-ink); font-size: 1.2rem; }

/* Eigene Abfrage statt Browser-Dialog */
.dlg { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5, 8, 6, .55); opacity: 0; transition: opacity .25s ease; }
.dlg.an { opacity: 1; }
.dlg-box { width: min(340px, 100%); background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.dlg-box p { margin: 0; }
.dlg-kn { display: flex; gap: 8px; justify-content: flex-end; }
.dlg-kn button { padding: 9px 16px; border-radius: 12px; border: 1px solid var(--line); }
.dlg-kn .ja { background: var(--akzent); color: var(--akzent-ink); border-color: transparent; font-weight: 600; }
.dlg-kn .ja.rot { background: var(--rot); color: #fff; }
.plus { position: absolute; right: 18px; bottom: 18px; width: 54px; height: 54px; border-radius: 50%; background: var(--akzent); color: var(--akzent-ink); font-size: 1.6rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01s !important; } }

/* Ergänzungen 11.11.2026: Fußzeile, Bausteine für Baufirmen */
.fuss { margin: 14px 0 0; text-align: center; font-size: .8rem; }
.fuss a { color: var(--muted); margin: 0 8px; }
.marke-klein { flex: none; font-size: .72rem; padding: 3px 9px; border-radius: 10px; background: color-mix(in srgb, var(--akzent) 18%, transparent); color: var(--ink); }
.betrag { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.betrag.offen { color: var(--rot); }
.betrag.plus { color: var(--gruen); }
.betrag.minus { color: var(--rot); }
.seg { display: flex; gap: 6px; margin: 0 0 10px; }
.seg button { flex: 1; padding: 9px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--karte); font-size: .88rem; transition: background .3s ease, color .3s ease; }
.seg button.an { background: var(--akzent); color: var(--akzent-ink); border-color: transparent; font-weight: 600; }
.betreff { margin: 10px 0 2px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.zeit { margin: 0; }
.zeit.rechts { text-align: right; }
.tabs button { min-width: 0; overflow: hidden; }
.rechtsseite { max-width: 720px; margin: 0 auto; padding: 24px 20px 60px; }
.rechtsseite h1 { font-size: 1.5rem; }
.rechtsseite h2 { font-size: 1.05rem; margin: 22px 0 6px; }
.rechtsseite .platz { background: #fff3b0; color: #3a2f00; padding: 0 4px; border-radius: 4px; }
.rechtsseite .entwurf { padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--rot); color: var(--rot); }

/* ---- Bausteine Baufirma: Scan, Diktat, Mailantwort, Kalenderformular, Bezahlt ---- */
.rund { flex: none; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--akzent); color: var(--akzent-ink); transition: background .2s, opacity .2s; }
.rund.leer { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.rund.rot-an { background: var(--rot); color: #fff; border-color: transparent; }
.eingabe .senden { transition: opacity .25s, width .25s; overflow: hidden; }
.eingabe .senden.weg { opacity: 0; width: 0; padding: 0; margin-left: -8px; pointer-events: none; }
.weg { display: none; }
.scan { position: fixed; inset: 0; z-index: 15; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; gap: 10px; padding: 12px clamp(14px, 3.5vw, 40px) 14px; opacity: 0; transition: opacity .25s; overflow: hidden; }
.scan.an { opacity: 1; }
.scan.bus { pointer-events: none; }
.scan.bus .scan-kacheln { opacity: .5; }
.scan-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scan-kacheln { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; align-content: start; transition: opacity .2s; }
.kachel { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--karte); }
.kachel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kachel span { position: absolute; left: 6px; bottom: 6px; padding: 1px 7px; border-radius: 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .78rem; }
.scan-fuss { flex: none; display: flex; gap: 8px; }
.scan-fuss .knopf { flex: 1; text-align: center; }
.scan-neu { cursor: pointer; display: block; }
.scan-gross { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.scan-gross img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.box.breit { width: min(520px, 100%); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { padding: 8px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--karte); transition: background .2s, color .2s; }
.chip input:checked + span { background: var(--akzent); color: var(--akzent-ink); border-color: transparent; font-weight: 600; }
.chip.lang { align-self: flex-start; }
.zeit-zeile { display: flex; gap: 10px; transition: opacity .25s; }
.zeit-zeile label { flex: 1; }
.zeit-zeile.aus { opacity: .35; pointer-events: none; }
textarea { width: 100%; font: inherit; color: inherit; background: var(--karte); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; box-sizing: border-box; }
select { width: 100%; font: inherit; color: inherit; background: var(--karte); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; box-sizing: border-box; }
.antwort { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 8px clamp(16px, 3.5vw, 40px) 12px; border-top: 1px solid var(--line); }
.antwort-kn { display: flex; gap: 8px; align-items: center; }
.antwort-kn .knopf { flex: 1; }
.zeile .zl { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; }
.pille { flex: none; padding: 5px 11px; border-radius: 14px; border: 1px solid var(--line); font-size: .8rem; transition: background .2s, color .2s; }
.pille.an { background: var(--akzent); color: var(--akzent-ink); border-color: transparent; }
