/* FWPilot - lokale Web-App. Keine externen Schriften.
   Gestaltung (Entwurf E): anthrazit Kopfbereich mit feinem Grundriss-Raster und rotem Streifen oben,
   helle Inhaltsfläche, weiße Karten mit Rahmen. Rot nur für Logo, Hauptknopf, Überzeile und Status. */
:root {
  /* Markenfarben aus dem FWPilot-Logo */
  --rot: #D7261E; --rot-dunkel: #A81B15; --rot-hell-text: #F0605A; --rot-logo-dunkel: #E8453D; --orange: #D7261E;
  --text: #16191C; --grau: #6B7076; --gedimmt: #A3A8AE; --linie: #E6E8EB;
  --hinter: #F3F4F6; --flaeche: #ffffff; --feld: #F3F4F6; --feld-hover: #E9EBEE;
  --anthrazit: #16191C; --anthrazit-2: #22262A; --anthrazit-linie: #3A3F45; --anthrazit-raster: #22262B; --anthrazit-text: #B9BEC4;
  --blau: #1d5fae; --gruen: #16803d; --gruen-hell: #e7f5ec; --orange-hell: #FDEBE6; --rot-hell: #FCE9E8;
  --radius: 18px; --radius-klein: 12px; --tipp: 44px;   /* Mindestgröße für Touch-Ziele */
  --schatten: 0 1px 2px rgba(22, 25, 28, .04), 0 8px 24px rgba(22, 25, 28, .08);
  --ueberlappung: 2.5rem;   /* so weit ragen die Inhalte in den dunklen Kopf */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; background: var(--hinter);
  min-height: 100vh; -webkit-tap-highlight-color: rgba(215, 38, 30, .15); }
body.modal-offen { overflow: hidden; }
a { color: var(--blau); }
h1 { font-size: 1.7rem; margin: .2rem 0 1rem; letter-spacing: -.02em; }
h2 { font-size: 1.12rem; font-weight: 600; margin: 0 0 .6rem; letter-spacing: -.01em; }
.klein { font-size: .84rem; color: var(--grau); }
.fehlertext { color: var(--rot) !important; }
.leer { color: var(--grau); padding: 1rem 0; }
.gedimmt { color: var(--gedimmt); font-weight: inherit; }

/* ---------- Kopfbereich ---------- */
.kopfbereich { color: #fff; border-top: 5px solid var(--rot); padding-top: env(safe-area-inset-top, 0px);
  background-color: var(--anthrazit);
  background-image: linear-gradient(var(--anthrazit-raster) 1px, transparent 1px), linear-gradient(90deg, var(--anthrazit-raster) 1px, transparent 1px);
  background-size: 40px 40px; padding-bottom: calc(var(--ueberlappung) + 1.8rem); }
.kopf { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  max-width: 1320px; margin: 0 auto; padding: 1rem 2rem; }
.marke { display: flex; align-items: center; gap: .65rem; text-decoration: none; min-height: var(--tipp); justify-self: start; }
.logo { width: 40px; height: 40px; border-radius: 10px; display: block; }
.wortmarke { font-size: 1.55rem; font-weight: 600; letter-spacing: -.035em; color: #fff; line-height: 1; }
.wortmarke b { font-weight: 800; color: var(--rot-logo-dunkel); }
.logo-gross { display: flex; flex-direction: column; align-items: center; gap: .7rem; margin: .4rem 0 1.4rem; }
.logo-gross img { width: 84px; height: 84px; }
.logo-gross .wortmarke { font-size: 2.3rem; color: var(--text); }
.logo-gross .wortmarke b { color: var(--rot); }
.pillen { display: flex; gap: .25rem; padding: .3rem; border-radius: 99px; background: var(--anthrazit-2); }
.pillen a { color: var(--anthrazit-text); text-decoration: none; padding: .6rem 1.2rem; border-radius: 99px; font-size: .95rem; }
.pillen a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.pillen a.an { background: #fff; color: var(--text); font-weight: 600; }
.kopf-rechts { display: flex; justify-content: flex-end; align-items: center; gap: .55rem; }
.avatar { width: var(--tipp); height: var(--tipp); border-radius: 50%; background: #fff; color: var(--text); display: grid; place-items: center;
  font-weight: 700; font-size: .95rem; }
.rund { width: var(--tipp); height: var(--tipp); border-radius: 50%; display: inline-grid; place-items: center; padding: 0; border: 0;
  background: var(--feld); color: var(--text); cursor: pointer; flex: none; }
.rund:hover { background: var(--feld-hover); }
.kopf .rund { background: var(--anthrazit-2); color: #fff; border: 1px solid var(--anthrazit-linie); }
.kopf .rund:hover { background: #2C3136; }
.klein-rund { width: 32px; height: 32px; font-size: 1.05rem; color: var(--grau); }

/* ---------- Hero (im dunklen Kopf) ---------- */
.hero { max-width: 1320px; margin: 0 auto; padding: 1.4rem 2rem 0; display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 1.2rem 2rem; align-items: flex-end; }
.hero-text { min-width: 0; }
.eyebrow { margin: 0 0 .5rem; font-size: .85rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--rot-hell-text); }
.eyebrow a { color: var(--rot-hell-text); text-decoration: none; }
.eyebrow a:hover { color: #fff; }
.eyebrow .gedimmt-hell { color: var(--anthrazit-text); font-weight: 500; letter-spacing: 0; text-transform: none; }
.hero h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.08; margin: 0; color: #fff;
  text-wrap: balance; }
.hero-knoepfe { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.pille { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.4rem; min-height: 46px; border-radius: 99px;
  border: 1px solid var(--anthrazit-linie); background: var(--anthrazit-2); color: #fff !important; text-decoration: none;
  font-weight: 500; font-size: .95rem; cursor: pointer; }
.pille:hover { background: #2C3136; }
.pille.haupt { background: var(--rot); border-color: var(--rot); font-weight: 600; }
.pille.haupt:hover { background: var(--rot-dunkel); border-color: var(--rot-dunkel); }
.speicherstand { font-size: .82rem; color: var(--anthrazit-text); }
.speicherstand.fehlertext { color: #fff !important; background: var(--rot-dunkel); padding: .2rem .6rem; border-radius: 99px; }

/* ---------- Inhalt ---------- */
.inhalt { max-width: 1320px; margin: calc(-1 * var(--ueberlappung)) auto 0; padding: 0 2rem 3rem; position: relative; }
body.schmal .kopfbereich { padding-bottom: 0; }
body.schmal .inhalt { max-width: 460px; margin-top: 6vh; }
body.schmal h1 { text-align: center; font-size: 1.35rem; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1.35rem 1.5rem; margin-bottom: 1rem; }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .4rem; }
.karte-kopf h2 { margin: 0; }
.meldung { padding: .8rem 1.1rem; border-radius: 16px; margin-bottom: 1rem; box-shadow: var(--schatten); }
.meldung.fehler { background: #fff; color: #8f0a1f; border-left: 4px solid var(--rot); }
.meldung.ok { background: #fff; color: #11592c; border-left: 4px solid var(--gruen); }

/* Dashboard (Projekte) */
.dashboard { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; gap: 1rem; margin-bottom: 1rem; }
.dashboard .karte { margin-bottom: 0; }
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.kacheln-vier { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.dashboard > .karte { margin-bottom: 0; }
.upload { display: flex; flex-direction: column; }
.upload form { flex: 1; }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1.15rem 1.25rem;
  display: flex; flex-direction: column; text-align: left; border: 0; font: inherit; color: inherit; }
button.kachel { cursor: pointer; transition: transform .15s, box-shadow .15s; align-items: stretch; justify-content: flex-start;
  text-align: left; white-space: normal; padding: 1.15rem 1.25rem; }
button.kachel:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(70, 30, 10, .05), 0 16px 34px rgba(70, 30, 10, .1); background: #fff; }
.kachel-kopf { display: flex; justify-content: space-between; align-items: center; font-weight: 500; font-size: .92rem; color: var(--grau); }
.zahl { font-size: 2rem; font-weight: 600; letter-spacing: -.03em; margin: auto 0 .15rem; padding-top: .8rem; }
.zahl .gedimmt { font-size: 1.35rem; }
.trend { font-size: .8rem; color: var(--grau); }
.punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--gedimmt); flex: none; }
.p-aktiv { background: var(--rot); }
.p-gut { background: var(--gruen); }
.p-schlecht { background: var(--rot); }
.kachel-titel { display: flex; align-items: center; gap: .5rem; }
.t-gut { color: var(--grau); }
.t-schlecht { color: var(--rot); }
.projekt-kacheln { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 1.2rem; }

/* ---------- Formulare ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; padding: .6rem .85rem; min-height: var(--tipp); font-size: 1rem; border: 1px solid transparent; border-radius: var(--radius-klein); background: var(--feld); }
input:hover, select:hover, textarea:hover { background: var(--feld-hover); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--rot); background: #fff; box-shadow: 0 0 0 3px rgba(215, 38, 30, .15); }
:focus-visible { outline: 3px solid rgba(215, 38, 30, .45); outline-offset: 2px; }
textarea { resize: vertical; min-height: 2.3rem; }
label { display: block; }
.formular label { margin-bottom: .9rem; font-weight: 500; font-size: .88rem; color: var(--grau); }
.formular label input { margin-top: .3rem; font-weight: 400; color: var(--text); }
.formular .raster { display: grid; grid-template-columns: 1fr; gap: .2rem; }
.formular.breit .raster { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .2rem 1rem; align-items: end; }
.formular .haken { font-weight: 400; color: var(--text); }
button, .knopf { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.15rem; min-height: var(--tipp);
  border-radius: 99px; border: 0; background: var(--feld); cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; font-size: .92rem; }
button:hover, .knopf:hover { background: var(--feld-hover); }
button:disabled { opacity: .5; cursor: default; }
.primaer { background: var(--rot); color: #fff !important; font-weight: 600; }
.primaer:hover { background: var(--rot-dunkel); }
.gross { padding: .8rem 1.6rem; font-size: 1rem; }
.gefahr { color: var(--rot); background: var(--rot-hell); }
.gefahr:hover { background: #fbd9dc; }
button.link { background: none; padding: 0; color: var(--blau); text-decoration: underline; border-radius: 0; }
.klein-knopf { padding: .35rem .9rem; font-size: .88rem; min-height: 36px; }
button.x { background: none; padding: 0; width: 40px; min-height: 40px; font-size: 1.35rem; line-height: 1; color: var(--gedimmt); border-radius: 10px; }
button.x:hover { color: var(--rot); background: var(--rot-hell); }
.inline { display: inline; }
.haken { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.haken { min-height: 36px; }
.haken input { width: 1.3rem; height: 1.3rem; accent-color: var(--rot); }
.knopfleiste { display: flex; gap: .6rem; flex-wrap: wrap; margin: .6rem 0 1rem; }

/* Drag-and-Drop */
.formular .raster .ablage { grid-column: 1 / -1; }
.ablage { position: relative; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  min-height: 180px; padding: 1.4rem 1rem; border: 2px dashed #D5D8DC; border-radius: 18px; background: #FAFBFC;
  text-align: center; cursor: pointer; font-weight: 400 !important; transition: border-color .15s, background .15s; }
.ablage:hover, .ablage:focus-within { border-color: var(--rot); background: #fff7f6; }
.ablage.ziehen { border-color: var(--rot); background: #fdeeea; }
.ablage.gewaehlt { border-style: solid; border-color: var(--gruen); background: var(--gruen-hell); }
.ablage input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ablage-symbol { width: 40px; height: 48px; border: 2px solid var(--grau); border-radius: 5px 14px 5px 5px; position: relative; }
.ablage-symbol::after { content: 'PDF'; position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%);
  font: 700 .65rem/1 system-ui, sans-serif; color: #fff; background: var(--rot); padding: .15rem .25rem; border-radius: 3px; }
.ablage.gewaehlt .ablage-symbol { border-color: var(--gruen); }
.ablage-text { font-size: .95rem; color: var(--text); }
.ablage-datei { font-weight: 600; }
.ablage.gewaehlt .ablage-datei { color: var(--gruen); }
.ablage.fehler-datei .ablage-datei { color: var(--rot); }
.ablage.fehler-datei { border-color: var(--rot); }
.ablage-klein { min-height: 96px; padding: .8rem 1rem; gap: .25rem; border-radius: 14px; width: 100%; }
.ablage-klein .ablage-text { font-size: .9rem; }
.ablage-foto { width: 30px; height: 24px; border: 2px solid var(--grau); border-radius: 5px; position: relative; }
.ablage-foto::before { content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border: 2px solid var(--grau); border-radius: 50%; }
.ablage-foto::after { content: ''; position: absolute; right: 3px; top: -5px; width: 8px; height: 4px; background: var(--grau); border-radius: 2px 2px 0 0; }
.ablage.gewaehlt .ablage-foto, .ablage.gewaehlt .ablage-foto::before { border-color: var(--gruen); }
.ablage.gewaehlt .ablage-foto::after { background: var(--gruen); }

/* ---------- Listen ---------- */
.zeilenliste { list-style: none; margin: .4rem 0 0; padding: 0; }
.zeilenliste li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 1rem;
  padding: .8rem .9rem; min-height: 68px; border-radius: 16px; background: #F7F8F9; margin-bottom: .45rem; }
.zeilenliste li:hover { background: #F0F2F4; }
.zeilen-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--anthrazit); color: #fff;
  font-weight: 700; font-size: .8rem; }
.zeilen-haupt { display: flex; flex-direction: column; min-width: 0; }
.zeilen-titel { color: var(--text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeilen-titel:hover { color: var(--rot); }
.zeilen-pdf { text-align: right; }
.aktionen { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; }
table.liste { width: 100%; border-collapse: separate; border-spacing: 0 .4rem; }
.liste th { text-align: left; font-size: .78rem; font-weight: 500; color: var(--grau); padding: .2rem .8rem; }
.liste td { padding: .7rem .8rem; background: #F7F8F9; vertical-align: middle; }
.liste td:first-child { border-radius: 14px 0 0 14px; font-weight: 600; }
.liste td:last-child { border-radius: 0 14px 14px 0; }
.liste td.aktionen { text-align: right; white-space: nowrap; display: table-cell; }
.liste td.aktionen > * { margin-left: .3rem; }
.aufklapp { display: inline-block; text-align: left; vertical-align: middle; }
.aufklapp summary { cursor: pointer; color: var(--blau); font-size: .88rem; }
.aufklapp .zeile { display: flex; gap: .3rem; margin-top: .4rem; }
.status { display: inline-block; padding: .25rem .75rem; border-radius: 99px; font-size: .78rem; font-weight: 500; background: var(--feld); white-space: nowrap; }
.s-bereit { background: var(--orange-hell); color: #c2410c; }
.s-fertig { background: var(--gruen-hell); color: var(--gruen); }
.s-fehler, .s-fehler_pdf { background: var(--rot-hell); color: var(--rot); }
.s-analyse, .s-erzeugen { background: #fff6d6; color: #8a6100; }

/* ---------- Projekt ---------- */
.tabs { display: inline-flex; gap: .2rem; padding: .3rem; margin-bottom: 1.2rem; border-radius: 99px; background: var(--flaeche);
  box-shadow: var(--schatten); max-width: 100%; overflow-x: auto; }
.tab { padding: .6rem 1.25rem; border-radius: 99px; background: none; color: var(--grau); font-weight: 500; }
.tab:hover { background: var(--feld); color: var(--text); }
.tab.an { background: var(--anthrazit); color: #fff; }
.tabinhalt { min-height: 300px; }
.einleitung { color: var(--grau); max-width: 900px; margin: 0 0 1rem; }
h2.abschnitt { margin: 1.8rem 0 .8rem; font-size: 1.2rem; }
.hinweisbox { max-width: 760px; }

.stellen { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 1rem; }
.stelle { --kat: #777; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); display: flex; flex-direction: column; min-width: 0; }
.stelle.aus { opacity: .6; }
.stelle.aus .stelle-rumpf { display: none; }
.stelle-kopf { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem .5rem 1.1rem; }
.stelle-kopf::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--kat); flex: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--kat) 18%, transparent); }
.stelle-kopf .haken { order: 3; font-size: .82rem; color: var(--grau); white-space: nowrap; }
.stelle-kopf .titel { font-weight: 600; font-size: 1rem; background: transparent; padding-left: .35rem; }
.stelle-kopf .titel:hover { background: var(--feld); }
.titel.fest { padding: .55rem .35rem; flex: 1; }
.stelle-rumpf { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; padding: .5rem 1.1rem 1.1rem; }
.stelle-bild img.ausschnitt { width: 130px; border-radius: 14px; display: block; background: #fff; box-shadow: 0 0 0 1px var(--linie); }
.stelle-felder { display: flex; flex-direction: column; gap: .6rem; min-width: 0; align-items: stretch; }
.stelle-felder > button { align-self: flex-start; }
.feldzeile { display: flex; align-items: center; gap: .6rem; }
.feldzeile > .klein { min-width: 5.5rem; }
.feldzeile select { flex: 1; }
.feld { display: block; font-size: .84rem; color: var(--grau); margin-bottom: .55rem; }
.feld input, .feld select { margin-top: .2rem; color: var(--text); }
.feldgruppe { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }

.zeilen { display: flex; flex-direction: column; gap: .35rem; }
.zeile-edit { display: grid; grid-template-columns: 11rem 1fr auto; gap: .35rem; align-items: start; }
.zeile-edit .z-k { font-weight: 600; font-size: .88rem; }
.zeile-edit .z-v { font-size: .9rem; min-height: 2.3rem; }
.zeilen-fuss { display: flex; gap: .6rem; align-items: center; }
.fundstellen, .orte { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; min-height: 36px; border-radius: 99px; background: var(--feld); font-size: .86rem; }
.chip input { width: 1.15rem; height: 1.15rem; accent-color: var(--rot); }
.chip button.x { width: 28px; min-height: 28px; }
.chip button.link { text-decoration: none; color: var(--text); }
.chip button.link:hover { color: var(--rot); }
.chip-aus { opacity: .45; text-decoration: line-through; }
.foto { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.foto img { max-width: 170px; max-height: 105px; border-radius: 12px; }
.foto-leer { display: inline-flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--grau); cursor: pointer; }
.foto-leer input { font-size: .8rem; }
ul.stoffe { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; }
ul.stoffe li { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.tafel { display: inline-block; background: #ee7322; border: 1px solid #000; font: 700 .6rem/1.05 system-ui, sans-serif;
  text-align: center; padding: 0 .25rem; min-width: 2.3rem; border-radius: 2px; }
details.vorgabe summary { cursor: pointer; font-size: .84rem; color: var(--blau); }
details.vorgabe dl { display: grid; grid-template-columns: 6rem 1fr; gap: .2rem .6rem; font-size: .82rem; margin: .45rem 0 0; }
details.vorgabe dt { font-weight: 600; }
details.vorgabe dd { margin: 0; color: var(--grau); }

.belegung { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .9rem; }
.belegung > button, .karte > button { align-self: flex-start; }
.bel-zeile { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; padding: .5rem; border-radius: 14px; background: #F7F8F9; }
.bel-zeile input[type=time] { width: 7.2rem; }
.bel-zeile .breit { flex: 1; min-width: 14rem; }
.tage { display: flex; gap: 2px; }
.tag { display: flex; flex-direction: column; align-items: center; font-size: .7rem; color: var(--grau); padding: 0 .12rem; }
.netz-zeile { display: grid; grid-template-columns: 1fr auto auto auto; gap: .5rem; align-items: center; margin-bottom: .45rem; max-width: 720px; }
.seitenwahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .35rem 1rem; font-size: .9rem; }

.pdfbox { max-width: 780px; }
.pdfstatus { margin-top: 1rem; }
.fehlerbox { background: var(--rot-hell); color: #7a0c1d; padding: .9rem; border-radius: 14px; white-space: pre-wrap; font-size: .84rem; }
.warnungen pre { white-space: pre-wrap; font-size: .8rem; color: var(--grau); }
.laeuft { display: flex; align-items: center; gap: .6rem; }
.laeuft-gross { display: flex; align-items: center; gap: 1rem; max-width: 620px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--rosa); border-top-color: var(--rot); border-radius: 50%;
  animation: drehen .9s linear infinite; flex: none; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* ---------- Planbetrachter ---------- */
.betrachter { position: fixed; inset: 0; z-index: 50; background: rgba(22, 25, 28, .94); padding-top: env(safe-area-inset-top); display: flex; flex-direction: column; }
.betrachter[hidden] { display: none; }
.betrachter-kopf { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; margin: .7rem .7rem 0; background: #fff;
  border-radius: 18px; flex-wrap: wrap; box-shadow: var(--schatten); }
.betrachter-kopf .spacer { flex: 1; }
.b-seite { display: flex; align-items: center; gap: .4rem; font-size: .9rem; }
.b-seite select { width: auto; max-width: 360px; }
.betrachter-flaeche { flex: 1; overflow: auto; padding: 1rem; }
.b-blatt { position: relative; background: #fff; margin: 0 auto; box-shadow: 0 6px 28px rgba(0, 0, 0, .5); border-radius: 4px; }
.b-blatt img, .b-blatt svg { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
#b-svg { touch-action: pan-x pan-y pinch-zoom; }
#b-svg.waehlen { touch-action: none; }
.betrachter-kopf button { min-width: var(--tipp); }
#b-svg.waehlen { cursor: crosshair; }
.b-ort { fill: none; stroke-width: 1.4; stroke-dasharray: 3 2; opacity: .8; }
.b-markiert { fill: rgba(255, 200, 0, .3); stroke: #e00; stroke-width: 2; }
.b-ring { fill: none; stroke: #e00; stroke-width: 3; animation: ring 1.4s ease-out 3; transform-box: fill-box; transform-origin: center; }
@keyframes ring { from { opacity: 1; transform: scale(.6); } to { opacity: .35; transform: scale(1); } }
.b-neu { fill: rgba(29, 95, 174, .2); stroke: var(--blau); stroke-width: 1.5; }
.b-linie { fill: none; stroke: #0b6cd9; stroke-width: 3; stroke-linejoin: round; }
.b-netz-alt { fill: none; stroke: #0b6cd9; stroke-width: 2; opacity: .45; }
.b-punkt { fill: #fff; stroke: #0b6cd9; stroke-width: 1.5; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 1100px) {
  .projekt-kacheln { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(138px, 1fr); overflow-x: auto;
    scroll-snap-type: x mandatory; padding-bottom: .4rem; margin-left: -.25rem; padding-left: .25rem; }
  .projekt-kacheln .kachel { scroll-snap-align: start; padding: 1rem; }
  .projekt-kacheln .zahl { font-size: 1.75rem; }
  .dashboard { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .kopf { grid-template-columns: 1fr auto; padding: 1rem; }
  .pillen { grid-column: 1 / -1; grid-row: 2; justify-self: start; overflow-x: auto; max-width: 100%; }
  .hero { padding: 1.2rem 1rem 0; }
  .hero-knoepfe .pille { flex: 1 1 auto; }
  .inhalt { padding: 0 1rem 2rem; }
  .kacheln { grid-template-columns: 1fr 1fr; }
  .stelle-rumpf { grid-template-columns: 1fr; }
  .zeile-edit { grid-template-columns: 1fr auto; }
  .feldgruppe { grid-template-columns: 1fr; }
  .zeilenliste li { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .zeilenliste .status { grid-column: 2; justify-self: start; }
}

body.schmal .formular button.primaer { width: 100%; margin-top: .3rem; }

/* ---------- Planprüfung ---------- */
:root { --gelb: #B7791F; --gelb-hell: #FDF4DD; --blau-hell: #E8F0FA; }
.schalter { display: inline-flex; align-items: center; gap: .5rem; min-height: var(--tipp); padding: 0 .9rem 0 .4rem; border-radius: 99px;
  background: var(--feld); color: var(--grau); font-size: .85rem; border: 0; cursor: pointer; }
.schalter-knopf { width: 34px; height: 20px; border-radius: 99px; background: #C9CDD2; position: relative; transition: background .15s; flex: none; }
.schalter-knopf::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s; }
.schalter.an { background: var(--gruen-hell); color: var(--gruen); }
.schalter.an .schalter-knopf { background: var(--gruen); }
.schalter.an .schalter-knopf::after { left: 16px; }

.zaehler { display: inline-flex; gap: .3rem; }
.zaehler span, .mini { min-width: 30px; height: 26px; padding: 0 .5rem; border-radius: 99px; display: inline-grid; place-items: center;
  font-size: .8rem; font-weight: 600; }
.z-fehler, .m-fehler { background: var(--rot-hell); color: var(--rot-dunkel); }
.z-warnung, .m-warnung { background: var(--gelb-hell); color: #8a5a00; }
.z-hinweis { background: var(--blau-hell); color: var(--blau); }
.mini { min-width: 22px; height: 20px; font-size: .72rem; margin-left: .35rem; }

.filter-kachel[aria-pressed="true"] { outline: 2px solid var(--anthrazit); outline-offset: -2px; }
.pr-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.pr-raster > .karte { margin-bottom: 0; }
.pr-ansicht { position: sticky; top: 1rem; }
.segment { display: inline-flex; gap: .2rem; padding: .2rem; border-radius: 99px; background: var(--feld); }
.segment button { min-height: 36px; padding: 0 .9rem; border-radius: 99px; background: none; color: var(--grau); font-size: .85rem; border: 0; }
.segment button.an { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(22, 25, 28, .12); }
.filterleiste { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .9rem; }
.chip-filter { min-height: 38px; padding: 0 .95rem; border-radius: 99px; background: var(--feld); color: var(--text); font-size: .86rem; border: 0;
  display: inline-flex; align-items: center; gap: .45rem; }
.chip-filter::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gedimmt); }
.chip-filter.f-fehler::before { background: var(--rot); }
.chip-filter.f-warnung::before { background: var(--gelb); }
.chip-filter.f-hinweis::before { background: var(--blau); }
.chip-filter.f-ok::before { background: var(--gruen); }
.chip-filter[data-filter="alle"]::before { display: none; }
.chip-filter.an { background: var(--anthrazit); color: #fff; }

.bf-gruppe { margin-bottom: 1rem; }
.bf-gruppe-kopf { display: flex; align-items: center; font-size: .82rem; font-weight: 600; color: var(--grau); text-transform: uppercase;
  letter-spacing: .04em; margin: 0 0 .45rem; }
.befund { display: flex; flex-direction: column; align-items: stretch; gap: .25rem; width: 100%; text-align: left; white-space: normal;
  padding: .75rem .9rem .75rem 1rem; margin-bottom: .45rem; border-radius: var(--radius-klein); background: #F7F8F9; border: 1px solid transparent;
  border-left: 4px solid var(--gedimmt); font: inherit; color: inherit; cursor: pointer; min-height: var(--tipp); }
.befund:hover { background: #F0F2F4; }
.befund.an { background: #fff; border-color: var(--linie); border-left-color: inherit; box-shadow: var(--schatten); }
.b-fehler { border-left-color: var(--rot); }
.b-warnung { border-left-color: var(--gelb); }
.b-hinweis { border-left-color: var(--blau); }
.b-ok { border-left-color: var(--gruen); }
.befund.an.b-fehler { border-left-color: var(--rot); }
.befund.an.b-warnung { border-left-color: var(--gelb); }
.befund.an.b-hinweis { border-left-color: var(--blau); }
.befund.an.b-ok { border-left-color: var(--gruen); }
.bf-oben { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; }
.bf-stufe { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.b-fehler .bf-stufe { color: var(--rot); }
.b-warnung .bf-stufe { color: #8a5a00; }
.b-hinweis .bf-stufe { color: var(--blau); }
.b-ok .bf-stufe { color: var(--gruen); }
.bf-regel { font-weight: 600; }
.bf-text { font-size: .9rem; color: #3A3F45; }
.bf-unten { display: flex; flex-wrap: wrap; gap: .35rem .8rem; font-size: .76rem; color: var(--grau); }
.bf-ort::before { content: "◎ "; }

.pr-blaettern { display: flex; align-items: center; gap: .35rem; }
.pr-blaettern select { max-width: 260px; min-height: var(--tipp); }
.pr-blatt { position: relative; overflow: auto; max-height: 72vh; width: 100%; border-radius: var(--radius-klein); background: #fff;
  border: 1px solid var(--linie); -webkit-overflow-scrolling: touch; }
.pr-innen { position: relative; width: 100%; }
.pr-innen img { display: block; width: 100%; height: auto; }
.pr-innen svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mk { fill: none; stroke-width: 1.2; opacity: .55; vector-effect: non-scaling-stroke; }
.mk-fehler { stroke: var(--rot); }
.mk-warnung { stroke: var(--gelb); }
.mk-hinweis { stroke: var(--blau); }
.mk-ok { stroke: var(--gruen); }
.mk-an { stroke-width: 3; opacity: 1; fill: rgba(215, 38, 30, .12); animation: mk-puls 1.4s ease-in-out 2; }
.mk-an.mk-warnung { fill: rgba(183, 121, 31, .14); }
.mk-an.mk-ok { fill: rgba(22, 128, 61, .12); }
.mk-an.mk-hinweis { fill: rgba(29, 95, 174, .1); }
@keyframes mk-puls { 50% { stroke-width: 6; } }
#ansicht-text { margin: .7rem 0 0; min-height: 2.6em; }

.checkliste { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1.2rem; }
.checkliste .haken { display: flex; gap: .6rem; align-items: flex-start; min-height: var(--tipp); padding: .45rem 0; font-size: .9rem; }
.checkliste .haken input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--gruen); }
.checkliste b { font-weight: 600; color: var(--grau); margin-right: .25rem; }

@media (max-width: 1100px) {
  .pr-raster { grid-template-columns: 1fr; }
  .pr-ansicht { position: static; order: -1; }
  .pr-kacheln { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .pr-kacheln { grid-template-columns: 1fr 1fr; }
  .checkliste { grid-template-columns: 1fr; }
  .pr-ansicht .karte-kopf { flex-wrap: wrap; }
  .pr-blaettern select { max-width: 180px; }
}

/* Prüfbericht drucken */
@media print {
  .kopfbereich { background: none; color: var(--text); border: 0; padding: 0; }
  .kopf, .hero-knoepfe, .pr-ansicht, .filterleiste, .segment, .meldung { display: none !important; }
  .hero { padding: 0; } .hero h1 { color: var(--text); } .eyebrow, .eyebrow a { color: var(--grau); }
  body { background: #fff; } .inhalt { margin-top: 0; padding: 0; }
  .pr-raster { display: block; } .karte, .kachel { box-shadow: none; border: 1px solid var(--linie); }
  .befund { break-inside: avoid; background: #fff; border: 1px solid var(--linie); border-left-width: 4px; }
  .checkliste { grid-template-columns: 1fr; }
}

.p-warnung { background: var(--gelb); }
.t-warnung { color: #8a5a00; }
.mk-fokus { stroke-width: 4; fill: rgba(215, 38, 30, .22); }
.stellen-nav { display: flex; align-items: center; gap: .6rem; margin-top: .6rem; font-size: .85rem; color: var(--grau); }
.mk-hof { fill: none; stroke: #16191C; stroke-width: 7; opacity: .75; vector-effect: non-scaling-stroke; }
.mk-an { fill: rgba(255, 255, 255, .25) !important; }
.pr-blatt { position: relative; }
.blatt-fehler { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; padding: 1rem; text-align: center; background: var(--hinter); color: var(--text); font-size: .92rem; }
.blatt-fehler[hidden] { display: none !important; }
.blatt-fehler span { color: var(--grau); }

/* ---------- Befunde entscheiden ---------- */
.befund { cursor: default; padding: 0; }
.bf-wahl { display: flex; flex-direction: column; align-items: stretch; gap: .25rem; width: 100%; text-align: left; white-space: normal;
  padding: .75rem .9rem .6rem 1rem; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; border-radius: inherit; min-height: var(--tipp); }
.bf-wahl:hover { background: rgba(22, 25, 28, .03); }
.befund.st-abgelehnt .bf-wahl { opacity: .55; }
.befund.st-abgelehnt .bf-regel { text-decoration: line-through; }
.bf-marke { font-size: .7rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; }
.m-zu { background: var(--gruen-hell); color: var(--gruen); }
.m-ab { background: var(--feld); color: var(--grau); }
.entscheid { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: 0 .9rem .75rem 1rem; }
.entscheid button { min-height: 40px; padding: 0 .95rem; border-radius: 99px; border: 1px solid var(--linie); background: #fff;
  font-size: .86rem; font-weight: 500; color: var(--text); }
.entscheid .ent-zu.an { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.entscheid .ent-ab.an { background: var(--anthrazit); border-color: var(--anthrazit); color: #fff; }
.entscheid .ent-zu:not(.an):hover { border-color: var(--gruen); color: var(--gruen); }
.entscheid .ent-ab:not(.an):hover { border-color: var(--anthrazit); }
.ent-kommentar { flex: 1 1 220px; min-height: 40px !important; font-size: .86rem; }
.ent-von { flex-basis: 100%; font-size: .74rem; color: var(--grau); }
.entscheid-gross { padding: .6rem 0 0; }
#ansicht-text p { margin: 0; }
.entscheid-stand { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin: 0 0 .7rem; }
.balken { flex: 1 1 100%; height: 8px; border-radius: 99px; background: var(--feld); overflow: hidden; display: flex; }
.balken span { display: block; height: 100%; transition: width .25s; }
.b-zu { background: var(--gruen); }
.b-ab { background: #9AA0A6; }
.entscheid-stand .klein-knopf { margin-left: auto; }
.chip-filter.e-offen::before { background: var(--gelb); }
.chip-filter.e-zu::before { background: var(--gruen); }
.chip-filter.e-ab::before { background: #9AA0A6; }
.chip-filter[data-entscheid="alle"]::before { display: none; }

.fuss-zeile { max-width: 1320px; margin: 0 auto; padding: 0 2rem 2rem; font-size: .8rem; color: var(--grau); }
.fuss-zeile a { color: var(--grau); }
.text-karte { max-width: 860px; }
.text-karte h2 { margin-top: 1.4rem; }
.text-karte h2:first-child { margin-top: 0; }
.text-karte li { margin-bottom: .35rem; }
code { background: var(--feld); padding: .05rem .35rem; border-radius: 4px; font-size: .9em; }
@media (max-width: 700px) { .fuss-zeile { padding: 0 1rem 1.5rem; } }

.hinweis-veraltet { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem;
  background: var(--gelb-hell); color: #5c3d00; border: 1px solid #F0D9A0; }
.liste td.klein { white-space: nowrap; }
/* Prüfprotokoll im Browser */
.protokoll-seiten { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
.protokoll-blatt { margin: 0; width: 100%; max-width: 780px; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.protokoll-blatt img { display: block; width: 100%; height: auto; background: #fff; border-radius: 6px; border: 1px solid var(--linie);
  box-shadow: var(--schatten); }
.protokoll-blatt.quer { max-width: 1240px; }

/* Lösungsvorschlag */
.loesung-box { margin-top: .7rem; padding: .75rem .9rem; border-radius: var(--radius-klein); background: var(--gruen-hell); color: #11592C; }
.loesung-box p { margin: .25rem 0 .4rem; color: #0f3f22; }
.loesung-titel { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.loesung-bilder { display: flex; flex-wrap: wrap; gap: .5rem; margin: .3rem 0 .35rem; }
.loesung-bild { display: flex; flex-direction: column; gap: .25rem; width: 150px; padding: .35rem; background: #fff; border: 1px solid #CDE8D6;
  border-radius: 10px; font-size: .72rem; color: var(--grau); text-align: left; white-space: normal; cursor: zoom-in; min-height: 0; }
.loesung-bild img { width: 100%; height: 90px; object-fit: contain; background: #fff; }
.bildlupe { position: fixed; inset: 0; z-index: 50; background: rgba(22, 25, 28, .82); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.bildlupe[hidden] { display: none !important; }
.bildlupe figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.bildlupe img { max-width: 92vw; max-height: 82vh; background: #fff; border-radius: 8px; }
.bildlupe figcaption { color: #fff; font-size: .9rem; }
.bildlupe .rund { position: absolute; top: 1rem; right: 1rem; background: #fff; }
/* Eingänge je Geschoss */
.eingang-frage { margin: 0 0 .9rem; padding: .7rem .9rem; border-radius: var(--radius-klein); background: var(--gelb-hell); border: 1px solid #F0D9A0; }
.eingang-frage summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.eingang-frage p { margin: .3rem 0 .5rem; }
.eingang-liste { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .5rem; }
.eingang-zeile { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.eingang-name { min-width: 110px; font-weight: 600; font-size: .88rem; }
.eingang-zeile button { min-height: 36px; padding: 0 .8rem; border-radius: 99px; border: 1px solid var(--linie); background: #fff; font-size: .82rem; }
.eingang-zeile button.an { background: var(--anthrazit); border-color: var(--anthrazit); color: #fff; }
.eingang-status { margin-left: .2rem; }

/* ---------- Prüfung: Stapel links, Vorschau rechts, Entscheidung darunter ---------- */
.pr-raster { align-items: stretch; }
.pr-ansicht { position: static; display: flex; flex-direction: column; }
.pr-ansicht .pr-blatt { flex: 1; max-height: 64vh; }
.stapel { display: flex; flex-direction: column; }
.stapel-karte { display: flex; flex-direction: column; align-items: stretch; gap: .3rem; width: 100%; text-align: left; white-space: normal;
  padding: .9rem 1rem; border-radius: 14px; background: #fff; border: 1px solid var(--linie); border-left: 5px solid var(--gedimmt);
  font: inherit; color: inherit; cursor: pointer; min-height: var(--tipp); position: relative; }
.stapel-karte.b-fehler { border-left-color: var(--rot); }
.stapel-karte.b-warnung { border-left-color: var(--gelb); }
.stapel-karte.b-hinweis { border-left-color: var(--blau); }
.stapel-karte.b-ok { border-left-color: var(--gruen); }
.stapel-karte.oben { cursor: default; z-index: 4; padding: 1.1rem 1.15rem 1rem; box-shadow: 0 2px 4px rgba(22, 25, 28, .06), 0 14px 30px rgba(22, 25, 28, .12); }
.stapel-karte.oben .bf-regel { font-size: 1.08rem; }
.stapel-karte.oben .bf-text { font-size: .95rem; color: #2B3035; }
.bf-seite-zeile { font-size: .8rem; color: var(--grau); }
.stapel-hinweis { margin-top: .3rem; font-size: .75rem; color: var(--gedimmt); }
/* dahinterliegende Karten schauen unten heraus */
.stapel-hinten { display: flex; flex-direction: column; }
.stapel-hinten .stapel-karte { margin-top: -10px; padding: 1rem 1rem .55rem; z-index: calc(4 - var(--tiefe));
  transform: scale(calc(1 - var(--tiefe) * .025)); transform-origin: top center; background: #FAFBFC;
  box-shadow: 0 6px 14px rgba(22, 25, 28, .06); }
.stapel-hinten .stapel-karte:hover { background: #fff; transform: scale(calc(1 - var(--tiefe) * .025)) translateY(2px); }
.stapel-hinten .stapel-karte .bf-oben { font-size: .9rem; }
.stapel-karte.st-abgelehnt .bf-regel { text-decoration: line-through; opacity: .7; }
.stapel-weitere { margin-top: .9rem; }
.stapel-weitere summary { cursor: pointer; color: var(--blau); font-size: .88rem; min-height: 36px; display: flex; align-items: center; }
.stapel-liste { display: flex; flex-direction: column; gap: .35rem; margin-top: .3rem; }
.stapel-karte.kompakt { padding: .55rem .8rem; gap: .1rem; background: #F7F8F9; border-left-width: 4px; }
.stapel-karte.kompakt .bf-oben { font-size: .86rem; }

/* Entscheidung zum aktiven Befund */
.pr-aktion { border-top: 4px solid var(--anthrazit); }
.pr-aktion.leer-aktiv { opacity: .6; }
.aktion-kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem 1.5rem; margin-bottom: 1rem; }
.aktion-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--grau); }
.aktion-kopf h2 { margin: .15rem 0 0; font-size: 1.15rem; }
.aktion-knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; }
.ent-gross { min-height: 50px; padding: 0 1.4rem; border-radius: 99px; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
  border: 2px solid var(--linie); background: #fff; color: var(--text); }
.ent-gross.ent-zu { border-color: var(--rot); color: var(--rot-dunkel); }
.ent-gross.ent-zu:hover, .ent-gross.ent-zu.an { background: var(--rot); color: #fff; }
.ent-gross.ent-ab { border-color: #9AA0A6; color: #3A3F45; }
.ent-gross.ent-ab:hover, .ent-gross.ent-ab.an { background: var(--anthrazit); border-color: var(--anthrazit); color: #fff; }
.ent-gross:disabled, .aktion-knoepfe .knopf:disabled { opacity: .4; cursor: not-allowed; background: #fff; }
.aktion-knoepfe .knopf { min-height: 50px; }
.aktion-felder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1rem; }
.aktion-feld { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; font-weight: 600; color: var(--grau); }
.aktion-feld label { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.aktion-feld textarea { font-weight: 400; color: var(--text); font-size: .95rem; min-height: 110px; resize: vertical; }
#feld-vorschlag { background: #F4FAF6; }
#aktion-status { margin: .8rem 0 0; min-height: 1.2em; }
@media (max-width: 1100px) {
  .pr-ansicht { order: 0; }
  .aktion-felder { grid-template-columns: 1fr; }
}

/* ---------- Prüfung als Blätterstapel ---------- */
.stapel-leiste { margin-bottom: .6rem; }
.stapel-leiste-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .6rem; }
.stapel-leiste-kopf h2 { margin: 0; }
.stapel-leiste-kopf .filterleiste { margin: 0; }
.stapel-leiste .entscheid-stand { margin-bottom: .4rem; }
.stapel-leiste #eingaenge .eingang-frage { margin: .5rem 0 0; }
.stapel-buehne { position: relative; margin: 1.4rem 0 2.4rem; padding: 0 22px 22px 0; overflow-x: clip; }
.unterblaetter { position: absolute; inset: 0 22px 22px 0; z-index: 0; }
.unterblatt { position: absolute; inset: 0; background: #fff; border: 1px solid #DDE0E4; border-radius: var(--radius);
  transform: translate(calc(var(--n) * 7px), calc(var(--n) * 7px)) rotate(calc(var(--n) * .45deg));
  box-shadow: 0 2px 6px rgba(22, 25, 28, .06); }
.pruefblatt { position: relative; z-index: 1; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius);
  border-top: 7px solid var(--gedimmt); padding: 1.3rem 1.5rem 1.4rem;
  box-shadow: 0 2px 4px rgba(22, 25, 28, .05), 0 18px 40px rgba(22, 25, 28, .13); }
.pruefblatt[hidden] { display: none !important; }
.pruefblatt.b-fehler { border-top-color: var(--rot); }
.pruefblatt.b-warnung { border-top-color: var(--gelb); }
.pruefblatt.b-hinweis { border-top-color: var(--blau); }
.pruefblatt.b-ok { border-top-color: var(--gruen); }
.pb-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.pb-titel { min-width: 0; }
.pb-zeile { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pb-stufe { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .2rem .6rem; border-radius: 99px;
  background: var(--feld); color: var(--grau); }
.pb-stufe.s-fehler { background: var(--rot-hell); color: var(--rot-dunkel); }
.pb-stufe.s-warnung { background: var(--gelb-hell); color: #8a5a00; }
.pb-stufe.s-hinweis { background: var(--blau-hell); color: var(--blau); }
.pb-stufe.s-ok { background: var(--gruen-hell); color: var(--gruen); }
.pb-titel h2 { margin: .4rem 0 .3rem; font-size: 1.45rem; letter-spacing: -.02em; }
.pb-text { margin: 0 0 .3rem; font-size: 1rem; color: #2B3035; max-width: 75ch; }
.pb-nav { display: flex; align-items: center; gap: .4rem; flex: none; }
.pb-zaehler { font-size: .85rem; color: var(--grau); min-width: 92px; text-align: center; font-variant-numeric: tabular-nums; }
.pb-nav .rund:disabled { opacity: .35; }
.pb-plan { border: 1px solid var(--linie); border-radius: var(--radius-klein); padding: .7rem; background: #FAFBFC; }
.pb-plan-kopf { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.pb-plan-titel { font-weight: 600; font-size: .92rem; }
.pb-plan .pr-blatt { max-height: 44vh; }
.pb-plan #ansicht-text { margin: .5rem 0 0; min-height: 0; }
.pb-aktion { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px dashed #D5D8DC; }
.pb-aktion.leer-aktiv { opacity: .5; }
.pb-aktion .aktion-knoepfe { align-items: center; margin-bottom: 1rem; }
.pb-aktion #aktion-status { margin-left: .4rem; }
.pb-aktion .aktion-feld textarea { min-height: 84px; }
.stapel-leer { padding: 3rem 1.5rem; text-align: center; background: #fff; border: 1px dashed #C9CDD2; border-radius: var(--radius);
  color: var(--grau); position: relative; z-index: 1; }
.stapel-leer[hidden] { display: none !important; }
.stapel-uebersicht summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; gap: .4rem; }
.stapel-uebersicht .stapel-liste { margin-top: .7rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .45rem; }
.stapel-karte.kompakt.an { outline: 2px solid var(--anthrazit); background: #fff; }
.bf-nr { min-width: 22px; height: 22px; border-radius: 99px; background: var(--feld); font-size: .72rem; font-weight: 700;
  display: inline-grid; place-items: center; color: var(--grau); }

/* Stempel und Bewegung */
.pb-stempel { position: absolute; top: 34%; left: 50%; z-index: 5; pointer-events: none; opacity: 0;
  transform: translate(-50%, -50%) rotate(-12deg) scale(1.6); padding: .35rem 1.1rem; border: 5px solid currentColor;
  border-radius: 10px; font-size: 2.4rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: rgba(255, 255, 255, .85); }
.pb-stempel.st-fehler { color: var(--rot); }
.pb-stempel.st-falsch { color: #5F656B; }
.pb-stempel.st-spaeter { color: var(--blau); }
.pb-stempel.st-fehler, .pb-stempel.st-falsch, .pb-stempel.st-spaeter { animation: stempeln .18s ease-out forwards; }
@keyframes stempeln { to { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); } }
.pruefblatt.weg-fehler { animation: weg-rechts .5s ease-in .16s forwards; }
.pruefblatt.weg-falsch { animation: weg-links .5s ease-in .16s forwards; }
.pruefblatt.weg-spaeter { animation: weg-unten .5s ease-in .16s forwards; }
@keyframes weg-rechts { to { transform: translate(110%, 40px) rotate(9deg); opacity: 0; } }
@keyframes weg-links { to { transform: translate(-110%, 40px) rotate(-9deg); opacity: 0; } }
@keyframes weg-unten { to { transform: translate(14px, 26px) scale(.96); opacity: 0; } }
.pruefblatt.ankunft-auf { animation: ankunft-auf .38s ease-out; }
.pruefblatt.ankunft-vor { animation: ankunft-vor .3s ease-out; }
.pruefblatt.ankunft-zurueck { animation: ankunft-zurueck .3s ease-out; }
@keyframes ankunft-auf { from { transform: translate(7px, 7px) rotate(.45deg) scale(.985); box-shadow: 0 2px 6px rgba(22, 25, 28, .06); } }
@keyframes ankunft-vor { from { transform: translateX(40px); opacity: .2; } }
@keyframes ankunft-zurueck { from { transform: translateX(-40px); opacity: .2; } }

@media (max-width: 760px) {
  .pruefblatt { padding: 1rem 1rem 1.1rem; }
  .pb-kopf { flex-direction: column-reverse; }
  .pb-nav { align-self: flex-end; }
  .pb-titel h2 { font-size: 1.2rem; }
  .stapel-buehne { padding: 0 14px 14px 0; }
  .unterblaetter { inset: 0 14px 14px 0; }
  .unterblatt { transform: translate(calc(var(--n) * 4px), calc(var(--n) * 4px)) rotate(calc(var(--n) * .3deg)); }
}

/* ---------- Prüfvorgang: Feuerwehrmann prüft den Plan ---------- */
.pruefanimation { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.5rem; padding: 2rem 2.2rem; }
.pa-bild { width: min(460px, 100%); height: auto; flex: none; }
.pa-text { flex: 1 1 260px; }
.pa-text h2 { font-size: 1.4rem; margin-bottom: .3rem; }
.pa-schritte { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--grau); font-size: .9rem; line-height: 1.8; }
.pa-tisch { fill: #E6E8EB; }
.pa-jacke { fill: #22303C; }
.pa-mann { animation: pa-atmen 2.6s ease-in-out infinite; transform-box: view-box; }
@keyframes pa-atmen { 50% { transform: translateY(1.5px); } }
.pa-lupe { transform-box: view-box; transform-origin: 100px 146px; animation: pa-lupe 5.2s ease-in-out infinite; }
@keyframes pa-lupe {
  0%, 100% { transform: rotate(-6deg); }
  22% { transform: translate(18px, 6px) rotate(14deg); }
  45% { transform: translate(52px, 12px) rotate(34deg); }
  68% { transform: translate(84px, -4px) rotate(18deg); }
  84% { transform: translate(40px, 30px) rotate(40deg); }
}
.pa-scan { transform-box: view-box; animation: pa-scan 2.6s linear infinite; opacity: .55; }
@keyframes pa-scan { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .55; } 90% { opacity: .55; } 100% { transform: translateY(156px); opacity: 0; } }
.pa-fund { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: pa-fund 5.2s ease-out infinite; }
.pa-fund circle { fill: var(--gruen); }
.pa-fund.pa-rot circle { fill: var(--rot); }
.pa-fund path { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pa-f1 { animation-delay: .9s; }
.pa-f2 { animation-delay: 2.1s; }
.pa-f3 { animation-delay: 3.3s; }
@keyframes pa-fund { 0% { transform: scale(0); } 8% { transform: scale(1.25); } 12%, 70% { transform: scale(1); } 80%, 100% { transform: scale(0); } }

@media (prefers-reduced-motion: reduce) {
  .pa-mann, .pa-lupe, .pa-scan, .pa-fund, .pruefblatt, .pb-stempel { animation: none !important; }
  .pa-fund { transform: scale(1); }
}
.pa-schritte li { transition: color .3s; }
.pa-schritte li.an { color: var(--text); font-weight: 600; }
.pa-schritte li.an::marker { color: var(--rot); }
.pa-schritte li.fertig { color: var(--gruen); }
/* Kopfzeile auf Tablets im Hochformat: Menü darf schmaler werden und notfalls seitlich scrollen */
@media (max-width: 1100px) {
  .kopf { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pillen { min-width: 0; max-width: 100%; overflow-x: auto; justify-self: center; scrollbar-width: none; }
  .pillen::-webkit-scrollbar { display: none; }
  .pillen a { padding: .6rem .9rem; white-space: nowrap; }
}

/* Prüfanimation ohne Figur: Lupe gleitet über den Plan */
.pa-lupe { transform-origin: 180px 74px; animation: pa-lupe-frei 5.2s ease-in-out infinite; }
@keyframes pa-lupe-frei {
  0%, 100% { transform: translate(-10px, -6px); }
  22% { transform: translate(28px, 48px); }
  45% { transform: translate(64px, 2px); }
  68% { transform: translate(78px, 88px); }
  84% { transform: translate(16px, 70px); }
}
.pa-bild { width: min(380px, 100%); }

/* Blatt: links oben Befund, links unten Entscheidung, rechts feste Planvorschau */
.pruefblatt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  grid-template-areas: "kopf plan" "aktion plan"; grid-template-rows: auto 1fr; column-gap: 1.6rem; align-items: start; }
.pruefblatt .pb-kopf { grid-area: kopf; margin-bottom: .2rem; }
.pruefblatt .pb-plan { grid-area: plan; align-self: start; }
.pruefblatt .pb-aktion { grid-area: aktion; margin-top: .9rem; }
.pruefblatt .pb-aktion .aktion-felder { grid-template-columns: 1fr; gap: .8rem; }
.pruefblatt .pb-aktion .aktion-knoepfe { flex-wrap: wrap; }
.pruefblatt .ent-gross { flex: 1 1 auto; }
.pb-plan .pr-blatt { max-height: none; overflow: hidden; margin: 0 auto; touch-action: auto; }
.pb-plan .pr-innen img { pointer-events: none; }
@media (max-width: 1000px) {
  .pruefblatt { grid-template-columns: 1fr; grid-template-areas: "kopf" "plan" "aktion"; }
}
.mk-ring { fill: none; stroke-width: 2; opacity: .45; vector-effect: non-scaling-stroke; }
.mk-ring.mk-fehler { stroke: var(--rot); } .mk-ring.mk-warnung { stroke: var(--gelb); }
.mk-ring.mk-hinweis { stroke: var(--blau); } .mk-ring.mk-ok { stroke: var(--gruen); }
.mk-ring-an { stroke-width: 3; opacity: .95; transform-box: fill-box; transform-origin: center; animation: mk-ring 1.6s ease-in-out infinite; }
@keyframes mk-ring { 50% { transform: scale(1.18); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .mk-ring-an { animation: none; } }
.pruefblatt { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.pruefblatt .pb-kopf { flex-direction: column-reverse; align-items: stretch; gap: .5rem; }
.pruefblatt .pb-nav { justify-content: flex-end; }
@media (max-width: 1000px) { .pruefblatt { grid-template-columns: 1fr; } }

/* Rechte Seite: oben ganze Planseite, unten Detail der Fundstelle */
.pb-plan .pr-blatt { max-height: 36vh; }
.pb-detail { margin-top: .7rem; }
.pb-detail-titel { display: block; font-size: .78rem; font-weight: 600; color: var(--grau); margin-bottom: .3rem; }
.pb-detail-fenster { position: relative; height: 30vh; min-height: 180px; border: 1px solid var(--linie); border-radius: 10px;
  background: #fff; overflow: hidden; }
.pb-detail-fenster img { display: block; width: 100%; height: 100%; object-fit: fill; }
.pb-detail-fenster img[hidden] { display: none; }
.pb-detail-fenster svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pb-detail-leer { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; text-align: center;
  font-size: .85rem; color: var(--grau); background: #FAFBFC; }
.pb-detail-leer[hidden] { display: none; }

/* Umblättern wie eine Buchseite (ersetzt Wegfliegen und Nachrücken) */
.stapel-buehne { perspective: 2400px; }
.pruefblatt.ankunft-auf, .pruefblatt.ankunft-vor, .pruefblatt.ankunft-zurueck { animation: none; }
.pruefblatt.umblatt { position: absolute; z-index: 6; margin: 0; pointer-events: none; transform-style: preserve-3d;
  backface-visibility: hidden; will-change: transform; animation: blatt-links .72s cubic-bezier(.45, .05, .35, 1) forwards; }
.pruefblatt.umblatt.nach-links { transform-origin: left center; }
.pruefblatt.umblatt.nach-rechts { transform-origin: right center; animation-name: blatt-rechts; }
.pruefblatt.umblatt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(to left, rgba(22, 25, 28, .28), rgba(22, 25, 28, 0) 60%); opacity: 0;
  animation: blatt-schatten .72s ease-in forwards; }
.pruefblatt.umblatt.nach-rechts::after { background: linear-gradient(to right, rgba(22, 25, 28, .28), rgba(22, 25, 28, 0) 60%); }
@keyframes blatt-links {
  0% { transform: rotateY(0); box-shadow: 0 18px 40px rgba(22, 25, 28, .13); }
  100% { transform: rotateY(-108deg); box-shadow: -30px 30px 60px rgba(22, 25, 28, .25); opacity: .15; }
}
@keyframes blatt-rechts {
  0% { transform: rotateY(0); box-shadow: 0 18px 40px rgba(22, 25, 28, .13); }
  100% { transform: rotateY(108deg); box-shadow: 30px 30px 60px rgba(22, 25, 28, .25); opacity: .15; }
}
@keyframes blatt-schatten { 70% { opacity: 1; } 100% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .pruefblatt.umblatt { animation: none; display: none; } }
/* Seite bleibt beim Umblättern deckend; jenseits von 90° verschwindet die Rückseite */
.pruefblatt.umblatt { transform-style: flat; background: #fff; }
@keyframes blatt-links {
  0% { transform: rotateY(0); box-shadow: 0 18px 40px rgba(22, 25, 28, .13); }
  100% { transform: rotateY(-100deg); box-shadow: -30px 30px 60px rgba(22, 25, 28, .25); }
}
@keyframes blatt-rechts {
  0% { transform: rotateY(0); box-shadow: 0 18px 40px rgba(22, 25, 28, .13); }
  100% { transform: rotateY(100deg); box-shadow: 30px 30px 60px rgba(22, 25, 28, .25); }
}

.pb-art, .m-plaus { font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 99px; background: #EDE7F6; color: #4B2C8A; }
.pb-art[hidden] { display: none; }

/* Eigener Bestätigungsdialog */
.dialog-hinter { position: fixed; inset: 0; z-index: 100; background: rgba(22, 25, 28, .55); display: grid; place-items: center; padding: 1rem; }
.dialog { background: #fff; border-radius: var(--radius); padding: 1.4rem 1.5rem 1.2rem; width: min(440px, 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dialog p { margin: 0 0 1.2rem; font-size: 1rem; line-height: 1.5; }
.dialog-knoepfe { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.dialog-knoepfe button { min-height: var(--tipp); padding: 0 1.2rem; }
.gefahr-voll { background: var(--rot) !important; border-color: var(--rot) !important; color: #fff !important; }

/* ---------- Geführter Ablauf der Prüfung: Eingänge → Maschinelle Befunde → Händische Prüfung → Protokoll ---------- */
.schritte { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 0 0 1rem; }
.schritt { justify-content: flex-start; gap: .6rem; border-radius: var(--radius-klein); background: var(--flaeche);
  border: 1px solid var(--linie); box-shadow: var(--schatten); padding: .55rem .9rem; min-height: 54px; white-space: normal; text-align: left; }
.schritt-nr { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  font-size: .88rem; background: var(--feld); color: var(--grau); }
.schritt-name { font-weight: 600; font-size: .92rem; line-height: 1.2; }
.schritt.fertig .schritt-nr { background: var(--gruen-hell); color: var(--gruen); }
.schritt.fertig .schritt-nr::before { content: '✓'; }
.schritt.fertig .schritt-nr { font-size: 0; }
.schritt.fertig .schritt-nr::before { font-size: .9rem; }
.schritt.an { border-color: var(--rot); box-shadow: 0 0 0 2px var(--rot-hell), var(--schatten); }
.schritt.an .schritt-nr { background: var(--rot); color: #fff; }
.weiter-leiste { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.weiter-leiste.karte { margin-top: 0; padding: .8rem 1rem; }
.weiter-leiste > .klein { margin-right: auto; }
.eingang-karte .eingang-liste { margin: .8rem 0; gap: .5rem; }
.knopf-link { display: inline-flex; align-items: center; justify-content: center; padding: .6rem 1.15rem; min-height: var(--tipp);
  border-radius: 99px; text-decoration: none; font-size: .92rem; }
.kacheln-drei { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: .4rem 0 1rem; }

/* Händische Prüfung: links der Plan (klicken/ziehen), rechts Formular und Liste */
.hand-raster { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; margin-bottom: 1rem; }
.hand-raster > .karte { margin-bottom: 0; }
.hand-kopf { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.hand-zoom { display: flex; align-items: center; gap: .4rem; }
.hand-zoom .klein { min-width: 3.2rem; text-align: center; }
.hand-anleitung { margin: .5rem 0; }
.hand-blatt { overflow: auto; max-height: 76vh; border: 1px solid var(--linie); border-radius: var(--radius-klein); background: #fff; }
.hand-innen { position: relative; width: 100%; margin: 0 auto; }
.hand-innen img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.hand-innen svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.hm { fill: rgba(215, 38, 30, .10); stroke: var(--rot); stroke-width: 2.5; vector-effect: non-scaling-stroke; cursor: pointer; }
.hm-hof { fill: none; stroke: #fff; stroke-width: 6; vector-effect: non-scaling-stroke; pointer-events: none; }
.hm.an { fill: rgba(215, 38, 30, .22); stroke-width: 3.5; }
.hm-neu { fill: rgba(29, 95, 174, .15); stroke: var(--blau); stroke-width: 2.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.hm-masch { fill: rgba(163, 168, 174, .22); stroke: #A3A8AE; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; }
.hm-masch.an { fill: rgba(107, 112, 118, .28); stroke: #6B7076; stroke-width: 3; }
.hand-seite { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.hand-form { display: flex; flex-direction: column; gap: .7rem; }
.hand-form h2 { margin: 0; }
.hand-form textarea, .hand-form select { width: 100%; }
.hand-form input[type=file] { font-size: .85rem; max-width: 100%; }
.hand-form-knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; }
.hand-form-knoepfe .gefahr { margin-left: auto; }
.hand-bild { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; margin: .3rem 0; }
.hand-bild img, .hand-muster { max-width: 100%; max-height: 180px; border-radius: 8px; border: 1px solid var(--linie); }
.hand-leer p { margin: .3rem 0 .8rem; }
.hand-liste-titel { margin: 1.2rem 0 .4rem; font-size: .98rem; border-top: 1px solid var(--linie); padding-top: .9rem; }
.hand-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.hand-liste button { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; border-radius: var(--radius-klein);
  background: var(--feld); padding: .5rem .7rem; min-height: 0; flex-direction: column; align-items: flex-start; gap: .1rem; }
.hand-liste button.an { background: var(--rot-hell); box-shadow: inset 3px 0 0 var(--rot); }
.hand-liste .hl-seite { font-size: .76rem; color: var(--grau); font-weight: 600; }
.hand-liste .hl-text { font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1100px) {
  .hand-raster { grid-template-columns: 1fr; }
  .hand-seite { position: static; max-height: none; }
  .schritte { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) { .kacheln-drei { grid-template-columns: 1fr; } }
/* Seitenleiste der händischen Prüfung */
.hand-leiste { display: flex; gap: .45rem; overflow-x: auto; padding: .6rem .1rem .5rem; margin-top: .4rem; scroll-snap-type: x proximity; }
.hand-leiste .hl-kachel { flex: none; flex-direction: column; gap: .2rem; padding: .3rem; min-height: 0; border-radius: 10px;
  background: var(--feld); border: 2px solid transparent; scroll-snap-align: center; }
.hand-leiste .hl-kachel.an { border-color: var(--rot); background: var(--rot-hell); }
.hl-bild { position: relative; display: grid; place-items: center; width: 64px; height: 64px; background: #fff; border-radius: 6px; overflow: hidden; }
.hl-bild img { max-width: 60px; max-height: 60px; display: block; box-shadow: 0 0 0 1px var(--linie); }
.hl-zahl { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--rot); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.hl-nr { font-size: .74rem; font-weight: 600; color: var(--grau); }
.hl-kachel.an .hl-nr { color: var(--rot-dunkel); }

/* maschinelle Befunde in der händischen Prüfung: hellgrau */
.hl-zahl-m { top: auto; bottom: 2px; background: #A3A8AE; }
.hand-liste button.hl-masch { background: #F7F8F9; color: var(--grau); box-shadow: inset 3px 0 0 #C9CDD2; }
.hand-liste button.hl-masch.an { background: #EEF0F2; box-shadow: inset 3px 0 0 var(--grau); }
.hand-liste button.hl-hand { box-shadow: inset 3px 0 0 var(--rot); }
.hand-liste button.hl-hand.an { background: var(--rot-hell); }
.hand-legende { display: flex; align-items: center; gap: .9rem; margin: .8rem 0 .2rem; flex-wrap: wrap; }
.hand-legende .lg { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.lg-hand { background: rgba(215, 38, 30, .15); border: 2px solid var(--rot); }
.lg-masch { background: rgba(163, 168, 174, .25); border: 2px solid #A3A8AE; margin-left: .5rem; }
.hand-info { display: flex; flex-direction: column; gap: .4rem; }
.hand-info h2 { margin: 0; }
.hand-info p { margin: 0; }
.hand-herkunft { font-size: .76rem; font-weight: 600; color: var(--grau); }
.hand-info-vorschlag { color: #7A7F85; }

/* Nummernmarken wie im Protokoll: grau = maschinell, rot = händisch */
.mk-gruppe { cursor: pointer; }
.hm-masch { fill: none; stroke: #A3A8AE; stroke-width: 1.5; }
.mk-gruppe:hover .hm-masch, .mk-gruppe.an .hm-masch { stroke: #6B7076; stroke-width: 2.5; fill: rgba(107, 112, 118, .12); }
.nr-schild { stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; }
.nr-schild.nr-m { fill: #8A9096; }
.nr-schild.nr-h { fill: var(--rot); }
.mk-gruppe.an .nr-schild.nr-m, .mk-gruppe:hover .nr-schild.nr-m { fill: #4F5459; }
.nr-text { fill: #fff; font-weight: 700; text-anchor: middle; font-family: system-ui, -apple-system, sans-serif; pointer-events: none; }
.hand-balken { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; padding: .45rem .7rem; margin-bottom: .4rem;
  background: #EEF0F2; border: 1px solid #DDE0E3; border-radius: var(--radius-klein); }
.hand-balken .klein { margin-right: .2rem; }
.balken-nr { min-height: 26px; min-width: 26px; padding: 0 .5rem; border-radius: 6px; font-size: .8rem; font-weight: 700; color: #fff; }
.balken-nr.nr-m { background: #8A9096; }
.balken-nr.nr-m:hover, .balken-nr.nr-m.an { background: #4F5459; }
.balken-nr.nr-h { background: var(--rot); }
.balken-nr.nr-h:hover, .balken-nr.nr-h.an { background: var(--rot-dunkel); }
.hand-legende .lg { width: auto; height: auto; min-width: 18px; padding: 0 4px; border-radius: 4px; border: 0; color: #fff;
  font-size: .7rem; font-weight: 700; text-align: center; line-height: 16px; }
.hand-legende .lg-hand { background: var(--rot); }
.hand-legende .lg-masch { background: #8A9096; }

/* ---------- Interaktiver Plan: Hochladen -> Plan sichten -> Vorschläge erstellen ---------- */
.ia-animation .ia-bild { width: min(340px, 100%); }
.ia-animation [class^="ia-s"], .ia-plan, .ia-lupe { transition: opacity .45s ease; }
.ia-animation[data-schritt="1"] .ia-plan, .ia-animation[data-schritt="1"] .ia-lupe, .ia-animation[data-schritt="1"] .ia-s3,
.ia-animation[data-schritt="2"] .ia-s1, .ia-animation[data-schritt="2"] .ia-s3,
.ia-animation[data-schritt="3"] .ia-s1, .ia-animation[data-schritt="3"] .ia-lupe, .ia-animation[data-schritt="3"] .ia-scan { opacity: 0; }
/* 1: Blatt steigt aus der Ablage, Pfeil wippt, Balken füllt sich (bei echtem Fortschritt per --ia-fortschritt) */
.ia-blatt { transform-box: view-box; animation: ia-hoch 2.4s cubic-bezier(.3, .7, .3, 1) infinite; }
@keyframes ia-hoch { 0% { transform: translateY(70px); opacity: 0; } 25% { opacity: 1; } 70%, 100% { transform: translateY(0); opacity: 1; } }
.ia-pfeil { transform-box: view-box; animation: ia-wippen 1.2s ease-in-out infinite; }
@keyframes ia-wippen { 50% { transform: translateY(-6px); } }
.ia-balken { transform-box: fill-box; transform-origin: left center; transform: scaleX(var(--ia-fortschritt, .05)); transition: transform .25s linear; }
.ia-animation:not([data-fortschritt]) .ia-balken { animation: ia-laden 2.4s ease-in-out infinite; }
@keyframes ia-laden { from { transform: scaleX(.05); } to { transform: scaleX(1); } }
/* 2: Lupe gleitet über den Plan, Scanlinie läuft */
.ia-animation[data-schritt="2"] .ia-lupe { animation: ia-lupe 5.2s ease-in-out infinite; transform-box: view-box; }
@keyframes ia-lupe {
  0%, 100% { transform: translate(-6px, -4px); }
  22% { transform: translate(52px, 50px); }
  45% { transform: translate(80px, -10px); }
  68% { transform: translate(30px, 70px); }
  84% { transform: translate(100px, 46px); }
}
.ia-animation[data-schritt="2"] .ia-scan { transform-box: view-box; animation: ia-scan 2.6s linear infinite; }
@keyframes ia-scan { 0% { transform: translateY(0); opacity: 0; } 10%, 90% { opacity: .55; } 100% { transform: translateY(146px); opacity: 0; } }
.ia-scan { opacity: 0; }
/* 3: Fundstellen pulsieren auf, Infokarten klappen auf */
.ia-fund circle { fill: none; stroke: #D7261E; stroke-width: 3; }
.ia-fund, .ia-karte { transform-box: fill-box; transform-origin: center; transform: scale(0); }
.ia-animation[data-schritt="3"] .ia-fund { animation: ia-fund 4.2s ease-out infinite; }
.ia-animation[data-schritt="3"] .ia-karte { animation: ia-karte 4.2s ease-out infinite; transform-origin: left top; }
.ia-f2, .ia-k2 { animation-delay: .7s !important; }
.ia-f3 { animation-delay: 1.4s !important; }
@keyframes ia-fund { 0% { transform: scale(0); } 10% { transform: scale(1.3); } 16%, 80% { transform: scale(1); } 90%, 100% { transform: scale(0); } }
@keyframes ia-karte { 0%, 14% { transform: scale(0); opacity: 0; } 26% { transform: scale(1.05); opacity: 1; } 32%, 80% { transform: scale(1); opacity: 1; } 90%, 100% { transform: scale(.9); opacity: 0; } }
/* Schrittliste: aktueller Schritt fett, erledigte grün mit Haken */
.ia-schritte li.fertig::marker { content: "✓  "; }
@media (prefers-reduced-motion: reduce) {
  .ia-blatt, .ia-pfeil, .ia-balken, .ia-lupe, .ia-scan, .ia-fund, .ia-karte { animation: none !important; }
  .ia-blatt { transform: none; }
  .ia-animation[data-schritt="3"] .ia-fund, .ia-animation[data-schritt="3"] .ia-karte { transform: scale(1); opacity: 1; }
}
