/* Bausteine: Karten, Meldungen, Listen, Kacheln, Tabellen, Ampeln, Dialoge */
.karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 18px var(--abstand); margin-bottom: var(--abstand); box-shadow: var(--schatten);
}
.karte > h2:first-child { margin-top: 0; }
@media (min-width: 900px) { .karte { padding: 22px 24px; } }
.raster { display: grid; gap: var(--abstand); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.meldung { padding: 12px 14px 12px 16px; border-radius: var(--radius-klein); margin: 0 0 12px; border-left: 4px solid currentColor; }
.meldung.fehler { background: var(--fehler-hg); color: var(--fehler); }
.meldung.erfolg { background: var(--erfolg-hg); color: var(--erfolg); }
.meldung.hinweis { background: var(--warnung-hg); color: var(--warnung); }

.liste-einfach { list-style: none; margin: 0; padding: 0; }
.liste-einfach > li { border-bottom: 1px solid var(--rand); }
.liste-einfach > li:last-child { border-bottom: 0; }
.liste-einfach a, .liste-einfach .zeile {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 8px;
  color: var(--text); text-decoration: none; border-radius: var(--radius-klein);
  transition: background-color var(--dauer);
}
.liste-einfach a:hover { background: var(--flaeche-2); }
.liste-einfach svg { width: 22px; height: 22px; color: var(--text-leise); flex: none; }

.kacheln { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kachel {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  color: var(--text); text-decoration: none;
  transition: transform var(--dauer), box-shadow var(--dauer), border-color var(--dauer);
}
@media (hover: hover) {
  .kachel:hover { transform: translateY(-2px); box-shadow: var(--schatten); border-color: var(--akzent-rand); }
}
.kachel .bild { aspect-ratio: 1; background: var(--flaeche-2); display: flex; align-items: center; justify-content: center; }
.kachel .bild img { width: 100%; height: 100%; object-fit: cover; }
.kachel .bild svg { width: 40px; height: 40px; color: var(--text-leise); }
.kachel .text { padding: 10px 12px 12px; }
.kachel .name { font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.kachel .unter { font-size: 0.8rem; color: var(--text-leise); }

.tabelle-huelle { overflow-x: auto; }
table.tabelle { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; }
.tabelle th, .tabelle td { padding: 10px 8px; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: top; }
.tabelle th { font-size: 0.8rem; font-weight: 650; letter-spacing: 0.02em; color: var(--text-leise); background: var(--flaeche-2); }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle td.zahl, .tabelle th.zahl { text-align: right; white-space: nowrap; }

.ampel { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ampel::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: currentColor; }
.ampel.gruen { color: var(--gruen); }
.ampel.gelb { color: var(--gelb); }
.ampel.rot { color: var(--rot); }
progress.balken {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; margin: 8px 0 6px;
  border: 0; border-radius: var(--radius-rund); background: var(--flaeche-2); overflow: hidden; color: var(--akzent);
}
progress.balken::-webkit-progress-bar { background: var(--flaeche-2); border-radius: var(--radius-rund); }
progress.balken::-webkit-progress-value { background: currentColor; border-radius: var(--radius-rund); }
progress.balken::-moz-progress-bar { background: currentColor; border-radius: var(--radius-rund); }

.marke-klein {
  display: inline-block; padding: 2px 10px; border-radius: var(--radius-rund); font-size: 0.75rem; font-weight: 650;
  background: var(--flaeche-2); color: var(--text-leise);
}
.marke-klein.wert { background: var(--akzent-hell); color: var(--akzent); }

.codes { columns: 2; font-family: ui-monospace, monospace; font-size: 1.05rem; padding-left: 1.2em; }
.geheimnis { font-family: ui-monospace, monospace; letter-spacing: 0.08em; overflow-wrap: anywhere; }
.qr { background: #fff; padding: 8px; border-radius: var(--radius-klein); width: 200px; height: 200px; }

dialog.dialog {
  border: 1px solid var(--rand); border-radius: 18px; padding: 0; box-shadow: var(--schatten-hoch);
  background: var(--flaeche); color: var(--text); width: min(520px, calc(100vw - 32px));
}
dialog.dialog::backdrop { background: var(--abdunkeln); }
dialog.dialog .dialog-inhalt { padding: 22px; }

.kopfreihe { justify-content: space-between; align-items: center; margin: 0 0 12px; }
.kopfreihe .anzahl { margin: 0; color: var(--text-leise); }
.knopf[aria-pressed="true"] { background: var(--akzent-hell); }
.kachel-huelle { position: relative; display: flex; }
.kachel-huelle > .kachel { flex: 1; }
.auswahl {
  position: absolute; top: 6px; left: 6px; z-index: 1;
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  background: var(--flaeche); border-radius: var(--radius-klein); box-shadow: var(--schatten);
}
.tabelle .auswahl { position: static; box-shadow: none; width: auto; height: auto; }
.filter .raster { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 var(--abstand); }
.filter { padding-bottom: 4px; }

.fotos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 12px; }
.foto { margin: 0; border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; background: var(--flaeche-2); box-shadow: var(--schatten); }
.foto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.foto figcaption { padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; background: var(--flaeche); }
.foto .knopfreihe { margin: 0; }
.platzhalter { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-leise); }
.platzhalter svg { width: 36px; height: 36px; }
.hochladen { margin-top: 8px; }
.hochladen .knopf svg { width: 20px; height: 20px; }
/* Belege auslesen (1.6): Unterlagen-Zeile mit zwei Knoepfen, Kasten „Aus dem Beleg gelesen“ */
.unterlage .zeile { flex-wrap: wrap; }
.unterlage .zeile > a { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.unterlage .knopf.klein { min-height: 44px; }
.beleg-kasten {
  border: 1px solid var(--rand); border-left: 4px solid var(--akzent); border-radius: var(--radius-klein);
  padding: 12px 14px; margin: 12px 0; background: var(--flaeche);
}
.beleg-kasten h3 { margin: 0 0 4px; }
.beleg-werte { list-style: none; margin: 8px 0; padding: 0; }
.beleg-wert { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 0; border-bottom: 1px solid var(--rand); }
.beleg-wert:last-child { border-bottom: 0; }
.beleg-wert .ankreuzen { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
/* "bisher" unter dem Text des Ankreuzfelds (22 px Feld + 10 px Abstand), wenn die Zeile umbricht */
.beleg-wert > .leise { padding-left: 32px; }
.marke-klein.pruefen { background: var(--warnung-hg); color: var(--warnung); }
dl.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px var(--abstand); margin: 0; }
dl.felder dt { font-size: 0.85rem; color: var(--text-leise); }
dl.felder dd { margin: 0; overflow-wrap: anywhere; }
fieldset.karte { border: 1px solid var(--rand); }
fieldset.karte legend { font-weight: 700; padding: 0 6px; }
.verlauf li { padding: 8px 4px; }

ul.baum { list-style: none; margin: 0; padding: 0; }
ul.baum ul.baum { padding-left: 20px; border-left: 2px solid var(--rand); margin-left: 6px; }
.baum-zeile { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; min-height: 44px; padding: 8px 4px; border-bottom: 1px solid var(--rand); }
.baum-zeile a { font-weight: 600; }
.zeile-breit { justify-content: space-between; }
.passwort-neu { padding: 8px 4px 12px; }
.fotos-neu { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); margin-bottom: 8px; }
.foto-neu { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.foto-neu img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-klein); }
.foto-neu .knopf { font-size: 0.75rem; padding: 4px 6px; }
.scanbereich { margin: 8px 0 12px; }
.scanbereich .knopf svg { width: 20px; height: 20px; }
.scanner-video { width: 100%; max-height: 50vh; object-fit: cover; border-radius: var(--radius); background: #000; }
.scan-ergebnis .meldung { margin-top: 8px; }
.scan-ergebnis .meldung p { margin: 0 0 8px; }
.ampel-zeile { margin-bottom: 14px; }
.ampel-zeile p { margin: 0 0 4px; }
.balken.gruen { color: var(--gruen); }
.balken.gelb { color: var(--gelb); }
.balken.rot { color: var(--rot); }
fieldset { border: 1px solid var(--rand); border-radius: var(--radius-klein); padding: 8px 12px 12px; margin: 0 0 14px; }
fieldset legend { font-weight: 600; padding: 0 4px; }
.auswahl-liste ul { max-height: 320px; overflow-y: auto; }
.grenze-feld { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; }
.grenze-feld input { width: 9em; }
.marke-stand { display: inline-block; padding: 1px 10px; border-radius: var(--radius-rund); font-weight: 650; font-size: 0.85rem; }
.marke-stand.offen { color: var(--text-leise); background: var(--flaeche-2); }
.marke-stand.erledigt { color: var(--erfolg); background: var(--erfolg-hg); }
.marke-stand.veraltet { color: var(--warnung); background: var(--warnung-hg); }
/* Knoepfe in Listen behalten Farbe und Groesse des Knopfs (nicht die Zeilenregel von .liste-einfach a) */
.liste-einfach a.knopf { display: inline-flex; min-height: 36px; padding: 6px 12px; color: var(--akzent-text); }
.liste-einfach a.knopf.zweit { color: var(--akzent); }
.liste-einfach a.knopf:hover { background: var(--akzent-druck); }
.merkliste .zeile { flex-wrap: wrap; }
.merkliste .knopfreihe { margin: 0; }
.videos figure.video { margin: 0; padding: 10px 0; }
.videos video { display: block; width: 100%; max-height: 360px; background: #000; border-radius: var(--radius-klein); }
.videos figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.videos figcaption .knopfreihe { margin: 0; }

/* Leere Zustaende (1.2.0) */
.leer { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 16px; text-align: center; color: var(--text-leise); }
.leer > svg { width: 56px; height: 56px; padding: 14px; border-radius: 18px; background: var(--akzent-hell); color: var(--akzent); }
.leer p { margin: 0; }
/* Marke auf der Anmeldeseite (1.2.0) */
.anmelde-marke { display: flex; align-items: center; gap: 12px; margin: 8px 0 28px; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.anmelde-marke svg { width: 48px; height: 48px; padding: 9px; border-radius: 14px; background: var(--akzent); color: var(--akzent-text); box-shadow: var(--schatten-hoch); }
.anmelde-marke span.unter { display: block; font-size: 0.9rem; font-weight: 500; letter-spacing: 0; color: var(--text-leise); }
/* Titelfoto oben auf der Detailseite (1.4, Spec 3.2) - gleitet aus der angetippten Kachel herein */
.titelfoto { margin: 0 0 14px; }
.titelfoto img { display: block; width: 100%; aspect-ratio: 4 / 3; max-height: 360px; object-fit: cover; border-radius: 22px; background: var(--flaeche-2); box-shadow: var(--schatten); }
/* Nur am Telefon bzw. nur ab 900 px sichtbar (1.4) */
@media (max-width: 899px) { .nur-gross { display: none !important; } }
@media (min-width: 900px) { .nur-klein { display: none !important; } }

/* Blaetter von unten (1.4, Spec 4): Telefon unten mit Griff, PC mittig */
dialog.blatt { border: 1px solid var(--rand); border-radius: 24px; padding: 0; background: var(--flaeche); color: var(--text); box-shadow: var(--schatten-hoch); width: min(560px, calc(100vw - 32px)); max-height: 85dvh; overflow: hidden; }
dialog.blatt[open] { display: flex; flex-direction: column; }
dialog.blatt::backdrop { background: var(--abdunkeln); }
.blatt-griff { flex: none; width: 40px; height: 5px; margin: 8px auto 0; border-radius: var(--radius-rund); background: var(--rand-stark); touch-action: none; }
.blatt-kopf { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px 8px 20px; touch-action: none; }
.blatt-kopf h2 { margin: 0; font-size: 1.15rem; }
.blatt-inhalt { overflow-y: auto; padding: 4px 20px 20px; overscroll-behavior: contain; }
.blatt-aktionen { display: grid; gap: 10px; }
dialog.dialog.blatt .dialog-inhalt { overflow-y: auto; }
@media (min-width: 900px) { .blatt-griff { display: none; } }
@media (max-width: 899px) {
  dialog.blatt, dialog.dialog.blatt { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 90dvh; border-radius: 24px 24px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
}
/* Nachweise und Beweiskraft (1.5, Spec 1.3): Farbe plus Symbol plus Text */
.beweiskraft { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.beweiskraft svg { width: 20px; height: 20px; flex: none; }
.beweiskraft.stark { color: var(--gruen); }
.beweiskraft.mittel { color: var(--gelb); }
.beweiskraft.schwach { color: var(--rot); }
.nachweis-liste { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.nachweis-liste li { display: flex; align-items: center; gap: 8px; }
.nachweis-liste svg { width: 18px; height: 18px; color: var(--gruen); flex: none; }
/* Schadensfall (1.5, Spec 4.4) */
.chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-rund); font-size: 0.85rem; font-weight: 700; }
.chip.offen { background: var(--warnung-hg); color: var(--warnung); }
.chip.fertig { background: var(--erfolg-hg); color: var(--erfolg); }
.frist-uhr { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; color: var(--text-leise); }
.frist-uhr .grosse-zahl { color: var(--text); margin: 0; }
.schritte { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.schritt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 10px 4px; border-bottom: 1px solid var(--rand); }
.schritt:last-child { border-bottom: 0; }
.schritt-symbol svg { width: 26px; height: 26px; }
.schritt-text p { margin: 2px 0 0; color: var(--text-leise); overflow-wrap: anywhere; }
.schritt-stand { font-size: 0.85rem; font-weight: 650; }
.schritt.erledigt .schritt-symbol, .schritt.erledigt .schritt-stand { color: var(--gruen); }
.schritt.faellig .schritt-symbol, .schritt.faellig .schritt-stand { color: var(--gelb); }
.schritt.ueberfaellig .schritt-symbol, .schritt.ueberfaellig .schritt-stand { color: var(--rot); }
.schritt.offen .schritt-symbol, .schritt.offen .schritt-stand, .schritt.hinweis .schritt-symbol, .schritt.hinweis .schritt-stand { color: var(--text-leise); }
@media (max-width: 520px) { .schritt { grid-template-columns: auto minmax(0, 1fr); } .schritt > .knopf { grid-column: 2; justify-self: start; } }
.schritt-kurz { font-weight: 650; }
.schritt-kurz.ueberfaellig { color: var(--rot); }
.schritt-kurz.faellig { color: var(--gelb); }
.fall-liste .fall-zeile { display: grid; gap: 4px; padding: 12px 4px; color: var(--text); text-decoration: none; }
.fall-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.art-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; border: 0; padding: 0; margin: 0 0 14px; }
.art-wahl legend { font-weight: 700; margin-bottom: 8px; }
.art-knopf { display: flex; align-items: center; gap: 10px; min-height: 52px; margin: 0; padding: 10px 14px; border: 1px solid var(--rand-stark); border-radius: var(--radius-klein); font-weight: 650; cursor: pointer; }
.art-knopf:has(input:checked) { border-color: var(--akzent); background: var(--akzent-hell); color: var(--akzent); }
.art-knopf:has(input:focus-visible) { outline: 3px solid var(--fokus); outline-offset: 2px; }
.schadenfotos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-bottom: 10px; }
.schadenfotos figure { margin: 0; display: grid; gap: 6px; }
.schadenfotos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-klein); }
.schadenfotos figcaption { display: grid; gap: 4px; justify-items: start; }
.wahl-liste { max-height: 50vh; overflow-y: auto; }
.kachel-schaden { border-left: 4px solid var(--rot); }
.karte.kachel-schaden h2 { display: flex; align-items: center; gap: 10px; }
.karte.kachel-schaden h2 svg { width: 28px; height: 28px; color: var(--rot); flex: none; }
/* Raum-Inventur (1.6): Zeilen umbrechen am Telefon, Knoepfe in Listen mindestens 44 px */
.inventur .zeile { flex-wrap: wrap; }
.inventur .zeile .knopfreihe { margin: 0; }
.inventur .liste-einfach a.knopf { min-height: 44px; }
.kurzcode { font-weight: 650; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.kurzcodes { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; }
/* Vorschlag aus dem Foto (1.6): Karte am Gegenstand, Liste #/vorschlaege, Wahl in den Einstellungen */
.vorschlag-felder { border: 0; padding: 0; margin: 0 0 8px; }
.vorschlag-form .ankreuzen, .ankreuzen.wahl { align-items: flex-start; padding: 6px 0; }
.vorschlag-form .ankreuzen input, .ankreuzen.wahl input { margin-top: 3px; flex: none; }
.vorschlag-form .ankreuzen > span { min-width: 0; overflow-wrap: anywhere; }
.vorschlag-form > p:last-child { margin: 8px 0 0; }
.vorschlag-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.vorschlag-liste > .karte { margin: 0; }
.vorschlag-eintrag { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; align-items: start; }
.vorschlag-eintrag h2 { margin: 0 0 6px; font-size: 1.05rem; overflow-wrap: anywhere; }
.vorschlag-foto { display: block; }
.vorschlag-foto img, .vorschlag-foto .platzhalter { display: flex; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-klein); }
@media (max-width: 520px) { .vorschlag-eintrag { grid-template-columns: minmax(0, 1fr); } .vorschlag-foto { max-width: 260px; } }
.ankreuzen.wahl > span { display: grid; gap: 2px; min-width: 0; }
.ankreuzen.wahl .hilfe { margin: 0; font-weight: 400; font-size: 0.875rem; color: var(--text-leise); }
