[hidden] { display: none !important; }
:root { --gruen: #2f6b3a; --rand: #d9d5c8; --grau: #5a6359; --text: #1f2a22; --hg: #f4f1e8; --karte: #fff; }
@media (prefers-color-scheme: dark) { :root { --rand: #3a423b; --grau: #a2aba3; --text: #e8ece6; --hg: #1d221e; --karte: #262c27; } }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--hg); color: var(--text); }
a { color: #3f8a4c; }
body.mitte { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.kasten { background: var(--karte); padding: 24px; border-radius: 16px; box-shadow: 0 4px 18px rgba(0,0,0,.12); width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.kasten h1 { margin: 0; font-size: 22px; color: #3f8a4c; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--grau); margin-top: 8px; }
input, textarea { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--rand); border-radius: 8px; background: var(--karte); color: var(--text); width: 100%; }
.knopf { display: inline-block; border: 1px solid var(--rand); background: var(--karte); color: var(--text); border-radius: 20px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.knopf.gruen { background: var(--gruen); color: #fff; border-color: var(--gruen); }
.knopf.rot { background: #fff; color: #c62828; border-color: #e9b1b1; }
.knopf.klein { padding: 5px 11px; font-size: 13px; }
.knopf.block { display: block; margin: 6px 0; }
.ohne { background: none; border: 0; font-size: 18px; cursor: pointer; color: inherit; }
.fehler { color: #c62828; margin: 0; }
.klein { font-size: 12.5px; color: var(--grau); margin-top: 4px; }
.zeile { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.zeile input { flex: 1; }
.hak { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.hak input { width: auto; }
.kopfleiste { display: flex; gap: 14px; align-items: center; padding: 8px 14px; background: var(--gruen); color: #fff; flex-wrap: wrap; }
.kopfleiste a { color: #fff; }
.kopfleiste > span:empty { flex: 1; }
.werkzeuge { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.werkzeuge .knopf { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.seite { max-width: 900px; margin: 0 auto; padding: 16px; }
.tab { width: 100%; border-collapse: collapse; background: var(--karte); }
.tab td, .tab th { padding: 8px; border-bottom: 1px solid var(--rand); text-align: left; }
.treffer { list-style: none; padding: 0; }
.treffer li { padding: 8px 0; border-bottom: 1px solid var(--rand); display: flex; gap: 10px; align-items: center; }
.arbeitsflaeche { display: flex; height: calc(100vh - 50px); }
#akarte { flex: 1; }
#seite { width: 380px; overflow-y: auto; padding: 12px; background: var(--karte); border-left: 1px solid var(--rand); }
#modus { background: #fff3cd; color: #6b5200; padding: 8px 10px; border-radius: 8px; margin-bottom: 8px; }
.tliste { list-style: none; padding: 0; margin: 8px 0; max-height: 34vh; overflow-y: auto; border: 1px solid var(--rand); border-radius: 8px; }
.tliste li { display: flex; gap: 8px; align-items: center; padding: 5px 8px; cursor: pointer; border-bottom: 1px solid var(--rand); }
.tliste li.an { background: rgba(63,138,76,.15); }
.tliste li.aus { opacity: .5; }
.tliste img, .tliste .s { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #e3eed8; flex: none; }
.tliste span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tliste i { font-size: 12px; color: var(--grau); }
.tliste small { font-size: 11px; color: #b26a00; text-align: right; }
.formkopf { display: flex; justify-content: space-between; align-items: center; }
.formkopf h3 { margin: 6px 0; }
/* Tierbild ganz zeigen (keine abgeschnittenen Köpfe) – freie Ränder dunkel */
.fbild { width: 100%; height: min(320px, 48vw); object-fit: contain; background: #1b1f1c; border-radius: 10px; display: block; }
div.fbild.leer { height: auto; background: none; }
.fbild.leer { height: 80px; background: #e3eed8; display: flex; align-items: center; justify-content: center; color: var(--grau); }
/* .amw: keine eigene position – Leaflet setzt position:absolute, sonst rutschen die Symbole */
.am { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); background: #e3eed8; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: grab; }
.leaflet-marker-pane .am img { width: 100% !important; height: 100% !important; object-fit: cover; }
.am.aus { opacity: .45; border-style: dashed; }
.am.gew { border-color: #e8711a; transform: scale(1.25); }
.am.ein { background: #fff3cd; }
.aml { position: absolute; top: 36px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.85); padding: 0 5px; border-radius: 6px; color: #233; }
#meldung { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: rgba(30,30,30,.92); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 2000; max-width: 90vw; }
@media (max-width: 760px) {
  .arbeitsflaeche { flex-direction: column; height: auto; }
  #akarte { height: 55vh; flex: none; }
  #seite { width: auto; border-left: 0; }
}

/* Gehege-Marker: Bewohnerbilder überlappend nebeneinander */
.ams { display: flex; align-items: center; }
.ams .am + .am { margin-left: -14px; }
.ams.leer .am { opacity: .55; border-style: dashed; color: #6b746c; }
.ams.gew .am { border-color: #e8711a; }
.ams.gew { transform: scale(1.2); transform-origin: 17px 17px; }
.ams b { margin-left: 2px; font-size: 11px; background: #fff; border-radius: 8px; padding: 0 4px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.werkzeuge .knopf.hell { background: #fff; color: var(--gruen); }
h4 { margin: 14px 0 6px; }
.belegung { list-style: none; padding: 0; margin: 0; }
.belegung li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--rand); flex-wrap: wrap; }
.belegung img, .belegung .s { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #e3eed8; flex: none; }
.belegung a { flex: 1; min-width: 90px; font-weight: 600; }
select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--karte); color: var(--text); max-width: 100%; }
label select { width: 100%; }

/* Gehege-Tabelle */
.gtab { width: 100%; border-collapse: collapse; background: var(--karte); }
.gtab th { text-align: left; font-size: 13px; color: var(--grau); padding: 8px; border-bottom: 2px solid var(--rand); position: sticky; top: 0; background: var(--karte); z-index: 1; }
.gtab td { padding: 8px; border-bottom: 1px solid var(--rand); vertical-align: top; }
.gtab tr.leer td:first-child input { color: var(--grau); font-style: italic; }
.gtab tr.ohne td { background: #fff8e6; }
@media (prefers-color-scheme: dark) { .gtab tr.ohne td { background: #3a3320; } }
.gtab .gname { min-width: 180px; }
.gtab .tierzeile { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.gtab .tierzeile img, .gtab .tierzeile .s { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #e3eed8; flex: none; }
.gtab .tierzeile b { min-width: 130px; }
.gtab .tierzeile.aus { opacity: .5; }
.gtab .aktion { white-space: nowrap; }
.gtab .aktion a, .gtab .aktion button { margin-right: 6px; }
.zusammenfassung { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 12px; color: var(--grau); font-size: 14px; }
.blink { animation: blink 1.2s ease; }
@keyframes blink { 0% { background: #d9f2dd; } 100% { background: transparent; } }
@media (max-width: 760px) {
  .gtab thead { display: none; }
  .gtab, .gtab tbody, .gtab tr, .gtab td { display: block; width: 100%; }
  .gtab tr { border-bottom: 2px solid var(--rand); padding: 6px 0; }
  .gtab td { border: 0; padding: 4px 8px; }
}
.seite.breit { max-width: 1200px; }

.warnung { background: #fff3cd; color: #6b5200; padding: 6px 8px; border-radius: 8px; margin-top: 6px; }
.gtab tr.intern td { background: #eef1f6; }
@media (prefers-color-scheme: dark) { .gtab tr.intern td { background: #263040; } .warnung { background: #4a3d10; color: #ffe08a; } }
.gtab .hak { margin-top: 6px; font-size: 13px; color: var(--grau); }
.spaltenwahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.neu { background: #3f8a4c; color: #fff; border-radius: 8px; padding: 1px 7px; font-size: 12px; font-weight: 700; }
.wer { font-size: 13px; opacity: .9; white-space: nowrap; }
.rollenhilfe { display: grid; gap: 6px; background: var(--karte); border: 1px solid var(--rand); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.neuform { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; align-items: end; background: var(--karte); padding: 10px 14px; border-radius: 10px; border: 1px solid var(--rand); }
.gtab td input:not([type=checkbox]) { min-width: 140px; }

.tierzeile.status, .belegung .status { background: #fff3cd; border-radius: 8px; padding: 2px 6px; }
@media (prefers-color-scheme: dark) { .tierzeile.status { background: #4a3d10; } }

fieldset.indiv { border: 1px solid #e8a317; border-radius: 10px; margin: 12px 0 4px; padding: 6px 10px 10px; background: #fffaf0; }
fieldset.indiv legend { font-weight: 700; font-size: 13px; color: #9a6a00; padding: 0 4px; }
@media (prefers-color-scheme: dark) { fieldset.indiv { background: #2e2a1e; } }

svg.schloss { width: 13px; height: 15px; vertical-align: -2px; flex: none; }
svg.schloss.zu { color: #6b7a90; }
svg.schloss.offen { color: #3f8a4c; }

.am.haus { background: #f3e7d3; }
.nrfeld { width: 56px !important; min-width: 0 !important; text-align: center; padding: 5px 4px !important; flex: none !important; }
.belegung li.an { background: rgba(232,113,26,.12); border-radius: 8px; }
.belegung small { color: var(--grau); flex: 1 1 100%; padding-left: 64px; }
.planedit { position: relative; border: 2px dashed #e8711a; border-radius: 10px; overflow: hidden; cursor: crosshair; margin: 6px 0; }
.planedit img { display: block; width: 100%; }
.planedit .pnr, .gtab .pnr { position: absolute; transform: translate(-50%, -50%); min-width: 20px; height: 20px; padding: 0 3px; border-radius: 10px; background: rgba(47,107,58,.9); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.planedit .pnr.hervor { background: #e8711a; }

.gtab tr.hauszeile td { background: #f8f0e2; border-top: 2px solid #e1cfa8; }
.gtab tr.imhaus td:first-child { padding-left: 28px; border-left: 4px solid #e1cfa8; }
@media (prefers-color-scheme: dark) { .gtab tr.hauszeile td { background: #3a3220; } }
.hausnr { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.hausnr select { flex: 1; min-width: 0; }

.zweistufig { display: inline-flex; gap: 6px; flex-wrap: wrap; max-width: 100%; }
.zweistufig .bereich { max-width: 190px; }
.zweistufig .ziel { min-width: 160px; max-width: 260px; }
#formular .zweistufig { display: flex; width: 100%; }
#formular .zweistufig select { flex: 1; max-width: none; }
.ansichten { display: flex; gap: 6px; margin: 8px 0 4px; flex-wrap: wrap; }
.planedit .pnr.intern { background: rgba(107,122,144,.9); }
.zpgriff span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; background: #e8711a; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: move; }
.zpgriff.mitte span { background: #1a73e8; }

:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.fliste { display: grid; gap: 12px; margin-top: 12px; }
.fkarte { background: var(--karte); border: 1px solid var(--rand); border-radius: 12px; padding: 10px 14px; }
.fkarte.aus { opacity: .55; }
.fkarte.faellt { border-color: #c62828; }
.fkarte input[type=time] { width: 110px; flex: none; }
.tage { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag { flex-direction: row; align-items: center; gap: 4px; color: var(--text); font-size: 14px; margin: 0; border: 1px solid var(--rand); border-radius: 14px; padding: 3px 8px; }
.tag input { width: auto; }
.kasten h1 { display: flex; align-items: center; gap: 10px; }
.kasten h1 img { height: 40px; width: auto; }
.logo-zusatz { font-size: 18px; color: #ef7d1a; font-weight: 700; }
.kopfleiste .marke { display: inline-flex; align-items: center; gap: 6px; background: #fbf7ef; color: #2c3a2e; border-radius: 8px; padding: 3px 10px; }
.kopfleiste .marke img { height: 24px; width: auto; display: block; }
.ams.intern .am { border: 2px dashed #6d4c41; }
.ams.intern .am.schl { background: #efebe9; border-style: solid; }
.gebschild { background: rgba(255,255,255,.85); border: 0; box-shadow: none; font-weight: 700; color: #4e342e; padding: 1px 4px; }

/* Grundriss-Werkzeuge */
.planedit { position: relative; }
.raumsvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.raumsvg .raum { fill-rule: evenodd; fill: rgba(76, 175, 80, .28); stroke: #2e7d32; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: auto; cursor: pointer; }
.raumsvg .raum.intern, .raumsvg .raum.art-box { fill: rgba(141, 110, 99, .3); stroke: #6d4c41; stroke-dasharray: 4 3; }
.raumsvg .raum.art-versorgung { fill: rgba(120, 144, 156, .35); stroke: #455a64; }
.raumsvg .raum.art-gang { fill: rgba(255, 213, 79, .3); stroke: #f9a825; }
.raumsvg .raum.wahl { stroke-width: 4; }
.raumsvg .raum.neu { fill: rgba(239, 125, 26, .3); stroke: #ef7d1a; stroke-width: 3; pointer-events: none; }
.planedit.wz .raumsvg .raum { pointer-events: none; }
.planedit .ecke { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid #ef7d1a; cursor: grab; touch-action: none; z-index: 3; }
.planedit .ptuer { position: absolute; transform: translate(-50%, -50%); font-size: 13px; background: #fff; border-radius: 6px; padding: 0 3px; border: 1px solid #999; z-index: 2; }
.planedit .ptuer.art-eingang, .planedit .ptuer.art-ausgang { border-color: #1a73e8; color: #1a73e8; }
.planedit .ptuer.art-notausgang { border-color: #007a3d; }
.planedit .ptuer.neu { border-color: #ef7d1a; color: #ef7d1a; font-weight: 700; }
.raumdialog { background: #fff7ec; border: 1px solid #f0c08a; border-radius: 10px; padding: 8px 10px; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
@media (prefers-color-scheme: dark) { .raumdialog { background: #3a2a14; border-color: #6b4a22; } }
.entzerren { position: fixed; inset: 0; z-index: 5000; background: rgba(0,0,0,.85); display: flex; flex-direction: column; padding: 10px; gap: 8px; color: #fff; }
.entzerren .ekopf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.entzerren .eflaeche { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.entzerren .eflaeche img { max-width: 100%; max-height: 100%; display: block; }
.entzerren .eflaeche { width: fit-content; margin: 0 auto; }
.entzerren svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.entzerren polygon { fill: rgba(239,125,26,.15); stroke: #ef7d1a; stroke-width: 2; vector-effect: non-scaling-stroke; }
.entzerren .egriff { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #ef7d1a; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; cursor: grab; touch-action: none; z-index: 2; }

/* Bestand als Baum: Bereich › Tierhaus › Gehege › Box › Besatz */
.baumleiste input { min-width: 220px; }
.baum { margin-top: 12px; }
.knoten { background: var(--karte); border: 1px solid var(--rand); border-radius: 12px; margin: 6px 0; }
.knoten .knoten { margin: 6px 0 6px 4px; border-radius: 10px; }
.knoten > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 10px; flex-wrap: wrap; border-radius: 12px; }
.knoten > summary::-webkit-details-marker { display: none; }
.knoten > summary::before { content: "▸"; color: var(--grau); width: 12px; flex: none; transition: transform .15s; }
.knoten[open] > summary::before { transform: rotate(90deg); }
.knoten > summary:hover { background: rgba(47,107,58,.06); }
.knoten > .kinder { padding: 0 8px 8px 22px; }
.k-bereich { border-color: #9cc48a; border-width: 2px; }
.k-bereich > summary { background: #eef6e8; font-size: 16px; }
.k-haus > summary { background: #f8f0e2; }
.k-gruppe.intern > summary, .k-gehege.intern > summary { background: #eef1f6; }
.k-gruppe.warn > summary { background: #fff3cd; }
.knoten.leer > summary b { color: var(--grau); font-style: italic; }
.ksym { font-size: 18px; width: 24px; text-align: center; flex: none; }
.knr { min-width: 30px; text-align: center; font-weight: 700; color: #fff; background: var(--gruen); border-radius: 8px; padding: 2px 5px; font-size: 13px; flex: none; }
.kinfo { color: var(--grau); font-size: 13px; flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kchip { font-size: 12px; border-radius: 8px; padding: 1px 7px; background: #eef1f6; white-space: nowrap; }
.kchip.status { background: #fff3cd; }
.kchip.gesell { background: #e3f2d9; color: #2f6b22; font-weight: 600; }
.kchip.warn { background: #fde2e2; color: #a12020; }
.bearbknopf { font-size: 17px; padding: 2px 6px; border-radius: 8px; margin-left: auto; }
.bearbknopf:hover { background: rgba(0,0,0,.07); }
.bearb { background: #fbfaf5; border: 1px dashed var(--rand); border-radius: 10px; padding: 4px 12px 12px; margin: 4px 0 8px; }
.bearb select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--karte); color: var(--text); }
.bearb label { flex: 1; min-width: 180px; }
.gesellkopf { font-size: 12.5px; font-weight: 700; color: #2f6b22; margin: 6px 0 2px; }
.tierblatt { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--rand); flex-wrap: wrap; }
.tierblatt.aus { opacity: .5; }
.tierblatt img, .tierblatt .s { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #e3eed8; flex: none; }
.tierblatt .tname { display: flex; flex-direction: column; min-width: 140px; flex: 1; }
.tierblatt .tname a { font-weight: 700; text-decoration: none; }
.tierblatt .tname i { font-size: 12px; color: var(--grau); }
.tierblatt .ganz { margin-left: auto; }
button.bestand { font: inherit; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid #c8bfb9; background: #efebe9; color: #4e342e; border-radius: 7px; padding: 2px 8px; cursor: pointer; }
button.bestand.leer { font-weight: 400; color: var(--grau); background: none; border-style: dashed; }
.teilfeld { background: #f4f9ef; border: 1px solid #c5dcb2; border-radius: 10px; padding: 2px 12px 10px; margin: 4px 0 8px 40px; }
.teilfeld label { flex-direction: row; align-items: center; gap: 4px; margin: 0; }
.teilfeld input[type=number] { width: 64px; }
.teilfeld select { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid var(--rand); border-radius: 8px; }
.dazu { margin-top: 8px; }
.dazu select { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px dashed var(--rand); border-radius: 8px; background: none; color: var(--grau); }
.leerhinweis { padding: 6px; }
@media (prefers-color-scheme: dark) {
  .k-bereich > summary { background: #24361d; } .k-haus > summary { background: #3a3220; }
  .k-gruppe.intern > summary, .k-gehege.intern > summary { background: #263040; } .k-gruppe.warn > summary { background: #4a3d10; }
  .bearb { background: #20251f; } .teilfeld { background: #1f2a1a; border-color: #3c5530; }
  button.bestand { background: #3e2723; color: #efebe9; border-color: #5d4037; }
  .kchip { background: #263040; } .kchip.gesell { background: #24361d; color: #a5d68f; } .kchip.status { background: #4a3d10; }
}
@media (max-width: 640px) { .knoten > .kinder { padding-left: 8px; } .tierblatt .ganz { margin-left: 40px; } .teilfeld { margin-left: 0; } }
.verbindungen { margin-top: 10px; }
.vtitel { font-size: 13px; color: var(--grau); }
.vchip { display: inline-flex; align-items: center; gap: 4px; background: #e3f2fd; color: #0d47a1; border-radius: 8px; padding: 2px 4px 2px 8px; margin: 4px 6px 0 0; font-size: 13px; }
.vchip .ohne { font-size: 13px; }
.verbindungen select { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--karte); color: var(--text); }
.kchip.verb { background: #e3f2fd; color: #0d47a1; }
@media (prefers-color-scheme: dark) { .vchip, .kchip.verb { background: #0d2a45; color: #bbdefb; } }
.gtab tr.mitstand { cursor: pointer; }
.gtab tr.mitstand:hover td { background: #f1f7ec; }
@media (prefers-color-scheme: dark) { .gtab tr.mitstand:hover td { background: #24361d; } }

.raumsvg .raum.art-besucherweg { fill: rgba(239, 214, 160, .45); stroke: #b08a3e; }

/* Ansicht nach Tierarten */
.ansichtwahl .knopf.an { background: var(--gruen); color: #fff; border-color: var(--gruen); }
.k-art > summary img, .k-art > summary .s { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; display: inline-flex; align-items: center; justify-content: center; background: #e3eed8; flex: none; }
.kwiss { font-size: 12px; color: var(--grau); }
.kchip.bestandchip { background: #efebe9; color: #4e342e; font-weight: 700; font-variant-numeric: tabular-nums; }
.tierblatt.standort .ortpfad { font-weight: 600; }
.tierblatt.standort i { font-style: normal; font-size: 12.5px; color: #2f6b22; }
.dazufeld { margin: 6px 0 0; }
@media (prefers-color-scheme: dark) { .kchip.bestandchip { background: #3e2723; color: #efebe9; } .tierblatt.standort i { color: #a5d68f; } }

/* Systematik (wie ZIMS): Klasse › Ordnung › Familie › Gattung › Art */
.krang { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--grau); min-width: 56px; }
.k-sys.rang-klasse > summary { background: #eef3fa; font-size: 16px; }
.k-sys.rang-klasse { border-color: #a9c1e0; border-width: 2px; }
.k-sys.rang-ordnung > summary { background: #f5f8fc; }
.kchip.zimschip { background: #e3f2fd; color: #0d47a1; font-weight: 700; font-size: 10.5px; }
.sysleiste { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; }
@media (prefers-color-scheme: dark) { .k-sys.rang-klasse > summary { background: #1e2a3a; } .k-sys.rang-ordnung > summary { background: #1b232e; } .kchip.zimschip { background: #0d2a45; color: #bbdefb; } }

/* Toiletten & Service (Pflegekarte) – divIcon ohne eigene position (Leaflet setzt absolute) */
.einrpunkt span { display: flex; width: 30px; height: 30px; align-items: center; justify-content: center; background: #fff; border-radius: 8px; box-shadow: 0 1px 5px rgba(0,0,0,.35); font-size: 17px; border: 2px solid #fff; }
.einrpunkt.rolli-yes span { border-color: #2e7d32; }
.einrpunkt.rolli-limited span { border-color: #f9a825; }
.einrpunkt.rolli-no span { border-color: #c62828; }
.einrpunkt.an span { outline: 3px solid #e8711a; }
.einrliste li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.einrliste li.an { background: #fff3e0; border-radius: 8px; }
.einrliste input { flex: 1; min-width: 120px; padding: 5px 8px; font-size: 14px; }
.einrliste select { font: inherit; font-size: 13px; padding: 5px 6px; border: 1px solid var(--rand); border-radius: 8px; background: var(--karte); color: var(--text); }
@media (prefers-color-scheme: dark) { .einrliste li.an { background: #3a3220; } }

.knoten.platzhalter > summary { opacity: .6; font-style: italic; }
.individuen { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px 42px; }
.indiv-chip { font-size: 13px; background: #f1efe8; border-radius: 12px; padding: 2px 9px; }
.indiv-chip small { color: var(--grau); }
.pfadknopf { font: inherit; font-weight: 600; background: none; border: 0; border-bottom: 1px dashed currentColor; padding: 0 1px; cursor: pointer; color: inherit; }
.pfadknopf:hover { color: #e8711a; }
@media (prefers-color-scheme: dark) { .indiv-chip { background: #2e352f; } }

/* Bearbeiten (Tier, Gehege): Formular über die ganze Breite, Karte ausgeblendet; „Auf der Karte zeigen“ = gewohnte Ansicht */
#karteZeigen { display: none; margin-bottom: 8px; }
body.bearbeiten #karteZeigen { display: inline-block; }
body.bearbeiten:not(.karteoffen) #akarte { display: none; }
body.bearbeiten:not(.karteoffen) #seite { width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px 24px; border-left: 0; }
body.bearbeiten:not(.karteoffen) .arbeitsflaeche { background: var(--karte); }
body.bearbeiten #filter, body.bearbeiten #tliste { display: none; }
body.bearbeiten:not(.karteoffen) #formular textarea { min-height: 9em; }
body.bearbeiten:not(.karteoffen) #formular .formkopf h3 { font-size: 20px; }
@media (max-width: 760px) {
  body.bearbeiten:not(.karteoffen) #seite { padding: 12px; }
}

/* runde Tierbilder: Ausschnitt eher oben (Köpfe) */
.tliste img, .belegung img, .gtab .tierzeile img, .tierblatt img, .leaflet-marker-pane .am img { object-position: 50% 30%; }
.am.schl svg.schloss, .ksym svg.schloss { width: 15px; height: 17px; }

/* Übersichtszeile im Bestand: Kennzahlen als Sprungknöpfe */
.summeknopf { font: inherit; color: inherit; background: var(--karte); border: 1px solid var(--rand); border-radius: 18px; padding: 4px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.summeknopf:hover { border-color: #3f8a4c; background: rgba(63,138,76,.08); }
/* Pflegekarte: Tierhaus-/Gehege-Treffer über den Tieren */
.tliste li.gehtreffer { background: #f8f0e2; }
.tliste li.gehtreffer .s { background: #f3e7d3; font-size: 18px; }
.tliste li.leer { cursor: default; }
@media (prefers-color-scheme: dark) { .tliste li.gehtreffer { background: #3a3220; } .tliste li.gehtreffer .s { background: #4a3d28; } }

/* Anlege-Knöpfe (Gehege, Tierhaus) rot hervorgehoben */
.knopf.rotvoll, .werkzeuge .knopf.rotvoll { background: #c62828; color: #fff; border-color: #c62828; }
.knopf.rotvoll:hover { background: #a91f1f; }

/* Grundriss: gezogene Durchgänge (Schieber, Gatter, Schleuse) und Innenraum aussparen */
.raumsvg .durchgang { stroke: #8d6e63; stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.raumsvg .durchgang.art-gatter { stroke-dasharray: 2 4; stroke: #5d4037; }
.raumsvg .durchgang.art-schleuse { stroke: #6a1b9a; }
.raumsvg .durchgang.neu { stroke: #ef7d1a; }
.raumsvg .lochlinie { fill: none; stroke: #c62828; stroke-width: 2; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.planedit .lochpunkt { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #c62828; z-index: 3; pointer-events: none; }

/* Ausstattung im Gebäude: WC, Rollstuhl-WC, Wickeltisch, Treppe, Rampe */
.planedit .pausst { position: absolute; transform: translate(-50%, -50%); min-width: 22px; height: 22px; padding: 0 3px; border-radius: 6px; background: #fff; border: 1.5px solid #1a73e8; color: #1a73e8; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.planedit .pausst.art-wc_rolli { background: #1a73e8; color: #fff; }
.planedit .pausst.art-treppe, .planedit .pausst.art-rampe { border-color: #5d4037; color: #5d4037; }
.planedit .pausst.neu { border-color: #ef7d1a; color: #ef7d1a; font-weight: 700; }
.raumsvg .umriss { fill: none; stroke: #4e342e; stroke-width: 4; vector-effect: non-scaling-stroke; }
.raumsvg .umriss.neu { stroke: #ef7d1a; stroke-dasharray: 6 4; }
.planedit .lochpunkt.umr { background: #ef7d1a; }

/* Tierhaus mit Umriss platzieren: Griffe */
.platzgriff { display: flex !important; align-items: center; justify-content: center; border-radius: 50%; background: #fff; border: 3px solid #ef7d1a; color: #ef7d1a; font-size: 17px; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: grab; touch-action: none; }
.platzgriff.mitte { background: #ef7d1a; color: #fff; }

/* Tierhaus-Marker in der Pflegekarte: gezeichnetes Haus statt Emoji */
.am.haus .haussym { width: 62%; height: 62%; color: #6d4c41; flex: none; }

/* Kreise im Marker nie zusammendrücken (sonst Ovale bei Tierhäusern mit Zahl und bei mehreren Bewohnern) */
.ams .am { flex: none; }

/* Bestand: Knopf „Gebäudeplan“ am Tierhaus und Planfenster */
.planknopf { padding: 2px 9px; font-size: 12px; margin-left: 4px; }
.planfenster { position: fixed; inset: 0; z-index: 6000; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pfkasten { background: var(--karte); border-radius: 14px; max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.pfkopf { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 52px 10px 12px; border-bottom: 1px solid var(--rand); }
.pfkopf [data-pfzu] { position: absolute; top: 8px; right: 8px; }
.pfansicht { display: inline-flex; gap: 4px; }
.pfbild { flex: 1; min-height: 0; overflow: auto; background: #fff; }
.pfbild img { display: block; max-width: 100%; height: auto; }

/* Gebäudeplan-Fenster, Ansicht „Intern“: Pfleger-Sicht über dem Grundriss */
.pfplan { position: relative; }
.pfplan .raumsvg .raum { pointer-events: none; }
.pfschild { position: absolute; transform: translate(-50%, -50%); background: rgba(255,255,255,.92); border: 1px solid #2e7d32; border-radius: 8px; padding: 1px 6px; font-size: 12px; line-height: 1.25; text-align: center; max-width: 180px; pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.pfschild b { display: block; color: #1f3a22; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfschild i { display: block; font-style: normal; color: #555; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfschild.intern { border-color: #6d4c41; border-style: dashed; }
.pfsym { position: absolute; transform: translate(-50%, -50%); background: #fff; border: 1px solid #999; border-radius: 6px; padding: 0 3px; font-size: 12px; pointer-events: none; }
.pfsym.tuer.art-eingang, .pfsym.tuer.art-ausgang { border-color: #1a73e8; color: #1a73e8; }
.pfsym.tuer.art-notausgang { border-color: #007a3d; }
.pfsym.ausst { border: 1.5px solid #1a73e8; color: #1a73e8; }
.pfsym.ausst.art-wc_rolli { background: #1a73e8; color: #fff; }

/* Tiere im Gebäudeplan wie auf der Übersichtskarte */
.ptierw { position: absolute; transform: translate(-50%, -50%); pointer-events: none; z-index: 2; }
.ptierw .ams .am { width: 28px; height: 28px; font-size: 15px; border-width: 2px; cursor: default; }
.ptierw .ams .am + .am { margin-left: -11px; }
.ptierw .nrb { position: absolute; top: -7px; left: -9px; background: rgba(47,107,58,.95); color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; padding: 0 4px; line-height: 15px; }
.ptierw .aml { top: 30px; font-size: 10px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.ptierw.hervor .am { border-color: #e8711a; }
.ptierw.intern .am { border-style: dashed; border-color: #6d4c41; }
.pfplan .pnr { position: absolute; transform: translate(-50%, -50%); min-width: 20px; height: 20px; padding: 0 3px; border-radius: 10px; background: rgba(47,107,58,.9); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.pfplan .pnr.intern { background: rgba(107,122,144,.9); }

/* Revier-Filter (Bestand + Pflegekarte) */
.revierwahl { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-left: auto; white-space: nowrap; }
.revierwahl select { font-size: 13px; padding: 4px 8px; }
#seite .revierwahl { display: flex; margin: 6px 0; }
#seite .revierwahl[hidden], .revierwahl[hidden] { display: none; }
.revierchip { display: inline-flex; align-items: center; gap: 4px; background: #2f7d32; color: #fff; border-radius: 18px; padding: 4px 12px; }

/* Raumarten Treppe und Aufzug im Grundriss */
.raumsvg .raum.art-treppe { fill: rgba(239, 125, 26, .22); stroke: #ef7d1a; stroke-dasharray: 2 3; }
.raumsvg .raum.art-aufzug_besucher { fill: rgba(26, 115, 232, .2); stroke: #1a73e8; }
.raumsvg .raum.art-aufzug_personal { fill: rgba(96, 125, 139, .25); stroke: #546e7a; stroke-dasharray: 4 3; }

/* Aufschrift „Treppe“ im Gebäudeplan-Fenster */
.pfplan .ptreppentext { position: absolute; transform: translate(-50%, -50%); pointer-events: none; font-weight: 800; font-size: clamp(14px, 2.6vw, 26px); letter-spacing: .08em; text-transform: uppercase; color: #b85a00; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff; white-space: nowrap; }
.raumsvg .raum.art-rampe_besucher { fill: rgba(46, 125, 50, .25); stroke: #2e7d32; stroke-dasharray: 2 3; }
.raumsvg .raum.art-rampe_personal { fill: rgba(96, 125, 139, .22); stroke: #546e7a; stroke-dasharray: 2 3; }
.pfplan .ptreppentext.rampe { color: #2e7d32; }

/* Bestand: Funktion der Räume (aus dem Grundriss) */
.kchip.funktion { background: #e8f0e4; color: #2f5d34; }
.kchip.funktion.raum { background: #eceff1; color: #455a64; }
details.knoten.raum > summary { opacity: .92; }

/* Verbundene Gehege */
.geteilt { margin: 4px 0 6px; padding: 5px 8px; border: 1px dashed #8e24aa; border-radius: 8px; background: rgba(142, 36, 170, .06); font-size: 13px; }
.geteilt a, .geteilt .pfadknopf { font-weight: 700; }
.kchip.verb { background: #f3e5f5; color: #6a1b9a; font-weight: 700; }
.ams .am.verbunden { border: 2px dashed #8e24aa; opacity: .85; }

/* Termine: frisch angelegter Termin oben, hervorgehoben */
.fkarte.neu { border: 2px solid #ef7d1a; box-shadow: 0 0 0 4px rgba(239, 125, 26, .15); }
.fkarte .neuhinweis { font-size: 13px; font-weight: 700; color: #b85a00; margin-bottom: 6px; }

/* ================= Neue Pflege-Oberfläche: feste Reiter oben (Handy: unten), Werkzeugleiste, Menüs ================= */
.pkopf { display: flex; align-items: stretch; gap: 16px; min-height: 54px; padding: 0 16px; background: var(--gruen); color: #fff; flex-wrap: wrap; }
.pkopf a { color: #fff; }
.pkopf-links { display: flex; align-items: center; gap: 10px; }
.pzoos { font-size: 18px; text-decoration: none; opacity: .85; padding: 4px; }
.pmarke { display: flex; align-items: baseline; gap: 8px; text-decoration: none; white-space: nowrap; font-size: 17px; }
.pmarke span { opacity: .85; font-size: 15px; }
.preiter { display: flex; gap: 2px; }
.preiter a { display: flex; align-items: center; gap: 6px; padding: 0 13px; text-decoration: none; opacity: .88; border-bottom: 3px solid transparent; white-space: nowrap; }
.preiter a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.preiter a.an { opacity: 1; font-weight: 700; border-bottom-color: #fff; background: rgba(255,255,255,.13); }
.preiter a:focus-visible, .pmenu-liste button:focus-visible, .pmenu-liste a:focus-visible { outline: 3px solid #ffd54f; outline-offset: -3px; }
.pkopf-rechts { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 14px; font-size: 14px; flex-wrap: wrap; padding: 6px 0; }
.psuche { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.16); border-radius: 18px; padding: 0 12px; height: 34px; }
.psuche input { border: 0; background: none; color: #fff; outline: 0; width: 210px; font-size: 14px; padding: 0; }
.psuche input::placeholder { color: rgba(255,255,255,.75); }
.pbesucher { white-space: nowrap; }
.pwerkzeug { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--karte); border-bottom: 1px solid var(--rand); flex-wrap: wrap; position: relative; z-index: 1100; }
.ptrenner { width: 1px; height: 24px; background: var(--rand); }
.pwtipp { margin: 0 0 0 auto; }
.pwerkzeug .revierwahl { flex-direction: row; align-items: center; gap: 6px; margin: 0; color: var(--text); font-size: 14px; }
.pwerkzeug .revierwahl select { font: inherit; padding: 4px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--karte); color: var(--text); }
.pmenu { position: relative; }
.pmenu-liste { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; background: var(--karte); border: 1px solid var(--rand); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; z-index: 1200; }
.pmenu-liste[hidden] { display: none; }
.pmenu-liste button, .pmenu-liste a { text-align: left; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); padding: 10px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.pmenu-liste button:hover, .pmenu-liste a:hover { background: rgba(63,138,76,.1); }
.pmenu-liste hr { border: 0; height: 1px; background: var(--rand); margin: 4px 8px; width: auto; }
body.admin { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
body.admin .arbeitsflaeche { flex: 1; height: auto; min-height: 0; }

/* Handy: Reiter als Leiste unten, gut mit dem Daumen erreichbar */
@media (max-width: 760px) {
  .pkopf { gap: 8px; padding: 6px 12px; min-height: 0; }
  .pkopf-rechts { flex-basis: 100%; justify-content: flex-start; gap: 10px; padding: 0 0 4px; }
  .psuche { flex: 1; height: 40px; border-radius: 20px; }
  .psuche input { width: 100%; font-size: 16px; }
  .pbesucher, .pkopf .wer { font-size: 12px; }
  .preiter { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1900; background: var(--karte); border-top: 1px solid var(--rand);
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -2px 10px rgba(0,0,0,.08); }
  .preiter a { flex-direction: column; gap: 1px; padding: 6px 0 8px; color: var(--grau); opacity: 1; border-bottom: 0; border-top: 3px solid transparent; font-size: 11.5px; }
  .preiter a .psym { font-size: 21px; }
  .preiter a.an { color: var(--gruen); background: none; border-top-color: var(--gruen); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  body.admin { height: auto; }
  #meldung { bottom: 80px; }
  .pwtipp { display: none; }
}
@media (max-width: 760px) and (prefers-color-scheme: dark) { .preiter a.an { color: #8fd19a; border-top-color: #8fd19a; } }

/* Mein Revier */
.rvkopf { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 8px 0 16px; }
.rvkopf h1 { margin: 0; font-size: 26px; }
.rvkopf .revierwahl { flex-direction: row; align-items: center; gap: 6px; margin: 0; color: var(--text); font-size: 14px; }
.rvkopf .revierwahl select { font: inherit; padding: 5px 8px; border: 1px solid var(--rand); border-radius: 8px; background: var(--karte); color: var(--text); }
.rvkopf #datum { margin-left: auto; }
.rvraster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .rvraster { grid-template-columns: minmax(0, 1fr); } }
.rvkarte { background: var(--karte); border: 1px solid var(--rand); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rvkarte h2 { margin: 0; font-size: 18px; }
.rvkarte .rvzweit { margin-top: 8px; }
.rvkarte p { margin: 0; }
.rvmehr { font-weight: 600; margin-top: 4px; }
.rvtermin { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--rand); align-items: start; }
.rvtermin small { display: block; color: var(--grau); }
.rvtermin small em { color: #c62828; font-style: normal; font-weight: 600; }
.rvtermin button { grid-column: 2; justify-self: start; min-height: 36px; }
.rvtermin.aus > b, .rvtermin.aus > span { opacity: .6; }
.rvkacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rvkachel { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 10px; text-decoration: none; color: var(--text) !important; min-width: 0; }
.rvkachel b { overflow-wrap: anywhere; }
.rvkachel small { color: var(--grau); }
.rvkachel:hover { border-color: #3f8a4c; background: rgba(63,138,76,.06); }
.rvkachel.mehr { justify-content: center; color: var(--grau) !important; }
.rvletzte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.rvletzte small { display: block; color: var(--grau); }
.rvzahl { background: #c62828; color: #fff; border-radius: 11px; padding: 1px 9px; font-size: 14px; margin-left: 4px; }
.rvpunkt { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #f7f4ea; text-decoration: none; color: var(--text) !important; }
.rvpunkt:hover { background: #efe9d8; }
.rvalles { color: #2e7d32; font-weight: 600; }
.rvwerkzeuge { margin-top: 18px; }
.rvknoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
@media (prefers-color-scheme: dark) { .rvpunkt { background: #2e2a1e; } .rvpunkt:hover { background: #3a3424; } .rvalles { color: #8fd19a; } }

/* Verwaltung */
.vwseite { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .vwseite { grid-template-columns: minmax(0, 1fr); } }
.vwkarte { background: var(--karte); border: 1px solid var(--rand); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vwkarte h2 { margin: 0 0 4px; font-size: 17px; }
.vwcheck h2 { font-size: 20px; }
.vwcheck p { margin: 0; }
.vwbalken { height: 8px; background: var(--rand); border-radius: 4px; overflow: hidden; }
.vwbalken div { height: 100%; background: var(--gruen); }
.vwschritt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 10px; }
.vwschritt.naechster { border: 2px solid var(--gruen); }
.vwschritt.ok { border-style: dashed; opacity: .75; }
.vwhaken { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid #b8b3a4; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 14px; }
.vwschritt.ok .vwhaken { background: var(--gruen); border-color: var(--gruen); }
.vwschritt.naechster .vwhaken { border-color: var(--gruen); }
.vwtext { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.vwtext small { color: var(--grau); }
.vwgruppen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-content: start; }
@media (max-width: 640px) { .vwgruppen { grid-template-columns: minmax(0, 1fr); } }
.vwfeld { display: flex; flex-direction: column; padding: 11px 12px; border-radius: 10px; background: #f7f4ea; text-decoration: none; color: var(--text) !important; font-weight: 600; }
.vwfeld small { color: var(--grau); font-weight: 400; }
.vwfeld:hover { background: #efe9d8; }
@media (prefers-color-scheme: dark) { .vwfeld { background: #2e2a1e; } .vwfeld:hover { background: #3a3424; } }

/* Bestand: Baum links, geöffnetes Gehege rechts (breiter Bildschirm); schmal: Ansicht im Baum */
.pwerkzeug .ansichtwahl { display: flex; gap: 6px; }
.bestand { display: flex; gap: 20px; max-width: 1500px; margin: 0 auto; padding: 0 16px; align-items: flex-start; }
.bestand-baum { flex: 1 1 0; min-width: 0; padding: 16px 0; }
.bestand-detail { flex: 0 0 min(520px, 42%); position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow-y: auto; margin: 16px 0;
  background: var(--karte); border: 1px solid var(--rand); border-radius: 14px; padding: 14px 16px; box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.bestand-detail .bearb { background: none; border: 0; padding: 0; margin: 0; }
.dkopf { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.dtitel { display: flex; align-items: center; gap: 10px; }
.dtitel h2 { margin: 0; font-size: 22px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dtitel .dzu { font-size: 20px; padding: 4px 8px; }
.kchip.sicht { background: #e5efe1; color: #2f6b3a; }
@media (prefers-color-scheme: dark) { .kchip.sicht { background: #24361d; color: #a5d68f; } }
/* Reiter der Gehege-Ansicht (Bestand und Karte gleich) */
.greiter { display: flex; gap: 2px; border-bottom: 1px solid var(--rand); margin: 12px 0 10px; overflow-x: auto; }
.greiter button { font: inherit; font-size: 14.5px; border: 0; background: none; color: var(--grau); padding: 9px 13px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.greiter button.an { color: var(--gruen); font-weight: 700; border-bottom-color: var(--gruen); }
.greiter button:focus-visible { outline: 3px solid #e8711a; outline-offset: -3px; }
@media (prefers-color-scheme: dark) { .greiter button.an { color: #8fd19a; border-bottom-color: #8fd19a; } }
.ginhalt { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.gfuss { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--rand); }
@media (max-width: 1099px) { .bestand { display: block; } }

/* Grundriss bearbeiten: eigener Vollbild-Modus – Werkzeuge links, Plan in der Mitte, Eigenschaften rechts */
.gm { position: fixed; inset: 0; z-index: 2500; display: flex; flex-direction: column; background: #eceae3; color: var(--text); }
.gmkopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: #1f2a22; color: #fff; }
.gmkopf b { font-size: 17px; }
.gmort { opacity: .8; }
.gmkopf .etagen, .gmkopf .ansichten { display: flex; gap: 6px; margin: 0; }
.gmkopf .knopf:not(.gruen):not(.hell) { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.gmluecke { flex: 1; }
.gmflaeche { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px minmax(0, 1fr) 330px; }
.gmwz { background: var(--karte); border-right: 1px solid var(--rand); padding: 6px 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.gmgruppe { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--grau); padding: 12px 8px 4px; }
.gmknopf { text-align: left; border: 0; border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px; background: none; color: var(--text); cursor: pointer; }
.gmknopf:hover { background: rgba(63,138,76,.1); }
.gmknopf.an { background: var(--gruen); color: #fff; font-weight: 600; }
.gmknopf:focus-visible { outline: 3px solid #e8711a; outline-offset: -2px; }
.gmplan { overflow: auto; padding: 16px; display: flex; align-items: flex-start; justify-content: center; }
.gmplan .planedit { width: 100%; max-width: 1100px; margin: 0; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.gmseite { background: var(--karte); border-left: 1px solid var(--rand); padding: 12px 14px; overflow-y: auto; }
.gmhilfe { background: #1f2a22; color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 14px; margin-bottom: 10px; }
.gmseite .raumdialog { margin-top: 0; }
body.grundrissmodus #meldung { z-index: 2600; }
@media (prefers-color-scheme: dark) { .gm { background: #151916; } }
@media (max-width: 900px) {
  .gmflaeche { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; overflow-y: auto; }
  .gmwz { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--rand); padding: 6px; }
  .gmgruppe { display: none; }
  .gmknopf { white-space: nowrap; }
  .gmseite { border-left: 0; border-top: 1px solid var(--rand); max-height: 45vh; }
  .gmplan { padding: 8px; }
}
.knopf.gross { font-size: 16px; padding: 10px 22px; }
.knopf.zimsknopf { border: 2px solid #c62828; }

.pwerkzeug .pschalter { margin: 0; font-size: 14px; color: var(--text); white-space: nowrap; }

/* Gehegeschild gelesen: Prüffeld im Tier-Formular */
.schildpruef { border: 2px solid #ef7d1a; border-radius: 12px; padding: 10px 14px; margin: 8px 0; background: #fff8ef; display: flex; flex-direction: column; gap: 6px; }
.schildpruef textarea { min-height: 8em; }
.schildsb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.schildsb li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.schildsb li b { min-width: 120px; }
.schildsb input { flex: 1; padding: 4px 8px; font-size: 14px; }
@media (prefers-color-scheme: dark) { .schildpruef { background: #3a2a14; border-color: #6b4a22; } }
