/* Wegwarte · öffentliche Kartenanwendung */

body.app { height: 100dvh; display: grid; grid-template-rows: auto auto 1fr; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.ohne-js { margin: 1rem; }
.sym { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; flex: none; }
.sym svg { width: 100%; height: 100%; }

/* Kopf */
.kopf { min-width: 0; display: flex; align-items: center; gap: .75rem 1.25rem; padding: .55rem 1rem; background: var(--flaeche); border-bottom: 1px solid var(--linie);
  position: relative; z-index: 20; flex-wrap: wrap; }
.marke { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--tinte); flex: none; }
.marke img { width: 40px; height: 40px; }
.marke-text { display: flex; flex-direction: column; line-height: 1.1; }
.marke-text strong { font-size: 1.3rem; letter-spacing: -0.02em; }
.marke-text span { font-size: .8rem; color: var(--tinte-3); font-weight: 600; letter-spacing: .01em; }
.hauptnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem; }
.hauptnav a { display: block; padding: .5rem .75rem; border-radius: var(--radius-klein); color: var(--tinte-2); text-decoration: none; font-weight: 600; }
.hauptnav a:hover { background: var(--flaeche-2); color: var(--tinte); }
.hauptnav a[aria-current="page"] { color: var(--akzent-stark); background: var(--akzent-hell); }
.kopf-rechts { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.melden-knopf[aria-current="page"] { box-shadow: 0 0 0 3px var(--flaeche), 0 0 0 5px var(--akzent); }
.melden-knopf .sym { width: 1.3em; height: 1.3em; }
.melden-knopf .kurz-text { display: none; }

/* Bühne: Karte + Seitenleiste */
.buehne { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 32vw, 460px); min-height: 0; outline: none; }
.kartenbereich { position: relative; min-height: 0; background: var(--flaeche-3); }
.karte { position: absolute; inset: 0; outline: none; }
.karte:focus-visible { outline: 3px solid var(--fokus); outline-offset: -3px; }
.seitenleiste { position: relative; background: var(--flaeche); border-left: 1px solid var(--linie); min-height: 0; overflow: auto; overscroll-behavior: contain; }
.griff { display: none; }
.ansicht { padding: 1.25rem 1.25rem 2.5rem; }
.ansicht > h1:first-child, .ansicht > header:first-child h1 { margin-top: .25rem; }

/* Kartensuche */
.kartensuche { position: absolute; left: .75rem; top: .75rem; width: min(380px, calc(100% - 5.5rem)); z-index: 9; }
.kartensuche input { padding-left: 2.4rem; box-shadow: var(--schatten); border-color: var(--rand-feld); border-radius: 999px; }
.suchsym { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--tinte-3); width: 1.1rem; height: 1.1rem; pointer-events: none; }
.suchliste { list-style: none; margin: .3rem 0 0; padding: .3rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  box-shadow: var(--schatten-stark); max-height: 50vh; overflow: auto; }
.suchliste li { padding: .5rem .65rem; border-radius: var(--radius-klein); cursor: pointer; display: flex; justify-content: space-between; gap: .75rem; }
.suchliste li[aria-selected="true"], .suchliste li:hover { background: var(--akzent-hell); }
.suchliste .art { color: var(--tinte-3); font-size: .85rem; white-space: nowrap; }

/* Werkzeuge */
.werkzeuge { position: absolute; right: .75rem; top: .75rem; display: flex; flex-direction: column; gap: .35rem; z-index: 5; }
.wz { width: 44px; height: 44px; border-radius: var(--radius-klein); border: 1px solid var(--rand-feld); background: var(--flaeche); color: var(--tinte);
  box-shadow: var(--schatten); display: grid; place-items: center; cursor: pointer; padding: 0; }
.wz .sym { width: 22px; height: 22px; }
.wz:hover { background: var(--flaeche-2); }
.wz[aria-pressed="true"], .wz[aria-expanded="true"] { background: var(--akzent); color: var(--auf-akzent); border-color: var(--akzent); }
.tastaturhilfe { position: absolute; right: 4.2rem; top: .75rem; width: min(330px, calc(100% - 5.5rem)); z-index: 6; box-shadow: var(--schatten-stark); font-size: .9375rem; }
.tastaturhilfe dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; margin-bottom: .5rem; }
.tastaturhilfe dt { white-space: nowrap; }
.tastaturhilfe dd { margin: 0; }

/* Fadenkreuz in der Kartenmitte (Melden, Messen) */
.fadenkreuz { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; transform: translate(-50%, -50%); pointer-events: none; z-index: 4; }
.fadenkreuz::before, .fadenkreuz::after { content: ''; position: absolute; background: var(--fokus); box-shadow: 0 0 0 2px #fff, 0 0 6px rgb(0 0 0 / .35); border-radius: 2px; }
.fadenkreuz::before { left: 50%; top: 0; bottom: 0; width: 3px; transform: translateX(-50%); }
.fadenkreuz::after { top: 50%; left: 0; right: 0; height: 3px; transform: translateY(-50%); }
.fadenkreuz.ziel { border: 2px solid var(--fokus); border-radius: 50%; }

.messleiste { position: absolute; left: 50%; bottom: 2.75rem; transform: translateX(-50%); z-index: 6; box-shadow: var(--schatten-stark);
  width: min(560px, calc(100% - 1.5rem)); padding: .75rem .9rem; }
.messleiste .wert { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.messleiste .knopfreihe { margin-top: .5rem; }

.massstab { position: absolute; left: .75rem; bottom: .75rem; z-index: 3; background: color-mix(in srgb, var(--flaeche) 88%, transparent);
  padding: .3rem .5rem .2rem; border-radius: 4px; }
.ms-balken { display: flex; height: 7px; border: 1.5px solid var(--tinte); }
.ms-balken span { flex: 1; background: var(--tinte); }
.ms-balken span + span { background: var(--flaeche); }
.ms-text { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; position: relative; }
.ms-text span { transform: translateX(-30%); }
.ms-text .ms-ende { transform: translateX(40%); }
.kartenquelle { position: absolute; right: .5rem; bottom: .4rem; margin: 0; font-size: .75rem; background: color-mix(in srgb, var(--flaeche) 85%, transparent);
  padding: .1rem .45rem; border-radius: 4px; color: var(--tinte-2); z-index: 3; }

/* Inhalte der Seitenleiste */
.einleitung { font-size: 1.05rem; color: var(--tinte-2); }
.kennzahlen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: 1rem 0 1.25rem; padding: 0; list-style: none; }
.kennzahlen li { background: var(--flaeche-2); border-radius: var(--radius); padding: .7rem .8rem; }
.kennzahlen strong { display: block; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kennzahlen span { display: block; color: var(--tinte-2); font-size: .9rem; text-wrap: balance; }
.abschnitt { border-top: 1px solid var(--linie); padding-top: 1rem; margin-top: 1.25rem; }
.abschnitt > h2 { font-size: 1.05rem; }

/* Ebenen und Legende */
.ebenen { list-style: none; margin: 0; padding: 0; }
.ebenen > li { margin-bottom: .75rem; }
.ebenen .gruppe { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tinte-3); margin: .5rem 0 .3rem; }
.ebene { display: grid; grid-template-columns: auto 34px 1fr; gap: .55rem; align-items: center; padding: .3rem .2rem; border-radius: var(--radius-klein); font-weight: 600; }
.ebene:hover { background: var(--flaeche-2); }
.ebene input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--akzent); }
.ebene .muster { width: 34px; height: 22px; display: grid; place-items: center; }
.ebene .muster img, .ebene .muster svg { max-width: 100%; max-height: 100%; }
.legende { list-style: none; margin: .3rem 0 .4rem 2.7rem; padding: 0; display: grid; gap: .25rem; font-size: .875rem; color: var(--tinte-2); }
.legende li { display: flex; gap: .5rem; align-items: center; }
.legende .muster { width: 30px; height: 18px; flex: none; display: grid; place-items: center; }

/* Filter */
.filter { display: grid; gap: .9rem; }
.filter .kacheln { display: flex; flex-wrap: wrap; gap: .35rem; }
.filter .kachel { position: relative; }
.filter .kachel input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.filter .kachel > span { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .65rem .35rem .45rem; border: 1.5px solid var(--linie-stark); border-radius: 999px;
  font-size: .9rem; font-weight: 600; background: var(--flaeche); }
.filter .kachel > span .sym { width: 1.1rem; height: 1.1rem; color: var(--akzent); }
.filter .kachel input:checked + span, .filter .kachel input:checked + span .sym { background: var(--akzent-hell); border-color: var(--akzent); color: var(--akzent-stark); }
.filter .kachel input:focus-visible + span { outline: 3px solid var(--fokus); outline-offset: 2px; }
.filter .kachel input:checked + span::after { content: '✓'; font-weight: 700; margin-left: .1rem; }
.filter .zeile { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.treffer { font-weight: 700; }
.filter-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: .75rem 1rem; }
.filter-raster .feld { margin: 0; }
.filterkasten > summary { cursor: pointer; font-weight: 700; padding: .2rem 0; }
.filterkasten[open] > summary { margin-bottom: .75rem; }
.nur-schmal { display: none; }
@media (max-width: 600px) { .nur-schmal { display: block; } }
.kasten.filter .treffer { margin: .9rem 0 0; }

/* Karten-Popup und Hinweis */
.karteninfo { display: grid; gap: .25rem; }
.hinweis-kopf { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .75rem; }
.hinweis-kopf .kreis { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.hinweis-kopf .kreis svg { width: 26px; height: 26px; }
.hinweis-kopf h1 { overflow-wrap: normal; }
.hinweis-kopf h1 .vorgang-nr { font-size: .78em; letter-spacing: 0; }
.status-text { color: var(--tinte-2); }
.kreis.offen { background: var(--st-offen); } .kreis.in_arbeit { background: var(--st-in-arbeit); color: #1A1300; }
.kreis.erledigt { background: var(--st-erledigt); } .kreis.nicht_umsetzbar { background: var(--st-nicht); } .kreis.intern { background: var(--tinte-3); }
.hinweis-text { font-size: 1.05rem; white-space: pre-line; background: var(--flaeche-2); padding: .8rem .9rem; border-radius: var(--radius); margin: .75rem 0; }
.zeitleiste { list-style: none; margin: .5rem 0 1rem; padding: 0 0 0 1.4rem; position: relative; }
.zeitleiste::before { content: ''; position: absolute; left: .45rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--linie-stark); }
.zeitleiste li { position: relative; margin-bottom: .9rem; }
.zeitleiste li::before { content: ''; position: absolute; left: -1.22rem; top: .35rem; width: .8rem; height: .8rem; border-radius: 50%;
  background: var(--flaeche); border: 2px solid var(--akzent); }
.zeitleiste li.erledigt::before { background: var(--st-erledigt); border-color: var(--st-erledigt); }
.zeitleiste li.nicht_umsetzbar::before { background: var(--st-nicht); border-color: var(--st-nicht); }
.zeitleiste li.in_arbeit::before { background: var(--st-in-arbeit); border-color: var(--st-in-arbeit); }
.zeitleiste time { display: block; color: var(--tinte-3); font-size: .85rem; }
.zeitleiste .antwort { background: var(--akzent-hell); border-radius: var(--radius-klein); padding: .55rem .7rem; margin-top: .3rem; white-space: pre-line; }
.amtsantwort { background: var(--akzent-hell); border-left: 4px solid var(--akzent); border-radius: var(--radius-klein); padding: .7rem .9rem; margin: .5rem 0 1rem; white-space: pre-line; }
.amtsantwort > strong { display: block; margin-bottom: .2rem; }
.danke { color: var(--erfolg); font-weight: 700; }
/* kurze Meldung direkt an der Karte (Standort, Suche) */
.kartenmeldung { position: absolute; left: 50%; top: 4.1rem; transform: translateX(-50%); z-index: 7; max-width: min(460px, calc(100% - 6rem));
  box-shadow: var(--schatten-stark); padding: .55rem .8rem; font-size: .9375rem; }
.zurueck { min-height: 44px; }

/* Listen in der Seitenleiste */
.kartenliste { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.kartenliste a { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; padding: .7rem .8rem; border: 1px solid var(--linie);
  border-radius: var(--radius); text-decoration: none; color: var(--tinte); background: var(--flaeche); }
.kartenliste a:hover { border-color: var(--akzent); background: var(--akzent-hell); }
.kartenliste .kreis { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; grid-row: span 2; }
.kartenliste .kreis svg { width: 20px; height: 20px; }
.kartenliste .zeile1 { font-weight: 700; display: flex; justify-content: space-between; gap: .5rem; }
.kartenliste .zeile2 { color: var(--tinte-2); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Melden-Assistent */
.schritte { list-style: none; display: flex; gap: .3rem; padding: 0; margin: 0 0 1.25rem; counter-reset: schritt; }
.schritte li { flex: 1; height: 6px; border-radius: 3px; background: var(--flaeche-3); }
.schritte li.fertig { background: var(--akzent); }
.schritte li.aktuell { background: var(--akzent-mittel); }
.wahl { display: grid; gap: .45rem; }
.wahl label { display: grid; grid-template-columns: auto 34px 1fr; gap: .7rem; align-items: center; padding: .65rem .75rem; border: 1.5px solid var(--linie);
  border-radius: var(--radius); font-weight: 600; cursor: pointer; background: var(--flaeche); margin: 0; }
.wahl label:hover { border-color: var(--tinte-3); }
.wahl label:has(input:checked) { border-color: var(--akzent); background: var(--akzent-hell); }
.wahl input { width: 1.2rem; height: 1.2rem; accent-color: var(--akzent); margin: 0; }
.wahl .sym { width: 30px; height: 30px; color: var(--akzent); }
.wahl small { display: block; font-weight: 400; color: var(--tinte-2); }
.zaehler { text-align: right; font-size: .85rem; color: var(--tinte-3); }
/* Weiter/Zurück kleben unten am Blatt: auf dem Telefon immer erreichbar, ohne erst zu scrollen */
.aktionsleiste .leiste-fehler { flex-basis: 100%; margin: 0; }
.aktionsleiste .leiste-fehler:empty { display: none; }
.aktionsleiste { position: sticky; bottom: 0; z-index: 3; background: var(--flaeche); margin: 1rem -1.25rem 0; padding: .7rem 1.25rem calc(.7rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--linie); }
.vorschau-foto { max-height: 240px; width: auto; border-radius: var(--radius); border: 1px solid var(--linie); display: block; margin: .5rem 0; }
.bestaetigung { text-align: center; padding-top: .5rem; }
.bestaetigung .vorgang-nr { font-size: 1.6rem; display: block; margin: .3rem 0 .8rem; }

/* Maßnahmen */
.massnahme-karte { border: 1px solid var(--linie); border-radius: var(--radius); padding: .8rem .9rem; margin-bottom: .6rem; background: var(--flaeche); }
.massnahme-karte h3 { margin-bottom: .3rem; }
.massnahme-karte .status, .ansicht > p > .status { white-space: normal; }
.massnahme-karte .zeile { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; font-size: .9rem; color: var(--tinte-2); }

/* Volle Seiten (Projekt, Daten, Technik …) nutzen die ganze Breite */
.buehne.seite { grid-template-columns: minmax(0, 1fr); overflow: auto; }
.buehne.seite .kartenbereich { display: none; }
.buehne.seite .seitenleiste { border: 0; background: var(--papier); overflow: visible; }
/* alle Textseiten mit derselben Spalte, damit Kopf und Inhalt beim Seitenwechsel nicht springen */
.buehne.seite .ansicht, .buehne.seite .ansicht.breit { max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.prosa { max-width: 70ch; }
.prosa h2 { margin-top: 2rem; }
.raster-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.endpunkt { margin: .4rem 0 1rem; font-family: var(--mono); font-size: .9rem; background: var(--flaeche-2); padding: .5rem .7rem; border-radius: var(--radius-klein); display: block; overflow-wrap: anywhere; }

details.abschnitt > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .2rem 0; }
details.abschnitt > summary::-webkit-details-marker { display: none; }
details.abschnitt > summary::after { content: ''; width: .6rem; height: .6rem; border-right: 2px solid var(--tinte-2); border-bottom: 2px solid var(--tinte-2); transform: rotate(45deg); margin-right: .3rem; transition: transform .15s; }
details.abschnitt[open] > summary::after { transform: rotate(-135deg); }
details.abschnitt > summary h2.inline { display: inline; margin: 0; font-size: 1.05rem; }
details.abschnitt[open] > summary { margin-bottom: .75rem; }
.fuss { border-top: 1px solid var(--linie); margin-top: 2rem; padding-top: 1rem; }
.fuss nav { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; }
.fuss a { color: var(--tinte-2); }
.matrix td { text-align: center; }
.matrix .ja { display: inline-grid; width: 1.4rem; height: 1.4rem; place-items: center; border-radius: 50%; background: var(--erfolg-hell); color: var(--erfolg); }
.matrix .ja svg { width: .95rem; height: .95rem; }
.leicht { font-size: 1.15rem; line-height: 1.7; }
.leicht p { margin-bottom: .6em; }

/* Mobil: Karte voll, Seitenleiste als Blatt von unten */
@media (max-width: 860px) {
  body.app { grid-template-rows: auto auto 1fr; }
  .kopf { padding: .45rem .75rem; gap: .4rem .75rem; }
  .marke img { width: 34px; height: 34px; }
  .marke-text span { display: none; }
  .hauptnav { order: 3; width: 100%; }
  .hauptnav ul { flex-wrap: wrap; }
  .hauptnav a { padding: .4rem .5rem; font-size: .95rem; }
  .hauptnav .nur-breit { display: none; }
  .melden-knopf { padding: .5rem .7rem; }
  .buehne { grid-template-columns: 1fr; }
  .seitenleiste { position: absolute; left: 0; right: 0; bottom: 0; height: 42%; border-left: 0; border-top: 1px solid var(--linie);
    border-radius: 16px 16px 0 0; box-shadow: var(--schatten-stark); z-index: 8; transition: height .2s; }
  .seitenleiste.gross { height: calc(100% - .75rem); }
  .griff { display: grid; place-items: center; width: 100%; height: 28px; background: none; border: 0; cursor: pointer; position: sticky; top: 0; z-index: 2;
    background: var(--flaeche); border-radius: 16px 16px 0 0; }
  .griff span { width: 44px; height: 5px; border-radius: 3px; background: var(--linie-stark); }
  .ansicht { padding: .25rem 1rem 2rem; }
  .aktionsleiste { margin-left: -1rem; margin-right: -1rem; padding-left: 1rem; padding-right: 1rem; }
  .kartenbereich { height: 100%; }
  .karte { bottom: 0; }
  .werkzeuge { top: 4.1rem; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; left: .75rem; pointer-events: none; }
  .werkzeuge .wz { pointer-events: auto; }
  .suchliste { max-height: 38vh; }
  .kartenmeldung { top: 7.4rem; max-width: calc(100% - 1.5rem); }
  .seitenleiste.hoch { height: 72%; }
  .melden-knopf .lang-text { display: none; }
  .melden-knopf .kurz-text { display: inline; }
  .tastaturhilfe { top: 7.4rem; right: .75rem; width: calc(100% - 1.5rem); }
  .kartensuche { width: calc(100% - 1.5rem); }
  .massstab { bottom: calc(42% + .5rem); }
  .buehne[data-blatt="hoch"] .massstab { bottom: calc(72% + .5rem); }
  .kartenquelle { display: none; }
  .messleiste { bottom: calc(42% + 3.5rem); }
  .buehne.seite .seitenleiste { position: static; height: auto; border-radius: 0; box-shadow: none; }
  .buehne.seite .griff { display: none; }
}
@media (max-width: 380px) {
  .hauptnav a { padding: .35rem .4rem; font-size: .9rem; }
  .melden-knopf .kurz-text { display: none; }
}
@media (max-width: 400px) {
  .kennzahlen strong { font-size: 1.35rem; }
  .filter .zeile { grid-template-columns: minmax(0, 1fr); }
}
/* B2: bei starker Vergrößerung (wenig Höhe) darf die Seite scrollen, damit Werkzeuge und Blatt erreichbar bleiben */
@media (max-height: 560px) {
  body.app { height: auto; min-height: 100dvh; overflow: auto; }
  .buehne { min-height: 520px; }
}

.musterhinweis .kurz { display: none; }
@media (max-width: 600px) {
  .musterhinweis .lang { display: none; }
  .musterhinweis .kurz { display: inline; }
}
