@font-face { font-family: 'DM Sans'; src: url('/vorlagen/fonts/DMSans.ttf') format('truetype'); font-weight: 100 1000; }
@font-face { font-family: 'Roboto Slab'; src: url('/vorlagen/fonts/RobotoSlab.ttf') format('truetype'); font-weight: 100 900; }
@font-face { font-family: 'JetBrains Mono'; src: url('/vorlagen/fonts/JetBrainsMono.ttf') format('truetype'); font-weight: 100 800; }

:root {
  /* Design „Ruhig“: warmes Off-White, Navy (Logo) für Aktionen, GL-Orange nur als Akzent – Variablennamen aus der Lexnik-Vorlage beibehalten */
  --petrol: #E27A2F; --petrol-d: #B85F1E; --petrol-hell: #E27A2F; --soft: #FBEDE1;
  --dunkel: #26314A; --dunkel-2: #34405C; --papier: #F6F4EF; --weiss: #FFFFFF;
  --text: #23262B; --text-2: #6E6A62; --linie: #E4E0D8; --raster: #ECE9E2;
  --anzeige: 'Roboto Slab', Georgia, serif;
  --rot: #b4233c; --rot-soft: #fbe9ec; --gruen: #1d7a4d; --gruen-soft: #e3f3ea; --gelb: #9a6700; --gelb-soft: #fdf3d8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: 'DM Sans', system-ui, sans-serif; font-size: 14px; color: var(--text); background: var(--papier); display: flex; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--petrol); }

/* Navigation */
.nav { width: 232px; flex: none; background: var(--dunkel); color: #cfd6d8; padding: 22px 16px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; height: 100vh; }
.nav .logo { width: 132px; margin: 4px auto 18px; display: block; }
.nav nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.nav nav a { padding: 10px 12px; border-radius: 10px; cursor: pointer; color: #cfd6d8; text-decoration: none; font-weight: 600; }
.nav nav a:hover { background: var(--dunkel-2); }
.nav nav a.aktiv { background: var(--dunkel-2); color: #fff; box-shadow: inset 3px 0 0 var(--petrol-hell); }
.nav .neu { background: var(--petrol); color: #fff; border: 0; border-radius: 10px; padding: 11px 12px; font-weight: 700; cursor: pointer; text-align: left; }
.nav .neu:hover { background: var(--petrol-d); }
.nav .neu.zweit { background: transparent; border: 1px solid #34464f; }
.nav .neu.zweit:hover { background: var(--dunkel-2); }
.nav-fuss { margin-top: auto; font-size: 12px; color: #7d8b90; line-height: 1.5; }

main { flex: 1; min-width: 0; padding: 28px 36px 60px; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 800; margin: 26px 0 10px; }
.sub { color: var(--text-2); margin: 0 0 22px; }
.label { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--petrol); }
.kopfzeile { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--linie); background: var(--weiss); border-radius: 9px; padding: 8px 14px; font-weight: 700; cursor: pointer; font-size: 13.5px; white-space: nowrap; }
.btn:hover { border-color: var(--petrol); }
.btn.primaer { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.btn.primaer:hover { background: var(--petrol-d); }
.btn.gefahr { color: var(--rot); }
.btn.gefahr:hover { border-color: var(--rot); }
.btn.klein { padding: 5px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.kachel { background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px; padding: 16px 18px; }
.kachel .wert { font-size: 22px; font-weight: 800; margin-top: 6px; letter-spacing: -0.01em; }
.kachel .hinw { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.balken { height: 6px; background: var(--soft); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.balken i { display: block; height: 100%; background: var(--petrol); border-radius: 4px; }
.balken i.warn { background: #d08a00; } .balken i.krit { background: var(--rot); }
@media (max-width: 1100px) { .kacheln { grid-template-columns: repeat(2, 1fr); } }

/* Tabellen */
.filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.chip { border: 1px solid var(--linie); background: var(--weiss); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 13px; }
.chip.an { background: var(--dunkel); color: #fff; border-color: var(--dunkel); }
.filter input[type=search] { margin-left: auto; min-width: 220px; }
table.liste { width: 100%; border-collapse: collapse; background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px; overflow: hidden; }
table.liste th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); background: #f4f3ee; padding: 10px 12px; font-weight: 700; }
table.liste td { padding: 11px 12px; border-top: 1px solid var(--linie); vertical-align: middle; }
table.liste tr.klick { cursor: pointer; } table.liste tr.klick:hover td { background: #f8fbfb; }
.r { text-align: right; white-space: nowrap; }
.spalte { text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }   /* Betrag/Status: Wert steht genau unter der Überschrift */
.jahr-wahl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.leer { padding: 40px; text-align: center; color: var(--text-2); background: var(--weiss); border: 1px dashed var(--linie); border-radius: 14px; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; }

.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; background: #eee; }
.b-Entwurf { background: #eceae4; color: #5b6b70; } .b-Offen { background: var(--soft); color: var(--petrol-d); }
.b-Bezahlt, .b-Angenommen { background: var(--gruen-soft); color: var(--gruen); } .b-Überfällig { background: var(--rot-soft); color: var(--rot); }
.b-Storniert, .b-Storno, .b-Abgelehnt { background: #f1e9ea; color: #7a5058; }
.typ { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; background: var(--dunkel); color: #fff; }
.typ.AN { background: var(--petrol-hell); } .typ.SR { background: #7a5058; }

/* Formulare */
.feld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
input, select, textarea { border: 1px solid #d5d3cb; background: var(--weiss); border-radius: 8px; padding: 8px 10px; font-size: 14px; font-weight: 500; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--petrol-hell); outline-offset: -1px; border-color: transparent; }
input[readonly], textarea[readonly], select:disabled, input:disabled, textarea:disabled { background: #f4f3ee; }
textarea { resize: vertical; min-height: 60px; }
.raster { display: grid; gap: 12px; }
.r2 { grid-template-columns: 1fr 1fr; } .r3 { grid-template-columns: repeat(3, 1fr); } .r4 { grid-template-columns: repeat(4, 1fr); }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--text); font-size: 14px; }
.check input { width: auto; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(520px, 1fr) minmax(360px, 0.8fr); gap: 22px; align-items: start; }
@media (max-width: 1250px) { .editor { grid-template-columns: 1fr; } }
.vorschau { position: sticky; top: 20px; background: #dcdad3; border-radius: 14px; padding: 12px; height: calc(100vh - 60px); display: flex; flex-direction: column; gap: 8px; }
.vorschau iframe { flex: 1; border: 0; border-radius: 8px; background: #fff; width: 100%; }
.vorschau .kopf { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-2); font-weight: 700; }
table.pos { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.pos th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); text-align: left; padding: 6px 4px; }
table.pos td { padding: 4px; vertical-align: top; border-top: 1px solid var(--linie); }
table.pos tr.detail td { border-top: 0; padding-top: 0; }
table.pos td.nr { width: 26px; color: var(--text-2); padding-top: 12px; font-weight: 700; }
table.pos .titel { font-weight: 700; }
table.pos textarea { min-height: 34px; height: 34px; font-size: 13px; color: var(--text-2); }
table.pos .summe { padding-top: 12px; font-weight: 700; }
table.pos input.zahl { text-align: right; }
.summenbox { margin-left: auto; width: 300px; margin-top: 12px; }
.summenbox div { display: flex; justify-content: space-between; padding: 4px 0; }
.summenbox .gesamt { font-size: 18px; font-weight: 800; border-top: 2px solid var(--dunkel); margin-top: 4px; padding-top: 8px; }
.hinweis { background: var(--gelb-soft); color: #5f4500; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 10px 0; }
.hinweis.info { background: var(--soft); color: var(--petrol-d); }
.status-leiste { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }

/* Modal & Toast */
.modal { position: fixed; inset: 0; background: rgba(22,35,42,.45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--weiss); border-radius: 16px; padding: 24px; width: min(640px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-box h2 { margin-top: 0; }
.modal-fuss { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--dunkel); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 80vw; }
.toast.fehler { background: var(--rot); }

/* ===================== Verwaltungsapp (v2) ===================== */
.nav { overflow-y: auto; }
.nav nav a { display: flex; align-items: center; gap: 10px; }
.nav nav a > span { width: 18px; text-align: center; opacity: .7; font-weight: 800; }
.zaehler { margin-left: auto; background: var(--rot); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
.neu-leiste { display: grid; gap: 8px; }
.timer-laeuft { background: var(--dunkel-2); border: 1px solid #34464f; border-radius: 12px; padding: 12px; margin-top: 8px; display: grid; gap: 4px; }
.timer-zeit { font-family: 'JetBrains Mono', monospace; font-size: 22px; color: #fff; }
.timer-info { font-size: 12px; color: #9aa8ad; margin-bottom: 6px; }
.segment { display: inline-flex; border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; width: fit-content; }
.segment button { border: 0; background: var(--weiss); padding: 8px 14px; font-weight: 700; cursor: pointer; color: var(--text-2); }
.segment button.an { background: var(--dunkel); color: #fff; }
.klein-grau { font-size: 12px; color: var(--text-2); }
.rot { color: var(--rot) !important; }
.hinweis-klein { font-size: 12.5px; color: var(--text-2); margin: 6px 0 0; }
.modal-box.breit { width: min(860px, 100%); }
.zweispaltig { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .zweispaltig { grid-template-columns: 1fr; } }
.kachel.warnung { border-color: #e7b9c0; background: #fff8f9; }
.kachel a { color: var(--rot); font-weight: 700; }
.typ.AB { background: #3b5b6b; } .typ.MA { background: var(--rot); } .typ.SN { background: #5b6b70; } .typ.AP { background: #6b5b3b; }
.b-Bestätigt, .b-Erstellt, .b-Aktiv { background: var(--soft); color: var(--petrol-d); }
.b-Abgerechnet, .b-Erledigt { background: var(--gruen-soft); color: var(--gruen); }
.b-Fällig { background: var(--gelb-soft); color: var(--gelb); } .b-Pausiert { background: #eceae4; color: #5b6b70; }
.aufgaben { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.aufgaben a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 13.5px; }
.aufgaben a:hover { background: #f4f3ee; }
.a-icon { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: var(--soft); color: var(--petrol-d); }
.a-icon.mahnung { background: var(--rot-soft); color: var(--rot); } .a-icon.abo { background: var(--gelb-soft); color: var(--gelb); }
.chip-link { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--rot-soft); color: var(--rot); text-decoration: none; margin: 1px 0; }
.chip-link.entwurf { background: #eceae4; color: var(--text-2); }
.auswahl-leiste { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--dunkel); color: #fff; padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; }
.auswahl-leiste .btn { border-color: transparent; }
.kat { font-size: 12px; background: #f1efe8; border-radius: 6px; padding: 2px 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--linie); margin-bottom: 14px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; text-decoration: none; font-size: 14px; }
.tab.an { color: var(--text); border-bottom-color: var(--petrol); }
.status-leiste a { color: var(--petrol); text-decoration: none; font-weight: 600; }

/* Diagramme */
.diagramm-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 10px; flex-wrap: wrap; }
.legende { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.leg { display: inline-flex; align-items: center; gap: 6px; } .leg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
svg.diagramm { width: 100%; height: auto; display: block; }
svg.diagramm .gitter { stroke: #ecebe6; stroke-width: 1; }
svg.diagramm .basis { stroke: #c9c7bf; stroke-width: 1; }
svg.diagramm .achse { font-size: 11px; fill: var(--text-2); font-family: 'Manrope', sans-serif; }
svg.diagramm .treffer { cursor: default; outline: none; }
svg.diagramm .treffer.aktiv, svg.diagramm .treffer:focus { fill: rgba(22,35,42,.04); }
.klein-tab td, .klein-tab th { padding: 6px 10px; }
.tooltip { position: fixed; z-index: 80; background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px; padding: 8px 12px; box-shadow: 0 10px 30px rgba(22,35,42,.15); pointer-events: none; font-size: 13px; min-width: 150px; }
.tt-zeile { display: flex; align-items: center; gap: 8px; } .tt-zeile + .tt-zeile { margin-top: 3px; }
.tt-zeile i { width: 12px; height: 3px; border-radius: 2px; } .tt-zeile span { color: var(--text-2); }
.hbalken { display: grid; grid-template-columns: 170px 1fr 90px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hb-spur { height: 10px; background: #f1efe8; border-radius: 5px; overflow: hidden; } .hb-spur i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hb-wert { text-align: right; } .hb-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-laeuft .btn { background: var(--petrol); color: #fff; border-color: transparent; }
.timer-laeuft .btn:hover { background: var(--petrol-d); }
.editor { grid-template-columns: minmax(560px, 1.3fr) minmax(340px, 0.7fr); }
table.pos input { padding: 7px 8px; font-size: 13.5px; }

/* ===================== Mobil (Handy & Tablet) ===================== */
.mobil-kopf, .mobil-nav, .nur-mobil { display: none !important; }
.datei-knopf { cursor: pointer; }
.beleg-vorschau { max-width: 100%; max-height: 220px; border-radius: 10px; border: 1px solid var(--linie); margin-top: 8px; object-fit: contain; }
.anleitung { padding-left: 20px; display: grid; gap: 8px; margin: 0 0 10px; }
.geraete { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.btn.gross { padding: 13px 18px; font-size: 16px; justify-content: center; }
.blatt { position: fixed; inset: 0; z-index: 70; background: rgba(22,35,42,.45); display: flex; align-items: flex-end; }
.blatt[hidden] { display: none; }
.blatt-box { background: var(--weiss); width: 100%; border-radius: 20px 20px 0 0; padding: 10px 14px calc(16px + env(safe-area-inset-bottom)); max-height: 85vh; overflow: auto; animation: hoch .18s ease-out; }
@keyframes hoch { from { transform: translateY(40px); opacity: .5; } }
.blatt-griff { width: 40px; height: 4px; border-radius: 2px; background: #d5d3cb; margin: 0 auto 10px; }
.blatt-box h2 { margin: 4px 6px 8px; }
.blatt-eintrag { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; background: none; padding: 14px 8px; font-size: 16px; font-weight: 700; text-align: left; border-radius: 12px; cursor: pointer; color: var(--text); }
.blatt-eintrag:active, .blatt-eintrag:hover { background: #f4f3ee; }
.blatt-eintrag span { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--soft); color: var(--petrol-d); font-size: 18px; }
.blatt-eintrag .zaehler { margin-left: auto; }
.login-modus .nav, .login-modus .mobil-nav { display: none !important; }
.login { max-width: 400px; margin: 10vh auto 0; background: var(--weiss); border: 1px solid var(--linie); border-radius: 18px; padding: 28px 24px; }
.login-logo { width: 170px; margin-bottom: 18px; }

@media (max-width: 900px) {
  body { display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .nav { display: none; }
  .nur-pc { display: none !important; }
  .nur-mobil { display: inline-flex !important; }
  .mobil-kopf { display: flex !important; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between;
    background: var(--dunkel); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .mobil-kopf img { height: 26px; }
    .mobil-nav { display: grid !important; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--weiss); border-top: 1px solid var(--linie); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(22,35,42,.06); }
  .mobil-nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--text-2); padding: 4px 0; cursor: pointer; }
  .mobil-nav button span { font-size: 19px; line-height: 1.2; }
  .mobil-nav button.aktiv { color: var(--petrol); }
  .mobil-nav .plus span { width: 48px; height: 48px; margin-top: -18px; border-radius: 16px; background: var(--petrol); color: #fff; display: grid; place-items: center; font-size: 26px; box-shadow: 0 6px 16px rgba(38,49,74,.25); }
  main { padding: 16px 16px 24px; }
  h1 { font-size: 22px; }
  .kopfzeile { flex-direction: column; align-items: stretch; gap: 10px; }
  .kopfzeile .aktionen { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .kopfzeile .aktionen > * { flex: none; }
  input, select, textarea { font-size: 16px; }   /* verhindert Auto-Zoom auf dem iPhone */
  .btn { padding: 10px 14px; }
  .kacheln { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kachel { padding: 12px 14px; } .kachel .wert { font-size: 18px; }
  .raster.r2, .raster.r3, .raster.r4 { grid-template-columns: 1fr; }
  .raster.r4 { grid-template-columns: 1fr 1fr; }
  .karte { padding: 14px; }
  .filter input[type=search] { margin-left: 0; min-width: 0; width: 100%; }
  .filter { overflow-x: auto; flex-wrap: nowrap; } .filter .chip { flex: none; }
  .modal { padding: 0; align-items: end; }
  .zweispaltig { grid-template-columns: 1fr; }
  .hbalken { grid-template-columns: 110px 1fr 80px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; } .tab { flex: none; }

  /* Listen als Karten */
  table.liste { background: none; border: 0; }
  table.liste thead { display: none; }
  table.liste, table.liste tbody { display: block; }
  table.liste tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
  table.liste td { display: block; border: 0; padding: 0; text-align: left !important; font-size: 13.5px; }
  table.liste td:empty, table.liste td.m-aus { display: none; }
  table.liste td[data-l]::before { content: attr(data-l) ': '; color: var(--text-2); font-weight: 600; font-size: 12px; }
  table.liste td.m-titel { order: -1; flex: 1 1 60%; font-weight: 800; font-size: 15px; }
  table.liste td.m-typ { order: -2; }
  table.liste td.m-betrag { order: -1; margin-left: auto; font-size: 15px; }
  table.liste td.m-sub { flex-basis: 100%; color: var(--text-2); }
  table.liste td.m-voll { flex-basis: 100%; }
  table.liste td.m-voll .aktionen { justify-content: flex-start !important; }

  /* Editor */
  .editor { grid-template-columns: 1fr; }
  .vorschau { display: none; }
  table.pos thead { display: none; }
  table.pos, table.pos tbody { display: block; }
  table.pos tr.haupt { display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; gap: 6px; padding-top: 10px; border-top: 1px solid var(--linie); }
  table.pos tr.haupt td { border: 0; padding: 0; }
  table.pos tr.haupt td.nr { display: none; }
  table.pos tr.haupt td:nth-child(2) { grid-column: 1 / -1; }
  table.pos tr.haupt td.summe { align-self: center; padding: 0 4px; }
  table.pos tr.haupt td:last-child { position: absolute; right: 14px; margin-top: -2px; }
  table.pos tr.haupt { position: relative; }
  table.pos tr.haupt td:nth-child(2) input { padding-right: 46px; }
  table.pos tr.detail { display: block; } table.pos tr.detail td { display: block; padding: 4px 0 6px; border: 0; }
  table.pos tr.detail td:first-child, table.pos tr.detail td:last-child { display: none; }
  .summenbox { width: 100%; }
  .status-leiste { gap: 6px 10px; }
  .status-leiste .mono { display: none; }
  .auswahl-leiste { top: 56px; }
}
@media (max-width: 900px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor > div, .karte, .raster > * { min-width: 0; }
  .filter { flex-wrap: wrap; overflow: visible; }
  .diagramm-flaeche { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .diagramm-flaeche svg.diagramm { min-width: 620px; }
  .diagramm-kopf .legende { flex-wrap: wrap; gap: 10px; }
}
@media (max-width: 900px) {
  .karte .kopfzeile .aktionen { flex-wrap: wrap; overflow: visible; }
  #leistung-wahl { width: 100% !important; }
}

/* iOS-Safari: Datums-/Zeitfelder haben eine feste Eigenbreite und drücken die Seite breiter als den Bildschirm */
html { -webkit-text-size-adjust: 100%; }
input, select, textarea { min-width: 0; max-width: 100%; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; display: block; min-height: 2.6em; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
@media (max-width: 900px) {
  html { overflow-x: hidden; } body { overflow-x: clip; max-width: 100%; }
  main { max-width: 100vw; overflow-x: clip; }
  .karte, .kopfzeile, .raster, .raster > *, .feld, .editor > div { min-width: 0; max-width: 100%; }
  .kopfzeile > div { min-width: 0; }
  .kopfzeile h1 { overflow-wrap: anywhere; }
  .kopfzeile .aktionen { max-width: calc(100vw - 32px); }
  .hinweis { overflow-wrap: anywhere; }
}

/* Handy: Aktionsknöpfe kompakt und umbrechend – kein seitliches Wischen */
@media (max-width: 900px) {
  .btn { padding: 8px 11px; font-size: 13.5px; border-radius: 8px; }
  .kopfzeile .aktionen { flex-wrap: wrap; overflow: visible; max-width: 100%; gap: 6px; padding-bottom: 0; }
  .kopfzeile .aktionen > .btn { flex: 1 1 calc(50% - 3px); justify-content: center; min-width: 0; white-space: normal; text-align: center; line-height: 1.2; }
  .kopfzeile .aktionen > .btn.primaer:first-child { flex-basis: 100%; padding: 11px; font-size: 14.5px; }
  .kopfzeile .aktionen > select { flex: 1 1 100%; width: 100% !important; }
  .filter .chip { padding: 5px 10px; font-size: 12.5px; }
  .status-leiste { font-size: 12.5px; }
  .kopfzeile .label + h1 { margin-top: 2px; }
}

/* ===================== Offline-Modus ===================== */
.offline-badge { border: 0; background: #e9b44c; color: #3b2a00; font-weight: 800; font-size: 12px; border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.offline-badge[hidden] { display: none; }
.nav .offline-badge { margin-top: 6px; }
.kopf-rechts { display: flex; gap: 8px; align-items: center; }
.ist-offline .mobil-kopf { background: #4a3d1c; }
.offline-kopf { display: flex; gap: 12px; align-items: flex-start; background: #fdf3d8; border: 1px solid #ecd9a4; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.offline-punkt { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #d08a00; margin-top: 5px; box-shadow: 0 0 0 4px rgba(208,138,0,.2); }
.offline-kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.offline-kachel { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border: 1px solid var(--linie); background: var(--weiss); border-radius: 14px; font-weight: 800; font-size: 14px; cursor: pointer; color: var(--text); }
.offline-kachel span { font-size: 26px; }
.offline-kachel:active { background: #f4f3ee; }
.warteschlange { display: grid; gap: 8px; }
.ws-eintrag { display: flex; gap: 12px; align-items: center; background: var(--weiss); border: 1px solid var(--linie); border-radius: 12px; padding: 10px 12px; }
.ws-eintrag.ws-fehler { border-color: #e7b9c0; background: #fff8f9; }
.ws-icon { font-size: 20px; } .ws-text { flex: 1; min-width: 0; } .ws-knoepfe { display: flex; gap: 6px; }
.o-position { border-top: 1px solid var(--linie); padding: 8px 0; display: grid; gap: 6px; }
.o-zeile1 { display: flex; gap: 6px; } .o-zeile1 input { flex: 1; font-weight: 700; }
.o-zeile2 { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 6px; }
.karte-innen { background: #f8f7f3; border-radius: 12px; padding: 12px; }
@media (max-width: 900px) { .ws-eintrag { flex-wrap: wrap; } .ws-knoepfe { width: 100%; justify-content: flex-end; } }

/* E-Rechnung */
tr.zeile-pruefen td { background: #fffbef; }
@media (max-width: 900px) { table.liste tr.zeile-pruefen { border-color: #ecd9a4; background: #fffbef; } }

/* ---------------------------------------------------------------- GL: Abrechnung → Rechnung */
.testmodus-band { background: #fdf1d0; color: #7a4d00; border: 1px solid #f0d48a; border-radius: 10px; padding: 8px 14px; margin-bottom: 16px; font-weight: 600; font-size: 13px; }
.quellen { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pruef { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pruef .quelle-ansicht { max-height: 78vh; overflow: auto; background: #fff; border: 1px solid var(--linie); border-radius: 12px; padding: 10px; }
.pruef .quelle-ansicht img { width: 100%; height: auto; display: block; }
.pruef .quelle-ansicht pre { white-space: pre-wrap; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; margin: 0; }
.checks { list-style: none; padding: 0; margin: 8px 0; }
.checks li { padding: 5px 0; display: flex; gap: 8px; align-items: baseline; }
.checks .ok { color: var(--gruen); font-weight: 800; } .checks .nein { color: var(--rot); font-weight: 800; } .checks .warn { color: var(--gelb); font-weight: 800; }
.segment.steuer button { flex: 1; }
.ablage { border: 2px dashed var(--linie); border-radius: 14px; padding: 28px; text-align: center; color: var(--text-2); cursor: pointer; }
.ablage.ueber { border-color: var(--petrol); background: var(--soft); }
table.liste tr.abrechnung td:first-child { box-shadow: inset 3px 0 0 var(--petrol); }
.lade { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--linie); border-top-color: var(--petrol); border-radius: 50%; animation: drehen .8s linear infinite; vertical-align: -2px; }
.btn .lade { border-color: currentColor; border-top-color: transparent; margin-right: 8px; }   /* Warteanzeige im Knopf (passt zu hellen und dunklen Knöpfen) */
@keyframes drehen { to { transform: rotate(360deg); } }
@media (max-width: 900px) { .pruef { grid-template-columns: 1fr; } .pruef .quelle-ansicht { max-height: 40vh; } }

/* =====================================================================================================
   Design „Ruhig“ (Inspiration: Granola, Steno, Sandbar – Lapa Ninja) – mobil zuerst
   warmes Off-White · weiße Flächen mit feinen Linien · kräftige Slab-Schrift (wie im Logo) nur für große Zahlen/Titel · Navy für Aktionen ·
   GL-Orange nur als kleiner Akzent (Punkt im Logo, Markierungen) · weiche Ecken, kaum Schatten
   ===================================================================================================== */
body { background: var(--papier); }
h1 { font-family: var(--anzeige); font-weight: 700; letter-spacing: -.015em; font-size: 30px; line-height: 1.1; }
h2 { font-family: 'DM Sans', system-ui, sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 0; color: var(--text); }
.label, .kachel .label { font-family: 'DM Sans', system-ui, sans-serif; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-2); }
.feld { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
table.liste th, table.pos th { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-2); }
.sub { color: var(--text-2); }
a { color: var(--dunkel); }
.mono, .betrag-gross, .kachel .wert, td.r, .summenbox { font-variant-numeric: tabular-nums; }
.mono { font-family: 'DM Sans', system-ui, sans-serif; font-weight: 600; font-size: 13.5px; letter-spacing: 0; }

/* Weiche Ecken */
.btn, .chip, .segment, .tabs, input, select, textarea { border-radius: 10px; }
.karte, .kachel, .leer, table.liste, .modal-box, .login, .vorschau, .pruef .quelle-ansicht, .hinweis, .testmodus-band, .ablage, .karte-innen { border-radius: 14px; }

/* Knöpfe: ruhig, Navy für die Hauptaktion */
.btn { border: 1px solid var(--linie); background: var(--weiss); color: var(--text); font-weight: 600; box-shadow: 0 1px 1px rgba(35,38,43,.04); }
.btn:hover { border-color: #cfc9bd; background: #fbfaf7; }
.btn.primaer { background: var(--dunkel); border-color: var(--dunkel); color: #fff; }
.btn.primaer:hover { background: var(--dunkel-2); border-color: var(--dunkel-2); }
.btn.gefahr { color: var(--rot); background: var(--weiss); }
.btn.gefahr:hover { border-color: var(--rot); }
.btn.gross { font-weight: 600; }

/* Flächen */
.karte, .kachel, table.liste, .leer, .login, .modal-box, .pruef .quelle-ansicht { background: var(--weiss); border: 1px solid var(--linie); box-shadow: 0 1px 2px rgba(35,38,43,.04); }
.kachel .wert { font-family: var(--anzeige); font-weight: 700; font-size: 30px; letter-spacing: -.01em; line-height: 1; margin-top: 8px; }
.kachel.orange { background: var(--weiss); border-color: var(--linie); box-shadow: inset 3px 0 0 var(--petrol), 0 1px 2px rgba(35,38,43,.04); }
.kachel.orange .label, .kachel.orange .hinw { color: var(--text-2); }
.kachel.tinte { background: var(--dunkel); border-color: var(--dunkel); color: #fff; }
.kachel.tinte .label, .kachel.tinte .hinw { color: #B9C0CE; }
.kachel.warnung { box-shadow: inset 3px 0 0 var(--petrol); }
.hinweis { background: var(--weiss); color: var(--text); border: 1px solid var(--linie); box-shadow: inset 3px 0 0 var(--petrol); }
.hinweis.info { box-shadow: inset 3px 0 0 var(--dunkel); }
.testmodus-band { background: #FBF3E6; color: #7A4B1E; border: 1px solid #F0DFC4; font-size: 13px; font-weight: 500; }
.testmodus-band a { color: #7A4B1E; font-weight: 600; }

/* Listen & Tabellen */
table.liste th { background: transparent; border-bottom: 1px solid var(--linie); }
table.liste td { border-top: 1px solid #EFECE5; }
table.liste tr.klick:hover td { background: #FAF8F4; }
table.pos td { border-top: 1px solid #EFECE5; }
.summenbox .gesamt { font-weight: 700; border-top: 1px solid var(--text); }
.chip { border: 1px solid var(--linie); background: var(--weiss); font-weight: 500; }
.chip.an { background: var(--dunkel); border-color: var(--dunkel); color: #fff; }
.badge { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px; }
.typ { background: #EEF0F4; color: var(--dunkel); border-radius: 6px; }

/* Formulare */
input, select, textarea { border: 1px solid var(--linie); background: var(--weiss); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(38,49,74,.14); outline-offset: 0; border-color: var(--dunkel); }
.segment { border: 1px solid var(--linie); background: #F1EEE8; padding: 3px; gap: 3px; }
.segment button { background: transparent; color: var(--text-2); border: 0; border-radius: 8px; font-weight: 600; }
.segment button.an { background: var(--weiss); color: var(--text); box-shadow: 0 1px 3px rgba(35,38,43,.12); }
.tabs { border-bottom: 1px solid var(--linie); border-radius: 0; }
.tab { font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.tab.an { color: var(--text); border-bottom: 2px solid var(--dunkel); }

/* Seitenleiste (PC): hell */
.nav { background: var(--weiss); border-right: 1px solid var(--linie); color: var(--text); }
.nav nav a { color: var(--text-2); font-weight: 500; border-radius: 10px; }
.nav nav a:hover { background: #F4F2ED; color: var(--text); }
.nav nav a.aktiv { background: #F1EEE8; color: var(--text); box-shadow: none; font-weight: 600; }
.nav .neu { background: var(--dunkel); color: #fff; font-weight: 600; border-radius: 10px; }
.nav .neu:hover { background: var(--dunkel-2); }
.nav .neu.zweit { background: var(--weiss); color: var(--text); border: 1px solid var(--linie); }
.nav .neu.zweit:hover { background: #F4F2ED; }
.nav-fuss { color: var(--text-2); }

/* Übersicht */
.held { margin: 2px 0 18px; }
.held .gross { font-family: var(--anzeige); font-weight: 700; font-size: clamp(60px, 16vw, 104px); letter-spacing: -.03em; line-height: .95; margin: 4px 0 2px; color: var(--dunkel); }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 24px; }
.bento .breit { grid-column: span 2; }
a.kachel { text-decoration: none; color: inherit; display: block; }
.mailkarte { display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin-bottom: 8px; background: var(--weiss); border: 1px solid var(--linie);
  border-radius: 14px; cursor: pointer; text-decoration: none; color: inherit; }
.mailkarte .nr { font-weight: 600; font-size: 16px; }
.mailkarte .pfeil { margin-left: 8px; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #F1EEE8; display: grid; place-items: center; color: var(--text-2); }
.stempel { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 3px 10px; margin-left: auto; white-space: nowrap; background: #FBEDE1; color: var(--petrol-d); }
.stempel.lux { background: #EEF0F4; color: var(--dunkel); } .stempel.ok { background: var(--gruen-soft); color: var(--gruen); }

/* Startseite: drei gleich große Kennzahlen, dann die neuen Abrechnungen */
.kennzahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 26px; }
.kennzahlen .kachel { padding: 14px 16px; }
.kennzahlen .kachel .wert { font-size: 24px; margin-top: 6px; }
.abschnitt-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.abschnitt-kopf h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.abschnitt-kopf .zahl:not(:empty) { background: var(--petrol); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 8px; }
.abschnitt-kopf a { text-decoration: none; }
.leer-ruhig { background: var(--weiss); border: 1px dashed var(--linie); border-radius: 14px; padding: 16px; color: var(--text-2); text-align: center; }
@media (max-width: 900px) {
  .kennzahlen { gap: 8px; margin-bottom: 20px; }
  .kennzahlen .kachel { padding: 11px 12px; }
  .kennzahlen .kachel .wert { font-size: 19px; }
  .kennzahlen .kachel .label, .kennzahlen .kachel .hinw { font-size: 11px; }
}

/* Prüfmaske */
.pruef-titel { font-family: var(--anzeige); font-weight: 700; font-size: clamp(34px, 9vw, 48px); letter-spacing: -.02em; line-height: 1; margin: 4px 0 8px; }
.checks li { border-bottom: 1px solid #EFECE5; padding: 9px 0; }
.checks .ok, .checks .nein, .checks .warn { width: 20px; height: 20px; flex: none; display: grid; place-items: center; font-size: 11px; border-radius: 50%; }
.checks .ok { background: var(--gruen-soft); color: var(--gruen); }
.checks .nein { background: var(--rot-soft); color: var(--rot); }
.checks .warn { background: var(--gelb-soft); color: var(--gelb); }
.betrag-gross { font-family: var(--anzeige); font-size: 30px; font-weight: 700; }

/* ----------------------------------------------------------------------------- Handy */
@media (max-width: 900px) {
  .mobil-kopf { background: rgba(246,244,239,.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--linie); }
  .mobil-kopf img { height: 28px; }
  .mobil-nav { background: rgba(255,255,255,.96); border-top: 1px solid var(--linie); box-shadow: none; }
  .mobil-nav button { color: #9A958B; font-size: 11px; font-weight: 500; }
  .mobil-nav button.aktiv { color: var(--dunkel); font-weight: 600; }
  .mobil-nav .plus span { border-radius: 50%; background: var(--dunkel); color: #fff; width: 52px; height: 52px; margin-top: -20px; border: 4px solid var(--papier); box-shadow: 0 4px 12px rgba(38,49,74,.25); font-weight: 400; }
  h1 { font-size: 26px; }
  .bento { grid-template-columns: 1fr 1fr; }
  .bento .breit { grid-column: span 2; }
  .kachel .wert { font-size: 26px; }
  table.liste tr { border-radius: 14px; border: 1px solid var(--linie); background: var(--weiss); padding: 12px 14px; margin: 0 0 8px; }
  table.liste { background: transparent; border: 0; box-shadow: none; }
  table.liste td { border-top: 0; }
  table.liste td.m-titel { font-weight: 600; }
  .modal-box, .modal-box.breit, .blatt-box { border-radius: 20px 20px 0 0 !important; }
  /* Haupt-Aktion unten fest */
  .aktion-unten { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 20; margin-top: 14px; }
  .aktion-unten .btn { width: 100%; justify-content: space-between; padding: 16px 18px; font-size: 16px; border-radius: 14px; box-shadow: 0 6px 18px rgba(38,49,74,.22); }
}

@media (max-width: 900px) { .pruef .quelle-ansicht { order: 2; } }

.feld input, .feld select, .feld textarea, .feld .check, .feld span[style] { font-family: 'DM Sans', system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 400; color: var(--text); }

/* App-Gefühl am Handy: kein Zoomen, kein Gummiband-Wackeln, kein seitliches Verschieben */
/* Nur das Dokument (html) sperrt Gummiband/Seitwärts – body darf kein eigener Scroll-Container sein, sonst scrollt das Mausrad am PC nicht */
html { overscroll-behavior: none; overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: clip; max-width: 100%; }
body { touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.kopfzeile .aktionen, .filter, .tabs, .diagramm-flaeche, .tabelle-scroll, [style*="overflow-x"] { touch-action: pan-x pan-y; }  /* seitlich wischbare Leisten */
@media (max-width: 760px) {
  input, select, textarea, .feld input, .feld select, .feld textarea { font-size: 16px; }   /* ab 16px zoomt iOS beim Antippen nicht */
}

/* Vorschau/PDF im Vollbild (Home-Bildschirm-App ohne Zurück-Knopf) */
#vollbild { position: fixed; inset: 0; z-index: 9000; background: var(--papier); display: flex; flex-direction: column; }
#vollbild .vb-kopf { display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; color: var(--text);
  font: 600 14px 'DM Sans', sans-serif; border-bottom: 1px solid var(--linie); background: var(--weiss); }
#vollbild .vb-kopf span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#vollbild .vb-zu { background: var(--dunkel); color: #fff; border: 0; border-radius: 10px; padding: 10px 14px; font: 600 15px 'DM Sans', sans-serif; }
#vollbild .vb-laden { color: var(--text); text-decoration: none; font-size: 20px; padding: 6px 8px; }
#vollbild iframe { flex: 1; width: 100%; border: 0; background: #fff; touch-action: pan-x pan-y; }
body.vb-offen { overflow: hidden; }

/* Linien-Icons (statt Emojis) */
.ico { display: inline-block; flex: none; vertical-align: -3px; }
i[data-ico] { display: inline-flex; align-items: center; font-style: normal; }
.btn i[data-ico], .tab i[data-ico], .neu span[data-ico] { margin-right: 6px; }
.btn i[data-ico]:only-child { margin-right: 0; }
.nav .neu { display: flex; align-items: center; }
.nav nav a { display: flex; align-items: center; gap: 10px; }
.nav nav a span[data-ico] { display: inline-flex; color: var(--text-2); }
.nav nav a.aktiv span[data-ico] { color: var(--dunkel); }
.mobil-nav button span[data-ico] { display: inline-flex; height: 26px; align-items: center; }
.mobil-nav .plus span[data-ico] { display: grid; height: 52px; }
.blatt-eintrag span { color: var(--dunkel); background: #F1EEE8; }
.offline-kachel span { color: var(--dunkel); }

/* Montagebericht */
.mb-gruppe { padding: 0; overflow: hidden; }
.mb-gruppe summary { padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.mb-gruppe summary::after { content: '+'; color: var(--text-2); font-weight: 400; font-size: 18px; line-height: 1; }
.mb-gruppe[open] summary::after { content: '−'; }
.mb-gruppe summary::-webkit-details-marker { display: none; }
.mb-pos { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid #EFECE5; }
.mb-pos.an { background: #FAF8F4; box-shadow: inset 3px 0 0 var(--petrol); }
.mb-text { min-width: 0; display: flex; flex-direction: column; }
.mb-text span { font-size: 12px; color: var(--text-2); }
.mb-text em { color: var(--petrol-d); font-style: normal; }
.mb-menge { display: flex; align-items: center; gap: 6px; flex: none; }
.mb-menge input { width: 64px; text-align: center; padding: 8px 4px; }
.mb-menge .btn { width: 38px; height: 38px; justify-content: center; padding: 0; font-size: 18px; }
.mb-reihe { margin-bottom: 6px; }
.mb-summe { display: flex; justify-content: space-between; align-items: center; }
.mb-summe .wert { font-family: var(--anzeige); font-weight: 700; font-size: 30px; margin-top: 4px; color: var(--dunkel); }
.mb-summe .hinw { font-size: 12px; color: var(--text-2); }
a.btn { text-decoration: none; }
.mb-aktionen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.mb-aktionen .btn { justify-content: center; }
.mb-aktionen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mb-aktionen .btn { white-space: normal; text-align: center; min-height: 44px; }

.mb-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.mb-foto { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #F1EEE8; }
.mb-foto img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.mb-foto-weg { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(35,38,43,.7); color: #fff; display: grid; place-items: center; cursor: pointer; }
/* Logo oben links: füllt die Breite der Seitenleiste (PC), am Handy etwas größer */
.nav .logo { width: 100%; max-width: none; margin: 0 0 20px; }
.nav { padding-top: 18px; }
@media (max-width: 900px) { .mobil-kopf img { height: 36px; } .mobil-kopf { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; } }

/* Vermerk Lexnik IT */
.lexnik { font-size: 11.5px; color: var(--text-2); letter-spacing: .01em; }
.lexnik b { color: var(--dunkel); font-weight: 600; }
.nav-fuss .lexnik { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--linie); }
.blatt-box .lexnik, .login .lexnik { text-align: center; margin-top: 14px; }

.logo-start { cursor: pointer; }
.lexnik { display: flex; align-items: center; gap: 8px; }
.lexnik img { height: 22px; width: auto; display: block; }
.blatt-box .lexnik, .login .lexnik { justify-content: center; }

/* Handy: Tipp-Ziele groß genug (mind. ca. 40–44 px) */
@media (max-width: 900px) {
  .btn.klein { min-height: 40px; padding: 8px 12px; }
  .chip { min-height: 38px; }
  .mb-foto-weg { width: 36px; height: 36px; }
}

/* Passwort anzeigen */
.pw-feld { position: relative; display: block; }
.pw-feld input { padding-right: 48px; }
.pw-auge { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none;
  color: var(--text-2); cursor: pointer; display: grid; place-items: center; border-radius: 8px; }
.pw-auge:hover, .pw-auge:focus-visible { color: var(--text); background: var(--papier); }
/* Schnellanmeldung */
.login .oder { text-align: center; color: var(--text-2); font-size: 13px; margin: 6px 0; }
.login .btn.faceid { display: flex; align-items: center; justify-content: center; gap: 10px; }
input.pin { font-size: 26px; letter-spacing: .4em; text-align: center; }

/* Preisliste: auf dem Handy je Position zwei Zeilen (Name, darunter Einheit/Preis/Gruppe) */
@media (max-width: 760px) {
  table.pl colgroup, table.pl thead { display: none; }
  table.pl, table.pl tbody { display: block; }
  table.pl tr { display: grid; grid-template-columns: 64px 1fr 1fr 40px; gap: 6px; padding: 10px 0; border-top: 1px solid var(--linie); }
  table.pl td { display: block; padding: 0; border: 0; }
  table.pl td:first-child { grid-column: 1 / -1; }
}

/* ===================== Dialoge & Menüs: feste Kopf- und Knopfleiste, nur der Inhalt scrollt ===================== */
.modal-box { display: flex; flex-direction: column; padding: 0; overflow: hidden; max-height: 90vh; max-height: 90dvh; }
.modal-kopf { position: relative; display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px 24px; border-bottom: 1px solid var(--linie); flex: none; }
.modal-kopf h2 { margin: 0; flex: 1; min-width: 0; font-size: 20px; line-height: 1.25; }
.modal-kopf .blatt-griff { display: none; }
.modal-zu { margin-left: auto; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #F1EEE8; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.modal-zu:hover { background: #E7E3DA; }
.modal-inhalt { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 18px 24px 20px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-inhalt > :first-child { margin-top: 0; }
.modal-fuss { flex: none; margin: 0; padding: 14px 24px; border-top: 1px solid var(--linie); background: var(--weiss); }
.modal-fuss:empty { display: none; }
.modal-box input[type=checkbox], .modal-box input[type=radio], .blatt-box input[type=checkbox] { accent-color: var(--dunkel); width: 20px; height: 20px; }
.blatt-box { display: flex; flex-direction: column; padding: 0; overflow: hidden; max-height: 85vh; max-height: 85dvh; }
.blatt-kopf { position: relative; display: flex; align-items: center; padding: 22px 14px 10px 20px; flex: none; }
.blatt-kopf .blatt-griff { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); margin: 0; }
.blatt-kopf h2 { margin: 0; flex: 1; font-size: 20px; }
.blatt-liste { overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 10px calc(14px + env(safe-area-inset-bottom)); }
.blatt-eintrag { padding: 11px 10px; font-weight: 600; }
.blatt-eintrag + .blatt-eintrag { border-top: 1px solid #EFECE5; border-radius: 0; }
.blatt-eintrag:active, .blatt-eintrag:hover { border-radius: 12px; }
.blatt-eintrag .weiter { margin-left: auto; color: #B3ADA2; display: inline-flex; }
.blatt-eintrag .zaehler + .weiter { margin-left: 8px; }
@media (max-width: 900px) {
  .modal { padding: 0; align-items: end; padding-top: calc(env(safe-area-inset-top) + 16px); }
  .modal-box, .modal-box.breit { width: 100%; max-height: 100%; border-radius: 20px 20px 0 0; animation: hoch .2s ease-out; }
  .modal-kopf { padding: 24px 12px 12px 18px; }
  .modal-kopf .blatt-griff { display: block; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); margin: 0; }
  .modal-kopf h2 { font-size: 19px; }
  .modal-inhalt { padding: 16px 18px 18px; }
  .modal-fuss { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 16px rgba(35,38,43,.05); }
  .modal-fuss .btn { flex: 1 1 0; min-width: 0; justify-content: center; padding: 14px 12px; font-size: 16px; border-radius: 14px; margin-right: 0 !important; white-space: normal; text-align: center; }
  .modal-fuss .btn.primaer { flex-grow: 2; }
  .modal-fuss .btn.gefahr { flex-basis: 100%; order: 3; }
}
.quelle-modal img { width: 100%; height: auto; display: block; border-radius: 10px; }
.quelle-modal pre { white-space: pre-wrap; word-break: break-word; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.5; margin: 0; background: var(--papier); padding: 12px; border-radius: 10px; }
.postfach-neu { display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 10px; padding: 4px 0; border: 0; background: none; color: var(--text-2); font: 500 13px 'DM Sans', sans-serif; cursor: pointer; }
.postfach-neu:disabled { opacity: .6; }
.abschnitt-kopf h2 { white-space: nowrap; }
.f-kurz { font-size: 14px; color: var(--text-2); margin: 0 0 4px 30px; line-height: 1.5; }
.f-kurz b { color: var(--text); font-weight: 600; }
button.link { border: 0; background: none; padding: 0 0 0 6px; color: var(--dunkel); font: 600 14px 'DM Sans', sans-serif; text-decoration: underline; cursor: pointer; }
.btn.f-ansehen { width: 100%; justify-content: center; margin-top: 4px; }
.modal-inhalt .checks li { padding: 7px 0; font-size: 14.5px; }
@media (max-width: 900px) {
  .modal-kopf h2 { font-size: 17px; }
  .modal-kopf { padding: 20px 10px 8px 16px; }
  .modal-zu { width: 32px; height: 32px; }
  .modal-inhalt { padding: 12px 16px 14px; font-size: 14.5px; }
  .modal-inhalt .feld { font-size: 12.5px; }
  .modal-fuss { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .modal-fuss .btn { padding: 12px 10px; font-size: 15px; }
}
/* Wischen zum Archivieren */
.wisch { position: relative; margin-bottom: 8px; border-radius: 14px; overflow: hidden; transition: height .25s ease, margin .25s ease, opacity .25s ease; }
.wisch .mailkarte { position: relative; margin-bottom: 0; touch-action: pan-y; }
.wisch-hinter { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-right: 22px;
  background: #8E8A80; color: #fff; font-weight: 700; font-size: 15px; border-radius: 14px; }
.wisch.bereit .wisch-hinter { background: var(--dunkel); }
.wisch.weg { height: 0 !important; margin-bottom: 0; opacity: 0; }
.toast-knopf { margin-left: 14px; border: 0; background: rgba(255,255,255,.18); color: #fff; font: 700 14px 'DM Sans', sans-serif; padding: 6px 12px; border-radius: 8px; cursor: pointer; }

/* Versand-Bestätigung */
.bestaetigung{list-style:none;margin:4px 0 10px;padding:0;display:grid;gap:10px}
.bestaetigung li{display:flex;gap:10px;align-items:flex-start;line-height:1.4}
.bestaetigung li i{flex:none;width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin-top:-2px}
.bestaetigung li.ok i{background:#E3F1E6;color:#2E7D46}
.bestaetigung li.nein i{background:#FBE7E4;color:#B3261E}
.bestaetigung li.laeuft i{background:#FDF0E4;color:#B85F1E;animation:fg-puls 1.2s ease-in-out infinite}
.bestaetigung li.wartet{color:var(--text-2)}
.bestaetigung li.wartet i{background:var(--flaeche-2,#EEE);color:var(--text-2)}
@keyframes fg-puls{50%{opacity:.45}}

/* Kasten „Bei dieser Rechnung ist noch etwas zu erledigen“: je Punkt Text + Knöpfe */
.hinweis ul.nachholen { margin: 8px 0 0; padding-left: 18px; }
.hinweis ul.nachholen li { margin: 0 0 10px; }
.hinweis ul.nachholen .aktionen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Dokumentseite 2026-11-10: Zurück-Knopf, gut sichtbarer Bezahlt-Status, seltene Aktionen hinter „Mehr“ */
.btn.zurueck { display: flex; width: max-content; padding: 6px 12px 6px 8px; margin-bottom: 10px; font-size: 14px; }
.bezahlt-box { display: flex; align-items: center; gap: 12px; border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 14.5px; line-height: 1.35; border: 2px solid transparent; }
.bezahlt-box b { font-size: 16px; }
.bezahlt-box.ja { background: var(--gruen-soft); color: var(--gruen); border-color: #b9e0c9; }
.bezahlt-box.nein { background: var(--gelb-soft); color: #5f4500; border-color: #f0dca6; }
.bezahlt-box.ueberfaellig { background: var(--rot-soft); color: var(--rot); border-color: #f1c3cc; }
.bezahlt-box .bz-zeichen { width: 40px; height: 40px; border-radius: 50%; background: var(--gruen); color: #fff; display: grid; place-items: center; flex: none; }
.bezahlt-box .btn { margin-left: auto; flex: none; }
.btn.gruen { background: var(--gruen); border-color: var(--gruen); color: #fff; padding: 11px 18px; font-size: 15px; }
.btn.gruen:hover { filter: brightness(.92); border-color: var(--gruen); }
.btn.mehr-knopf.an { border-color: var(--petrol); color: var(--petrol-d); }
.mehr-menue { display: flex; flex-direction: column; gap: 0; margin-top: 8px; border: 1px solid var(--linie); border-radius: 12px; background: var(--weiss); overflow: hidden; }
.mehr-menue[hidden] { display: none; }
.mehr-menue .btn { border: 0; border-bottom: 1px solid var(--raster); border-radius: 0; justify-content: flex-start; padding: 13px 14px; font-size: 14.5px; }
.mehr-menue .btn:last-child { border-bottom: 0; }
/* Freigabe im Hintergrund: Leiste unten (über der Navigation am Handy) */
.fg-leiste { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 55; display: flex; align-items: center; gap: 12px; width: min(560px, calc(100vw - 24px));
  background: var(--dunkel); color: #fff; border: 0; border-radius: 14px; padding: 12px 14px; text-align: left; font: inherit; font-size: 13.5px; line-height: 1.3; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.28); }
.fg-leiste .lade { border-color: #fff; border-top-color: transparent; flex: none; }
.fg-leiste .fg-text { flex: 1; min-width: 0; }
.fg-leiste .fg-mehr { flex: none; font-weight: 700; opacity: .8; font-size: 12.5px; }
@media (max-width: 900px) {
  .fg-leiste { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .kopfzeile .aktionen > .btn.mehr-knopf { flex-basis: 100%; }
  .bezahlt-box { margin: 10px 0 12px; }
}
