/* Laadio charger map (/kaart/, /en/map/, /de/karte/). Loaded after site.css and leaflet.css.
   Desktop: panel left (search, filters, list or detail), map right, full height under the header.
   Phones (≤760px): search and filters above the map, the list as a bottom sheet over it. */
:root { --bad: #D92D3A; --unk: #6B7280; --peek: 150px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bad: #EF5A64; --unk: #9AA3B2; } }
:root[data-theme="dark"] { --bad: #EF5A64; --unk: #9AA3B2; }

.map-page .top { padding-block: 12px; border-bottom: 1px solid var(--line); }
.map-page .top .wrap { max-width: none; }

.mapapp { position: relative; display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - var(--hdr, 65px)); height: calc(100dvh - var(--hdr, 65px)); border-bottom: 1px solid var(--line); }
.mapbar { grid-column: 1; grid-row: 1; display: grid; gap: 12px; padding: 16px 16px 14px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mapbar-row { display: flex; gap: 8px; align-items: flex-start; }
.mapwrap { grid-column: 2; grid-row: 1 / 3; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--paper); }
.sheet { grid-column: 1; grid-row: 2; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); }
.sheet-handle { display: none; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* Search */
.msearch { position: relative; flex: 1; min-width: 0; display: flex; gap: 8px; }
.msearch input { flex: 1; min-width: 0; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 500 15.5px var(--sans); padding: 0 12px; }
.msearch input::placeholder { color: var(--dim); }
.msearch-res { position: absolute; z-index: 1200; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.msearch-res button, .msearch-res p { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); font: 500 15px/1.35 var(--sans); padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.msearch-res p { color: var(--dim); cursor: default; }
.msearch-res button:hover, .msearch-res button:focus-visible { background: var(--paper); }
#mlocate[aria-busy="true"] { opacity: .6; }
.mlocate { flex: none; padding: 0 11px; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 14px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"], .chip-select.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-select { position: relative; padding: 0; }
.chip-select select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; min-height: 34px; padding: 0 30px 0 14px; border-radius: 999px; cursor: pointer; }
.chip-select::after { content: ""; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); pointer-events: none; }
.chip-select select option { color: #111827; background: #FFFFFF; }
.chip-select:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.chip-select select:focus-visible { outline: none; }

/* List */
.mlist-head { display: grid; gap: 2px; padding: 16px 16px 8px; }
.mlist-head h2, .mdetail h2 { font-size: 19px; letter-spacing: -0.01em; }
.mstatus { color: var(--dim); font-size: 14px; min-height: 1.5em; }
.sites { list-style: none; margin: 0; padding: 0; }
.site { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--ink); font: inherit; padding: 12px 16px; cursor: pointer; }
.site:hover, .site.sel { background: var(--paper); }
.site:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.site .glyph { margin-top: 5px; }
.site-main, .site-side { display: grid; gap: 1px; min-width: 0; }
.site-addr { font-weight: 600; font-size: 15.5px; line-height: 1.35; overflow-wrap: anywhere; }
.site-sub { color: var(--dim); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.site-side { text-align: right; }
.site-price { font-weight: 700; font-size: 15.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.site-free { font-size: 13.5px; color: var(--dim); white-space: nowrap; }
.site-free.free { color: var(--mark); font-weight: 600; }
.mnote { padding: 12px 16px 20px; color: var(--dim); font-size: 13.5px; border-top: 1px solid var(--line); }

/* Status glyphs: shape and colour both carry the status */
.glyph { display: inline-block; flex: none; width: 12px; height: 12px; vertical-align: -1px; }
.glyph-free { color: var(--mark); } .glyph-busy { color: var(--busy); } .glyph-broken { color: var(--bad); } .glyph-unknown { color: var(--unk); }

/* Detail panel: the charger page's structure, compacted for the panel */
.mdetail { padding: 0; display: block; }
.mdetail[hidden] { display: none; }
.pd { display: grid; gap: 10px; padding: 16px 16px 4px; }
.pd p { font-size: 15px; }
.pd .dim { color: var(--dim); font-size: 14px; }
.pd h3 { font-size: 17px; margin-top: 8px; }
.pd-head { gap: 6px; padding-top: 14px; }
.pd-title { display: flex; align-items: flex-start; gap: 10px; }
.pd-title h2 { flex: 1; min-width: 0; font-size: 24px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.pd-title h2:focus { outline: none; }
.pd-close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: -4px -6px 0 0; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.pd-close:hover { border-color: var(--accent); }
.pd-sub { color: var(--dim); font-size: 16px !important; }
.pd .charger-status { font-size: 15px; margin-top: 2px; }
.charger-status.st-broken strong { color: var(--bad); }
.charger-status.st-broken strong::before { border-radius: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 2l8 8M10 2l-8 8' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 2l8 8M10 2l-8 8' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.pd .table-wrap { border-radius: 12px; }
.pd table.data { font-size: 14.5px; }
.pd table.data th, .pd table.data td { padding: 9px 12px; }
.pd table.data td:first-child { min-width: 0; }
.pd table.data .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pd table.facts td:first-child { width: 34%; }
.nw { white-space: nowrap; }
.pd-meta { display: block; color: var(--dim); font-size: 13px; font-weight: 400; margin-top: 1px; }
.pd-tag { display: inline-block; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--dim); font-size: 12px; font-weight: 600; line-height: 1.5; vertical-align: 1px; }
.pd-note { color: var(--dim); font-size: 13.5px !important; }
.pd-actions { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 8px; margin-top: 16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line); }
.pd-actions .btn { flex: 1; }
.sk-rows { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.sk { display: block; height: 40px; background: var(--surface); position: relative; }
.sk::after { content: ""; position: absolute; left: 12px; right: 40%; top: 15px; height: 10px; border-radius: 5px; background: var(--line); animation: sk 1.2s ease-in-out infinite alternate; }
.sk:nth-child(2n)::after { right: 25%; }
@keyframes sk { from { opacity: 1; } to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }

/* Map overlays and Leaflet theming */
.map-hint { position: absolute; z-index: 900; top: 14px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 120px); margin: 0; padding: 9px 14px; border-radius: 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-size: 14.5px; font-weight: 600; text-align: center; }
.leaflet-container { font-family: var(--sans); background: var(--paper); }
.leaflet-container a { color: var(--accent); }
.leaflet-bar { border: 1px solid var(--line) !important; border-radius: 12px !important; overflow: hidden; box-shadow: none !important; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--ink); border-bottom-color: var(--line); width: 36px; height: 36px; line-height: 34px; }
.leaflet-bar a:hover { background: var(--paper); }
.leaflet-control-attribution { background: var(--surface) !important; color: var(--dim); font-size: 11.5px; }
.leaflet-control-attribution a { color: var(--dim); }

@media (max-width: 760px) {
  .map-page .top { padding-block: 8px; }
  .mapapp { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  .mapbar { grid-column: 1; border-right: 0; padding: 10px 16px; gap: 10px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .mapwrap { grid-column: 1; grid-row: 2; }
  .sheet { position: absolute; z-index: 1100; left: 0; right: 0; bottom: 0; height: min(72%, 600px); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0;
    transform: translateY(calc(100% - var(--peek))); transition: transform .22s ease; }
  .sheet[data-state="open"] { transform: none; }
  .sheet[data-state="peek"] .sheet-body { overflow: hidden; }
  .sheet-handle { display: flex; justify-content: center; align-items: center; flex: none; height: 22px; border: 0; background: none; cursor: pointer; padding: 0; }
  .sheet-handle .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
  .mlist-head { padding-top: 2px; }
  .mapwrap .leaflet-bottom { bottom: calc(var(--peek) - 2px); }
  .map-hint { max-width: calc(100% - 80px); }
}
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }


/* Detail panel v2: summary first, icons, tiles, folded details */
.ic { width: 18px; height: 18px; flex: none; color: var(--dim); }
.pd-stats { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 15.5px; }
.pd-stats li { display: inline-flex; align-items: center; gap: 6px; }
.pd-stats .glyph { width: 12px; height: 12px; }
.pd-stats .dim { font-size: 13.5px; }
.pd-warn { display: flex; gap: 6px; align-items: center; margin-top: 8px; color: var(--busy); font-size: 14px; }
.pd-warn .ic { color: var(--busy); }
.pd-head .pd-actions { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; padding: 0; border: 0; background: none; box-shadow: none; }
.pd-actions .btn { gap: 6px; }
.pd-actions .btn .ic { width: 16px; height: 16px; color: currentColor; }
.pd h3 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pd h3 .dim { font-weight: 500; font-size: 13px; }
.tiles { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.tile { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; }
.tile .glyph { width: 12px; height: 12px; }
.tile[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tile-info { min-height: 1.4em; font-size: 13.5px; margin-bottom: 4px; }
.pd-line { display: flex; align-items: center; gap: 8px; font-size: 14.5px; margin-top: 4px; }
.cardlist { list-style: none; margin: 6px 0 0; padding: 0; }
.cardlist li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.cardlist li:first-child { border-top: 0; }
.cardlist strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 6px 0; border: 0; background: none; color: var(--accent); font: 600 14.5px var(--sans); cursor: pointer; }
.link-btn .ic { width: 14px; height: 14px; color: currentColor; }
.pd-more summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 600; padding: 4px 0; }
.pd-more summary::-webkit-details-marker { display: none; }
.pd-more summary .ic:last-child { margin-left: auto; transition: transform .15s; }
.pd-more[open] summary .ic:last-child { transform: rotate(180deg); }
.facts-list { list-style: none; margin: 8px 0 0; padding: 0; }
.facts-list li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.facts-list li:first-child { border-top: 0; }
.facts-list li > div { display: grid; gap: 1px; min-width: 0; }
.facts-list .dim { font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .pd-more summary .ic:last-child { transition: none; } }
.cardlist li[hidden] { display: none; }
.tile-info:empty { display: none; }

/* Charge cards as wallet cards (same look as the app) */
.wcard { color: var(--cf); background: var(--cb); border: 1px solid rgba(0, 0, 0, .08); }
.wcard-face { aspect-ratio: 85.6 / 54; border-radius: 16px; padding: 14px 16px 16px; display: flex; flex-direction: column; justify-content: space-between; margin-top: 8px; }
.wc-top { display: grid; gap: 1px; min-width: 0; }
.wc-brand { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-plan { font-size: 13px; font-weight: 600; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.wc-bottom .ic { width: 26px; height: 26px; color: var(--cf); opacity: .7; }
.wc-price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; display: block; line-height: 1.1; }
.wc-unit { font-size: 12.5px; opacity: .78; font-weight: 600; }
.wstack { list-style: none; margin: -14px 0 0; padding: 0; position: relative; }
.wcard-strip { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-radius: 16px 16px 0 0; padding: 12px 16px 20px; margin-top: -8px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, .14); position: relative; }
.wcard-strip:last-child, .wcard-strip:has(+ .more[hidden]) { border-radius: 16px; padding-bottom: 12px; }
.wcard-strip[hidden] { display: none; }
.wc-right { display: grid; justify-items: end; gap: 1px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wc-right strong { font-size: 15.5px; }
