/* ChargeRadar Web-Karte, Farben wie in der App (thema.js) */
:root {
  --bg: #eef2f4; --karte: #ffffff; --text: #12222b; --leise: #5a6d78; --linie: #d5dee3;
  --akzent: #0a6e8a; --akzent-text: #ffffff; --ac: #2f6fd6; --dc: #d98a06; --fehler: #b3261e;
  --gut: #1e7d4f; --voll: #c9b48a;
  --p-ac: #2f6fd6; --p-dc: #e08a00; --p-hpc: #d2481c; --p-ultra: #8a2bb8; --p-gut: #1e9d5f; --p-voll: #8c979d; --p-rand: #ffffff;
  --schatten: 0 2px 10px rgba(0, 0, 0, .15);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d171c; --karte: #15232a; --text: #e4edf1; --leise: #8fa3ad; --linie: #26383f;
    --akzent: #3fb6d6; --akzent-text: #06232c; --ac: #6a9cf0; --dc: #f0aa2e; --fehler: #f2b8b5;
    --gut: #6fd3a0; --voll: #b8a67e;
    --p-voll: #6b777d; --p-rand: #0d171c;
    --schatten: 0 2px 10px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
  .leaflet-tile-pane { filter: brightness(.75) contrast(1.1) saturate(.8); }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#karte { position: fixed; inset: 0; background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--akzent); }

.kopf { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: 760px; }
.kopf > * { pointer-events: auto; }
.suche { display: flex; gap: 6px; position: relative; }
.suche input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--linie);
  background: var(--karte); box-shadow: var(--schatten); font-size: 16px; }
.vorschlaege { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1200; margin: 0; padding: 4px 0;
  list-style: none; background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; box-shadow: var(--schatten);
  max-height: min(60vh, 420px); overflow-y: auto; }
.vorschlaege[hidden] { display: none; }
.vorschlaege li { padding: 8px 14px; cursor: pointer; display: flex; flex-direction: column; min-width: 0; }
.vorschlaege li b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vorschlaege li span { font-size: 13px; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vorschlaege li:hover, .vorschlaege li[aria-selected="true"] { background: var(--bg); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; background: var(--karte); border: 1px solid var(--linie); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; box-shadow: var(--schatten); font-size: 14px; font-weight: 500; }
.chip.an { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-feld { width: 130px; cursor: text; }

.knopf { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 9px 14px;
  cursor: pointer; box-shadow: var(--schatten); font-weight: 600; white-space: nowrap; }
.knopf.voll { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.knopf.leise { box-shadow: none; }
.knopf.rund { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 20px; }
.knopf:focus-visible, .chip:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.leiste { position: fixed; right: 10px; bottom: 34px; z-index: 1000; display: flex; gap: 8px; align-items: center; }
.hinweis { background: var(--karte); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--leise);
  box-shadow: var(--schatten); }

.details { position: fixed; z-index: 1100; background: var(--karte); box-shadow: var(--schatten); overflow-y: auto;
  left: 0; right: 0; bottom: 0; max-height: 60vh; border-radius: 16px 16px 0 0; padding: 18px 18px 30px; }
@media (min-width: 800px) {
  .details { left: auto; top: 10px; right: 10px; bottom: auto; width: 380px; max-height: calc(100vh - 20px); border-radius: 16px; }
  .leiste { bottom: 30px; }
}
.details h2 { margin: 0 32px 2px 0; font-size: 18px; }
.details h3 { margin: 16px 0 6px; font-size: 14px; color: var(--leise); text-transform: uppercase; letter-spacing: .04em; }
.details .unter { color: var(--leise); margin: 0 0 10px; }
.details dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; }
.details dt { color: var(--leise); }
.details dd { margin: 0; }
.details .liste-eintrag { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--linie);
  padding: 10px 0; cursor: pointer; }
.details .preis { font-size: 20px; font-weight: 700; color: var(--gut); }
.details .gesperrt { background: var(--bg); border-radius: 10px; padding: 10px 12px; color: var(--leise); }
.details table { width: 100%; border-collapse: collapse; font-size: 13px; }
.details td { padding: 3px 0; border-top: 1px solid var(--linie); }
.schliessen { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--bg); font-size: 22px; cursor: pointer; }
.marke { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-right: 4px;
  background: var(--bg); }

.laden { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: rgba(0, 0, 0, .25); }
.laden[hidden] { display: none; }
.laden-box { background: var(--karte); padding: 18px 22px; border-radius: 14px; box-shadow: var(--schatten); min-width: 240px; }
.balken { height: 6px; background: var(--linie); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.balken div { height: 100%; width: 5%; background: var(--akzent); transition: width .2s; }

dialog { border: 0; border-radius: 16px; background: var(--karte); color: var(--text); box-shadow: var(--schatten);
  width: min(400px, calc(100vw - 32px)); padding: 20px; }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
dialog h2 { margin: 0 0 6px; font-size: 18px; }
dialog label { display: block; margin: 12px 0; }
dialog input[type=password] { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--linie); background: var(--bg); font-size: 16px; }
dialog .haken { display: flex; gap: 8px; align-items: center; color: var(--leise); }
.reihe { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.fehler { color: var(--fehler); }

/* Pins: Zahl = kW, Farbe nach Leistungsklasse (wie in der App) */
.pin-halter { position: absolute; transform: translate(-50%, calc(-100% - 6px)); cursor: pointer; }
.pin { position: relative; min-width: 30px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--pf);
  border: 1.5px solid var(--p-rand); color: #fff; font: 800 12px/19px system-ui, sans-serif; text-align: center;
  white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.pin::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -5px;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--pf); }
.pin.an { min-width: 38px; height: 28px; line-height: 23px; font-size: 14px; border: 3px solid var(--text); }
.pin.an::after { border-top-color: var(--text); }
.legende { display: grid; gap: 6px; margin: 8px 0 4px; }
.legende div { display: flex; gap: 10px; align-items: center; }
.legende i { flex: none; width: 28px; height: 18px; border-radius: 9px; background: var(--pf); }
dialog.info { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
dialog.info h3 { font-size: 15px; margin: 16px 0 4px; }
dialog.info p { margin: 4px 0; }
.info-reiter { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.fuss button { background: none; border: 0; padding: 0; color: var(--akzent); text-decoration: underline; cursor: pointer; font-size: 12px; }

.fuss { position: fixed; left: 0; bottom: 0; z-index: 900; font-size: 12px; padding: 3px 8px; color: var(--leise);
  background: color-mix(in srgb, var(--karte) 85%, transparent); border-top-right-radius: 8px; }
.leaflet-control-attribution { font-size: 11px; }
.leaflet-container { font: inherit; }
.leaflet-bottom.leaflet-right { bottom: 0; }

/* Bündel (Cluster) */
.buendel { display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 12px;
  background: color-mix(in srgb, var(--akzent) 85%, transparent); border: 3px solid color-mix(in srgb, var(--akzent) 35%, transparent);
  background-clip: padding-box; }

/* Unterseiten (Impressum, Datenschutz) */
.seite { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.seite h1 { font-size: 24px; }
.seite h2 { font-size: 18px; margin-top: 28px; }
.platzhalter { background: #fff3b0; color: #5a4800; padding: 0 4px; border-radius: 4px; }

/* Adminbereich */
.admin-karte { max-width: 380px; }
.admin-karte input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--linie); background: var(--karte); font-size: 16px; }
.tabelle-rahmen { overflow-x: auto; }
.admin-tabelle { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-tabelle th { text-align: left; font-size: 13px; color: var(--leise); padding: 6px 4px; }
.admin-tabelle td { padding: 4px; vertical-align: middle; border-top: 1px solid var(--linie); }
.admin-tabelle input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--linie); background: var(--karte); }
.admin-tabelle td.unter { font-size: 13px; max-width: 220px; }
.reihe.links { justify-content: flex-start; flex-wrap: wrap; }
.unter { color: var(--leise); }
/* Auswahllisten: jede Zeile als Karte mit beschrifteten Feldern, bricht um statt seitlich zu scrollen */
.admin-tabelle.karten { min-width: 0; }
.admin-tabelle.karten tbody { display: block; }
.admin-tabelle.karten tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 8px; padding: 10px 0; border-top: 1px solid var(--linie); }
.admin-tabelle.karten tr[hidden] { display: none; }
.admin-tabelle.karten td { border: 0; padding: 0; display: block; }
.admin-tabelle.karten td.kurz { min-width: 0; }
.admin-tabelle.karten td:last-child { align-self: end; }
.admin-tabelle.karten label { display: block; font-size: 12px; color: var(--leise); }
.admin-tabelle.karten label input { margin-top: 2px; color: var(--text); font-size: 15px; }
.filter-feld { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--linie); background: var(--karte); min-width: 220px; }
.leaflet-bottom.leaflet-left { bottom: 24px; }

/* Markierter Punkt und Liste „In der Nähe“ */
.punkt-marke { width: 26px; height: 26px; background: #d93025; border: 3px solid #fff; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.leaflet-container.markieren, .leaflet-container.markieren .leaflet-interactive { cursor: crosshair; }
.knopf.an { background: var(--text); color: var(--bg); border-color: var(--text); }
.knopf.rund { font-size: 18px; }
.zurueck { background: none; border: 0; padding: 0; margin: 0 0 8px; color: var(--akzent); font-weight: 600; cursor: pointer; }
.details .liste-eintrag { position: relative; padding-right: 64px; }
.details .liste-eintrag .abstand { position: absolute; right: 0; top: 10px; color: var(--leise); font-size: 13px; }
.details .liste-eintrag.hervor { border: 2px solid var(--gut); border-radius: 10px; padding: 10px 70px 10px 12px; }
.details .liste-eintrag.hervor .abstand { right: 10px; }
.preis-klein { color: var(--gut); font-weight: 600; }
/* Schmale Bildschirme: Quellen stehen unter „Info“, damit die Fußzeile einzeilig bleibt und nicht unter den Knöpfen liegt */
@media (max-width: 700px) { .fuss #quelle, .fuss .quelle-trenner { display: none; } }
@media (max-width: 420px) { .leiste .hinweis { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
@media (min-width: 800px) { body:has(.details:not([hidden])) .leiste { right: 400px; } }
.info-reiter a.chip { text-decoration: none; color: inherit; }
.betreiber-dialog { width: min(480px, calc(100vw - 24px)); }
.betreiber-dialog input[type=search] { display: block; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--linie);
  background: var(--bg); font-size: 16px; margin-top: 8px; }
.betreiber-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 4px; }
.betreiber-liste { max-height: min(50vh, 420px); overflow-y: auto; border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.betreiber-liste label { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--linie); cursor: pointer; }
.betreiber-liste label:last-child { border-bottom: 0; }
.betreiber-liste input { width: 18px; height: 18px; flex: none; accent-color: var(--akzent); }
.betreiber-liste span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.betreiber-liste small { color: var(--leise); flex: none; }
/* Adminbereich als Akkordeon: jeder Abschnitt klappt einzeln auf, der Zustand bleibt im Browser */
.abschnitt { border: 1px solid var(--linie); border-radius: 12px; margin: 12px 0; padding: 0 14px; background: var(--karte); }
.abschnitt > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 0; font-weight: 700; font-size: 17px; }
.abschnitt > summary::-webkit-details-marker { display: none; }
.abschnitt > summary::before { content: '▸'; color: var(--leise); transition: transform .15s; flex: none; }
.abschnitt[open] > summary::before { transform: rotate(90deg); }
.abschnitt[open] > summary { border-bottom: 1px solid var(--linie); margin-bottom: 8px; }
.abschnitt-titel { flex: 1; min-width: 0; }
.abschnitt-zahl { font-size: 13px; font-weight: 600; color: var(--leise); white-space: nowrap; }
.abschnitt[open] { padding-bottom: 12px; }
.abschnitt-steuerung { margin-top: 4px; }
.admin-tabelle.karten td.breit { grid-column: 1 / -1; }
.hilfe { padding-left: 20px; margin: 0 0 8px; } .hilfe li { margin: 2px 0; }
