/* ==========================================================================
   Platzverwaltung Waldcamping Hesedorf
   Farben & Schriften zentral hier anpassen.
   ========================================================================== */
:root {
  /* Farben angelehnt an waldcamping-hesedorf.de */
  --wald: #0e3a3a;        /* Primärfarbe (dunkles Petrol/Tannengrün) */
  --wald-hell: #1e5a57;
  --rot: #dc3545;         /* Buttons / Handlungsaufforderung */
  --rot-dunkel: #bb2433;
  --moos: #7fae5f;
  --rinde: #8b5e34;       /* warmer Akzent (Holz) */
  --sonne: #e0a526;       /* Hervorhebung (Strom) */
  --sand: #f7f3e8;        /* Seitenhintergrund (Creme) */
  --papier: #fffdf7;      /* Karten / Flächen */
  --linie: #e4ddca;
  --text: #0e3a3a;
  --text-leise: #66706a;
  --gefahr: #b3402e;
  --ok: #3f7d3a;

  --font-head: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(36, 48, 42, .06), 0 4px 16px rgba(36, 48, 42, .08);
  --topbar-h: 60px;
  --tabbar-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -.01em; color: var(--wald); line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--wald-hell); }
/* Icon-Standard – gilt nicht für Leaflets eigene Zeichenfläche */
svg:not(.leaflet-zoom-animated) { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Kopfzeile & Navigation ---------- */
.topbar {
  flex: none;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: var(--wald);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 1100;
}
.brand { flex: none; display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand .tree { flex: none; width: 25px; height: 30px; fill: #fff; stroke: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
/* Schriftzug aus dem Original-Logo (assets/wordmark.svg), eingefärbt mit der Textfarbe */
.wordmark {
  /* feste Breite aus der Höhe (Seitenverhältnis 1929 : 159), sonst staucht Safari den Schriftzug */
  --wm-h: 18px;
  display: block; flex: none; height: var(--wm-h); width: calc(var(--wm-h) * 12.132); max-width: 100%;
  background: currentColor;
  -webkit-mask: url(../assets/wordmark.svg?v=20261016-20) left center / contain no-repeat;
  mask: url(../assets/wordmark.svg?v=20261016-20) left center / contain no-repeat;
}
.brand-text small { font-size: .62rem; opacity: .8; letter-spacing: .14em; text-transform: uppercase; margin-top: 4px; }

.tabbar { display: flex; gap: 4px; margin-left: auto; }
.tabbar a { white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  color: rgba(255,255,255,.85); text-decoration: none; font-weight: 600;
}
.tabbar a:hover { background: rgba(255,255,255,.1); color: #fff; }
.tabbar a.is-active { background: #fff; color: var(--wald); }

main { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; }
.view-page { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.page { max-width: 1100px; margin: 0 auto; padding: 24px 20px 48px; }

/* ---------- Bedienelemente ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 16px;
  border-radius: var(--radius-s); border: 1.5px solid transparent;
  background: var(--rot); color: #fff; font-weight: 600; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--rot-dunkel); }
.btn-dark { background: var(--wald); }
.btn-dark:hover { background: var(--wald-hell); }
.btn-ghost { background: var(--papier); color: var(--wald); border-color: var(--linie); }
.btn-ghost:hover { background: #fff; border-color: var(--wald-hell); }
.btn-ghost[aria-pressed="true"] { background: var(--rot); border-color: var(--rot); color: #fff; }
.btn-danger { background: var(--papier); color: var(--gefahr); border-color: #e7c3bb; }
.btn-danger:hover { background: #fbefec; }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: .92rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.segmented { display: inline-flex; background: var(--papier); border: 1.5px solid var(--linie); border-radius: 999px; padding: 3px; }
.segmented button {
  border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  font-weight: 600; color: var(--text-leise); min-height: 34px;
}
.segmented button.is-active { background: var(--wald); color: #fff; }

.field { display: flex; flex-direction: column; gap: 4px; }
.nr-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-leise); }
.nr-suggest:empty { display: none; }
.nr-suggest .chip { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--wald); background: transparent; color: var(--wald); font: inherit; font-weight: 700; cursor: pointer; }
.nr-suggest .chip.is-active { background: var(--wald); color: #fff; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--text-leise); }
input[type=text], input[type=search], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1.5px solid var(--linie); border-radius: var(--radius-s);
  background: #fff; font-size: 16px; /* 16px verhindert Auto-Zoom auf dem iPhone */
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--wald-hell); box-shadow: 0 0 0 3px rgba(30,90,87,.2); }
:focus-visible { outline: 3px solid rgba(224,165,38,.7); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; min-height: 36px; border-radius: 999px;
  border: 1.5px solid var(--linie); background: var(--papier); cursor: pointer; font-weight: 600; font-size: .92rem;
}
.chip.is-active { border-color: var(--wald); background: var(--wald); color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: #eee8da; color: var(--text);
  white-space: nowrap;
}
.nr {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 8px; border-radius: 10px;
  color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; flex: none;
}
.nr-sm { min-width: 32px; height: 32px; font-size: .95rem; border-radius: 8px; }
.nr-lg { min-width: 60px; height: 60px; font-size: 1.6rem; border-radius: 14px; }
.muted { color: var(--text-leise); }
.small { font-size: .88rem; }
.warn { color: var(--gefahr); font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- Kartenansicht ---------- */
.view-map { display: flex; flex-direction: column; }
.map-toolbar {
  flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--sand); border-bottom: 1px solid var(--linie); z-index: 1001;
}
.search { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.search > svg { position: absolute; left: 12px; color: var(--text-leise); pointer-events: none; }
.search input { padding-left: 40px; border-radius: 999px; background: var(--papier); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1200;
  background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 50vh; overflow-y: auto; padding: 4px;
}
.search-results button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: none; padding: 8px 10px; border-radius: var(--radius-s); cursor: pointer;
}
.search-results button:hover, .search-results button:focus { background: var(--sand); outline: none; }
.btn-icon span { display: inline; }

.map-modebar {
  flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 16px; background: #fbf1d6; border-bottom: 1px solid #eedcab; z-index: 1001; font-weight: 600;
}
.map-modebar .grow { flex: 1; min-width: 160px; }

.map-wrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: #5d8a4e; }
#map.is-drawing { cursor: crosshair; }
.leaflet-container { font-family: var(--font-body); }
.leaflet-control-zoom a { width: 36px !important; height: 36px !important; line-height: 36px !important; color: var(--wald) !important; }

.parcel-label {
  background: none; border: 0; box-shadow: none; padding: 0;
  color: #e9ecea; font-family: var(--font-head); font-weight: 700; font-size: 10px;
  text-shadow: 0 0 3px rgba(0,0,0,.75), 0 0 1px rgba(0,0,0,.9);
}
.parcel-label::before { display: none; }
/* Hintergrund + Beschriftung je als eine Ebene, die beim Zoomen nur per Transform skaliert wird */
.scale-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.bg-img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }
.label-layer .parcel-label { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.parcel-label { line-height: 1.05; text-align: center; white-space: nowrap; }
/* skaliert per Transform (siehe map.js _updateLabelClass) – kein Neu-Layout beim Zoomen */
.parcel-label .pl { display: flex; flex-direction: column; align-items: center; gap: 1px; transform: scale(var(--lbl-s, 1)); transform-origin: 50% 50%; }
.pl-free { font-size: .8em; font-weight: 700; background: rgba(255,255,255,.92); color: #234d1c; text-shadow: none; padding: 0 .35em; border-radius: .35em; }
.pl-badges { display: flex; gap: .15em; }
.pb { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5em; height: 1.35em; padding: 0 .25em; border-radius: .35em;
  font-family: var(--font-body); font-size: .8em; font-weight: 800; text-shadow: none; color: #fff; line-height: 1; }
.pb-ww { background: #1b8fc9; }
.pb-icons { gap: 0; padding: 0 2px; background: #fff; }
.pb-icons svg { width: 1.1em; height: 1.1em; fill: currentColor; stroke: none; }
.pb-icons b { font-size: .9em; margin-left: .1em; }
.pb-dog { color: #7a4a1f; }
.pb-person { color: #1f4e8c; }
.legend label .pb-icons svg { width: 12px; height: 12px; }
.snap-toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.snap-toggle input { width: 18px; height: 18px; accent-color: var(--wald); }
.pb-miet { background: #8b3fa0; }
.pb-pacht { background: #6b4521; }
.labels-hidden .parcel-label { display: none; }
.legend .toggles h4 { margin-bottom: 2px; }
.legend label .pb { min-width: 22px; height: 16px; font-size: 10px; }

.pin {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  height: 28px; padding: 0 8px 0 5px; border-radius: 999px;
  font-weight: 700; font-size: 13px; line-height: 1; white-space: nowrap;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: pointer;
  transform: translateX(calc(-50% + 22px));
}
.pin svg { width: 15px; height: 15px; stroke: none; }
.pin-box { background: var(--sonne); color: #2b2205; }
.pin-box svg { fill: #2b2205; }
.pin-tank { background: #8fdcbc; color: #0f4632; transform: translateX(calc(-50% + 25px)); }
.pin-tank svg { fill: #0f4632; }
.pin.is-selected { border-color: #1b2a1e; box-shadow: 0 0 0 4px rgba(27,42,30,.25), 0 2px 8px rgba(0,0,0,.4); transform: translateX(calc(-50% + 22px)) scale(1.15); }
.pin-tank.is-selected { transform: translateX(calc(-50% + 25px)) scale(1.15); }

.legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 1000;
  background: rgba(255,253,248,.96); border: 1px solid var(--linie); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 0; font-size: .9rem; max-width: 260px;
  max-height: calc(100% - 24px); display: flex; flex-direction: column;
}
.legend .legend-body { padding: 0 12px 10px; overflow-y: auto; }
.legend.is-collapsed .legend-body { display: none; }
.legend h4 { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise); }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .swatch { width: 16px; height: 12px; border-radius: 3px; flex: none; }
.legend .toggles { border-top: 1px solid var(--linie); margin-top: 8px; padding-top: 8px; display: grid; gap: 4px; }
.legend label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.legend input { width: 18px; height: 18px; accent-color: var(--wald); }
.legend-toggle {
  display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 12px; font: inherit; font-weight: 700; cursor: pointer; color: var(--wald);
}
.legend .placeholder-note { margin-top: 8px; font-size: .78rem; color: var(--rinde); font-weight: 600; }

.panel {
  position: absolute; z-index: 1002; top: 12px; right: 12px; bottom: 12px; width: 380px;
  background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px; border-bottom: 1px solid var(--linie); }
.panel-head .title { flex: 1; min-width: 0; }
.panel-head h2 { font-size: 1.2rem; }
.panel-body { padding: 12px 14px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--linie); }
.panel-actions .btn { flex: 1; }
.close {
  border: 0; background: var(--sand); width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-leise); flex: none;
}
.close:hover { background: var(--linie); }
.sheet-handle { display: none; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.facts dt { color: var(--text-leise); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.section-title { margin: 16px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise); font-family: var(--font-body); font-weight: 700; }

.meter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.meter-item {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-s);
  background: #fff; border: 1px solid var(--linie);
}
.meter-item.is-link { cursor: pointer; }
.meter-item.is-link:hover { border-color: var(--wald-hell); }
.meter-item .body { flex: 1; min-width: 0; }
.meter-item .line1 { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.meter-item .line2 { font-size: .88rem; color: var(--text-leise); }
.icon-strom { color: #b58600; }
.icon-gas { color: #d9822b; }
.link-btn { border: 0; background: none; padding: 0; color: var(--wald-hell); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Seiten (Kartei, Technik, Zähler, Daten) ---------- */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { flex: 1; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; text-decoration: none; font-weight: 600; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters .search { flex: 1 1 280px; }
.filters select { width: auto; min-width: 200px; border-radius: 999px; }
.result-count { color: var(--text-leise); font-size: .9rem; margin: 4px 0 10px; }

.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 12px 14px; background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius);
  text-decoration: none; color: inherit;
}
.card-row:hover { border-color: var(--wald-hell); box-shadow: var(--shadow); }
.card-row .main { min-width: 0; }
.card-row .name { font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row .name.free { color: var(--text-leise); font-style: italic; font-weight: 600; }
.card-row .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .88rem; color: var(--text-leise); margin-top: 2px; }
.card-row .meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-row .meta svg { width: 15px; height: 15px; }
.card-row .side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card > h2, .card > h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card .card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.card.span-all { grid-column: 1 / -1; }

.detail-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-head .title { flex: 1; min-width: 200px; }
.detail-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notice { padding: 10px 14px; border-radius: var(--radius-s); background: #fbf1d6; border: 1px solid #eedcab; font-size: .92rem; }

/* Formular */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.meter-edit { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; padding: 10px; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius-s); margin-bottom: 8px; }
.meter-edit-box { grid-template-columns: 1fr 1.3fr 1fr auto; }
.meter-edit .meter-remove { grid-column: -2 / -1; grid-row: 1; align-self: end; margin-bottom: 4px; }
.meter-edit.has-warn { border-color: #e7b8ad; background: #fdf3f0; }
.dup-warn { grid-column: 1 / -1; margin: 2px 0 0; color: var(--gefahr); font-weight: 600; font-size: .88rem; }
.dup-warn::before { content: '!'; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 6px; border-radius: 50%;
  background: var(--gefahr); color: #fff; font-weight: 800; font-size: .72rem; vertical-align: 1px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; align-self: end; }
.check input { width: 22px; height: 22px; accent-color: var(--wald); }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--text-leise); }
.nr-service { background: var(--rinde); }
.nr-free { background: #9a9ea6; }
.badge-service { background: #f1e3d0; color: #6b4521; }
.form-footer {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding: 12px 0 calc(12px + var(--safe-b)); margin-top: 16px;
  background: linear-gradient(to top, var(--sand) 75%, rgba(247,243,232,0));
}

/* Tabellen */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--papier); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-leise); background: #f8f4ea; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; background: #f8f4ea; }

/* Ablesung */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--linie); margin-bottom: 16px; }
.tabs a { padding: 10px 16px; text-decoration: none; font-weight: 700; color: var(--text-leise); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.is-active { color: var(--wald); border-color: var(--wald); }
.controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.controls .field { min-width: 160px; }
.progress { height: 8px; border-radius: 99px; background: var(--linie); overflow: hidden; margin: 4px 0 16px; }
.progress > div { height: 100%; background: var(--moos); transition: width .2s; }
.group { margin-bottom: 18px; }
.group-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.group-title .pin { transform: none; }
.reading-row {
  display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) 160px 120px; gap: 12px; align-items: center;
  padding: 10px 12px; background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius-s); margin-bottom: 6px;
}
.reading-row.is-done { border-color: #b9d3a6; background: #f5faef; }
.reading-row.is-warn { border-color: #e7c3bb; background: #fdf3f0; }
.reading-row .who { min-width: 0; }
.reading-row .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reading-row .prev { font-size: .88rem; color: var(--text-leise); }
.reading-row .diff { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.reading-row input { text-align: right; font-variant-numeric: tabular-nums; }
.save-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 12px 16px calc(12px + var(--safe-b)); margin: 16px -20px -48px;
  background: var(--papier); border-top: 1px solid var(--linie); box-shadow: 0 -4px 16px rgba(36,48,42,.06);
}
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--wald); font-variant-numeric: tabular-nums; }
.stat .l { font-size: .85rem; color: var(--text-leise); }

/* Auslastung: Balkenliste */
.bars { display: grid; gap: 6px; }
.bar-row {
  display: grid; grid-template-columns: 250px 1fr 200px 160px; gap: 14px; align-items: center;
  padding: 10px 12px; background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius-s);
  color: inherit; text-decoration: none;
}
.bar-row:hover { border-color: var(--wald-hell); }
.bar-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-label > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { position: relative; height: 12px; background: #ece7da; border-radius: 4px; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--wald-hell); border-radius: 0 4px 4px 0; min-width: 2px; }
.is-near .bar-fill { background: #d4900f; }
.is-over .bar-fill { background: var(--gefahr); }
.bar-limit { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); border-radius: 1px; box-shadow: 0 0 0 2px var(--papier); }
.bar-value { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.bar-state { text-align: right; }
.bars .bar-row:not(:has(.bar-state)) { grid-template-columns: 250px 1fr 200px; }
.state { display: inline-flex; gap: 4px; align-items: center; font-weight: 700; font-size: .85rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.state-over { background: #fbe4e1; color: #9b2c1f; }
.state-near { background: #fbefd2; color: #7a5208; }
.state-ok { background: #e3f1dc; color: #2c6524; }

/* Dialog & Toast */
.dialog {
  border: 0; border-radius: var(--radius); padding: 0; width: min(480px, calc(100vw - 32px));
  background: var(--papier); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.dialog::backdrop { background: rgba(14, 58, 58, .5); }
.dialog form { padding: 18px; display: grid; gap: 12px; }
.dialog .dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h) + var(--safe-b)); transform: translateX(-50%); z-index: 3000;
  background: var(--wald); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
}

/* Speicherstatus in der Kopfzeile */
.sync {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff;
  border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 600; cursor: default; white-space: nowrap;
}
.sync::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #9bd18b; flex: none; }
.sync.is-saving::before { background: var(--sonne); animation: pulse 1s infinite alternate; }
.sync.is-error { background: var(--rot); border-color: var(--rot); cursor: pointer; }
.sync.is-error::before { background: #fff; }
.sync.is-local::before { background: var(--sonne); }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }

/* Login */
body.is-locked > .topbar, body.is-locked > main, body.is-locked > .toast { display: none; }
body.is-locked { padding-bottom: 0; }
.auth {
  position: fixed; inset: 0; z-index: 4000; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: var(--wald);
  background-image: radial-gradient(circle at 20% 10%, rgba(127,174,95,.18), transparent 50%), radial-gradient(circle at 90% 90%, rgba(255,255,255,.06), transparent 40%);
}
.auth-card {
  width: min(400px, 100%); background: var(--papier); border-radius: 18px; padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--wald); }
.auth-brand .tree { flex: none; width: 34px; height: 40px; fill: var(--wald); stroke: none; }
.auth-brand .wordmark { --wm-h: 22px; }
.auth-brand small { display: block; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-leise); margin-top: 4px; }
#auth-body form { display: grid; gap: 14px; }
#auth-body h2 { margin-bottom: 4px; }
.auth-submit { width: 100%; min-height: 48px; font-size: 1.05rem; margin-top: 4px; }
.auth-link { justify-self: center; margin-top: 4px; }
#auth-body > .auth-link { display: block; margin: 14px auto 0; }
.auth-error { margin: 0; padding: 10px 12px; border-radius: var(--radius-s); background: #fbecea; color: var(--gefahr); font-weight: 600; font-size: .92rem; }
.auth-loading { display: flex; align-items: center; gap: 10px; margin: 8px 0; color: var(--text-leise); font-weight: 600; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--linie); border-top-color: var(--wald); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Mobil (iPhone hochkant)
   ========================================================================== */
@media (max-width: 860px) {
  :root { --topbar-h: 52px; --tabbar-h: 62px; }
  body { padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }
  .wordmark { --wm-h: 16px; }
  .brand .tree { width: 23px; height: 27px; }
  .sync { margin-left: auto; padding: 4px 10px; }
  .sync.is-ok { padding: 9px; }
  .sync.is-ok span { display: none; }
  .brand { flex: 1; }
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px; }
  .stat .v { font-size: 1.15rem; }
  .stat .l { font-size: .78rem; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500; margin: 0;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding: 4px 4px var(--safe-b);
    background: var(--papier); border-top: 1px solid var(--linie); gap: 0;
    box-shadow: 0 -2px 12px rgba(36,48,42,.08);
  }
  .tabbar a { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; border-radius: 10px; color: var(--text-leise); font-size: .72rem; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a:hover { background: none; color: var(--wald); }
  .tabbar a.is-active { background: none; color: var(--wald); }
  .tabbar a.is-active svg { stroke-width: 2.4; }

  .page { padding: 16px 16px 32px; }
  h1 { font-size: 1.35rem; }

  .map-toolbar { padding: 8px 10px; gap: 8px; }
  .search { flex-basis: 100%; }
  .segmented { flex: 1; }
  .segmented button { flex: 1; }
  .btn-icon span { display: none; }
  .btn-icon { width: 44px; padding: 0; }
  .map-modebar { padding: 8px 10px; font-size: .92rem; }

  .legend { left: 8px; bottom: 8px; max-width: calc(100% - 70px); }

  /* Infofenster als Bottom-Sheet */
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62%;
    border-radius: 18px 18px 0 0; border-left: 0; border-right: 0; border-bottom: 0;
    box-shadow: 0 -6px 24px rgba(0,0,0,.18);
  }
  .panel-actions { padding-bottom: 12px; }
  .sheet-handle { display: block; width: 40px; height: 5px; border-radius: 9px; background: var(--linie); margin: 8px auto 0; }
  .panel-head { padding-top: 8px; }

  .card-row { grid-template-columns: auto 1fr; gap: 12px; }
  .card-row .side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; margin-top: -4px; }
  .cards { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .meter-edit, .meter-edit-box { grid-template-columns: 1fr auto; }
  .meter-edit > .field { grid-column: 1; }
  .meter-edit .meter-remove { grid-column: 2; grid-row: 1; }
  .filters select { flex: 1; min-width: 0; }
  .toast { bottom: auto; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 10px); }
  .form-footer { flex-wrap: nowrap; gap: 8px; }
  .form-footer .btn-danger { padding: 0 12px; }
  .form-footer .btn-danger .btn-text { display: none; }
  .form-footer .btn[type=submit] { flex: 1; }
  .detail-head .actions { width: 100%; }
  .detail-head .actions .btn { flex: 1; }

  .reading-row { grid-template-columns: auto minmax(0, 1fr) 130px; grid-template-areas: "nr who input" "nr prev diff"; row-gap: 4px; }
  .reading-row > .nr { grid-area: nr; align-self: start; }
  .reading-row .who { grid-area: who; }
  .reading-row .prev { grid-area: prev; }
  .reading-row input { grid-area: input; }
  .reading-row .diff { grid-area: diff; font-size: .9rem; }
  .save-bar { margin: 16px -16px -32px; }
  .bar-row, .bars .bar-row:not(:has(.bar-state)) { grid-template-columns: 1fr auto; grid-template-areas: "label value" "track track" "state state"; gap: 6px 10px; }
  .bar-label { grid-area: label; }
  .bar-value { grid-area: value; }
  .bar-track { grid-area: track; }
  .bar-state { grid-area: state; text-align: left; }
  .bar-state:has(.muted) { display: none; }
  .controls .field { flex: 1 1 140px; min-width: 0; }

  /* Tabellen werden zu Karten */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 10px 12px; border-bottom: 1px solid var(--linie); }
  .table-cards td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-cards td::before { content: attr(data-label); color: var(--text-leise); font-size: .85rem; text-align: left; font-weight: 600; }
  .table-cards td.num { white-space: normal; }
  .table-cards tfoot tr { display: block; }
  .table-cards tfoot td { background: none; }
}

@media (max-width: 380px) {
  .brand-text small { display: none; }
}

/* Symbole bei weit herausgezoomter Karte verkleinern (z. B. iPhone-Gesamtansicht) */
/* Kästen/Tanks auf der Karte: stufenlos kleiner beim Rauszoomen (--pin-s aus map.js) */
.leaflet-container .pin-box { transform: translateX(calc(-50% + 22px)) scale(var(--pin-s, 1)); }
.leaflet-container .pin-tank { transform: translateX(calc(-50% + 25px)) scale(var(--pin-s, 1)); }
.leaflet-container .pin-box.is-selected { transform: translateX(calc(-50% + 22px)) scale(calc(var(--pin-s, 1) * 1.15 + .1)); }
.leaflet-container .pin-tank.is-selected { transform: translateX(calc(-50% + 25px)) scale(calc(var(--pin-s, 1) * 1.15 + .1)); }

@media (min-width: 861px) {
  .sync { margin-left: auto; }
  .sync:not([hidden]) + .tabbar { margin-left: 8px; }
}

/* ==========================================================================
   To-Dos & Orte
   ========================================================================== */
.tabbar a { white-space: nowrap; position: relative; }
.nav-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #e3ece8; color: var(--wald); font: 700 .7rem/18px var(--font-body); text-align: center; }
.nav-badge.is-over { background: var(--gefahr); color: #fff; }
.tabbar a.is-active .nav-badge:not(.is-over) { background: var(--wald); color: #fff; }

.todo-row { position: relative; padding-left: 18px; }
.todo-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; border-radius: var(--radius) 0 0 var(--radius); background: var(--c, #8a918b); }
.todo-row.is-done .name { text-decoration: line-through; color: var(--text-leise); }
.todo-row .meta .state { font-size: .8rem; }
.todo-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #e8ece6; flex: none; }
.card-row.todo-row { grid-template-columns: 1fr auto; }
.card-row.todo-row:has(.todo-thumb) { grid-template-columns: auto 1fr auto; }

.todo-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.todo-mini li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1px solid var(--linie); border-radius: var(--radius-s); background: var(--papier); cursor: pointer; font-size: .92rem; }
.todo-mini li:hover { border-color: var(--wald-hell); }
.todo-mini .dot { width: 10px; height: 10px; border-radius: 50%; }
.todo-mini .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-mini .d { font-size: .82rem; color: var(--text-leise); }
.todo-card .section-title:first-child { margin-top: 0; }
.todo-status-pick .chip { padding: 8px 12px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e8ece6; }
.photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.photo.is-loading { display: grid; place-items: center; color: var(--text-leise); font-size: .85rem; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.photo-del { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 5px;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; }
.photo-del svg { width: 18px; height: 18px; stroke: #fff; }
.photo-add { cursor: pointer; }
.dialog.dialog-photo { width: min(96vw, 1100px); max-width: none; padding: 0; background: #111; }
.lightbox img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; }
.lightbox-bar { display: flex; align-items: center; gap: 8px; padding: 10px; background: var(--papier); }
.lightbox-bar .grow { flex: 1; }

.pb-todo { background: #c2410c; }
.leaflet-container .pin-place { transform: translateX(-50%) scale(var(--pin-s, 1)); }
.leaflet-container .pin-place.is-selected { transform: translateX(-50%) scale(calc(var(--pin-s, 1) * 1.15 + .1)); }
.pin-place { background: #fff; color: #24302a; max-width: 180px; }
.pin-place i { font-style: normal; font-size: 15px; line-height: 1; }
.pin-place span { overflow: hidden; text-overflow: ellipsis; }
.pin { position: relative; }
.pin-todo { position: absolute; top: -8px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: #c2410c; color: #fff; border: 2px solid #fff; font: 800 10px/13px var(--font-body); text-align: center; }
.legend-ico svg { width: 16px; height: 16px; color: var(--wald); vertical-align: -3px; }
@media (min-width: 861px) and (max-width: 1240px) {
  .tabbar a span { display: none; }
}
@media (max-width: 860px) {
  .card-row.todo-row { grid-template-columns: 1fr; }
  .card-row.todo-row .side { grid-column: 1; }
  .card-row.todo-row:has(.todo-thumb) { grid-template-columns: auto 1fr; }
  .card-row.todo-row:has(.todo-thumb) .side { grid-column: 2; }
  .todo-thumb { width: 48px; height: 48px; align-self: start; }
  .nav-badge { top: 0; right: calc(50% - 26px); }
}
@media (max-width: 860px) {
  .summary.summary-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .summary-4 .stat { padding: 8px; }
  .summary-4 .stat .l { font-size: .72rem; line-height: 1.2; }
  .filters-todo .search { flex: 1 1 100%; }
  .filters-todo select { flex: 1 1 40%; }
  #t-status { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  #t-status .chip { flex: none; }
}
.plan-sync { border-color: #e0a526; background: #fffaf0; }
.plan-sync details { margin: 8px 0; }
.plan-sync summary { cursor: pointer; font-weight: 600; color: var(--wald); }
.sync-list { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: .88rem; font-variant-numeric: tabular-nums; }
/* Sicherungen am Stromzähler */
.fuse-edit { grid-column: 1 / -1; display: grid; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--linie); }
.fuse-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--text-leise); }
.fuse-head select { width: auto; min-width: 180px; padding: 6px 10px; font-size: .9rem; }
.fuse-row { display: grid; grid-template-columns: minmax(70px, 110px) 1fr auto; gap: 6px; align-items: center; }
.fuse-row input { padding: 8px 10px; }
.fuse-row .close { width: 32px; height: 32px; }
.fuse-edit .link-btn { justify-self: start; display: inline-flex; align-items: center; gap: 4px; }
.fuse-edit .link-btn svg { width: 16px; height: 16px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.card-title-row h2 { margin: 0; }

/* ==========================================================================
   Ferienunterkünfte (Airbnb)
   ========================================================================== */
/* Kartensymbol: Draufsicht in Originalgröße (--unit-s aus map.js), gedreht */
.unit-mk { position: relative; width: 0; height: 0; }
.unit-shape { position: absolute; left: 0; top: 0; width: var(--w); height: var(--h); cursor: pointer;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(var(--unit-s, 1)); filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.4)); }
.unit-shape svg, .unit-tile svg { display: block; width: 100%; height: 100%; stroke: none; }
.unit-mk.is-selected .unit-shape { filter: drop-shadow(0 0 1.5px #1b2a1e) drop-shadow(0 0 1.5px #1b2a1e) drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.unit-name { position: absolute; left: 0; top: calc(var(--r) * var(--unit-s, 1) + clamp(1px, calc(var(--unit-s, 1) * 4px), 3px)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer;
  font: 700 10.5px/1.2 var(--font-head); color: #24302a; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; }
.unit-mk .pin-todo { top: calc(-1 * var(--r) * var(--unit-s, 1) - 8px); right: auto; left: calc(var(--rx) * var(--unit-s, 1) - 6px); }
.labels-small .unit-name, .labels-hidden .unit-name { font-size: 0; gap: 0; }
.pol-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px #8a918b; }
.pol-dot.is-busy { background: #9b3b3b; box-shadow: 0 0 0 1.5px #fff; }
.pol-dot.is-blk { background: #9a9ea6; box-shadow: 0 0 0 1.5px #fff; }
.pol-dot.is-unk { background: #e6e3da; }
/* Belegungspunkt an der Unterkunft wächst/schrumpft mit dem Symbol (beim Rauszoomen ca. 5 px) */
.unit-name .pol-dot { width: clamp(3px, calc(var(--unit-s, 1) * 9px), 8px); height: clamp(3px, calc(var(--unit-s, 1) * 9px), 8px);
  box-shadow: 0 0 0 clamp(1px, calc(var(--unit-s, 1) * 2px), 1.5px) #8a918b; }
.unit-name .pol-dot.is-busy, .unit-name .pol-dot.is-blk { box-shadow: 0 0 0 clamp(1px, calc(var(--unit-s, 1) * 2px), 1.5px) #fff; }

/* Foto bzw. Draufsicht als Kachel (Infofenster, Reiter Airbnb) */
.unit-tile { width: 96px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #e8eedf; flex: none; border: 1px solid var(--linie); }
.unit-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.unit-tile.is-drawing { display: grid; place-items: center; background: #e4ebd5; }
.unit-tile-art { width: 78%; max-height: 78%; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.35)); }
.unit-tile.is-big { width: 150px; }
.tile-wrap { position: relative; cursor: pointer; flex: none; display: block; }
.tile-change { position: absolute; right: 4px; bottom: 4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(14,58,58,.78); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.tile-change svg { width: 11px; height: 11px; }
.tile-wrap:hover .tile-change { background: var(--wald); }
.rot-btns { display: flex; align-items: center; gap: 6px; }
.rot-btns .btn { padding: 0 10px; }

.airbnb-top { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.airbnb-status { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.state-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; padding: 4px 10px; border-radius: 999px; background: #eef1ec; width: fit-content; }
.state-chip.is-free { background: #e3f1dc; color: #2c6524; }
.state-chip.is-busy { background: #fbe4e1; color: #9b2c1f; }
.state-chip.is-blk { background: #ececee; color: #44474d; }

/* Monatskalender */
.cal { border: 1px solid var(--linie); border-radius: var(--radius-s); padding: 8px; background: #fff; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cal-head strong { flex: 1; }
.cal-head .muted { margin-right: 4px; }
.cal-nav { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--linie); background: var(--papier); font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--wald); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: .72rem; color: var(--text-leise); font-weight: 700; padding-bottom: 2px; }
.cal-day { --res: #9b3b3b; --blk: #9a9ea6; --free: #fff; text-align: center; font-size: .85rem; padding: 6px 0; border-radius: 6px; background: var(--free); box-shadow: inset 0 0 0 1px #e3e1d8; font-variant-numeric: tabular-nums; }
.cal-day.is-empty { background: none; box-shadow: none; }
.cal-day.is-past { opacity: .5; }
.cal-day.n-res { background: var(--res); color: #fff; font-weight: 700; box-shadow: none; }
.cal-day.n-blk { background: var(--blk); color: #fff; box-shadow: none; }
.cal-day.n-res.d-in { background: linear-gradient(135deg, var(--free) 50%, var(--res) 50%); color: #2b3a33; }
.cal-day.n-blk.d-in { background: linear-gradient(135deg, var(--free) 50%, var(--blk) 50%); color: #2b3a33; }
.cal-day.o-res { background: linear-gradient(135deg, var(--res) 50%, var(--free) 50%); }
.cal-day.o-blk { background: linear-gradient(135deg, var(--blk) 50%, var(--free) 50%); }
.cal-day.is-today { outline: 2px solid var(--wald); outline-offset: -2px; font-weight: 800; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--text-leise); margin-top: 6px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; background: #fff; border: 1px solid #cfccc2; }
.cal-legend i.n-res { background: #9b3b3b; border-color: #9b3b3b; }
.cal-legend i.n-blk { background: #9a9ea6; border-color: #9a9ea6; }

/* Reiter Airbnb */
.ab-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ab-card { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); text-decoration: none; color: inherit; }
.ab-card:hover { border-color: var(--wald-hell); box-shadow: var(--shadow); }
.ab-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px 6px; }
.tl { --tl-name: 150px; --tl-col: 24px; display: grid; gap: 2px 1px; align-items: center; width: max-content; }
.tl-corner { position: sticky; left: 0; background: var(--papier); z-index: 1; }
.tl-month { font-size: .78rem; font-weight: 700; color: var(--wald); border-left: 2px solid var(--linie); padding-left: 4px; white-space: nowrap; overflow: hidden; }
.tl-day { text-align: center; font-size: .72rem; color: var(--text-leise); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tl-day small { display: block; font-size: .62rem; }
.tl-day.is-we { color: var(--wald); font-weight: 700; }
.tl-day.is-today { background: var(--wald); color: #fff; border-radius: 5px; }
.tl-name { position: sticky; left: 0; z-index: 1; background: var(--papier); display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 0;
  font-weight: 700; font-size: .9rem; color: inherit; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-cell { --res: #9b3b3b; --blk: #9a9ea6; --free: #fff; height: 30px; background: var(--free); border-radius: 3px; box-shadow: inset 0 0 0 1px #e3e1d8; }
.tl-cell.is-we { --free: #f6f4ee; }
.tl-cell.n-res, .tl-cell.n-blk { box-shadow: none; }
.tl-cell.n-res { background: var(--res); }
.tl-cell.n-blk { background: var(--blk); }
.tl-cell.n-res.d-in { background: linear-gradient(90deg, var(--free) 45%, var(--res) 45%); }
.tl-cell.n-blk.d-in { background: linear-gradient(90deg, var(--free) 45%, var(--blk) 45%); }
.tl-cell.o-res { background: linear-gradient(90deg, var(--res) 55%, var(--free) 55%); }
.tl-cell.o-blk { background: linear-gradient(90deg, var(--blk) 55%, var(--free) 55%); }
.tl-cell.is-today, .tl-cell.n-res.is-today, .tl-cell.n-blk.is-today { box-shadow: inset 0 0 0 2px var(--wald); }
@media (max-width: 860px) {
  .tl { --tl-name: 108px; --tl-col: 22px; }
  .tl-name { font-size: .8rem; }
  .ab-cards { grid-template-columns: 1fr; }
  .airbnb-top { gap: 12px; }
  .unit-tile.is-big { width: 124px; }
  .tabbar a span { font-size: .66rem; }
}
.ab-card .state-chip { font-size: .82rem; }
@media (max-width: 860px) {
  .tl-name { white-space: normal; line-height: 1.15; font-size: .78rem; }
  .tl-name span { display: none; }
}
/* beim Zeichnen/Platzieren fangen Symbole keine Klicks ab */
#map.is-drawing .leaflet-marker-icon { pointer-events: none; }

/* Linien-Symbole statt Emojis */
.pin-place i { display: inline-flex; }
.pin.pin-place svg.pk-ico { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.panel-head .pin-place svg.pk-ico { width: 22px; height: 22px; }
.warn-ico { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--gefahr); color: #fff;
  font: 800 .7rem/1 var(--font-body); vertical-align: 1px; }
.pb-todo svg { width: .95em; height: .95em; stroke: #fff; stroke-width: 3; margin-right: 1px; }
.card-actions .btn svg { width: 16px; height: 16px; }
/* Daten: oben Sicherung + Export, darunter Konto (breit) + Zurücksetzen */
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-account { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-top: 14px; }
.facts-wide dd { overflow-wrap: anywhere; }
.section-head { margin-top: 28px; }
.section-head h2 { margin: 0; font-size: 1.25rem; }
/* Infrastruktur: Parzelle + Mieter je Zeile */
.tenant-rows { list-style: none; margin: 0 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 10px; }
.tenant-rows a, .tenant-rows .tr-static { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: inherit; text-decoration: none; font-size: .9rem; min-width: 0; }
.tenant-rows a span:last-child, .tenant-rows .tr-static > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-rows a:hover span:last-child { color: var(--wald); text-decoration: underline; }
@media (max-width: 860px) {
  .cards-2, .cards-account { grid-template-columns: 1fr; }
}
.legend-toggle { justify-content: space-between; min-height: 40px; }
.legend-chev { width: 22px !important; height: 22px !important; stroke-width: 2.6 !important; transition: transform .15s; }
.legend-chev.is-open { transform: rotate(180deg); }
/* Mieter beim Überfahren einer Parzelle */
.leaflet-tooltip.parcel-hover { background: rgba(255,253,248,.97); border: 1px solid var(--linie); border-radius: 8px; box-shadow: var(--shadow);
  padding: 4px 9px; font: 600 .85rem/1.3 var(--font-body); color: var(--text); }
.leaflet-tooltip.parcel-hover strong { color: var(--wald); margin-right: 4px; }
.leaflet-tooltip.parcel-hover::before { display: none; }
.pl-badges + .pl-badges { margin-top: 1px; }
/* Osterei: Dreirad mit Pritsche */
.easter-trike { position: absolute; left: 0; top: 0; z-index: 100000; cursor: pointer; transform-origin: 50% 50%; will-change: transform;
  filter: drop-shadow(0 1px 1.2px rgba(0,0,0,.45)); -webkit-tap-highlight-color: transparent; touch-action: none; }
.easter-trike::before { content: ''; position: absolute; inset: -14px; }   /* größere Tippfläche */
.easter-trike svg { display: block; width: 100%; height: 100%; stroke: none; }
.easter-trike.is-honk svg { animation: easter-honk .35s ease-out; }
@keyframes easter-honk { 30% { transform: scale(1.18); } 60% { transform: scale(.95); } }
/* Zoom mit den Knöpfen: Symbolgrößen gleiten im selben Takt wie die Karte (Leaflet: .25s) */
.leaflet-zoom-anim .unit-shape, .leaflet-zoom-anim .pin-box, .leaflet-zoom-anim .pin-tank, .leaflet-zoom-anim .pin-place {
  transition: transform .25s cubic-bezier(0, 0, .25, 1); }
.leaflet-zoom-anim .unit-name, .leaflet-zoom-anim .unit-name .pol-dot, .leaflet-zoom-anim .unit-mk .pin-todo {
  transition: top .25s cubic-bezier(0, 0, .25, 1), left .25s cubic-bezier(0, 0, .25, 1), width .25s cubic-bezier(0, 0, .25, 1), height .25s cubic-bezier(0, 0, .25, 1); }
.leaflet-zoom-anim .easter-trike { transition: transform .25s cubic-bezier(0, 0, .25, 1), width .25s cubic-bezier(0, 0, .25, 1),
  height .25s cubic-bezier(0, 0, .25, 1), margin .25s cubic-bezier(0, 0, .25, 1); }
