:root {
  --bg: #f2f0ec; --card: #fff; --ink: #1f2328; --muted: #6a6f75; --line: #dcd7cf;
  --accent: #b4441f; --accent-dk: #8f3417; --head: #2b3036;
  --ok: #2f7d4f; --warn: #a86b12; --bad: #b42318; --info: #2d5f8a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
h1 { font-size: 26px; margin: 8px 0 4px; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 17px; margin: 18px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pre { white-space: pre-wrap; margin: 0; }

/* Kopfzeile */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--head); color: #fff; }
.brand { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-right: auto; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent); font-size: 18px; }
.top nav { display: flex; gap: 4px; }
.top nav button { font: inherit; color: #d7dade; background: transparent; border: 0; padding: 10px 16px; border-radius: 8px; min-height: 44px; cursor: pointer; }
.top nav button.on { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.sync { font-size: 13px; min-width: 110px; text-align: right; color: #b9bec4; }
.sync.fehler { color: #ffb4a8; font-weight: 700; }

main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 120px; }

/* Bausteine */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 10px;
  border: 1px solid #c9c3b9; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-dk); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); border-color: #e6b8b2; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 15px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; color: var(--muted); font-size: 18px; }
.icon:hover { background: #f1ede6; color: var(--bad); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.cols { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.cols.c5 { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

label { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }
label > input, label > select, label > textarea { margin-top: 4px; }
input, select, textarea { font: inherit; color: var(--ink); width: 100%; min-height: 46px; padding: 8px 10px; border: 1px solid #c9c3b9; border-radius: 8px; background: #fff; }
textarea { min-height: 90px; resize: vertical; max-height: 50vh; overflow-y: auto; }   /* wächst beim Schreiben mit (app.js), bei langen Texten ab der halben Höhe mit Scrollbalken */
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(180,68,31,.25); border-color: var(--accent); }
input[disabled], select[disabled], textarea[disabled] { background: #f6f4f0; color: var(--ink); }
input[type=checkbox] { width: 26px; min-height: 26px; height: 26px; accent-color: var(--accent); }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
tfoot td { font-weight: 700; border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #faf7f2; }
.zeiten td input { min-width: 92px; }
.zeiten td.nm { min-width: 150px; font-weight: 600; vertical-align: top; padding-top: 10px; }

.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: #ece7df; color: #5b5146; vertical-align: middle; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.badge.entwurf { background: #ece7df; color: #5b5146; }
.badge.eingereicht { background: #fde8c8; color: #8a5300; }
.badge.geprueft { background: #d6f0df; color: #1e6b3e; }
.badge.korrektur { background: #fbd9d4; color: #9b1c10; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { font: inherit; font-size: 16px; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid #c9c3b9; background: #fff; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chip.add { font-size: 14px; min-height: 38px; padding: 0 12px; background: #f7f4ef; }
.chip[disabled] { cursor: default; }

.hint { padding: 9px 12px; margin-top: 8px; border-radius: 8px; border-left: 5px solid; font-size: 15px; }
.hint.rot { background: #fdecea; border-color: var(--bad); }
.hint.gelb { background: #fff4e0; border-color: var(--warn); }
.hint.info { background: #e9f1f8; border-color: var(--info); }

/* Start */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 18px; }
.tile { font: inherit; text-align: left; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; min-height: 130px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.tile:active { background: #faf6f0; }
.tile .t-name { font-size: 22px; font-weight: 700; }
.lock { float: right; font-size: 16px; }

/* Fotos */
.fotos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 12px; }
.foto { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #faf8f5; display: flex; flex-direction: column; }
.foto img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; cursor: zoom-in; background: #ddd; }
.foto .f-b { padding: 6px; display: flex; gap: 4px; align-items: center; }
.foto .f-b input { min-height: 38px; font-size: 15px; }
.foto .f-t { padding: 6px 8px; font-size: 14px; }
.upl { font-size: 15px; color: var(--info); font-weight: 600; }
.verlauf { display: flex; gap: 4px; overflow-x: auto; margin-top: 12px; padding-bottom: 2px; }
.vh { flex: 1 0 58px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; text-align: center; font-size: 12px; background: #fff; display: flex; flex-direction: column; }
.vh b { font-size: 14px; }
.vh.regen { background: #e3eef8; border-color: #9cc0e0; }
.vh.sturm { background: #fdecea; border-color: #e6a39b; }
.sw-btn { background: #2d5f8a; border-color: #2d5f8a; color: #fff; }
.sw-aktiv { border: 2px solid #2d5f8a; background: #f4f8fc; }
.bs-tab td input { min-width: 110px; }
details summary { cursor: pointer; padding: 6px 0; }
.qr-box { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; background: #f7f4ef; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.qr-box > div:last-child { flex: 1; min-width: 220px; }
.qr { background: #fff; padding: 8px; border-radius: 8px; width: 186px; height: 186px; }
.qr img, .qr canvas { display: block; }

/* Unterschrift */
.sig-wrap { border: 2px dashed #c9c3b9; border-radius: 10px; background: #fff; max-width: 620px; touch-action: none; }
.sig-wrap canvas { display: block; width: 100%; height: auto; touch-action: none; }

/* Aktionsleiste */
.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.actions .left { margin-right: auto; }

/* Chef */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { font: inherit; font-weight: 600; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.tabs button.on { background: var(--head); border-color: var(--head); color: #fff; }
.tabs .count { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 13px; margin-left: 4px; }
.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Dokument (Ansicht + Druck) */
.doc { background: #fff; color: #111; font-size: 14px; line-height: 1.4; }
.doc + .doc { margin-top: 24px; }
.doc-h { display: flex; justify-content: space-between; gap: 10px; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 10px; }
.doc-h .r { text-align: right; }
.doc table { font-size: 13px; }
.doc th, .doc td { padding: 4px 6px; border-bottom: 1px solid #ccc; }
.doc .kv td:first-child { width: 150px; color: #555; font-weight: 600; }
.doc h3 { font-size: 15px; margin: 14px 0 4px; border-bottom: 1px solid #999; }
.doc-fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.doc-fotos figure { margin: 0; break-inside: avoid; }
.doc-fotos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border: 1px solid #ccc; cursor: zoom-in; }
.doc-fotos figcaption { font-size: 12px; color: #444; }
.doc .sig img { max-height: 80px; }
.tb-eintrag { border-left: 4px solid var(--accent); padding-left: 12px; margin-bottom: 20px; break-inside: avoid-page; }

/* Dialog / Hinweis */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(20,22,25,.55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 16px; padding: 20px; width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.modal-box.wide { width: min(1000px, 100%); }
.modal-box h2 { margin-bottom: 12px; }
.modal-box label { margin-bottom: 12px; }
.modal-box .row { justify-content: flex-end; margin-top: 8px; }
.modal-box img.gross { width: 100%; height: auto; border-radius: 8px; }
.pin { font-size: 30px; letter-spacing: .3em; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 60; background: #222; color: #fff; padding: 12px 18px; border-radius: 10px; max-width: 90vw; }
.toast[hidden] { display: none; }
.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.banner.korrektur { background: #fbd9d4; color: #7d150b; }
.banner.ro { background: #e9f1f8; color: #1f4466; }

#print { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; }
  .doc { page-break-after: always; }
  .doc:last-child { page-break-after: auto; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .sync { display: none; }
  .top nav button { padding: 10px 10px; }
  .brand #brand { display: none; }
}

.btn.big { min-height: 64px; font-size: 19px; padding: 0 26px; }
tr.ausfall td { color: #2d5f8a; font-style: italic; }
#wer { color: #fff; font-weight: 600; }
.mini-row { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.mini { font: inherit; font-size: 13px; padding: 4px 8px; min-height: 32px; border-radius: 6px; border: 1px solid #c9c3b9; background: #f7f4ef; cursor: pointer; }
tr.abw td { background: #f4f1ec; }
.saldo-plus { color: var(--ok); font-weight: 700; }
.saldo-minus { color: var(--bad); font-weight: 700; }

.ls-liste { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
table.mat td { vertical-align: top; }

.check { display: grid; gap: 8px; }
.check-z { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.chip.on.rot { background: var(--bad); border-color: var(--bad); }
.card.pflicht { border: 2px solid var(--bad); }

.qr-blatt { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.qr-karte { border: 2px solid #b4441f; border-radius: 12px; padding: 12px; text-align: center; break-inside: avoid; }
.qr-karte h2 { font-size: 16px; margin: 0; }
.qr-druck { display: inline-block; margin: 8px 0; }

.wartet { position: absolute; top: 6px; left: 6px; background: rgba(43,48,54,.85); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.persoenlich { display: flex; gap: 10px; align-items: flex-start; margin-top: 28px; font-size: 15px; color: var(--ink); font-weight: 400; }
.persoenlich input { margin-top: 2px; flex: none; }

/* ---------- Handy-Bedienung ---------- */
.kontrast-btn { font: inherit; font-size: 20px; background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; min-width: 44px; min-height: 44px; cursor: pointer; }
nav.schritte { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 4px; }
nav.schritte button { flex: 1 0 auto; min-width: 74px; min-height: 58px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; color: var(--ink); }
nav.schritte button span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 99px; background: #ece7df; font-size: 13px; }
nav.schritte button.fertig span { background: var(--ok); color: #fff; }
nav.schritte button.an { background: var(--head); color: #fff; border-color: var(--head); }
.schnell .zeile { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.schnell .zeile span { color: var(--muted); }
.schnell .zeile b { text-align: right; }
.schnell .zeile.summe { border-bottom: 0; font-size: 19px; }
.hint ul { margin: 4px 0 0; padding-left: 20px; }
@media (max-width: 760px) {
  main { padding: 12px 12px 130px; }
  h1 { font-size: 22px; }
  .card { padding: 14px; border-radius: 12px; }
  .btn { min-height: 56px; font-size: 18px; }
  .btn.sm { min-height: 48px; font-size: 16px; }
  .chip { min-height: 50px; font-size: 17px; }
  input, select, textarea { min-height: 52px; font-size: 18px; }
  .actions { gap: 8px; }
  .actions .btn { flex: 1 1 0; }
  .top { flex-wrap: wrap; }
  #wer { display: none; }
  #sync { display: block !important; order: 9; width: 100%; text-align: left; font-size: 14px; padding-top: 2px; }
  .tablewrap.karten { overflow: visible; }
  /* Erfassungsliste am Handy: je Erfassung eine Karte (Datum + Status, Baustelle, Std./Fotos) */
  table.erfliste, table.erfliste tbody { display: block; width: 100%; }
  table.erfliste thead { display: none; }
  table.erfliste tbody tr { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
  table.erfliste td { display: block; border: 0; padding: 0; }
  table.erfliste td.d { font-weight: 700; }
  table.erfliste td.s { grid-column: 2 / 4; grid-row: 1; justify-self: end; }
  table.erfliste td.b { grid-column: 1 / -1; grid-row: 2; }
  table.erfliste td.num { grid-row: 3; font-size: 15px; font-weight: 600; text-align: left; }
  table.erfliste td.num::before { font-size: 12px; margin-right: 6px; display: inline; }   /* nur Tabellen, die auf dem Handy zu Karten werden (Zeiten, Material) */
  td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; margin-bottom: 2px; }
  td.num[data-l] { text-align: left; font-size: 20px; font-weight: 700; }
  .qr-box { flex-direction: column; }
  .fotos { grid-template-columns: repeat(2, 1fr); }
  .check-z { flex-direction: column; align-items: stretch; }
  .check-z .chips { display: grid; grid-template-columns: repeat(3, 1fr); }
}
/* Mindest-Tippfläche 44 Pixel am Handy */
@media (max-width: 760px) {
  .brand { min-width: 44px; min-height: 44px; }
  .chip.add { min-height: 44px; font-size: 15px; padding: 0 14px; }
  .mini { min-height: 44px; font-size: 14px; padding: 6px 14px; }
  details summary { min-height: 44px; display: flex; align-items: center; }
  input[type=checkbox] { width: 28px; min-height: 28px; height: 28px; }
}
/* Büro-Reiter am Handy: eine wischbare Zeile statt fünf umbrochener Zeilen */
@media (max-width: 760px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; white-space: nowrap; }
}
/* Kleine Höhe (Tastatur offen, Handy quer): Kopf und untere Leiste scrollen mit, damit genug Platz zum Schreiben bleibt */
@media (max-height: 560px) and (max-width: 900px) {
  .top { position: static; }
  .actions { position: static; border-top: 0; background: transparent; padding: 8px 0 0; }
  main { padding-bottom: 24px; }
}
/* Kontrastmodus für Sonnenlicht */
body.kontrast { --bg: #fff; --card: #fff; --ink: #000; --muted: #1a1a1a; --line: #000; font-size: 19px; }
body.kontrast .card, body.kontrast input, body.kontrast select, body.kontrast textarea, body.kontrast .btn, body.kontrast .chip, body.kontrast nav.schritte button { border: 2px solid #000; }
body.kontrast .btn.primary, body.kontrast .chip.on, body.kontrast nav.schritte button.an { background: #000; border-color: #000; color: #fff; }
body.kontrast .hint { border-left-width: 8px; color: #000; font-weight: 600; }
body.kontrast .muted { color: #1a1a1a; }

.modal-box .kundenansicht h2 { font-size: 22px; }
.kunden-doc { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; max-height: 45vh; overflow: auto; background: #fff; }
.kunden-doc .doc .cols { display: none; }   /* Unterschriftsbereich der Vorschau ausblenden */
.sig-wrap.gross { max-width: 100%; border-color: var(--ink); }
@media (max-width: 760px) { .modal { padding: 0; } .modal-box.wide { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; } }
/* Dialoge am Handy: Knopfleiste bleibt unten sichtbar (auch mit Tastatur), die Knöpfe stehen gleich breit nebeneinander */
@media (max-width: 760px) {
  .modal-box { max-height: 100dvh; max-height: 100vh; }
  @supports (height: 100dvh) { .modal-box { max-height: 100dvh; } }
  .modal-box > .row:last-child { position: sticky; bottom: -20px; margin: 8px -20px -20px; padding: 10px 20px 14px; background: #fff; border-top: 1px solid var(--line); flex-wrap: nowrap; z-index: 1; }
  .modal-box > .row:last-child .btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }
}
.kundenansicht .row { flex-wrap: wrap; }
.kundenansicht .row .btn.primary { order: -1; flex: 1 1 100%; }

/* Büro: Abwesenheitskalender */
.abwk table { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.abwk th, .abwk td { border: 1px solid var(--line); padding: 0; text-align: center; min-width: 34px; height: 36px; }
.abwk-n { position: sticky; left: 0; background: #fff; text-align: left !important; padding: 0 10px !important; min-width: 150px !important; white-space: nowrap; z-index: 1; }
.abwk-t { font-weight: 600; line-height: 1.2; padding: 4px 0 !important; }
.abwk-t.frei, .abwk-z.frei { background: #f4f1ec; }
.abwk-t.heute { box-shadow: inset 0 -3px 0 var(--accent); }
.abwk-z { cursor: default; font-weight: 700; font-size: 12px; background: #fff; }
.abwk-z[class*="abw-"] { cursor: pointer; background: #dbe9f7; color: #123; }
.abw-krank, .abw-kind_krank { background: #f9d9d6 !important; }
.abw-berufsschule, .abw-ueba, .abw-schulung { background: #e3f2d8 !important; }
.abw-ueberstunden { background: #fdf0c8 !important; }
.abwk-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.abwk-l { display: inline-block; min-width: 34px; text-align: center; padding: 2px 4px; border-radius: 4px; background: #dbe9f7; }

/* Fotodatenbank und Pläne */
.fld { min-width: 140px; }
.fld > span { display: block; }
.chk { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; color: var(--ink); }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fp-foto { margin: 0; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.fp-foto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #eee; }
.fp-foto figcaption { padding: 6px 8px; font-size: 13px; line-height: 1.3; word-break: break-word; }
@media (max-width: 760px) { .fp-grid { grid-template-columns: repeat(2, 1fr); } }

/* Datums-, Monats- und Zeitfelder: Safari (iPad/iPhone) gibt ihnen eine feste Mindestbreite und sie liefen über Nachbarfelder und Text */
input[type=date], input[type=month], input[type=time], input[type=datetime-local] { display: block; min-width: 0; max-width: 100%; box-sizing: border-box; -webkit-min-logical-width: calc(100% - 16px); }
.cols > label, .row > label { min-width: 0; }
.row > label:has(> input[type=date]), .row > label:has(> input[type=month]), .row > label:has(> input[type=time]) { flex: 1 1 240px; min-width: min(240px, 100%); max-width: 100%; }
.cols > label > input, .cols > label > select { max-width: 100%; }

/* Handy: Tabellen und Dokumentvorschauen, die breiter als der Bildschirm sind, scrollen seitlich statt die ganze Seite zu verbreitern */
@media screen and (max-width: 760px) {
  :not(.tablewrap) > table:not(.erfliste) { display: block; max-width: 100%; overflow-x: auto; }
  .doc { max-width: 100%; overflow-x: auto; }
}
@media print { :not(.tablewrap) > table { display: table !important; overflow: visible !important; } .doc { overflow: visible !important; } }

/* Aufmaß: große Knöpfe, hoher Kontrast, Ziffernblock */
.am { max-width: 560px; margin: 0 auto; padding-bottom: 96px; }
.am-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; background: var(--bg, #fff); padding: 8px 0; border-bottom: 2px solid var(--ink); }
.am-titel { flex: 1; text-align: center; font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-undo, .am-close { min-height: 52px; padding: 0 14px; font: inherit; font-weight: 700; border-radius: 10px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; }
.am-undo { background: #ffe9a8; }
.am-gross { display: block; width: 100%; min-height: 72px; margin: 14px 0; font: inherit; font-size: 20px; font-weight: 700; border-radius: 14px; border: 2px solid var(--ink); background: var(--accent); color: #fff; cursor: pointer; }
.am-kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.am-kachel { min-height: 84px; font: inherit; font-size: 19px; font-weight: 700; border-radius: 14px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; }
.am-kachel.on, .am-kachel:active { background: var(--accent); color: #fff; }
.am-breit { width: 100%; margin-bottom: 12px; min-height: 64px; }
.am-frage { font-size: 22px; margin: 16px 0 4px; }
.am-frage2 { font-size: 18px; font-weight: 600; margin: 8px 0; line-height: 1.3; }
.am-schritt { margin: 10px 0 4px; color: var(--muted); font-weight: 600; }
.am-bst { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-right: 6px; }
.am-wertbox { display: flex; align-items: baseline; justify-content: center; gap: 10px; border: 3px solid var(--ink); border-radius: 14px; padding: 8px 12px; margin: 8px 0; background: #fff; min-height: 76px; }
.am-wert { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.am-einheit { font-size: 24px; color: var(--muted); font-weight: 600; }
.am-tasten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.am-taste { min-height: 68px; font: inherit; font-size: 30px; font-weight: 700; border-radius: 12px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.am-taste:active { background: #e9e6df; }
.am-fuss { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--bg, #fff); border-top: 2px solid var(--ink); max-width: 560px; margin: 0 auto; }
.am-fuss .btn { min-height: 60px; }
.am-seg { display: flex; gap: 0; margin: 10px 0; }
.am-seg button { flex: 1; min-height: 56px; font: inherit; font-weight: 700; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; }
.am-seg button:first-child { border-radius: 12px 0 0 12px; } .am-seg button:last-child { border-radius: 0 12px 12px 0; }
.am-seg button.on { background: var(--ink); color: #fff; }
.am-sk { display: block; width: 100%; max-height: 190px; margin: 6px 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.am-sk .am-haus { fill: #f4f1ec; stroke: var(--ink); stroke-width: 2; }
.am-sk .am-hl { stroke: var(--ink); stroke-width: 1.5; fill: none; }
.am-sk .am-m line, .am-sk .am-m path { stroke: #6a6f75; stroke-width: 2; fill: none; }
.am-sk .am-m.am-on line, .am-sk .am-m.am-on path { stroke: var(--accent); stroke-width: 4; }
.am-sk .am-b { font: 700 13px system-ui, sans-serif; fill: #444; }
.am-sk .am-b.am-on { fill: var(--accent); font-size: 17px; }
.am-sk .am-t { font: 11px system-ui, sans-serif; fill: #6a6f75; stroke: #6a6f75; stroke-width: 0; }
.am-hint { background: #fff4e0; border: 2px solid var(--warn); border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-weight: 600; }
.am-vorschau { min-height: 28px; font-size: 18px; margin: 4px 0; }
.am-karte { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.am-karte input, .am-karte select { min-height: 56px; font-size: 18px; }
.am-chip { min-height: 56px; padding: 0 16px; font: inherit; font-weight: 700; border-radius: 28px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; }
.am-chip.on { background: var(--ink); color: #fff; }
.am-art { display: flex; flex-wrap: wrap; gap: 8px; }
.am-zeile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 64px; padding: 10px 14px; margin: 6px 0; font: inherit; text-align: left; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; }
.am-zeile2 { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 18px; }
.am-h { margin: 18px 0 4px; font-size: 18px; }
.am-gross-zahl { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 16px; margin: 12px 0; border: 3px solid var(--ink); border-radius: 14px; background: #fff; text-align: center; }
.am-gross-zahl b { font-size: 40px; font-variant-numeric: tabular-nums; }
.am-abzug { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 17px; }
.am-abzug span { flex: 1; }
.am-weg { min-width: 52px; min-height: 52px; font: inherit; font-size: 20px; border-radius: 10px; border: 2px solid var(--bad); background: #fff; color: var(--bad); cursor: pointer; }
.am-summe { text-align: right; font-weight: 700; margin: 6px 0; }
.am-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.am-zwei .btn { min-height: 60px; }
.am-fotos { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.am-fotos img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.am-notiz { background: #f4f1ec; border-radius: 10px; padding: 10px 12px; margin: 8px 0; white-space: pre-wrap; }
.am-row { justify-content: stretch !important; } .am-row .btn { flex: 1; min-height: 60px; }
.am-kopf { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px; }
@media (max-height: 560px) and (max-width: 900px) { .am-top { position: static; } }

/* Zeichnen (Skizze) */
#skizze { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #e9e6df; }
.sk-top { display: flex; align-items: center; gap: 8px; padding: 8px; background: #fff; border-bottom: 2px solid var(--ink); }
.sk-titel { flex: 1; text-align: center; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-b { min-height: 52px; min-width: 52px; padding: 0 14px; font: inherit; font-weight: 700; border-radius: 10px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.sk-b.on { background: var(--ink); color: #fff; }
.sk-gelb { background: #ffe9a8; }
.sk-ok { background: var(--accent); color: #fff; }
.sk-feld { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px; }
#sk-c { max-width: 100%; max-height: 100%; background: #fff; touch-action: none; box-shadow: 0 0 0 2px var(--ink); cursor: crosshair; }
.sk-leiste { display: flex; flex-direction: column; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 2px solid var(--ink); }
.sk-reihe { display: flex; gap: 6px; align-items: center; overflow-x: auto; }
.sk-reihe > span { display: inline-flex; gap: 6px; align-items: center; }
.sk-f { width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #888; cursor: pointer; flex: none; }
.sk-f.on { box-shadow: 0 0 0 4px var(--ink); }
.sk-w { flex: none; }
@media (max-height: 520px) { .sk-leiste { flex-direction: row; flex-wrap: wrap; } }

/* Blechkant: Karoblatt-Editor */
#kant-editor { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #e9e6df; }
.kt-top { display: flex; align-items: center; gap: 8px; padding: 8px; background: #fff; border-bottom: 2px solid var(--ink); }
.kt-name { flex: 1; min-height: 52px; font: inherit; font-weight: 700; font-size: 17px; border: 2px dashed var(--line); border-radius: 10px; background: #fff; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.kt-b { min-height: 52px; min-width: 52px; padding: 0 12px; font: inherit; font-weight: 700; border-radius: 10px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; touch-action: manipulation; flex: none; }
.kt-b.on { background: var(--ink); color: #fff; }
.kt-gelb { background: #ffe9a8; } .kt-ok { background: var(--accent); color: #fff; } .kt-rot { border-color: var(--bad); color: var(--bad); }
.kt-feld { position: relative; flex: 1; min-height: 0; }
#kt-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; background: #fff; }
.kt-info { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; }
.kt-info span { background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 14px; font-weight: 600; }
.kt-info .kt-warn { background: #fff4e0; border-color: var(--warn); }
.kt-hilfe { color: var(--muted); font-weight: 600; padding: 12px 4px; }
#kt-svg .kt-t { font: 700 16px system-ui, sans-serif; fill: #111; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
#kt-svg .kt-t.sel { fill: var(--accent); font-size: 19px; }
#kt-svg .kt-w { font: 600 13px system-ui, sans-serif; fill: #555; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.kt-zeile { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 8px 12px; margin: 6px 0; font: inherit; text-align: left; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; }
.kt-zeile svg { flex: none; background: #f4f1ec; border-radius: 8px; }
.am-umr { text-align: center; min-height: 1.4em; font-size: 15px; margin: -2px 0 6px; }
.kt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; } .kt-chips .kt-b { text-align: left; }
/* Kant-Editor (Kantbank-Eingabe): links Skizze, rechts Ziffernblock und Biegeknöpfe; schmal untereinander */
.kt-haupt { flex: 1; min-height: 0; display: flex; }
.kt-haupt .kt-feld { flex: 1; min-width: 0; }
.kt-panel { width: 400px; max-width: 46vw; overflow-y: auto; background: #fff; border-left: 2px solid var(--ink); padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.kt-panel .am-tasten { margin: 0; gap: 8px; } .kt-panel .am-taste { min-height: 58px; font-size: 26px; }
.kt-frage { font-weight: 700; font-size: 17px; }
.kt-wertbox { margin: 0; min-height: 64px; }
.kt-gross { width: 100%; min-height: 60px; font-size: 18px; }
.kt-biege { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kt-biege span { grid-column: 1 / -1; font-weight: 700; color: var(--muted); font-size: 14px; }
.kt-biege .kt-b { min-width: 0; padding: 0 4px; font-size: 17px; min-height: 58px; }
.kt-reihe2 { display: flex; flex-wrap: wrap; gap: 6px; } .kt-reihe2 .kt-b { flex: 1 1 auto; }
.kt-lab2 { font-weight: 700; margin-top: 4px; }
.kt-klein { min-height: 40px; font-size: 14px; }
@media (max-width: 760px), (orientation: portrait) and (max-width: 900px) {
  .kt-haupt { flex-direction: column; }
  .kt-haupt .kt-feld { flex: none; height: 42vh; }
  .kt-panel { width: auto; max-width: none; flex: 1; border-left: 0; border-top: 2px solid var(--ink); }
}
.kt-bb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 74px !important; }
.kt-ico { width: 64px; height: 48px; }
.kt-b.on .kt-ico line:first-child { stroke: #ccc; }
.kt-nw { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.kt-nw-k { display: flex; gap: 6px; } .kt-nw-k .kt-b { min-width: 104px; }
.kt-zuschnitt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 8px 12px; font: inherit; text-align: left; border: 3px solid var(--accent); border-radius: 12px; background: #fff7f2; color: var(--ink); cursor: pointer; }
.kt-zuschnitt span { font-size: 14px; font-weight: 700; color: var(--muted); } .kt-zuschnitt b { font-size: 28px; line-height: 1.1; } .kt-zuschnitt small { color: var(--muted); }
.kt-zeile-w { display: flex; align-items: center; gap: 8px; } .kt-zeile-w .kt-zeile { flex: 1; }
.kt-stern { font-size: 26px; min-width: 60px; min-height: 60px; } .kt-stern.on { background: #ffe9a8; color: var(--ink); border-color: var(--ink); }

/* iPad hochkant (bis 1100 px) und Handy: Zeiten und Material als Karten statt enger Tabelle.
   In der Tabelle wurden Zeitfelder und das Materialfeld zu schmal und schoben sich übereinander. */
@media (max-width: 760px), (max-width: 1100px) and (orientation: portrait) {
  table.zeiten thead, table.mat thead { display: none; }
  table.zeiten, table.zeiten tbody, table.mat, table.mat tbody { display: block; width: 100%; }
  table.zeiten tbody tr, table.mat tbody tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: end; }
  table.zeiten td, table.mat td { display: block; border: 0; padding: 0; min-width: 0; }
  table.zeiten td input, table.mat td input, table.zeiten td select, table.mat td select { min-width: 0; width: 100%; }
  table.zeiten td.nm, table.mat td:first-child { grid-column: 1 / -1; }
  table.zeiten td:last-child, table.mat td:last-child { justify-self: end; align-self: end; }
  table.zeiten tfoot, table.zeiten tfoot tr { display: block; }
  table.zeiten tfoot td { display: inline-block; border: 0; }
  table.zeiten td[data-l]::before, table.mat td[data-l]::before { content: attr(data-l); display: block; font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
  table.zeiten td.num[data-l] { text-align: left; font-size: 20px; font-weight: 700; }
  table.mat td:first-child input, table.mat td:first-child select { font-size: 20px; min-height: 56px; }
}
/* Material in der breiten Tabelle (iPad quer, PC): Materialname bekommt genug Platz */
table.mat td:first-child { min-width: 240px; }
/* iPad/iPhone: Datums- und Zeitfelder halten sich nur ohne Safari-Eigenform an ihre Breite */
@supports (-webkit-touch-callout: none) {
  input[type=date], input[type=month], input[type=time], input[type=datetime-local] { -webkit-appearance: none; appearance: none; width: 100%; min-width: 0; text-align: left; line-height: 1.3; }
  input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
}
/* Namensvorschläge unter dem Materialfeld */
.nv-zelle { position: relative; }
.nv { position: fixed; z-index: 45; background: #fff; border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.18); max-height: 380px; overflow-y: auto; }
.nv-kopf { padding: 8px 14px 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.nv-b { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 56px; padding: 8px 14px; font: inherit; text-align: left; background: #fff; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.nv-b:last-child { border-bottom: 0; } .nv-b:active { background: #f3efe8; }
.nv-b b { font-size: 18px; } .nv-b span { font-size: 13px; color: var(--muted); }
/* Dialoge: die Knopfleiste (z. B. „✓ Bestätigen“ beim Kunden-Unterschreiben) bleibt immer unten sichtbar, auch auf dem iPad,
   wo das Unterschriftsfeld das Scrollen mit dem Finger abfängt */
@supports (height: 100dvh) { .modal-box { max-height: 92dvh; } }
.modal-box > .row:last-child, .modal-box .kundenansicht > .row:last-child { position: sticky; bottom: -20px; margin: 8px -20px -20px; padding: 12px 20px 16px; background: #fff; border-top: 1px solid var(--line); z-index: 2; }
.kundenansicht > .row:last-child { flex-wrap: nowrap; }
.kundenansicht > .row:last-child .btn { flex: 1 1 0; min-width: 0; min-height: 60px; font-size: 18px; }
.kundenansicht > .row:last-child .btn.primary { flex: 2 1 0; }
@media (orientation: portrait) and (max-width: 1100px) { .kunden-doc { max-height: 32vh; } .sig-wrap.gross canvas { max-height: 24vh; } }

/* Baustelle/Handschuhe: alle Tippflächen mindestens 48 px, Schrift mindestens 16 px (Usability-Prüfung) */
.mini { min-height: 48px; padding: 6px 14px; font-size: 16px; font-weight: 600; border-radius: 10px; }
.icon { width: 48px; height: 48px; font-size: 22px; }
.btn.sm { min-height: 48px; font-size: 16px; }
.foto .f-b select, .foto .f-b input { min-height: 48px !important; font-size: 17px !important; }
.foto .f-b select { max-width: none !important; flex: 1; }
input[type=checkbox] { width: 32px; min-height: 32px; height: 32px; }
label:has(> input[type=checkbox]) { min-height: 48px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
/* Nachbestellen und Abnahme */
.best-zeile { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.best-k { display: flex; gap: 8px; flex-wrap: wrap; }
.best-pos { display: grid; grid-template-columns: minmax(0, 1fr) 120px 140px auto; gap: 8px; align-items: center; margin-bottom: 10px; }
.best-pos input, .best-pos select { min-height: 56px; font-size: 18px; }
@media (max-width: 760px) { .best-pos { grid-template-columns: 1fr 1fr auto; } .best-pos .best-name { grid-column: 1 / -1; } }
.abn-erg { display: grid; gap: 8px; } .abn-erg .btn { justify-content: flex-start; text-align: left; min-height: 64px; font-size: 19px; }
.abn-mangel { display: grid; grid-template-columns: auto minmax(0, 1fr) 190px auto auto; gap: 8px; align-items: end; margin-bottom: 10px; }
.abn-mangel > b { align-self: center; font-size: 20px; } .abn-mangel input { min-height: 56px; font-size: 18px; } .abn-frist { margin: 0; font-size: 14px; }
@media (max-width: 760px), (orientation: portrait) and (max-width: 900px) { .abn-mangel { grid-template-columns: auto 1fr auto auto; } .abn-mangel > input { grid-column: 2 / -1; } .abn-frist { grid-column: 1 / 3; } }
input, select { min-height: 48px; } .chip { min-height: 48px; } .btn { min-height: 48px; }

/* ===================== Optik 2026: hochwertiger, aber baustellentauglich =====================
   Ruhige Flächen mit weichen Schatten statt harter Rahmen, kräftige Überschriften, ein Hauptknopf je Bereich,
   Warnbaken-Streifen als Baustellen-Zeichen. Tippflächen bleiben mindestens 48 px, Kontrast-Modus (☀) bleibt hart und schwarz-weiß.
   Keine Schriften aus dem Internet (offline und Datenschutz): Systemschrift, nur stärker gewichtet. */
:root { --bg: #ebe8e3; --line: #ddd7ce; --rand: #c3bcb1; --schatten: 0 1px 2px rgba(31,35,40,.06), 0 8px 24px rgba(31,35,40,.07); --akzent-hell: #f6e9e3; --bake: #f2b705; }
.top { box-shadow: inset 0 -4px 0 var(--accent); padding-bottom: 12px; }
h1 { font-weight: 800; letter-spacing: -.01em; }
h2, h3 { font-weight: 800; }
.card { border: 1px solid rgba(31,35,40,.05); border-radius: 18px; box-shadow: var(--schatten); }
.btn { border: 1.5px solid var(--rand); border-radius: 12px; font-weight: 650; }
.btn.primary { box-shadow: 0 2px 8px rgba(180,68,31,.25); }
input, select, textarea { border: 1.5px solid var(--rand); border-radius: 10px; }
.tabs button { border: 1.5px solid var(--line); border-radius: 12px; min-height: 48px; }
.tabs button.on { box-shadow: 0 2px 8px rgba(31,35,40,.18); }
.badge { display: inline-flex; align-items: center; gap: 6px; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.hint { border-radius: 12px; }

/* Abschnittsüberschriften auf der Startseite */
.sek { font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 26px 4px 10px; }

/* Heute-Karte */
.heute { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; margin-bottom: 16px;
  padding: 20px 32px 20px 22px; border-radius: 20px; background: var(--head); color: #fff; box-shadow: 0 10px 30px rgba(31,35,40,.2); }
.heute::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 10px; background: repeating-linear-gradient(-45deg, var(--bake) 0 10px, var(--head) 10px 20px); }
.heute-t1 { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #c9ced4; }
.heute-t2 { font-size: 26px; font-weight: 800; line-height: 1.2; margin: 4px 0; }
.heute-t3 { color: #d7dade; }
.heute-k { display: grid; gap: 8px; min-width: 240px; }
.heute-k .btn.big { min-height: 64px; font-size: 19px; }
.btn.hell { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn.hell:active { background: rgba(255,255,255,.1); }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.kachel { display: grid; grid-template-columns: 56px 1fr; gap: 4px 14px; align-items: center; min-height: 104px; padding: 16px; border: 1px solid rgba(31,35,40,.05);
  border-radius: 18px; background: #fff; box-shadow: var(--schatten); text-align: left; font: inherit; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.kachel:active { transform: scale(.98); }
.k-ico { grid-row: span 2; width: 56px; height: 56px; border-radius: 14px; background: var(--akzent-hell); color: var(--accent); display: grid; place-items: center; }
.k-ico svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kachel b { font-size: 19px; align-self: end; line-height: 1.25; }
.kachel > span:last-child { color: var(--muted); font-size: 15px; align-self: start; }
.kachel .zahl { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 14px; vertical-align: 2px; }

/* Letzte Tage */
.liste-karte { padding: 4px 16px; }
.tag-zeile { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; width: 100%; min-height: 60px; padding: 12px 4px;
  border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.tag-zeile:last-child { border-bottom: 0; }
.tag-zeile:active { background: #faf7f2; }
.tz-b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tz-z { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* iPad hochkant und Handy */
@media (max-width: 700px) {
  .heute { grid-template-columns: 1fr; padding-right: 26px; }
  .heute-k { min-width: 0; }
  .heute-t2 { font-size: 23px; }
}
@media (max-width: 560px) {
  .kacheln { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kachel { grid-template-columns: 1fr; min-height: 132px; align-content: start; }
  .k-ico { grid-row: auto; }
  .tag-zeile { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .tz-b { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .tz-z { grid-row: 3; }
  .tz-s { grid-row: 1; grid-column: 2; }
}

/* Kontrast-Modus (Sonne): keine Schatten, harte schwarze Kanten */
body.kontrast .card, body.kontrast .kachel { box-shadow: none; border: 2px solid #000; }
body.kontrast .k-ico { background: #fff; color: #000; border: 2px solid #000; }
body.kontrast .heute { background: #000; box-shadow: none; }
body.kontrast .btn.primary { box-shadow: none; }
body.kontrast .tag-zeile { border-bottom: 2px solid #000; }
body.kontrast .btn.hell { border-color: #fff; color: #fff; background: transparent; }
body.kontrast .heute .btn.primary { background: #fff; color: #000; border-color: #fff; }
body.kontrast .tag-zeile:last-child { border-bottom: 0; }
/* Gespeicherte Stehfalz-Rechnungen */
.sf-zeile { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sf-zeile:last-child { border-bottom: 0; }
.sf-oeffnen { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 6px 4px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.sf-knoepfe { flex-wrap: wrap; } .sf-knoepfe .btn { flex: 1 1 140px; }
