/* Mobile-first, ab 360 px. Touch-Ziele >= 44 px, Systemschriften (keine externen Fonts). */
:root {
  --bg: #f4f5f6; --karte: #fff; --text: #1d2329; --leise: #5b6670; --rand: #d5dade;
  --primaer: #1f5f8b; --primaer-text: #fff; --gefahr: #b42318; --ok: #1e7b34;
  --warn-bg: #fff4c2; --warn-rand: #e0b400; --info-bg: #e8f1f8; --info-rand: #8db4d3;
  --radius: 10px; --kopf: #1f2a33;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }
a { color: var(--primaer); }
h1 { font-size: 1.4rem; margin: .25rem 0 .75rem; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; color: var(--leise); }

.kopf { background: var(--kopf); color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: .25rem .75rem; position: sticky; top: 0; z-index: 10; }
.marke { color: #fff; font-weight: 700; text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.nav { display: flex; flex-wrap: wrap; gap: .1rem; }
.nav a, .nav .link { color: #dfe7ee; text-decoration: none; min-height: 44px; display: flex; align-items: center; padding: 0 .55rem; border-radius: 6px; font-size: .95rem; }
.nav a[aria-current] { background: rgba(255,255,255,.15); color: #fff; }
.inhalt { max-width: 960px; margin: 0 auto; padding: .75rem; }
.fuss { text-align: center; color: var(--leise); font-size: .8rem; padding: 1rem 0 1.5rem; }

.karte { background: var(--karte); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.karte.schmal { max-width: 420px; margin: 2rem auto; }
.titelzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }

/* Buttons */
.btn, button { font: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .45rem 1rem; border-radius: 8px; border: 1px solid var(--rand); background: #fff; color: var(--text); text-decoration: none; cursor: pointer; }
.btn-primaer { background: var(--primaer); border-color: var(--primaer); color: var(--primaer-text); }
.btn-gefahr { color: var(--gefahr); border-color: #e7b4ae; }
.btn-leise { background: transparent; border-color: transparent; color: var(--primaer); }
.btn-klein { min-height: 44px; padding: .3rem .75rem; font-size: .9rem; }
.btn-breit { width: 100%; font-size: 1.1rem; min-height: 52px; }
.link { background: none; border: 0; cursor: pointer; }
.inline { display: inline; margin: 0; }
.aktionen { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }

/* Meldungen und Hinweise */
.meldung, .hinweis { padding: .7rem .9rem; border-radius: 8px; margin: 0 0 .75rem; border-left: 5px solid; }
.meldung-ok { background: #e6f4ea; border-color: var(--ok); }
.meldung-fehler { background: #fde8e6; border-color: var(--gefahr); }
.meldung-warnung, .hinweis-warnung { background: var(--warn-bg); border-color: var(--warn-rand); font-weight: 600; }
.meldung-info, .hinweis-info { background: var(--info-bg); border-color: var(--info-rand); }

/* Liste */
.filter { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.filter input[type=search] { grid-column: 1 / -1; }
.liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.listeneintrag { display: block; background: var(--karte); border-radius: var(--radius); padding: .8rem 1rem; color: inherit; text-decoration: none; border-left: 5px solid transparent; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.listeneintrag.mit-warnung { border-left-color: var(--warn-rand); }
.zeile1 { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; overflow-wrap: anywhere; }
.zeile2 { color: var(--text); margin-top: .2rem; }
.zeile3 { color: var(--leise); font-size: .9rem; margin-top: .2rem; }
.warn-text { color: #8a6d00; font-weight: 600; }
.leer { color: var(--leise); }

.status, .tag { display: inline-block; font-size: .8rem; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; background: #e9ecef; }
.status-entwurf { background: #e9ecef; }
.status-in_test { background: #fff0b3; }
.status-freigegeben { background: #d3f0dc; }
.status-verworfen { background: #f3d6d3; text-decoration: line-through; }
.tag-ok { background: #d3f0dc; color: #14532d; }
.tag-fehler { background: #f8d4d0; color: #7f1d1d; }

/* Daten */
.daten { display: grid; grid-template-columns: minmax(7rem, 40%) 1fr; gap: .25rem .75rem; margin: 0; }
.daten dt { color: var(--leise); }
.daten dd { margin: 0; overflow-wrap: anywhere; }
.daten.kompakt { font-size: .95rem; margin: .5rem 0; }
.umbruch { white-space: pre-line; }
.aenderungen { margin: 0; padding-left: 1.2rem; }
.serie, .los { border-top: 1px solid var(--rand); padding: .75rem 0; }
.serie:first-of-type, .los:first-of-type { border-top: 0; }
.fotos { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.fotos img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; display: block; }
.fotos figure { margin: 0; display: grid; gap: .25rem; }

/* Formulare */
.formular { display: grid; gap: .75rem; }
.gruppe { border: 0; padding: 0; margin: 0 0 .5rem; background: var(--karte); border-radius: var(--radius); padding: .75rem 1rem 1rem; }
.gruppe legend { font-weight: 700; padding: 0; float: left; width: 100%; margin-bottom: .5rem; }
.raster { display: grid; grid-template-columns: 1fr; gap: .75rem; clear: both; }
.feld { display: grid; gap: .25rem; min-width: 0; }
.feld label, .feld .label { font-weight: 600; font-size: .95rem; }
.einheit { color: var(--leise); font-weight: 400; }
input[type=text], input[type=number], input[type=date], input[type=search], input[type=password], select, textarea {
  font: inherit; font-size: 16px; /* verhindert iOS-Zoom */ width: 100%; min-height: 44px; padding: .5rem .65rem;
  border: 1px solid #b9c1c8; border-radius: 8px; background: #fff; color: inherit;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #9cc3e0; outline-offset: 0; border-color: var(--primaer); }
.hat-fehler input, .hat-fehler select, .hat-fehler textarea { border-color: var(--gefahr); }
.fehlertext { color: var(--gefahr); margin: 0; font-size: .9rem; }
.hilfe { color: var(--leise); margin: 0; font-size: .9rem; }
.mehr summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--primaer); font-weight: 600; }
.mehr[open] summary { margin-bottom: .5rem; }
.versteckt { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.foto-knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Große Ja/Nein-Knöpfe für die Schnellerfassung */
.janein { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; }
.janein legend { font-weight: 600; font-size: .95rem; margin-bottom: .25rem; padding: 0; }
.janein label { position: relative; }
.janein input { position: absolute; opacity: 0; inset: 0; }
.janein span { display: flex; align-items: center; justify-content: center; min-height: 56px; min-width: 56px; border: 2px solid var(--rand); border-radius: 10px; font-size: 1.15rem; font-weight: 700; background: #fff; cursor: pointer; }
.janein input:focus-visible + span { outline: 3px solid #9cc3e0; }
.knopf-ja input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.knopf-nein input:checked + span { background: var(--gefahr); border-color: var(--gefahr); color: #fff; }
.knopf-offen input:checked + span { background: #e9ecef; border-color: #9aa4ad; }

@media (min-width: 640px) {
  .inhalt { padding: 1rem 1.25rem; }
  .raster { grid-template-columns: 1fr 1fr; }
  .feld-textarea, .feld-janein { grid-column: 1 / -1; }
  .filter { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
  .filter input[type=search] { grid-column: auto; }
}
@media (min-width: 900px) {
  .gruppe .raster { grid-template-columns: repeat(3, 1fr); }
}
