:root {
  --brand: #2b2b2b;
  --akzent: #ED1C24;
  --akzent-hell: #FDEBEC;
  --bg: #f3f3f3;
  --karte: #ffffff;
  --text: #1b1f24;
  --blass: #6e6e6e;
  --linie: #e0e0e0;
  --ok: #1e7b3a;
  --ok-bg: #e3f4e8;
  --fehler: #b3261e;
  --fehler-bg: #fde7e7;
  --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45;
}
a { color: var(--brand); }
h1 { font-size: 1.35rem; margin: 4px 0 14px; color: var(--brand); }
h2 { font-size: 1.05rem; margin: 0 0 12px; color: var(--brand); }
code { background: #f0f0f0; padding: 1px 6px; border-radius: 4px; }

/* ---- Kopf und Menü ---- */
.testbanner {
  background: #fff3cd; color: #6b4e00; text-align: center; font-size: .8rem; font-weight: 600;
  padding: 6px 12px; border-bottom: 1px solid #f0dc9a;
}
.kopf {
  background: var(--brand); color: #fff; display: flex; align-items: center; gap: 16px;
  border-bottom: 3px solid var(--akzent);
  padding: 10px 16px; position: sticky; top: 0; z-index: 10;
}
@font-face { font-family: "Anton"; src: url("anton.ttf") format("truetype"); font-display: swap; }
.marke { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px;
  font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: 1.15rem; letter-spacing: .5px; white-space: nowrap; }
.marke .logo { height: 26px; width: auto; }
.menue { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.menue a, .menue .bald {
  color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .9rem; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.menue a.aktiv, .menue a:hover { background: rgba(255,255,255,.15); }
.menue .bald { opacity: .45; cursor: default; }
.abmelden { margin: 0; }
.knopf-link { background: none; border: 0; color: #fff; font: inherit; font-size: .85rem; cursor: pointer; opacity: .85; }

main { max-width: 900px; margin: 0 auto; padding: 16px 16px calc(96px + var(--safe-b)); }
main.schmal { max-width: 420px; padding-top: 48px; }
body.einfach { min-height: 100vh; }
.logo-gross { text-align: center; margin-bottom: 20px; color: var(--brand); font-family: "Anton", Impact, sans-serif; line-height: 1.1; }
.logo-gross .logo { display: block; height: 72px; width: auto; margin: 0 auto 10px; }
.logo-gross b { display: block; font-weight: 400; font-size: 2rem; }
.logo-gross span { display: block; font-size: 1.1rem; }
.farbwahl { display: flex; gap: 8px; align-items: center; }
.farbwahl input[type=color] { width: 48px; height: 42px; padding: 2px; flex: none; border-radius: 8px; }

/* Handy: Menü als Leiste unten */
@media (max-width: 760px) {
  .kopf { padding: 10px 16px; }
  .menue {
    position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--linie);
    padding: 4px 4px calc(4px + var(--safe-b)); justify-content: space-around; gap: 0;
  }
  .menue a, .menue .bald {
    color: var(--blass); flex-direction: column; gap: 0; font-size: .65rem; padding: 4px 2px; flex: 1; text-align: center;
  }
  .menue a span, .menue .bald span { font-size: 1.25rem; }
  .menue a.aktiv { background: none; color: var(--brand); font-weight: 700; }
  .menue .bald { opacity: .35; }
  .marke { flex: 1; }
}

/* ---- Bausteine ---- */
.karte {
  background: var(--karte); border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; }
.raster .breit { grid-column: 1 / -1; }

label { display: block; font-size: .8rem; color: var(--blass); margin-bottom: 12px; }
input, textarea, select {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 16px; color: var(--text);
  background: #fff; border: 1px solid var(--linie); border-radius: 8px; padding: 10px;
}
input[type=file] { padding: 8px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); border-color: transparent; }
textarea { resize: vertical; }

.knopf {
  display: inline-block; font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 12px 18px;
  cursor: pointer; text-decoration: none; background: #ebebeb; color: var(--brand);
}
.knopf.haupt { background: var(--akzent); color: #fff; }
.knopf.gefahr { background: var(--fehler-bg); color: var(--fehler); }
.knopf.voll { width: 100%; }
.knopf:active { transform: scale(.98); }

.leiste-unten {
  position: sticky; bottom: calc(64px + var(--safe-b)); display: flex; justify-content: flex-end;
  padding: 8px 0; margin-bottom: 14px;
}
@media (min-width: 761px) { .leiste-unten { bottom: 0; } }

.meldung { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: .95rem; }
.meldung.ok { background: var(--ok-bg); color: var(--ok); }
.meldung.fehler { background: var(--fehler-bg); color: var(--fehler); }
.hinweis { font-size: .85rem; color: var(--blass); }

.pruefliste { list-style: none; padding: 0; margin: 0; }
.pruefliste li { padding: 3px 0; }
.pruefliste .ok { color: var(--ok); }
.pruefliste .fehler { color: var(--fehler); font-weight: 600; }

.kacheln { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.kachel { background: var(--karte); border-radius: var(--radius); padding: 14px; text-align: center; font-size: .8rem; color: var(--blass); }
.kachel .zahl { font-size: 1.6rem; font-weight: 700; color: var(--brand); }

.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th, .tabelle td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--linie); }
.tabelle th { color: var(--blass); font-weight: 600; }
.tabelle tr.blass td { opacity: .45; }

.zeile { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.zeile label { flex: 1; min-width: 200px; margin: 0; }
.logo-vorschau { display: block; max-height: 60px; max-width: 200px; margin-top: 8px; }

/* ---- Listen ---- */
.werkzeuge { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.suchfeld { flex: 1; margin: 0; }
.suchfeld input { margin: 0; }
.liste { display: flex; flex-direction: column; gap: 8px; }
.eintrag {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: var(--karte); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.06); margin-bottom: 8px;
}
.eintrag:active { background: #f7f8fa; }
.eintrag-haupt { min-width: 0; flex: 1; }
.eintrag .titel { font-weight: 600; }
.eintrag .unter, .importzeile .unter { font-size: .85rem; color: var(--blass); }
.eintrag-rechts { text-align: right; white-space: nowrap; }
.eintrag-rechts .nr { font-size: .8rem; color: var(--blass); font-variant-numeric: tabular-nums; }
.eintrag-rechts .preis { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.eintrag-rechts .preis.fehlt { color: var(--fehler); }
.posnr { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; color: var(--blass); font-weight: 500; margin-right: 4px; }
.marke-klein { font-size: .7rem; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: #ebebeb; color: var(--brand); margin-left: 6px; vertical-align: middle; }
.marke-klein.warn { background: #fff3cd; color: #6b4e00; }
.gruppe { font-size: .85rem; color: var(--blass); margin: 18px 0 8px; font-weight: 600; }
.gruppe span { background: var(--brand); color: #fff; border-radius: 6px; padding: 1px 6px; margin-right: 4px; font-size: .75rem; }
.leer { text-align: center; color: var(--blass); padding: 24px 12px; }
.fuss-links { text-align: center; margin-top: 18px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; scrollbar-width: none; }
.chip {
  white-space: nowrap; font-size: .8rem; padding: 6px 12px; border-radius: 99px; background: #fff; color: var(--brand);
  text-decoration: none; border: 1px solid var(--linie);
}
.chip.aktiv { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---- Formulare ---- */
.karte-kopf { display: flex; justify-content: space-between; align-items: center; }
.umschalter { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.umschalter label {
  flex: 1; margin: 0; text-align: center; border: 1px solid var(--linie); border-radius: 10px; padding: 10px 6px;
  font-size: .95rem; color: var(--text); cursor: pointer;
}
.umschalter input { display: none; }
.umschalter label:has(input:checked) { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--text); }
label.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
details { margin-bottom: 12px; }
details summary { cursor: pointer; font-size: .85rem; color: var(--brand); margin-bottom: 6px; }
.schnell { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.schnell .knopf { padding: 8px 12px; font-size: .9rem; }
.vk-anzeige { background: #f2f4f7; border-radius: 10px; padding: 12px; font-size: 1rem; }
.vk-anzeige b { color: var(--brand); font-size: 1.15rem; }
.leiste-unten { gap: 10px; align-items: center; }
.leiste-unten .hinweis { margin-right: auto; }
.rechts { text-align: right; }
.knopf-text { background: none; border: 0; color: var(--fehler); font: inherit; font-size: .85rem; cursor: pointer; padding: 8px 0; }
.knopf[disabled] { opacity: .5; }
[hidden] { display: none !important; }

/* ---- Import ---- */
.importzeile {
  display: flex; gap: 12px; align-items: flex-start; background: var(--karte); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 8px; border-left: 4px solid transparent; flex-wrap: wrap;
}
.importzeile.warnung { border-left-color: #f0b400; background: #fffdf3; }
.importzeile.blass { opacity: .5; }
.importzeile .nehmen { margin: 0; min-width: 84px; }
.importzeile .daten { flex: 1; min-width: 200px; }
.importzeile .titel { font-weight: 600; }
.importzeile .hinweise { font-size: .8rem; color: #8a5a00; margin-top: 4px; }
.importzeile .wahl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.importzeile .wahl select { width: auto; margin: 0; padding: 6px 8px; font-size: .9rem; }
.importzeile .wahl label.check { margin: 0; }
.tabelle.klein { font-size: .82rem; }
.tabelle .r { text-align: right; white-space: nowrap; }
.tabelle tr.warn td { background: #fffdf3; }
.rot { color: var(--fehler); }
.kachel { text-decoration: none; display: block; }

/* ---- Angebote ---- */
.knopf.gross { padding: 16px; font-size: 1.05rem; text-align: center; margin-bottom: 14px; }
.kacheln { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.status { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; vertical-align: middle;
  background: #ebebeb; color: var(--brand); white-space: nowrap; }
.status.gesendet, .status.angesehen { background: #e1ecfb; color: #1d4f91; }
.status.angenommen { background: var(--ok-bg); color: var(--ok); }
.status.abgelehnt { background: var(--fehler-bg); color: var(--fehler); }
.status.abgelaufen { background: #eee; color: var(--blass); }
.zeile-link { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--linie);
  text-decoration: none; color: var(--text); font-size: .92rem; }
.raster.eng { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0 10px; }

.abschnitt-kopf { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 6px; font-weight: 700; color: var(--brand); }
.abschnitt-nr { background: var(--brand); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: .8rem; margin-right: 4px; }
.abschnitt-summe { font-variant-numeric: tabular-nums; }
.abschnitt-werkzeug { margin: -4px 0 8px; }
.abschnitt-werkzeug summary { font-size: .78rem; color: var(--blass); }
.abschnitt-werkzeug .zeile label { min-width: 140px; }

details.pos { background: var(--karte); border-radius: 10px; margin-bottom: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
  border-left: 4px solid transparent; }
details.pos.fehlt { border-left-color: var(--fehler); }
details.pos.textzeile { background: #fafbfc; }
details.pos.blinken { animation: blinken 1.6s ease-out; }
@keyframes blinken { from { background: #fff1d6; } to { background: var(--karte); } }
details.pos > summary { list-style: none; display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; padding: 10px 12px; cursor: pointer; margin: 0; color: var(--text); font-size: .95rem; }
details.pos > summary::-webkit-details-marker { display: none; }
details.pos[open] > summary { border-bottom: 1px solid var(--linie); }
.posnr { font-family: ui-monospace, Menlo, monospace; }
details.pos .posnr { font-size: .8rem; color: var(--blass); padding-top: 2px; }
.postext small { display: block; color: var(--blass); font-size: .8rem; margin-top: 2px; }
details.pos.fehlt .postext small { color: var(--fehler); }
.posbetrag { font-weight: 700; color: var(--brand); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos-form { padding: 12px; }
.pos-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pos-knoepfe .knopf { padding: 10px 14px; }

.treffer-liste { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.treffer { display: grid; grid-template-columns: 74px 1fr; gap: 2px 8px; text-align: left; font: inherit; font-size: .9rem;
  background: #f7f8fa; border: 1px solid var(--linie); border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--text); }
.treffer .posnr { font-size: .75rem; color: var(--blass); grid-row: span 2; padding-top: 2px; }
.treffer .i { font-size: .8rem; color: var(--blass); }
.treffer.fehlt .i { color: var(--fehler); }
.treffer.gewaehlt { border-color: var(--akzent); background: var(--akzent-hell); }
.auswahl { background: var(--akzent-hell); border: 1px solid var(--akzent); border-radius: 8px; padding: 10px; margin: -2px 0 8px; }
.auswahl-text { font-size: .85rem; margin-bottom: 8px; }
.auswahl .zeile label { min-width: 110px; }

.summen-tabelle { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.summen-tabelle td { padding: 4px 0; }
.summen-tabelle td:last-child { text-align: right; white-space: nowrap; }
.summen-tabelle tr.gesamt td { font-weight: 700; font-size: 1.1rem; color: var(--brand); border-top: 2px solid var(--brand); padding-top: 8px; }
.summen-tabelle tr.klein td, .summen-tabelle.klein td { font-size: .85rem; color: var(--blass); }
.fuss-aktionen { display: flex; justify-content: space-between; gap: 12px; }
.fuss-aktionen form { margin: 0; }
.knopf-text.blau { color: var(--brand); }

.teil { display: grid; grid-template-columns: 90px 1fr; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--linie); font-size: .92rem; }
.teil .posnr { font-size: .78rem; color: var(--blass); grid-row: span 2; }
.teil .i { font-size: .8rem; color: var(--blass); }
.teil-wahl { padding: 8px 0; border-bottom: 1px solid var(--linie); }
.teil-zeile { padding: 10px 0; border-bottom: 1px solid var(--linie); }
.teil-text { font-size: .92rem; margin-bottom: 6px; }
.teil-text small { display: block; }
.teil-felder { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; }
.teil-felder label { margin: 0; flex: 1; min-width: 90px; }
.teil-felder .knopf { padding: 10px 12px; }
.leiste-unten { background: linear-gradient(to bottom, rgba(242,244,247,0), var(--bg) 35%); padding-top: 18px; }
@media (max-width: 760px) { .kacheln { grid-template-columns: repeat(2, 1fr); } }
.link-kopieren { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.link-kopieren input { margin: 0; font-size: .8rem; color: var(--blass); }
.versand-aktionen { border-top: 1px solid var(--linie); padding-top: 10px; margin: 10px 0; }
.versand-aktionen .zeile { margin-bottom: 10px; }
.versand-aktionen .zeile label { min-width: 150px; }
.knopf-reihe { display: flex; gap: 8px; flex-wrap: wrap; }
.knopf.wa { background: #25d366; }
.verlauf td:first-child { white-space: nowrap; padding-right: 10px; vertical-align: top; }
.verlauf td:last-child { text-align: left !important; white-space: normal !important; }
.link-kopieren input { flex: 1; min-width: 0; }
.versand-aktionen .zeile { flex-wrap: nowrap; }
.versand-aktionen .zeile label { min-width: 0; flex: 1; }
.versand-aktionen .zeile .knopf { flex: none; padding: 11px 14px; }

/* ---- Aufträge / Unterschrift ---- */
.knopf.unterschreiben { background: var(--brand); color: #fff; text-align: center; }
.status.au-offen { background: #fff3cd; color: #6b4e00; }
.status.au-in_arbeit { background: #e1ecfb; color: #1d4f91; }
.status.au-fertig, .status.au-abgerechnet { background: var(--ok-bg); color: var(--ok); }
.status.au-storniert { background: #eee; color: var(--blass); text-decoration: line-through; }
.unterschrift-bild { display: block; max-width: 260px; max-height: 100px; margin-top: 10px; border-bottom: 1px solid var(--linie); }
details.karte > summary { font-weight: 600; color: var(--brand); }

/* ---- Rechnungen ---- */
.status.re-entwurf { background: #eee; color: var(--blass); }
.status.re-festgeschrieben, .status.re-gesendet { background: #fff3cd; color: #6b4e00; }
.status.re-bezahlt { background: var(--ok-bg); color: var(--ok); }
.status.re-storniert { background: #eee; color: var(--blass); text-decoration: line-through; }
.status.re-storno { background: var(--fehler-bg); color: var(--fehler); }
.status.re-korrektur { background: #fff3e0; color: #a35a00; }
.ok-text { color: var(--ok); font-weight: 600; margin: 8px 0 0; }
b.blau { color: var(--brand); }

/* ---- Diktat (Sprachsteuerung) ---- */
.diktat-start { margin-bottom: 14px; }
.diktat-feld textarea { font-size: 1.05rem; line-height: 1.45; }
.diktat-knoepfe { margin: 8px 0 14px; align-items: center; }
.diktat-text summary { cursor: pointer; color: var(--blass); font-size: .9rem; }
.diktat-text p { font-size: .9rem; color: var(--blass); margin: 6px 0 10px; }
.diktat-abschnitt { margin: 18px 0 6px; font-size: 1rem; color: var(--brand); }
.diktat-zeile { border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.diktat-zeile.unsicher { border-color: #e9b949; background: #fffbea; }
.diktat-zeile.ohne-preis { border-left: 4px solid var(--fehler); }
.diktat-nimm { margin: 0 0 4px; }
.diktat-text-kat { font-size: .9rem; margin: 2px 0 6px 30px; }
.diktat-felder { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.diktat-felder label { flex: 1 1 90px; min-width: 80px; margin: 0; }
.diktat-felder .diktat-abschnitt-feld { flex: 2 1 160px; }
.diktat-wert { flex: 1 1 80px; font-size: .95rem; padding-bottom: 8px; }
.diktat-wert small { display: block; color: var(--blass); font-size: .75rem; }
.diktat-bem { margin: 6px 0 0; font-size: .8rem; }
.unsicher-marke { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%;
  background: #e9b949; color: #fff; font-weight: 700; font-size: .75rem; }

/* ---- Nachfassen ---- */
.nachfass-zeile { border-top: 1px solid var(--linie); padding: 12px 0; }
.nachfass-zeile:first-of-type { border-top: 0; }
.nachfass-kopf { display: flex; justify-content: space-between; gap: 10px; color: var(--text); text-decoration: none; }
.nachfass-info { font-size: .85rem; margin: 4px 0 8px; color: var(--blass); }
.chip.rot-chip { border-color: var(--fehler); color: var(--fehler); font-weight: 600; }
code.umbruch { word-break: break-all; font-size: .8rem; }

/* Fotos */
.foto-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.foto-knoepfe .knopf { text-align: center; cursor: pointer; }
.knopf.gesperrt { opacity: .5; pointer-events: none; }
.foto-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.foto-karte { border: 1px solid #e3e6eb; border-radius: 10px; padding: 6px; background: #fff; }
.foto-karte img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #eef0f3; }
.foto-karte input:not([type]) { margin: 6px 0 4px; font-size: .9rem; padding: 6px 8px; }
.foto-werkzeug { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: .85rem; }
.foto-werkzeug .check { margin: 0; }
.knopf-klein { border: 1px solid #d5d9df; background: #f6f7f9; border-radius: 6px; padding: 4px 7px; font-size: .85rem; cursor: pointer; }
.knopf-klein:disabled { opacity: .35; }
.knopf-klein.gefahr { color: #b42318; }
.foto-streifen { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; }
.foto-streifen img { width: 84px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.foto-werkzeug { flex-wrap: wrap; }
.foto-werkzeug .check { white-space: nowrap; }
.foto-werkzeug span { display: flex; gap: 4px; margin-left: auto; }

/* ---- Seitenleiste ab Tablet quer / PC ---- */
.menue a.nur-breit { display: none; }
@media (min-width: 1000px) {
  body:has(> .kopf) { padding-left: 232px; }
  .kopf {
    position: fixed; left: 0; top: 0; bottom: 0; width: 232px; z-index: 20;
    flex-direction: column; align-items: stretch; gap: 18px; padding: 22px 14px 16px;
    border-bottom: 0; border-right: 4px solid var(--akzent);
  }
  .marke { font-size: 1.5rem; padding: 0 6px 6px; }
  .marke .logo { height: 34px; }
  .menue { flex-direction: column; gap: 2px; overflow: visible; }
  .menue a { padding: 11px 12px; font-size: 1rem; border-radius: 10px; gap: 10px; }
  .menue a.nur-breit { display: flex; }
  .menue a.aktiv { background: var(--akzent); }
  .menue a span { width: 1.4em; text-align: center; }
  .abmelden { margin-top: auto; padding: 0 6px; }
  main { max-width: 980px; padding-bottom: 40px; }
}
main.breit { max-width: 1240px; }

/* ---- Dashboard ---- */
.dash-datum { margin: -10px 0 14px; color: var(--blass); }
.schnell { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.schnell .knopf { white-space: nowrap; padding: 10px 14px; }
.kennzahlen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kennzahl { background: var(--karte); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 2px; border-top: 3px solid transparent; }
.kennzahl:hover { border-top-color: var(--akzent); }
.kennzahl b { font-size: 1.45rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kz-titel { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blass); }
.dash { display: flex; flex-direction: column; gap: 14px; }
.dash-links, .dash-rechts { display: contents; }
.dash .karte { margin: 0; }
.d-todo { order: 1; } .d-termine { order: 2; } .d-wetter { order: 3; } .d-baustellen { order: 4; } .d-umsatz { order: 5; }
@media (min-width: 761px) {
  .dash { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  .dash-links, .dash-rechts { display: flex; flex-direction: column; gap: 14px; }
}
@media (max-width: 760px) {
  .kennzahlen { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kennzahl { padding: 12px; }
  .kennzahl b { font-size: 1.15rem; }
}
.dash h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash h2 .mehr, .karte h2 .mehr { margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--akzent); text-decoration: none; }
.leer { text-align: center; padding: 14px 0; }
.dash-fuss { text-align: center; margin-top: 18px; }
.dash-fuss a { color: var(--blass); }
.klein { font-size: .78rem; }

/* Aufgaben */
.aufgabe-neu { display: flex; gap: 8px; margin-bottom: 8px; }
.aufgabe-neu input { margin: 0; }
.aufgabe-neu input[name=text] { flex: 1; min-width: 0; }
.aufgabe-neu input[type=date] { width: 150px; flex: none; }
@media (max-width: 520px) {
  .aufgabe-neu { flex-wrap: wrap; }
  .aufgabe-neu input[name=text] { flex-basis: 100%; }
  .aufgabe-neu input[type=date] { flex: 1; width: auto; }
}
.aufgabe-neu .knopf { padding: 0 16px; font-size: 1.3rem; }
.aufgaben { list-style: none; margin: 0; padding: 0; }
.aufgaben li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.aufgaben li:last-child { border-bottom: 0; }
.aufgaben form { margin: 0; flex: none; }
.aufgabe-text { flex: 1; min-width: 0; }
.aufgabe-text .hinweis { display: block; font-size: .78rem; }
.aufgabe-text .hinweis a { color: var(--blass); }
.haken { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #b5b5b5; background: #fff; cursor: pointer; padding: 0;
  color: #fff; font-weight: 700; line-height: 1; }
.haken:hover { border-color: var(--ok); background: var(--ok-bg); }
.haken.an { background: var(--ok); border-color: var(--ok); }
.aufgaben li.erledigt .aufgabe-text { text-decoration: line-through; color: var(--blass); }
.aufgabe-bearbeiten { flex: 1; }
.von-app { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.von-app .kz-titel { margin: 4px 0 2px; }
.von-app .zeile-link { background: #f6f6f6; border-radius: 8px; padding: 9px 10px; border: 0; }
.von-app .zeile-link.wichtig { background: var(--akzent-hell); }
.rot { color: var(--fehler); }
.blau { color: #1565c0; }

/* Termine */
.termin-tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--blass); margin: 10px 0 4px; }
.termin-tag:first-child { margin-top: 0; }
.termine { list-style: none; margin: 0; padding: 0; }
.termine li { display: flex; align-items: center; gap: 8px; border-left: 3px solid var(--akzent); background: #f7f7f7; border-radius: 0 8px 8px 0; margin-bottom: 6px; }
.termin { flex: 1; display: flex; gap: 10px; padding: 8px 10px; text-decoration: none; color: var(--text); min-width: 0; }
.termin-zeit { font-size: .8rem; color: var(--blass); width: 74px; flex: none; padding-top: 2px; font-variant-numeric: tabular-nums; }
.termin-text { min-width: 0; }
.termin-text b { display: block; font-weight: 600; }
.termin-text .hinweis { display: block; font-size: .8rem; }
.termine .knopf-klein { margin-right: 8px; text-decoration: none; }

/* Wetter */
.wetter-morgen { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--ok-bg); margin-bottom: 10px; }
.wetter-morgen.mittel { background: #fff3cd; }
.wetter-morgen.schlecht { background: var(--fehler-bg); }
.wetter-morgen .hinweis { display: block; }
.w-symbol { font-size: 2rem; }
.wetter-stunden { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 10px; overflow-x: auto; }
.wetter-stunden > span { display: flex; flex-direction: column; align-items: center; font-size: .95rem; min-width: 40px; }
.wetter-stunden small { font-size: .68rem; color: var(--blass); min-height: 1em; }
.wetter-tage { width: 100%; border-collapse: collapse; font-size: .88rem; }
.wetter-tage td { padding: 6px 4px; border-top: 1px solid var(--linie); white-space: nowrap; }
.wetter-tage td:last-child { white-space: normal; }
.ampel { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--ok); }
.ampel.mittel { background: #e0a100; } .ampel.schlecht { background: var(--fehler); }

/* Baustellen */
.baustelle { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--linie); }
.baustelle:last-child { border-bottom: 0; }
.b-text { flex: 1; min-width: 0; text-decoration: none; color: var(--text); }
.b-text b, .b-text > .hinweis { display: block; }
.b-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.b-meta .marke-klein { margin-left: 0; }

/* Grafik */
.grafik { width: 100%; height: auto; display: block; }
.g-linie { stroke: var(--linie); stroke-width: 1; }
.g-achse { fill: var(--blass); font-size: 11px; }
.g-saeule { fill: var(--akzent); }
.g-vorjahr { stroke: #8a8a8a; stroke-width: 3; stroke-linecap: round; }
.g-jetzt { fill: var(--akzent-hell); }
.umschalter.klein { margin: 0 0 0 auto; }
.umschalter.klein label { font-size: .75rem; padding: 4px 10px; }

/* Projektakte: Reiter, Buchungen, Nachkalkulation */
.reiter { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 2px solid #e2e5ea; overflow-x: auto; scrollbar-width: none; }
.reiter a { padding: 10px 14px; text-decoration: none; color: var(--blass); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.reiter a.aktiv { color: var(--text); border-bottom-color: var(--akzent); }
.gruen { color: var(--ok); }
.balken { display: block; height: 6px; background: #e8eaee; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.balken > span { display: block; height: 100%; background: var(--ok); }
.balken > span.ueber { background: var(--fehler); }
.buch-knoepfe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.buch-knopf { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; font: inherit; font-size: 1.5rem; cursor: pointer;
  background: var(--karte); border: 2px solid transparent; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.buch-knopf span { font-size: .85rem; font-weight: 600; color: var(--text); }
.buch-knopf.aktiv, .buch-knopf:hover { border-color: var(--akzent); }
.buchung { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #eef0f3; }
.buchung:first-of-type { border-top: 0; }
.buchung .b-datum { flex: none; width: 52px; font-size: .8rem; color: var(--blass); }
.buchung .b-was { flex: 1; min-width: 0; }
.buchung .b-was .hinweis { display: block; margin: 2px 0 0; }
.buchung .b-betrag { flex: none; font-variant-numeric: tabular-nums; }
.buchung form { flex: none; margin: 0; }
.treffer-liste { display: grid; gap: 4px; margin: -4px 0 10px; }
.treffer-liste .treffer { display: block; width: 100%; padding: 8px 10px; background: #f6f7f9; border: 1px solid #e2e5ea; border-radius: 6px; cursor: pointer; }
.treffer-liste .treffer small { display: block; color: var(--blass); }
.nk-tabelle { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.nk-tabelle th, .nk-tabelle td { padding: 9px 6px; text-align: right; border-bottom: 1px solid #eef0f3; }
.nk-tabelle th:first-child, .nk-tabelle td:first-child { text-align: left; }
.nk-tabelle thead th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--blass); }
.nk-tabelle tr.summe td { font-weight: 700; border-top: 2px solid #d5d9df; }
.nk-tabelle tr.gewinn td { font-weight: 700; font-size: 1.1rem; }
.nk-ampel { display: flex; align-items: center; gap: 14px; }
.nk-ampel .punkt { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; }
.nk-ampel .punkt.gut { background: var(--ok-bg); } .nk-ampel .punkt.mittel { background: #fff4d6; } .nk-ampel .punkt.schlecht { background: #fde4e2; }
.nk-ampel b { font-size: 1.15rem; }
@media (max-width: 520px) { .nk-tabelle th, .nk-tabelle td { padding: 8px 3px; font-size: .9rem; } }
.nk-kurz { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nk-kurz a { display: flex; flex-direction: column; gap: 2px; padding: 10px; background: #f6f7f9; border-radius: 8px; text-decoration: none; color: var(--text); }
.nk-kurz b { font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nk-kurz .hinweis { margin: 0; font-size: .78rem; }
.baustelle .knopf-klein + .knopf-klein { margin-left: 4px; }
.karte h2:has(.mehr) { display: flex; align-items: center; gap: 8px; }
@media (max-width: 520px) { .reiter a { padding: 10px 10px; flex: 1; text-align: center; } .r-lang { display: none; } }
@media (max-width: 520px) { .nk-tabelle th:nth-child(4), .nk-tabelle td:nth-child(4) { display: none; } }
.nk-tabelle td:not(:first-child) { white-space: nowrap; }

/* Standort-Knopf am Adressfeld */
.standort-feld { display: flex; gap: 8px; align-items: stretch; }
.standort-feld input { flex: 1; min-width: 0; }
.standort-knopf { flex: none; white-space: nowrap; padding: 0 14px; margin: 0; }
.standort-info { display: block; margin: 4px 0 0; }
.standort-info:empty { display: none; }

/* Zurück-Knopf auf Unterseiten */
.zurueck-knopf { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 6px -4px; padding: 6px 10px 6px 4px;
  color: var(--akzent); font-weight: 600; text-decoration: none; font-size: 1rem; border-radius: 8px; }
.zurueck-knopf:hover { background: var(--akzent-hell); }

/* Betrachter für PDFs/Belege (ansicht.php) */
body.ansicht { background: #525659; padding: 0; margin: 0; min-height: 100vh; }
.ansicht-leiste { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: #2b2b2b; color: #fff; border-bottom: 3px solid var(--akzent); }
.ansicht-titel { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ansicht-zu, .ansicht-teilen { flex: none; font: inherit; font-weight: 600; color: #fff; background: rgba(255,255,255,.14);
  border: 0; border-radius: 8px; padding: 9px 14px; cursor: pointer; text-decoration: none; }
.ansicht-zu { background: var(--akzent); }
.ansicht-inhalt { max-width: none; margin: 0; padding: 8px 8px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ansicht-seite, .ansicht-bild { display: block; max-width: 100%; height: auto; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.ansicht-status { color: #eee; margin-top: 40px; }
.ansicht-rahmen { width: 100%; height: calc(100vh - 70px); border: 0; background: #fff; }

/* Foto-Ebene */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.lb[hidden] { display: none; }
.lb img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lb-zu { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 2; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: var(--akzent); color: #fff; font-size: 1.3rem; cursor: pointer; }
.lb-zahl { position: absolute; top: calc(22px + env(safe-area-inset-top)); left: 16px; color: #ddd; font-size: .9rem; }
.lb-pfeil { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 64px; border: 0; border-radius: 8px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 2rem; cursor: pointer; }
.lb-zurueck { left: 8px; } .lb-vor { right: 8px; }
body.lb-offen { overflow: hidden; }

/* Bestätigung nach WhatsApp */
.bestaetigung { position: fixed; inset: 0; z-index: 90; background: rgba(20,20,20,.6); display: flex; align-items: flex-end; justify-content: center; }
.bestaetigung[hidden] { display: none; }
.b-karte { background: var(--karte); width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  text-align: center; box-shadow: 0 -4px 20px rgba(0,0,0,.25); }
@media (min-width: 600px) { .bestaetigung { align-items: center; } .b-karte { border-radius: 16px; } }
.b-karte h2 { margin: 6px 0; }
.b-karte .knopf { margin-top: 10px; }
.b-symbol { font-size: 2.6rem; }
.b-web { display: block; margin-top: 14px; font-size: .85rem; color: var(--blass); }
.gesperrt { opacity: .6; pointer-events: none; }

/* E-Mail-Versand prüfen */
.info-tabelle { width: 100%; border-collapse: collapse; font-size: .95em; }
.info-tabelle th, .info-tabelle td { text-align: left; padding: .35em .4em; border-bottom: 1px solid var(--linie, #ddd); vertical-align: top; }
.info-tabelle th { font-weight: 600; width: 42%; }

/* Rechnungskorrektur */
.korr-zeile { display: flex; gap: 8px; align-items: flex-end; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.korr-text { flex: 1; min-width: 0; font-size: .95em; }
.korr-text .hinweis { display: block; }
.korr-menge { width: 92px; margin: 0; }
.korr-menge input { text-align: right; }
.korr-summe { margin: 10px 0; }
