:root {
  --bg: #f5f4ef; --surface: #ffffff; --text: #1f2a1f; --muted: #66705f; --line: #dcdcd2;
  --accent: #2f6b3a; --accent-text: #ffffff; --warn: #a15c07; --bad: #a3271e; --good: #2f6b3a;
  --chip-yes: #e1efe1; --chip-no: #f6e1df; --chip-unk: #ecebe4;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141814; --surface: #1d231d; --text: #e7ebe3; --muted: #9aa597; --line: #343c33;
    --accent: #6fb27a; --accent-text: #0f1a10; --warn: #e3a64b; --bad: #ef8a80; --good: #7cc487;
    --chip-yes: #24402a; --chip-no: #4a2623; --chip-unk: #2b312a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
/* Am PC alles doppelt so groß; Handy bleibt unskaliert */
@media (min-width: 900px) {
  body { zoom: 2; }
  /* Leaflet rechnet mit unskalierten Pixeln – Gegen-Zoom, sonst laden Kacheln nur links */
  #flur-map { zoom: 0.5; }
}
a { color: var(--accent); }
header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header h1 { font-size: 18px; margin: 0; }
nav { display: flex; gap: 4px; }
nav button { background: none; border: 0; padding: 8px 10px; white-space: nowrap; border-radius: 6px; font: inherit; color: var(--muted); cursor: pointer; }
nav button.active { background: var(--accent); color: var(--accent-text); }
nav button.zustand-fehler { background: var(--bad); color: #fff; animation: zustand-puls 1.6s ease-in-out infinite; }
nav button.zustand-warnung { box-shadow: inset 0 -3px 0 var(--warn); color: var(--warn); }
@keyframes zustand-puls { 50% { opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { nav button.zustand-fehler { animation: none; } }
.zustand { border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; border: 1px solid; }
.zustand ul { margin: 4px 0; padding-left: 20px; }
.zustand-ok { border-color: var(--good); color: var(--good); }
.zustand-warnung { border-color: var(--warn); }
.zustand-warnung strong { color: var(--warn); }
.zustand-fehler { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.zustand-fehler strong { color: var(--bad); }
header .spacer { flex: 1; }
main { max-width: none; margin: 0; padding: 8px; }
section.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; }
label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; min-width: 0; }
button.primary, button.secondary { font: inherit; border-radius: 6px; padding: 8px 14px; cursor: pointer; border: 1px solid var(--accent); }
button.primary { background: var(--accent); color: var(--accent-text); }
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); }
.tile .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile.big .v { font-size: 28px; }
.tile.good .v { color: var(--good); } .tile.bad .v { color: var(--bad); }
.tile.hint .k:last-child { color: var(--warn); }
.tile-btn { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.tile-btn:hover { border-color: var(--accent); }
.tile-btn.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.profil-h3 { margin: 14px 0 8px; font-size: 15px; }
.ana-h4 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
#profil-ana { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.ana-tiles { margin-bottom: 4px; }
.tiles > p { grid-column: 1 / -1; margin: 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; margin: 1px 2px 1px 0; white-space: nowrap; }
.chip.ja { background: var(--chip-yes); } .chip.nein { background: var(--chip-no); } .chip.unk { background: var(--chip-unk); }
.muted { color: var(--muted); font-size: 13px; }
.warn { color: var(--warn); font-size: 13px; }
.status-weg { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown tr.sum td { font-weight: 650; border-top: 2px solid var(--text); }
.bar { height: 8px; background: var(--chip-unk); border-radius: 4px; overflow: hidden; min-width: 120px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
td .link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
fieldset.checks { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
fieldset.checks legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
fieldset.checks label { flex-direction: row; align-items: center; gap: 5px; color: var(--text); }
.pill { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 14px; padding: 4px 10px; cursor: pointer; }
.pill.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.anfrage { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--bg); }
.anfrage textarea { width: 100%; min-height: 150px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px; resize: vertical; }
.anfrage .grid { margin-top: 8px; }
#map { height: 560px; border-radius: 8px; border: 1px solid var(--line); z-index: 0; }
@media (max-width: 800px) { #map { height: 65vh; min-height: 360px; } }
/* Vollbild: Karte füllt den Bildschirm, Knöpfe und Legende bleiben sichtbar */
#map-panel.map-vollbild { position: fixed; inset: 0; z-index: 2000; margin: 0; border-radius: 0; display: flex; flex-direction: column;
  padding: 10px; overflow: auto; }
#map-panel.map-vollbild #map { flex: 1; height: auto; min-height: 0; }
#map-panel.map-vollbild .map-kopf h2, #map-panel.map-vollbild .legend > .muted:last-child { display: none; }
#map-panel.map-vollbild .legend { max-height: 18vh; overflow: auto; margin-top: 6px; }
#map-panel.map-vollbild #zonen-arten, #map-panel.map-vollbild #zonen-ebene { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 6px !important; }
body.kein-scroll { overflow: hidden; }
@media (max-width: 600px) {
  .map-kopf h2 .muted { display: none; }
  #zonen-arten { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  #zonen-arten .pill { white-space: nowrap; }
  .leaflet-touch .leaflet-control-zoom a { width: 38px; height: 38px; line-height: 38px; font-size: 20px; }
}
.legend-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; margin-right: 4px; border: 1px solid rgba(0,0,0,.25); }
.legend-swatch.square { border-radius: 3px; }
/* Nur die Straßenkarte grau – das Luftbild bleibt farbig */
#map .osm-grau { filter: grayscale(1) brightness(1.08) contrast(0.9); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; font-size: 13px; }
.profil-search { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 12px; }
.profil-search input { font-size: 16px; padding: 9px 10px; }
@media (max-width: 600px) { .profil-search { grid-template-columns: 1fr; } }
table.arten td { vertical-align: middle; }
table.arten .muted, #profil-groesse .muted { font-size: 12px; }
#profil-groesse th { white-space: nowrap; vertical-align: middle; }
.leaflet-tooltip { font-size: 13px; line-height: 1.4; }
.profil-search .more-filters { grid-column: 1 / -1; }
.more-filters summary { cursor: pointer; color: var(--accent); font-size: 14px; }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
.pill.small { font-size: 12px; padding: 3px 9px; }
.row.pills { gap: 6px; }
/* Werte im Kartenfeld: Ortsname klein, Wert fett; immer dunkel auf hell, unabhängig vom Farbschema */
.ort-label { background: none; border: 0; pointer-events: none; }
.ort-label > div { position: absolute; transform: translate(-50%, -50%); text-align: center; white-space: nowrap;
  color: #1b1b1b; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.ort-label span { display: block; font-size: 10px; line-height: 1.1; }
.ort-label b { display: block; font-size: 12px; line-height: 1.2; }
/* Flurstück-Info-Panel */
.flur-map-wrap { position: relative; overflow: hidden; border-radius: 8px; }
.flur-info-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 30%; min-width: 300px; max-width: 460px;
  background: var(--surface); border-left: 1px solid var(--line);
  border-radius: 0 8px 8px 0; z-index: 450; display: flex;
  transition: transform .25s ease; box-shadow: -2px 0 8px rgba(0,0,0,.08); overflow: hidden;
}
.flur-info-panel.collapsed { transform: translateX(calc(100% - 26px)); }
.flur-info-tab {
  flex-shrink: 0; width: 26px; align-self: stretch;
  background: var(--surface); border: none; border-right: 1px solid var(--line);
  cursor: pointer; color: var(--muted); font-size: 13px; padding: 0;
  display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl;
  gap: 4px; letter-spacing: 1px;
}
.flur-info-tab:hover { background: var(--bg); }
.flur-info-body { flex: 1; overflow-y: auto; padding: 10px 12px; font-size: 12px; line-height: 1.45; }
.info-block { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.info-block:last-child { border-bottom: none; margin-bottom: 0; }
.info-block-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 5px; }
.info-row { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 3px; font-size: 12px; }
.info-key { color: var(--muted); flex-shrink: 0; max-width: 52%; }
.info-val { text-align: right; font-weight: 500; word-break: break-word; }
.info-ok { color: var(--good); }
.info-warn { color: var(--warn); }
.info-na { color: var(--muted); font-style: italic; }
.info-mehr > summary { list-style: none; cursor: pointer; }
.info-mehr > summary::-webkit-details-marker { display: none; }
.info-i { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid currentColor;
  font: italic 700 10px/1 Georgia, serif; color: var(--accent); margin-left: 3px; vertical-align: 1px; }
.info-mehr[open] .info-i { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.info-details { font-size: 11.5px; line-height: 1.45; margin: 2px 0 8px; padding: 7px 9px; border-left: 3px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 8%, transparent); border-radius: 0 6px 6px 0; }
.info-details, .info-mehr .info-key { hyphens: auto; overflow-wrap: anywhere; }
.info-details p { margin: 5px 0; }
.info-details .info-key { max-width: none; }
.info-details a { color: var(--accent); }
.info-d-titel { font-weight: 600; margin-top: 4px; }
.info-lang summary { cursor: pointer; color: var(--accent); }

/* Preisfischer */
.pf-liste { display: grid; gap: 8px; }
.pf-karte { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.pf-rabatt { flex: 0 0 auto; min-width: 58px; text-align: center; font-weight: 700; font-size: 17px; color: var(--good);
  border: 2px solid var(--good); border-radius: 8px; padding: 6px 4px; }
.pf-text { min-width: 0; display: grid; gap: 3px; }
.pf-text a { overflow-wrap: anywhere; }
.pf-zahlen { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.pf-h3 { margin: 18px 0 6px; font-size: 15px; }
.pf-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.pf-zvg-land td:nth-child(3) { font-weight: 600; color: var(--good); }
.pf-gruppe { margin-bottom: 14px; }
.pf-mehr { margin-top: 6px; font-weight: 600; }
.pf-flaeche { width: 90px; text-align: right; }
/* Handy: Info-Feld unter der Karte statt seitlich (wichtig fürs GPS unterwegs) */
@media (max-width: 600px) {
  .flur-map-wrap { overflow: visible; }
  .flur-info-panel { position: static; width: auto; min-width: 0; transform: none !important; border-left: 0; border-top: 1px solid var(--line);
    border-radius: 0 0 8px 8px; box-shadow: none; }
  .flur-info-tab { display: none; }
  .flur-info-body { font-size: 14px; }
}
.leaflet-popup-content { font-size: 13px; line-height: 1.4; }
[hidden] { display: none !important; }
@media (max-width: 800px) { .calc { grid-template-columns: minmax(0, 1fr); } }
.calc > * { min-width: 0; }

/* ---------- Grundstücke: Art-Reiter und Diagramme ---------- */
:root { --s1: #2563b0; --s2: #c4610f; --grid: #e6e6de; }
@media (prefers-color-scheme: dark) { :root { --s1: #4f8fd6; --s2: #c97328; --grid: #2c332b; } }
.s1 { background: var(--s1); } .s2 { background: var(--s2); }
.art-tabs { display: flex; gap: 2px; margin-top: 14px; border-bottom: 2px solid var(--line); overflow-x: auto; }
.art-tab { font: inherit; font-size: 14px; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px;
  padding: 8px 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.art-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.chart { margin-top: 6px; }
.hgroup { padding: 8px 0; border-bottom: 1px solid var(--line); }
.hgroup:last-child { border-bottom: 0; }
.hgroup-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.hbar { display: grid; grid-template-columns: 170px minmax(0, 1fr) 150px; gap: 10px; align-items: center; font-size: 13px; padding: 2px 0; }
.hbar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hbar-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) { .hbar { grid-template-columns: 110px minmax(0, 1fr) 110px; } }
.cols { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-top: 18px; }
.col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.col-bar { width: 70%; max-width: 46px; border-radius: 4px 4px 0 0; }
.col-value { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; margin-bottom: 2px; }
.col-label { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: center; height: 28px; line-height: 1.2; overflow: hidden; }
.scatter { width: 100%; height: auto; display: block; }
.scatter .grid { stroke: var(--grid); stroke-width: 1; }
.scatter .axis { fill: var(--muted); font-size: 11px; }
.scatter .dot { fill: var(--s1); fill-opacity: .55; stroke: var(--surface); stroke-width: 1; }
.scatter .dot.gone { fill: none; stroke: var(--s1); stroke-width: 1.5; }
.scatter .dot:hover { fill-opacity: 1; }
.versand { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--bg); }
.versand-good { color: var(--good); font-weight: 600; } .versand-bad { color: var(--bad); font-weight: 600; } .versand-hint { color: var(--warn); font-weight: 600; }
.versand .zugang { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
#versand-bild { display: block; max-width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; }
a.button-link { display: inline-block; text-decoration: none; font: inherit; border-radius: 6px; padding: 8px 14px; border: 1px solid var(--accent); }
a.button-link.primary { background: var(--accent); color: var(--accent-text); }
/* Kurzgutachten */
#map.pruefmodus { cursor: crosshair; }
.hint-box { background: var(--chip-unk); border-radius: 6px; padding: 8px 10px; }
.gutachten { font-size: 13px; line-height: 1.45; }
.gutachten-kopf { padding: 6px 8px; border-radius: 6px; margin-bottom: 6px; color: #fff; }
.gutachten-kopf.bad { background: #b2182b; } .gutachten-kopf.hint { background: #b35806; } .gutachten-kopf.good { background: #1b7837; }
.gutachten-bereich { margin-top: 6px; }
.gutachten ul { margin: 2px 0 0; padding-left: 4px; list-style: none; }
.gutachten .stufe-rot { color: #b2182b; } .gutachten .stufe-gelb { color: #b35806; } .gutachten .stufe-info { color: var(--muted); }
.leaflet-popup-content .gutachten .stufe-info { color: #555; }
#gutachten .gutachten { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--bg); }
.chart-tip { position: fixed; z-index: 1000; max-width: 320px; pointer-events: none; background: var(--text); color: var(--surface);
  font-size: 12px; line-height: 1.4; padding: 6px 8px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
/* Handy: Kopfzeile nicht festkleben, Reiter waagrecht scrollbar statt umbrechen */
@media (max-width: 899px) {
  #flur-map { height: 70vh !important; }
}
#menu-knopf { display: none; }
@media (max-width: 700px) {
  /* Handy: Reiter als Menü, das links ausfährt (☰) */
  header { position: sticky; top: 0; gap: 10px; flex-wrap: nowrap; padding: 8px 12px; }
  header h1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  #menu-knopf { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--surface); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
  #logout { padding: 6px 10px; font-size: 13px; flex: 0 0 auto; }
  nav { position: fixed; top: 0; left: 0; bottom: 0; width: min(78vw, 300px); z-index: 3001; flex-direction: column; gap: 4px;
    background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; box-shadow: 4px 0 18px rgba(0,0,0,.25);
    transform: translateX(-105%); transition: transform .22s ease; overflow-y: auto; }
  body.menu-offen nav { transform: none; }
  nav button { text-align: left; font-size: 16px; padding: 12px 14px; }
  #menu-schatten { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 3000; }
}

.login { min-height: 100vh; box-sizing: border-box; margin: 0; display: grid; place-items: center; padding: 16px; }
/* Am PC ist die Seite doppelt gezoomt (body zoom: 2) – 100vh wären dann zwei Bildschirmhöhen */
@media (min-width: 900px) { .login { min-height: 50vh; } }
.login form { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; width: 100%; max-width: 340px; display: grid; gap: 12px; }
.login h1 { margin: 0; font-size: 20px; }
.error { color: var(--bad); font-size: 14px; min-height: 1.2em; }

/* ===== Aufklappbare Bereiche im Reiter Grundstücke & Rechner ===== */
details.panel.more { padding: 0; }
details.panel.more > summary { padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.panel.more > summary::-webkit-details-marker, details.more-fields > summary::-webkit-details-marker { display: none; }
details.panel.more > summary::before, details.more-fields > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details[open].panel.more > summary::before, details[open].more-fields > summary::before { transform: rotate(90deg); }
details.panel.more[open] { padding: 0 16px 4px; }
details.panel.more[open] > summary { padding-inline: 0; }
details.panel.more > section.panel, details.panel.more .calc > section.panel { border: 0; padding: 12px 0; margin: 0; border-top: 1px solid var(--line); border-radius: 0; }
details.more-fields { grid-column: 1 / -1; }
details.more-fields > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--accent); font-weight: 600; padding: 4px 0; }
details.more-fields[open] > summary { margin-bottom: 10px; }

/* ===== Kalender ===== */
:root {
  --h-wit: #4d7c0f; --h-vei: #be123c; --h-mfk: #1d4ed8; --h-zell: #7c3aed; --h-ger: #c026d3;
  --h-est: #0e7490; --h-reich: #b45309; --h-ran: #475569; --h-mag: #0f766e; --h-dorf: #a16207; --h-rim: #9333ea;
  --k-frist: #c2410c; --k-frist-bg: #fdeee5; --k-ersch: #1d7a52; --k-ersch-bg: #e4f3ec; --k-todo: #1d4ed8; --k-todo-bg: #e5edfd;
  --k-today: #2f6b3a; --k-weekend: rgba(0,0,0,.025);
}
@media (prefers-color-scheme: dark) {
  :root {
    --h-wit: #a3e635; --h-vei: #fb7185; --h-mfk: #60a5fa; --h-zell: #a78bfa; --h-ger: #e879f9;
    --h-est: #22d3ee; --h-reich: #f59e0b; --h-ran: #94a3b8; --h-mag: #2dd4bf; --h-dorf: #facc15; --h-rim: #c084fc;
    --k-frist: #fb923c; --k-frist-bg: #3a2418; --k-ersch: #4ade80; --k-ersch-bg: #16301f; --k-todo: #93c5fd; --k-todo-bg: #1b2a44;
    --k-today: #6fb27a; --k-weekend: rgba(255,255,255,.025);
  }
}
.kal { display: flex; flex-direction: column; gap: 16px; }
.kal .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; color: var(--muted); }
.kal button { font: inherit; color: inherit; cursor: pointer; }
.kal button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.kal-hero { display: grid; grid-template-columns: 2fr repeat(2, minmax(0, 1fr)); gap: 12px; }
.kal-hero > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kal-hero-main { background: linear-gradient(135deg, var(--k-frist-bg), var(--surface)) !important; border-color: color-mix(in srgb, var(--k-frist) 35%, var(--line)) !important; }
.kal-hero-main .lbl { color: var(--k-frist); }
.kal-hero-main.urgent .lbl::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--k-frist); margin-right: 6px; vertical-align: 1px; animation: kal-pulse 1.6s infinite; }
@keyframes kal-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .kal-hero-main.urgent .lbl::before { animation: none; } }
.kal-hero-main .big { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.kal-hero-main ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.kal-hero-main li i { display: inline-block; margin-right: 6px; }
.kal-hero-main li b { margin-right: 4px; }
.kal-hero-main li i, .kal-offen li i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; transform: translateY(-1px); }
.kal-stat .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kal-stat .s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kal-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; container-type: inline-size; }
.kal-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.kal-nav { display: flex; align-items: center; gap: 6px; }
.kal-title { margin: 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; min-width: 9.5ch; text-align: center; }
.kal-title span { color: var(--muted); font-weight: 500; }
.kal-ib { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); font-size: 20px !important; line-height: 1; display: grid; place-items: center; padding: 0 0 2px; }
.kal-ib:hover, .kal-btn:hover { border-color: var(--accent); }
.kal-btn { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 7px 12px; font-size: 13px !important; white-space: nowrap; }
.kal-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kal-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.kal-seg button { border: 0; background: transparent; padding: 7px 12px; font-size: 13px !important; }
.kal-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.kal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.kal-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 11px; font-size: 12.5px !important; }
.kal-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.kal-chip[aria-pressed="false"] { opacity: .5; }
.kal-chip[aria-pressed="false"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.kal-chip-all { color: var(--muted) !important; border-style: dashed; }

.kal-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@container (min-width: 820px) { .kal-main { grid-template-columns: minmax(0, 1fr) 250px; } }

.kal-wh { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-bottom: 4px; }
.kal-wh span { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; padding: 4px 0; }
.kal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kal-day { position: relative; border: 0; background: var(--surface); min-height: 54px; padding: 5px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: left; min-width: 0; }
.kal-day.we { background: color-mix(in srgb, var(--surface) 97%, var(--text)); }
.kal-day:hover { background: color-mix(in srgb, var(--surface) 92%, var(--accent)); }
.kal-day.out { color: var(--muted); }
.kal-day.out .kal-n { opacity: .45; }
.kal-day.past .kal-pills, .kal-day.past .kal-dots { opacity: .45; }
.kal-n { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.kal-day.today .kal-n { background: var(--k-today); color: var(--accent-text); }
.kal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); z-index: 1; }
.kal-pills { display: none; flex-direction: column; gap: 2px; width: 100%; min-width: 0; }
.kal-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.kal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.kal-dots i.t-f { border-radius: 1px; transform: rotate(45deg); box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 2.5px var(--k-frist); }
@container (min-width: 560px) {
  .kal-day { min-height: 108px; align-items: stretch; padding: 4px 4px 6px; }
  .kal-n { width: 24px; height: 24px; font-size: 12.5px; }
  .kal-pills { display: flex; }
  .kal-dots { display: none; }
}
.kal-pill { display: flex; align-items: center; gap: 4px; font-size: 10.5px; line-height: 1.3; padding: 2px 5px; border-radius: 4px; min-width: 0;
  background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: var(--text); white-space: nowrap; overflow: hidden; }
.kal-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.kal-pill b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.kal-pill span { display: none; }
@container (min-width: 1000px) { .kal-pill span { display: inline; color: var(--muted); overflow: hidden; text-overflow: ellipsis; } }
.kal-pill.t-f { background: var(--k-frist-bg); box-shadow: inset 2px 0 0 var(--k-frist); }
.kal-pill.t-f span { color: var(--k-frist); font-weight: 600; }
.kal-pill.t-t { background: var(--k-todo-bg); box-shadow: inset 2px 0 0 var(--k-todo); }
.kal-pill.t-t span { color: var(--k-todo); font-weight: 600; }
.kal-more { font-size: 10.5px; color: var(--muted); padding-left: 5px; font-weight: 600; }
.kal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.kal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kal-legend .lg { width: 12px; height: 10px; border-radius: 3px; }
.kal-legend .lg.t-f { background: var(--k-frist-bg); box-shadow: inset 2px 0 0 var(--k-frist); }
.kal-legend .lg.t-e { background: var(--k-ersch-bg); box-shadow: inset 2px 0 0 var(--k-ersch); }
.kal-legend .lg.t-t { background: var(--k-todo-bg); box-shadow: inset 2px 0 0 var(--k-todo); }

.kal-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kal-side-head { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.kal-side-head h3 { margin: 2px 0 0; font-size: 16px; }
.kal-side h4 { margin: 10px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kal-empty { color: var(--muted); font-size: 13px; margin: 6px 0; }

.kal-ev { display: flex; gap: 10px; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); box-shadow: inset 3px 0 0 var(--c); min-width: 0; }
.kal-ev.past { opacity: .5; }
.kal-ev-date { width: 38px; flex: none; text-align: center; line-height: 1.1; padding-top: 1px; }
.kal-ev-date b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.kal-ev-date span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kal-ev-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kal-ev-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.kal-heft { font-weight: 650; font-size: 13.5px; }
.kal-ev-note { font-size: 12.5px; }
.kal-ev-mail { font-size: 12px; color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kal-ev-mail:hover { color: var(--accent); text-decoration: underline; }
.kal-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; }
.kal-tag.t-f { background: var(--k-frist-bg); color: var(--k-frist); }
.kal-tag.t-e { background: var(--k-ersch-bg); color: var(--k-ersch); }
.kal-tag.t-t { background: var(--k-todo-bg); color: var(--k-todo); }
.kal-tag.t-o { background: var(--chip-unk); color: var(--muted); }
.kal-soon { font-size: 11px; font-weight: 600; color: var(--k-frist); }

.kal-list { display: flex; flex-direction: column; gap: 14px; }
.kal-lmonth { display: flex; flex-direction: column; gap: 6px; }
.kal-lmonth h3 { margin: 4px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); position: sticky; top: 0; background: var(--surface); padding: 4px 0; z-index: 1; }
@container (min-width: 700px) { .kal-list .kal-lmonth { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .kal-lmonth h3 { grid-column: 1 / -1; } }

.kal-section { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; }
.kal-section h2 { margin: 0 0 12px; }
.kal-hefte { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.kal-heftcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--bg); border-top: 3px solid var(--c); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kal-heftcard.offen { border-top-style: dashed; }
.kal-heftcard header { all: unset; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.kal-heftcard header i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.kal-heftcard h4 { margin: 0; font-size: 14px; flex: 1; min-width: 0; }
.kal-rueck { font-size: 11px; font-weight: 700; background: var(--k-ersch-bg); color: var(--k-ersch); padding: 2px 7px; border-radius: 999px; }
.kal-orte { margin: 0; font-size: 12px; color: var(--muted); }
.kal-heftcard dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12.5px; }
.kal-heftcard dt { color: var(--muted); }
.kal-heftcard dd { margin: 0; min-width: 0; }
.kal-heftcard a { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kal-offen ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.kal-offen li { display: flex; gap: 8px; align-items: baseline; max-width: 90ch; }

@media (max-width: 899px) {
  .kal-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kal-hero-main { grid-column: 1 / -1; }
  .kal-hero > div { padding: 10px 12px; }
  .kal-stat .v { font-size: 20px; }
  .kal-stat .lbl { font-size: 10px; letter-spacing: .04em; overflow-wrap: anywhere; hyphens: auto; }
  .kal-stat .s { white-space: normal; font-size: 11px; }
  .kal-panel { padding: 12px; }
  .kal-bar { flex-direction: column; align-items: stretch; }
  .kal-nav { justify-content: space-between; }
  .kal-title { font-size: 19px; flex: 1; }
  .kal-tools { justify-content: space-between; }
  .kal-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -12px; padding-inline: 12px; scrollbar-width: none; }
  .kal-chip { flex: none; }
  .kal-grid { border-radius: 8px; }
  .kal-hefte { grid-template-columns: minmax(0, 1fr); }
}

/* Infrastruktur im Info-Feld */
.infra-btn { width: 100%; margin-top: 8px; padding: 6px 10px; font-size: 12px; }
.infra-legende { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.infra-legende span { font-weight: 700; margin-left: 4px; }
/* Radon-Risikostufe */
.radon-gesamt { border-left: 4px solid; padding: 4px 0 6px 8px; margin: 2px 0 6px; }
.radon-skala { position: relative; margin: 6px 0 2px; }
.radon-band { display: flex; height: 8px; border-radius: 4px; overflow: hidden; }
.radon-marke { position: absolute; top: -3px; width: 3px; height: 14px; background: var(--text); border-radius: 2px; transform: translateX(-50%); }
.radon-achse { position: relative; height: 13px; font-size: 10px; color: var(--muted); }
.radon-achse span { position: absolute; transform: translateX(-50%); }
.radon-achse span:first-child { transform: none; }
.radon-achse span:last-child { transform: translateX(-100%); }
.radon-rat { font-size: 12px; margin-top: 4px; }

/* Zuletzt angesehene Flurstücke */
.zuletzt-tabelle tbody tr { cursor: pointer; }
.zuletzt-tabelle tbody tr:hover, .zuletzt-tabelle tbody tr:focus { background: rgba(47, 107, 58, .10); outline: none; }
.flur-reiter { overflow: visible; }

/* Leitungs-Knopf auf der Flurkarte */
.karten-knopf { font: 600 15px/1.2 system-ui, sans-serif; padding: 8px 12px; border-radius: 6px; border: 2px solid rgba(0,0,0,.3);
  background: #fff; color: #111; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.karten-knopf:hover { background: #f1f1f1; }
.karten-knopf.aktiv { background: #00b8d4; color: #fff; border-color: #007c91; }

/* Grundstücks-Übersicht */
.ueb-kopf { margin-bottom: 10px; }
.ueb-nr { font-size: 16px; font-weight: 700; line-height: 1.2; }
.ueb-ort { color: var(--muted); margin: 2px 0 8px; }
.ueb-werte { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.ueb-werte > div { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.ueb-klein { font-size: 11px; color: var(--muted); font-weight: 400; }
.ueb-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; }
.ueb-knopf { font: inherit; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; cursor: pointer; }
.ueb-knopf:hover { border-color: var(--accent); }
.ueb-blick-titel, .ueb-details-titel { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 10px 0 6px; }
.ueb-blick-titel .ueb-klein { text-transform: none; letter-spacing: 0; }
.ueb-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.ueb-summe { display: flex; gap: 10px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 6px; font-size: 12px; line-height: 1.35; }
.ueb-punkte { display: flex; flex-wrap: wrap; gap: 3px; max-width: 54px; flex: 0 0 auto; }
.ueb-punkte .ampel { width: 9px; height: 9px; }
.ueb-kachel { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; font: inherit; min-width: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; cursor: pointer; color: var(--text); }
.ueb-kachel:hover { border-color: var(--accent); }
.ueb-kachel-t { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 11.5px; }
.ueb-kachel-v { font-weight: 700; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.kachel-gelb .ueb-kachel-v { color: #c77700; } .kachel-rot .ueb-kachel-v { color: #d93025; } .kachel-grau .ueb-kachel-v { color: var(--muted); font-weight: 500; }
.ueb-kachel-q { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ampel { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.ampel-gruen { background: #2e9d4f; } .ampel-gelb { background: #e8a800; } .ampel-rot { background: #d93025; } .ampel-grau { background: #9aa0a6; }
.gruppe > .info-block-title { cursor: pointer; user-select: none; display: flex; justify-content: space-between; }
.gruppe > .info-block-title::after { content: '▾'; }
.gruppe.zu > .info-block-title::after { content: '▸'; }
.gruppe.zu > :not(.info-block-title) { display: none !important; }
.gruppe.zu { padding-bottom: 4px; margin-bottom: 4px; }
.gruppe.blinkt { animation: gruppe-blink 1.2s ease; }
@keyframes gruppe-blink { 0%, 60% { background: color-mix(in srgb, var(--accent) 18%, transparent); } 100% { background: transparent; } }

/* Luftbild etwas kräftiger, wie bei flurcheck */
.luftbild-klar { filter: saturate(1.18) contrast(1.06); }

/* Runde Kartenknöpfe (Handy, unten rechts) */
.karten-knopf.rund { width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 22px; line-height: 46px; text-align: center; }
.karten-knopf.rund.aktiv { background: #1a73e8; border-color: #1558b0; }
.infra-btn.karten-knopf.rund.aktiv { background: #00b8d4; border-color: #007c91; }
/* Quellenangabe der Karten klein und unaufdringlich */
.leaflet-container .leaflet-control-attribution { font-size: 9px; line-height: 1.3; padding: 0 4px; background: rgba(255, 255, 255, .6); color: #555; }
.leaflet-container .leaflet-control-attribution a { color: #555; }
@media (max-width: 600px) {
  .leaflet-container .leaflet-control-attribution { font-size: 8px; max-width: 62vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Gewählte Kachel hervorheben */
.ueb-kachel.gewaehlt { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* ===== Reiter „Anfragen“: Karten mit Emoji, Schritte links, Brief als Papier rechts ===== */
#kontakt { --k-r: 14px; --k-weich: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
#kontakt .k-reiter { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
#kontakt .k-reiter button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; }
#kontakt .k-reiter button.an { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
#kontakt .k-klein { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
#kontakt .k-warn { color: var(--warn); font-size: 13.5px; margin: 8px 0; }
#kontakt .k-leer { text-align: center; padding: 40px 10px; color: var(--muted); font-size: 16px; }
#kontakt .k-zeile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 0; }
#kontakt .k-knopf { font: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; }
#kontakt .k-knopf:hover:not(:disabled) { border-color: var(--accent); }
#kontakt .k-knopf:disabled { opacity: .5; cursor: default; }
#kontakt .k-haupt { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
#kontakt .k-ki { background: linear-gradient(135deg, #7c4dff, #448aff); color: #fff; border: 0; }
#kontakt .k-link { font: inherit; border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 0; }
#kontakt .k-feld { display: grid; gap: 5px; margin: 12px 0 0; }
#kontakt .k-feld > span { font-size: 13px; font-weight: 600; color: var(--muted); }
#kontakt .k-feld input, #kontakt .k-feld textarea, #kontakt select.k-knopf { font: inherit; font-size: 14px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; }
#kontakt select.k-knopf { width: auto; font-weight: 600; background: var(--surface); }
#kontakt textarea { resize: vertical; line-height: 1.45; }
#kontakt .k-vorschau-titel { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
#kontakt .k-karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--k-r); padding: 16px; margin-bottom: 14px; }

/* Startseite: zwei große Wege */
#kontakt .k-wege { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
#kontakt .k-weg { display: grid; gap: 6px; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 22px;
  border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(160deg, var(--k-weich), var(--surface) 70%);
  transition: transform .12s ease, border-color .12s ease; }
#kontakt .k-weg:hover { transform: translateY(-2px); border-color: var(--accent); }
#kontakt .k-weg-e { font-size: 38px; }
#kontakt .k-weg-t { font-size: 20px; font-weight: 700; }
#kontakt .k-weg-u { color: var(--muted); font-size: 14px; line-height: 1.45; }
#kontakt .k-weg-z { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--accent); }

/* Eigentümer: Schritte + Papier */
#kontakt .k-eig { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; align-items: start; }
#kontakt .k-schritt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--k-r); padding: 14px 16px; margin-bottom: 12px; }
#kontakt .k-schritt.fertig { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
#kontakt .k-schritt-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
#kontakt .k-nr { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line);
  font-weight: 700; font-size: 14px; }
#kontakt .k-schritt.fertig .k-nr { background: var(--good); color: #fff; border-color: var(--good); }
#kontakt .k-schritt-titel { font-size: 16px; font-weight: 700; }
#kontakt .k-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#kontakt .k-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--k-weich); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 6px 5px 12px; font-size: 14px; font-weight: 600; }
#kontakt .k-chip button { border: 0; background: none; color: var(--muted); font-size: 17px; cursor: pointer; padding: 0 5px; }
#kontakt .k-amt { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--good) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--good) 35%, var(--line)); }
#kontakt .k-amt-emoji { font-size: 30px; }
#kontakt .k-amt-titel { font-weight: 700; font-size: 15px; }
#kontakt .k-anlass-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
#kontakt .k-anlass { display: grid; gap: 2px; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
#kontakt .k-anlass:hover { border-color: var(--accent); }
#kontakt .k-anlass.an { border-color: var(--accent); background: var(--k-weich); box-shadow: 0 0 0 1px var(--accent) inset; }
#kontakt .k-anlass-e { font-size: 22px; }
#kontakt .k-anlass-t { font-weight: 700; font-size: 13.5px; }
#kontakt .k-anlass-u { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
#kontakt .k-check { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 4px; font-size: 14px; }
#kontakt .k-check li { color: var(--muted); }
#kontakt .k-check li.ok { color: var(--text); }
#kontakt .k-vorschau { position: sticky; top: 76px; }
#kontakt .k-papier { background: #fffdf8; color: #222; border-radius: 6px; padding: 26px 28px; box-shadow: 0 8px 30px rgba(0,0,0,.18);
  font: 13.5px/1.55 Georgia, 'Times New Roman', serif; max-height: 78vh; overflow: auto; }
#kontakt .k-papier-kopf { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin-bottom: 18px; font-size: 12px; }
#kontakt .k-papier-abs { grid-column: 1 / -1; color: #555; border-bottom: 1px solid #ddd; padding-bottom: 8px; margin-bottom: 6px; }
#kontakt .k-papier-datum { text-align: right; align-self: end; }
#kontakt .k-papier-betreff { font-weight: 700; margin-bottom: 14px; }
#kontakt .k-papier-text { white-space: pre-wrap; }
#kontakt mark { background: #fff1a8; color: #222; border-radius: 3px; padding: 0 2px; }

/* Anzeigen */
#kontakt .k-anz-oben { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 16px; }
#kontakt .k-anz-edit textarea { width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; }
#kontakt .k-zeitung { background: #fbf8ef; color: #1b1b1b; border: 2px solid #1b1b1b; padding: 14px 16px; font: 14px/1.4 Georgia, serif;
  box-shadow: 4px 4px 0 rgba(0,0,0,.15); }
#kontakt .k-zeitung::first-line { font-weight: 800; font-size: 17px; }
#kontakt .k-blaetter { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
#kontakt .k-blatt { display: grid; gap: 10px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--k-r); padding: 14px; }
#kontakt .k-blatt-kopf { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
#kontakt .k-blatt-name { font-weight: 700; font-size: 16px; }
#kontakt .k-blatt-orte { font-size: 13px; color: var(--muted); line-height: 1.4; }
#kontakt .k-tag { font-size: 11px; white-space: nowrap; border: 1px solid var(--warn); color: var(--warn); border-radius: 999px; padding: 2px 8px; }
#kontakt .k-blatt-werte { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#kontakt .k-blatt-werte > div { display: grid; justify-items: center; text-align: center; gap: 1px; background: var(--bg); border-radius: 10px; padding: 7px 4px; }
#kontakt .k-blatt-werte span { font-size: 18px; }
#kontakt .k-blatt-werte b { font-size: 12.5px; line-height: 1.2; overflow-wrap: anywhere; }
#kontakt .k-blatt-werte small { font-size: 10.5px; color: var(--muted); line-height: 1.2; }
#kontakt .k-blatt-werte .bald { background: color-mix(in srgb, var(--warn) 18%, var(--bg)); }
#kontakt .k-dialog-hg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2500; }
#kontakt .k-dialog { position: fixed; z-index: 2501; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, 94vw); max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: 16px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
#kontakt .k-dialog-kopf { display: flex; justify-content: space-between; align-items: center; font-size: 17px; font-weight: 700; }
#kontakt .k-x { border: 0; background: none; font-size: 26px; color: var(--muted); cursor: pointer; line-height: 1; }

/* Gesendet */
#kontakt .k-liste { display: grid; gap: 10px; }
#kontakt .k-eintrag { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--k-r); padding: 12px 14px; }
#kontakt .k-eintrag-e { font-size: 26px; }
#kontakt .k-eintrag-t { font-weight: 700; }
#kontakt .k-notiz { margin-top: 6px; width: 100%; font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 9px; }
#kontakt .k-pre { white-space: pre-wrap; font: inherit; font-size: 12.5px; }
#kontakt .k-zaehler { display: grid; justify-items: center; gap: 4px; }
#kontakt .k-zaehler small { font-size: 11px; color: var(--muted); }
#kontakt .k-zaehler div { display: flex; align-items: center; gap: 8px; }
#kontakt .k-zaehler button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 16px; cursor: pointer; }
#kontakt .k-zaehler b { font-size: 18px; min-width: 18px; text-align: center; }
#kontakt .k-absender { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
@media (max-width: 860px) {
  #kontakt .k-eig, #kontakt .k-anz-oben { grid-template-columns: minmax(0, 1fr); }
  #kontakt .k-vorschau { position: static; }
  #kontakt .k-blatt-werte { grid-template-columns: repeat(3, 1fr); }
  #kontakt .k-eintrag { grid-template-columns: auto 1fr; }
  #kontakt .k-zaehler { grid-column: 2; justify-items: start; }
}

/* Kennzahl-Kacheln (Reiter Daten) */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.kpi { display: grid; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi-e { font-size: 22px; }
.kpi b { font-size: 18px; }
.kpi small { color: var(--muted); font-size: 12px; }

.ueb-knopf.merk-btn.aktiv { border-color: #e8a800; color: #c77700; }
.zuletzt-tabelle .link { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; }

.pf-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.pf-chips .chip { font-size: 11px; }
.pf-rabatt.pf-vh { color: var(--text, inherit); border-color: var(--line); font-size: 15px; }
.pf-tage { font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }

.zeig-ort { display: inline-block; margin-top: 6px; font-weight: 600; }
.zeig-pin { background: none; border: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.zeig-pin svg { position: relative; display: block; }
.zeig-text { font-weight: 600; font-size: 11px; padding: 2px 6px; }
.zeig-puls { position: absolute; left: 1px; top: 29px; width: 16px; height: 7px; border-radius: 50%; background: rgba(229, 36, 43, .6);
  animation: zeig-puls 1.4s ease-out infinite; z-index: -1; }
@keyframes zeig-puls { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .zeig-puls { animation: none; } }
.kachel-pin { font-size: 12px; }
.ueb-brw { line-height: 1.35; white-space: nowrap; }
.ueb-brw + .ueb-brw { margin-top: 1px; }

/* Fette Ortsnamen auf der Flurstückskarte: dunkle Schrift mit hellem Rand – lesbar auf Luftbild und Webkarte */
.ort-name { background: none; border: 0; white-space: nowrap; }
.ort-name span { display: inline-block; transform: translate(-50%, -50%); font-weight: 800; color: #1d1d1d; letter-spacing: .2px;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff, 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff; }
.ort-city span { font-size: 18px; }
.ort-town span { font-size: 16px; }
.ort-suburb span { font-size: 13px; font-weight: 700; }
.ort-village span { font-size: 14px; }
.ort-hamlet span { font-size: 12px; font-weight: 700; }

/* ---------- Goldgrube ---------- */
#gg-map { height: 62vh; min-height: 380px; border-radius: 8px; border: 1px solid var(--line); margin-top: 10px; }
.gg-intro { margin: 0 0 8px; }
.gg-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.gg-legende span { display: inline-flex; align-items: center; gap: 6px; }
.gg-p { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.gg-p.heiss { background: #c2410c; } .gg-p.gut { background: #ca8a04; }
.gg-s { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.gg-s.fnp { background: #7c3aed; } .gg-s.bplan { background: #2563eb; } .gg-s.erschliessung { background: #059669; }
.gg-stand { font-size: 12px; margin-top: 6px; }
.gg-filter { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; font-size: 14px; }
.gg-liste { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.gg-karte { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow .3s; min-width: 0; }
.gg-karte.gg-aktiv { box-shadow: 0 0 0 3px #c2410c; }
.gg-kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.gg-badge { color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #64748b; }
.gg-badge.heiss { background: #c2410c; } .gg-badge.gut { background: #a16207; } .gg-badge.spek { background: #64748b; }
.gg-punkte { font-size: 18px; margin-left: auto; }
.gg-tipp { font-weight: 600; font-size: 14px; }
.gg-hebel { font-size: 13px; background: var(--bg); border-radius: 6px; padding: 4px 8px; }
.gg-gruende { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.gg-text { font-size: 13px; overflow-wrap: anywhere; }
.gg-knoepfe { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.gg-karte .link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }
#gg-mehr { margin-top: 10px; }
@media (max-width: 600px) { .gg-liste { grid-template-columns: 1fr; } #gg-map { height: 55vh; } }

/* Eingetragene Nutzung im Grundstückskopf */
.ueb-nutzung { margin: 8px 0 4px; line-height: 1.5; }
.ueb-nutz { display: inline-block; margin-right: 8px; }
.ueb-nutz.teils { opacity: .85; }
.ueb-plan { margin-top: 3px; font-size: 13px; }

/* Goldgrube-Karte bleibt unter Kopfzeile und Menü (Leaflet-Ebenen haben sonst z-index bis 1000) */
#gg-map { position: relative; z-index: 0; isolation: isolate; }
/* Anfragen: Zurück-Knopf und auf dem Handy die Unterreiter in einer wischbaren Zeile statt drei Reihen */
#kontakt .k-zurueck { font: inherit; font-size: 15px; font-weight: 600; background: none; border: 0; color: var(--accent); padding: 4px 0 10px; cursor: pointer; }
@media (max-width: 800px) {
  /* Die Handy-Regel für das Hauptmenü (nav als ausfahrende Seitenleiste) darf hier nicht greifen */
  #kontakt .k-reiter { position: static; transform: none; transition: none; width: auto; z-index: auto; box-shadow: none; border: 0; background: none;
    flex-direction: row; padding: 0 0 2px; overflow-y: visible;
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  #kontakt .k-reiter button { text-align: center; font-size: 14px; padding: 7px 14px; }
  #kontakt .k-reiter::-webkit-scrollbar { display: none; }
  #kontakt .k-reiter button { flex: 0 0 auto; white-space: nowrap; }
}


/* ---------- Deals ---------- */
.push-box { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.push-knoepfe { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.push-box .link, .deal-karte .link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }
.deal-form h3 { margin: 0 0 8px; }
.deal-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.deal-felder .breit { grid-column: 1 / -1; }
.deal-felder textarea { font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); resize: vertical; }
.deal-form-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.deals-liste { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 10px; }
.deal-karte { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.deal-karte.status-in_arbeit { border-left-color: var(--warn); }
.deal-karte.status-erledigt, .deal-karte.status-abgesagt { border-left-color: var(--line); opacity: .75; }
.deal-kopf { display: flex; align-items: baseline; gap: 8px; font-size: 16px; }
.deal-status { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.deal-zeile { font-size: 14px; overflow-wrap: anywhere; }
.deal-block { font-size: 14px; background: var(--bg); border-radius: 6px; padding: 5px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.deal-block .muted { font-size: 12px; display: block; }
.deal-knoepfe { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.deal-karte .deal-loeschen { color: var(--bad); margin-left: auto; }
.deal-klein { font-size: 12px; }
@media (max-width: 600px) { .deal-felder { grid-template-columns: 1fr; } .deals-liste { grid-template-columns: 1fr; } .push-knoepfe { margin-left: 0; } }
.deal-bilder { display: flex; flex-wrap: wrap; gap: 6px; }
.deal-bild { position: relative; display: block; }
.deal-bild img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.deal-bild button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--bad); font-size: 15px; line-height: 1; padding: 0; cursor: pointer; }
.deal-wv { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; font-size: 13px; }
.deal-wv-datum { position: relative; flex-direction: row; cursor: pointer; overflow: hidden; }
.deal-wv-datum input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.deal-upload { flex-direction: row; display: inline; }
.deal-fragen { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; display: grid; gap: 8px; }
.deal-fragen h4 { margin: 0; font-size: 15px; }
.deal-frage { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.deal-frage legend { padding: 0; margin-bottom: 4px; font-size: 14px; color: var(--text); }
.deal-frage label { flex-direction: row; position: relative; }
.deal-frage input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.deal-frage span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--text); background: var(--surface); }
.deal-frage input:checked + span { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.deal-frage input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.deal-grund { font-size: 14px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; }
.deal-plus b { color: var(--good); } .deal-minus b { color: var(--bad); }

/* Deals: kompakte Karten (Kurzüberblick, Details nach Antippen), Formular hinter einem Knopf */
.deals-oben { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.deals-oben h2 { margin: 0; }
.deals-kopf .push-box { margin: 10px 0 0; }
.deals-hinweis:empty { display: none; }
.deals-hinweis { margin-top: 8px; font-size: 13px; }
.deal-karte { padding: 0; gap: 0; overflow: hidden; }
.deal-karte.offen { padding-bottom: 10px; gap: 6px; }
.deal-karte.offen > :not(.deal-kurz) { margin: 0 12px; }
.deal-kurz { all: unset; box-sizing: border-box; display: grid; gap: 3px; width: 100%; padding: 9px 12px; cursor: pointer; }
.deal-karte.offen .deal-kurz { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.deal-kurz:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.deal-kurz-kopf { display: flex; align-items: baseline; gap: 8px; font-size: 16px; }
.deal-kurz-kopf strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-pfeil { margin-left: auto; color: var(--muted); font-size: 14px; }
.deal-kurz-was { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-kurz-zeile { font-size: 13px; }
.deal-kurz-geld { font-size: 14px; font-weight: 600; }
.deal-kurz-geld.deal-plus { color: var(--good); } .deal-kurz-geld.deal-minus { color: var(--bad); }
.deals-liste { align-items: start; }
@media (max-width: 600px) {
  .deals-panel, .deals-kopf { padding-left: 10px; padding-right: 10px; }
  .deals-oben .primary { width: 100%; }
  .deals-liste { gap: 8px; }
}

/* Deals: rotes Fristfeld oben, eigene Deal-Ansicht mit großen Feldern */
.deal-frist { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; background: #b3261e; color: #fff;
  border-radius: 8px; padding: 8px 12px; font-size: 15px; }
.deal-frist span { font-size: 13px; opacity: .9; white-space: nowrap; }
.deal-frist.ohne { background: var(--chip-unk); color: var(--muted); font-size: 13px; }
.deal-kurz { padding: 10px; gap: 6px; }
.deal-kurz-kopf { font-size: 18px; padding: 2px 2px 0; }
.deal-kurz-was { font-size: 15px; color: var(--text); padding: 0 2px; white-space: normal; }
.deal-kurz-geld { font-size: 16px; padding: 0 2px; }
.deal-kurz-geld.leise { font-weight: 400; color: var(--muted); font-size: 14px; }
.deal-pfeil { font-size: 22px; line-height: 1; }
.deal-karte { border-left-width: 1px; border-radius: 12px; }
.deal-detail { display: grid; gap: 14px; }
.dd-zurueck { all: unset; cursor: pointer; color: var(--accent); font-size: 16px; font-weight: 600; padding: 4px 0; }
.dd-kopf h2 { margin: 0; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.dd-was { font-size: 17px; margin-top: 2px; }
.dd-aktionen { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.dd-knopf { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer; box-sizing: border-box; flex-direction: row; }
.dd-knopf.haupt { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.dd-knopf.gefahr { color: var(--bad); }
.dd-block { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.dd-block h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.dd-preis { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 16px; }
.dd-preis b { font-size: 20px; text-align: right; }
.dd-klein { font-size: 13px; color: var(--muted); }
.dd-kacheln { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dd-kachel { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); text-align: center; }
.dd-kachel .dd-icon { font-size: 22px; }
.dd-kachel-name { font-size: 13px; color: var(--muted); }
.dd-kachel b { font-size: 16px; }
.dd-kachel.ja { background: var(--chip-yes); } .dd-kachel.nein { background: var(--chip-no); } .dd-kachel.offen b { color: var(--muted); }
.dd-zeile { display: flex; gap: 10px; font-size: 16px; overflow-wrap: anywhere; }
.dd-text { font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dd-upload { width: 100%; }
.deal-detail .deal-wv { font-size: 15px; gap: 8px; }
.deal-detail .deal-wv .pill.small { font-size: 15px; padding: 8px 14px; }
.deal-detail .deal-bild img { width: 96px; height: 96px; }
.deal-ohne-preis { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; color: var(--text); }
.deal-ohne-preis input { width: 20px; height: 20px; margin: 0; }

/* ---------- Zwangsversteigerungen: am Handy Karten statt Tabelle ---------- */
.pf-zvg-karten { display: none; gap: 10px; }
.zvg-karte { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; }
.zvg-karte.land { border-left: 4px solid var(--accent); }
.zvg-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 17px; }
.zvg-objekt { font-size: 15px; }
.zvg-klein { font-size: 12px; }
.zvg-werte { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.zvg-werte > div { background: var(--bg); border-radius: 8px; padding: 7px 9px; display: grid; gap: 1px; min-width: 0; }
.zvg-werte span { font-size: 12px; color: var(--muted); }
.zvg-werte b { font-size: 16px; }
.zvg-werte small { font-size: 11px; color: var(--muted); }
.zvg-werte input { font: inherit; font-size: 15px; width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--text); }
.zvg-fuss { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
@media (max-width: 700px) { .pf-zvg-tabelle { display: none; } .pf-zvg-karten { display: grid; } }

/* Rechner-Leiste (gleiche Reiter wie über der Flurstückssuche) */
.rechner-leiste { padding-bottom: 4px; }
.rechner-leiste .flur-reiter { margin: 0; }

/* ---------- Projekte ---------- */
.pj-karte { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; }
.pj-karte.fertig { opacity: .75; }
.pj-kurz { all: unset; box-sizing: border-box; display: grid; gap: 6px; width: 100%; padding: 12px; cursor: pointer; }
.pj-kurz:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pj-kurz-zahlen { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 0 2px; }
.pj-kurz-zahlen .plus, .pj-zahl.plus b, .pj-beleg .plus { color: var(--good); }
.pj-kurz-zahlen .minus, .pj-zahl.minus b, .pj-beleg .minus { color: var(--bad); }
.pj-balken { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 0 2px; }
.pj-balken i { display: block; height: 100%; background: var(--accent); }
.pj-zahlen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pj-zahl { background: var(--bg); border-radius: 10px; padding: 9px 11px; display: grid; gap: 2px; min-width: 0; }
.pj-zahl span { font-size: 12px; color: var(--muted); }
.pj-zahl b { font-size: 19px; overflow-wrap: anywhere; }
.pj-todos, .pj-belege { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pj-todos li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px 4px 10px; }
.pj-todos label { flex: 1; flex-direction: row; align-items: center; gap: 10px; font-size: 16px; color: var(--text); min-height: 40px; min-width: 0; cursor: pointer; }
.pj-todos input { width: 22px; height: 22px; flex: none; margin: 0; }
.pj-todos span { overflow-wrap: anywhere; }
.pj-todos li.fertig span { text-decoration: line-through; color: var(--muted); }
.pj-todos button, .pj-beleg > button { flex: none; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.pj-neu { display: flex; gap: 8px; }
.pj-neu input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.pj-neu button { width: 48px; font-size: 20px; border-radius: 10px; }
.pj-beleg-form { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.pj-art { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pj-art label { position: relative; flex-direction: row; }
.pj-art input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pj-art span { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 15px; color: var(--text); }
.pj-art input:checked + span { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.pj-beleg-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.pj-beleg-felder .breit { grid-column: 1 / -1; }
.pj-beleg-felder input, .pj-beleg-felder select { font-size: 16px; }
.pj-beleg-speichern { min-height: 46px; font-size: 16px; }
.pj-beleg { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px 6px 6px; }
.pj-beleg img, .pj-beleg-leer { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--bg); font-size: 22px; }
.pj-beleg-text { flex: 1; min-width: 0; display: grid; font-size: 14px; overflow-wrap: anywhere; }
.pj-beleg-text .muted { font-size: 12px; }
.pj-beleg > b { white-space: nowrap; font-size: 15px; }
/* Deal-/Projekt-Ansicht darf nie breiter als das Handy werden (Datumsfelder u. Ä. haben eine feste Mindestbreite) */
.deal-detail { grid-template-columns: minmax(0, 1fr); }
.deal-detail > *, .dd-block > *, .pj-beleg-form > * { min-width: 0; }
.pj-beleg-felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pj-beleg-felder input, .pj-beleg-felder select { width: 100%; min-width: 0; box-sizing: border-box; }
.pj-neu button { flex: none; }

/* Preisatlas-Leiste (Suchen · Zuletzt · Gemerkt · Rechner): passt am Handy in eine Zeile – die Seite selbst wird nie breiter */
@media (max-width: 700px) {
  .flur-reiter { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; gap: 0; }
  .flur-reiter::-webkit-scrollbar { display: none; }
  .flur-reiter .art-tab { flex: 1 1 auto; padding: 9px 5px; font-size: 13px; white-space: nowrap; text-align: center; }
}

/* Pacht-Ebene auf der Flurstückskarte */
.pacht-knopf.karten-knopf.aktiv, .pacht-knopf.karten-knopf.rund.aktiv { background: #31a354; border-color: #1b5e20; color: #fff; }
.pacht-legende { background: rgba(255,255,255,.94); color: #1f2a1f; padding: 6px 9px; border-radius: 6px; border: 1px solid rgba(0,0,0,.25);
  font: 12px/1.35 system-ui, sans-serif; max-width: 190px; }
.pacht-legende b { display: block; margin-bottom: 3px; }
.pacht-legende span { display: flex; align-items: center; gap: 6px; }
.pacht-legende i { width: 12px; height: 12px; border-radius: 2px; border: 1px solid rgba(0,0,0,.25); flex: none; }
.pacht-legende small { display: block; margin-top: 3px; color: #555; }

/* Online-Auktion (diia.de) in der Versteigerungsliste */
.pf-online { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); margin-right: 4px; }

/* To-do: Fälligkeitsdatum (erscheint im Kalender) */
.pj-todos input.pj-faellig { width: 38px; height: 34px; padding: 0 4px; font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--muted); opacity: .7; }
.pj-todos input.pj-faellig.gesetzt { width: 128px; color: var(--text); opacity: 1; }
.pj-neu { flex-wrap: wrap; }
.pj-neu input[name="text"] { flex: 1 1 60%; }
.pj-neu input.pj-faellig { flex: 1 1 130px; max-width: 170px; color: var(--muted); }

/* ===== Kalender ===== */
.kal-form { display: grid; gap: 10px; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.kal-form h3 { margin: 0; }
.kal-form label { display: block; font-size: 13px; color: var(--muted); }
.kal-form label > input, .kal-form label > textarea { display: block; margin-top: 4px; }
.kal-form input, .kal-form textarea { font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); box-sizing: border-box; width: 100%; min-width: 0; }
.kal-zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kal-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.kal-knoepfe button { padding: 10px 14px; border-radius: 10px; }
.kal-loeschen { margin-left: auto; color: var(--bad, #d9534f); }
.kal-monat { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
.kal-monat strong { font-size: 17px; min-width: 150px; text-align: center; }
.kal-monat > button:not(.link) { width: 38px; height: 38px; border-radius: 10px; font-size: 20px; }
.kal-monat .link { margin-left: auto; }
.kal-gitter { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.kal-wt { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.kal-tag { display: grid; grid-template-rows: auto 10px; justify-items: center; align-content: center; gap: 2px; min-height: 46px; padding: 4px 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.kal-tag.heute { border-color: var(--accent); font-weight: 700; }
.kal-tag.gewaehlt { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-color: var(--accent); }
.kal-punkte { display: flex; gap: 3px; }
.kal-p { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.kal-p.termin { background: #4c9be8; }
.kal-p.frist { background: #e5534b; }
.kal-p.todo { background: #e2a336; }
.kal-p.wiedervorlage { background: #9b7be0; }
.kal-legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin-top: 8px; }
.kal-legende span { display: inline-flex; align-items: center; gap: 5px; }
.kal-liste { display: grid; gap: 8px; }
.kal-eintrag { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: start; text-align: left; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.kal-eintrag.termin { border-left-color: #4c9be8; }
.kal-eintrag.frist { border-left-color: #e5534b; }
.kal-eintrag.todo { border-left-color: #e2a336; }
.kal-eintrag.wiedervorlage { border-left-color: #9b7be0; }
.kal-eintrag.erledigt { opacity: .55; }
.kal-eintrag.erledigt strong { text-decoration: line-through; }
.kal-wann { display: grid; gap: 2px; font-size: 13px; }
.kal-wann span { color: var(--muted); }
.kal-was { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.kal-was small { font-size: 12px; color: var(--muted); }
.kal-was .muted { font-size: 13px; }
.kal-rot { color: #e5534b; }
@media (max-width: 600px) {
  .kal-tag { min-height: 42px; font-size: 14px; }
  .kal-eintrag { grid-template-columns: 62px 1fr; padding: 9px 10px; }
  .kal-monat strong { min-width: 0; flex: 1; }
}

/* Deal-Formular: mehrere Flurstücke (＋ rechts) und Frist/Besichtigung nebeneinander – auch auf dem Handy */
.deal-flure { display: grid; gap: 8px; }
#deal-weitere { display: grid; gap: 8px; }
.deal-flur-zeile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; align-items: end; }
.deal-flur-plus, .deal-flur-weg { width: 44px; height: 42px; border-radius: 10px; font-size: 22px; line-height: 1; padding: 0; cursor: pointer; }
.deal-flur-plus { border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.deal-flur-weg { border: 1px solid var(--line); background: none; color: var(--muted); }
.deal-zwei { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.deal-zwei input { width: 100%; min-width: 0; box-sizing: border-box; }
.dd-besichtigung { margin-top: 6px; }
.kal-p.besichtigung { background: #4c9be8; }
.kal-eintrag.besichtigung { border-left-color: #4c9be8; }

/* Deal-Formular: Grundstücks-Übersicht wie im Preisatlas + vorausgefüllte Antworten */
.deal-flur-info { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); }
.deal-flur-status { font-size: 13px; margin-bottom: 6px; }
.deal-flur-info #flur-info-data { font-size: 14px; }
.deal-vorgabe { position: relative; }
.deal-vorgabe input, .deal-vorgabe select { border-color: var(--accent) !important; }
fieldset.deal-vorgabe legend::after, label.deal-vorgabe::after { content: ' · aus Kataster/Gelände'; font-size: 11px; color: var(--accent); }

/* Offline-Warteschlange für Deals */
.deals-warte { margin-bottom: 10px; }
.deals-warte-kopf { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid var(--warn); font-size: 14px; }
.deals-warte-kopf .link { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.deal-karte.wartet { border-left-color: var(--warn); border-style: dashed; }
nav button.hat-warte::after { content: '⏳'; margin-left: 4px; font-size: 12px; }
#deal-loeschen-ws { color: var(--bad); }
/* Frist-Banner: überfällig rot · 1 Tag vorher / am Tag orange · noch Zeit grün (weiße Schrift, Kontrast ≥ 4,5:1) */
.deal-frist.rot { background: #b3261e; }
.deal-frist.orange { background: #b45309; }
.deal-frist.gruen { background: #2e6b34; }
.deal-frist-wer legend { font-weight: 600; }
