/* =========================================================
   FORTAS — Projektkarte (karte.html) · Electra-Stil
   ========================================================= */
:root { --ksurf: var(--surface, #fff); --kmint: var(--mint, var(--red)); }
.kpage { --kbar-h: 72px; --ktop: calc(var(--nav-h) + var(--kbar-h)); --kr: var(--rc, 12px); --kmint: var(--mint, var(--red)); --ksurf: var(--surface, #fff); background: var(--ksurf); }
html.k-lock, html.k-lock body { overflow: hidden; }
/* App-Layout: Servicezeile ausblenden, damit Karte exakt in den Viewport passt */
.page-karte .util { display: none; }

/* ---------- Filterleiste ---------- */
.kbar { position: sticky; top: var(--nav-h); z-index: 95; height: var(--kbar-h); background: var(--ksurf); border-bottom: 1px solid var(--line); }
.kbar__in { height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 var(--gut); overflow-x: auto; scrollbar-width: none; }
.kbar__in::-webkit-scrollbar { display: none; }
.kbar__title { display: flex; align-items: center; gap: 12px; flex: none; margin-right: 6px; }
.kbar__title h1 { font-size: 20px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; line-height: 1; }
.kbar__back { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); border: 1.5px solid var(--line-2); transition: border-color .2s, background .2s; }
.kbar__back:hover { border-color: var(--ink); }
.kbar__back svg { width: 16px; height: 16px; }
.kbar__sep { width: 1px; height: 28px; background: var(--line); flex: none; }

.ksearch { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px; border: 1.5px solid var(--line-2); border-radius: 999px; flex: 0 1 300px; min-width: 220px; color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.ksearch svg { width: 17px; height: 17px; flex: none; }
.ksearch input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 14.5px; color: var(--ink); width: 100%; min-width: 0; }
.ksearch input::placeholder { color: var(--muted); }
.ksearch input::-webkit-search-cancel-button { cursor: pointer; }
.ksearch:focus-within { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent); }

.kseg { display: inline-flex; flex: none; padding: 4px; gap: 2px; border-radius: 999px; background: var(--tint); }
.kseg button { height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s, box-shadow .2s; }
.kseg button sup { font-size: 11px; color: var(--muted); top: 0; }
.kseg button:hover:not(:disabled) { color: var(--ink); }
.kseg button[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: 0 4px 12px -6px rgba(11,41,54,.5); }
.kseg button[aria-pressed="true"] sup { color: rgba(255,255,255,.7); }
.kseg button:disabled { opacity: .45; cursor: default; }

.kchip { height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-2); font-size: 14.5px; font-weight: 500; color: var(--text); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex: none; transition: border-color .2s, background .2s, color .2s; }
.kchip > svg { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.kchip[aria-expanded="true"] > svg { transform: rotate(180deg); }
.kchip:hover { border-color: var(--ink); color: var(--ink); }
.kchip.is-on, .kchip[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.kchip__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--kmint); color: var(--navy); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.kchip__n[hidden] { display: none; }
.kchip--toggle .kdot { width: 10px; height: 10px; border-radius: 3px; border: 2px solid currentColor; }
.kchip--toggle[aria-pressed="true"] .kdot { background: var(--kmint); border-color: var(--kmint); }
.klink { font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; padding: 0 6px; flex: none; }
.klink:hover { color: var(--red); }

/* Popover */
.kpop { position: fixed; z-index: 1200; min-width: 270px; padding: 8px; background: var(--ksurf); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(11,41,54,.35); animation: kpop-in .18s var(--ease); }
.kpop[hidden] { display: none; }
@keyframes kpop-in { from { opacity: 0; transform: translateY(-6px); } }
.kpop label { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; color: var(--ink); }
.kpop label:hover { background: var(--tint); }
.kpop input { width: 18px; height: 18px; accent-color: var(--red); margin: 0; flex: none; }
.kpop__n { margin-left: auto; font-size: 13px; color: var(--muted); }
.kpop__foot { border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 12px 4px; }
.kpop__foot button { font-size: 13.5px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; color: var(--text); }

/* ---------- Split ---------- */
.ksplit { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: start; }
.klist { padding: 26px var(--gut) 80px; min-height: calc(100svh - var(--ktop)); }
.klist__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; min-height: 36px; }
.klist__head p { font-size: 15px; color: var(--text); }
.klist__head p strong { color: var(--ink); font-weight: 600; }
.klist__head p span { color: var(--muted); }
.klist__head .klink { font-size: 14px; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 36px 24px; }

.kcard { position: relative; }
.kcard[hidden] { display: none; }
.kcard__link { display: block; }
.kcard__img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--kr); background: var(--tint); }
.kcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.kcard:hover .kcard__img img, .kcard.is-hot .kcard__img img { transform: scale(1.05); }
.kcard__img::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0 var(--kmint); transition: box-shadow .25s; pointer-events: none; }
.kcard.is-hot .kcard__img::after { box-shadow: inset 0 0 0 3px var(--kmint); }
.kbadge { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.95); color: #0b2936; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.kbadge--st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #118a91; }
.kbadge--done::before { background: #1fbf86; }
.kbadge--plan::before { background: #f2b33d; }
.kbadge--prep::before { background: #9aa7a9; }
.kbadge--note { top: auto; bottom: 12px; background: rgba(11,41,54,.72); color: #fff; backdrop-filter: blur(6px); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px; }
.kcard__cat { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin: 16px 0 4px; }
.kcard h3 { font-size: 19px; font-weight: 500; color: var(--ink); letter-spacing: -.01em; line-height: 1.3; transition: color .25s; }
.kcard__link:hover h3 { color: var(--red); }
.kcard__loc { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-top: 6px; }
.kcard__loc svg { width: 14px; height: 14px; flex: none; }
.kcard__loc em, .kpop-card__loc em { font-style: normal; opacity: .8; }
.kcard__meta { font-size: 14px; color: var(--text); margin-top: 2px; }
.kcard__fly { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.95); color: #0b2936; display: grid; place-items: center; box-shadow: 0 6px 16px -8px rgba(11,41,54,.5); transition: transform .2s var(--ease), background .2s; }
.kcard__fly svg { width: 18px; height: 18px; }
.kcard__fly:hover { background: var(--kmint); transform: scale(1.08); }

.kempty { text-align: center; padding: 64px 24px; border: 1.5px dashed var(--line-2); border-radius: 20px; }
.kempty[hidden] { display: none; }
.kempty svg { width: 36px; height: 36px; margin: 0 auto 14px; color: var(--red); }
.kempty p { color: var(--text); margin-bottom: 18px; }

/* ---------- Karte ---------- */
.kmap { --kpad: 16px; position: sticky; top: var(--ktop); height: calc(100svh - var(--ktop)); padding: var(--kpad) var(--kpad) var(--kpad) 0; isolation: isolate; }
.kmap__canvas { position: relative; width: 100%; height: 100%; border-radius: 20px var(--rb, 48px) 20px 20px; overflow: hidden; background: #eef3f2; z-index: 0; }
.kmap__ui { position: absolute; z-index: 500; }
.kmap__sync { top: calc(var(--kpad) + 14px); left: 14px; display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px 0 12px; border-radius: 999px; background: var(--ksurf); color: var(--ink); font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px -10px rgba(11,41,54,.4); cursor: pointer; user-select: none; }
.kmap__sync input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; margin: 0; cursor: pointer; transition: background .2s; flex: none; }
.kmap__sync input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.kmap__sync input:checked { background: #118a91; }
.kmap__sync input:checked::after { transform: translateX(16px); }
.kmap__sync input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.kmap__here { top: calc(var(--kpad) + 68px); left: 50%; transform: translateX(-50%); height: 42px; padding: 0 20px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 10px 28px -10px rgba(11,41,54,.6); display: inline-flex; align-items: center; gap: 8px; }
.kmap__here[hidden] { display: none; }
.kmap__here svg { width: 16px; height: 16px; }
.kmap__tools { top: calc(var(--kpad) + 14px); right: calc(var(--kpad) + 14px); display: flex; flex-direction: column; gap: 8px; }
.kmap__btn { width: 44px; height: 44px; border-radius: 50%; background: var(--ksurf); color: var(--ink); display: grid; place-items: center; box-shadow: 0 8px 24px -10px rgba(11,41,54,.45); transition: background .2s, color .2s, transform .2s var(--ease); }
.kmap__btn:hover { background: var(--navy); color: #fff; }
.kmap__btn svg { width: 19px; height: 19px; }
.kmap__btn .i-shrink { display: none; }
.kpage.is-full .kmap__btn .i-shrink { display: block; }
.kpage.is-full .kmap__btn .i-grow { display: none; }
.kmap__legend { left: 14px; bottom: calc(var(--kpad) + 56px); display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 9px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ksurf) 92%, transparent); backdrop-filter: blur(8px); font-size: 12.5px; color: var(--text); box-shadow: 0 8px 24px -14px rgba(11,41,54,.4); max-width: calc(100% - 100px); }
.kmap.has-pop .kmap__legend { opacity: 0; pointer-events: none; }
.kmap__legend { transition: opacity .2s; }
.kmap__legend span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.kmap__legend i { width: 12px; height: 12px; border-radius: 50%; background: #0b2936; box-shadow: 0 0 0 2px #fff; }
.kmap__legend i.l-approx { background: #fff; box-shadow: none; border: 1.5px dashed #0b2936; }
.kmap__legend i.l-off { border-radius: 3px; background: #fff; box-shadow: none; border: 2px solid #0b2936; }
.kmap__legend i.l-plan { background: #f2b33d; }

/* MapLibre-Feinschliff */
.kmap .maplibregl-map { font-family: var(--f); }
.kmap .maplibregl-canvas:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.theme-dark .kmap__canvas { background: #0b2936; }
.kmap .maplibregl-ctrl-top-right { top: 118px; right: 14px; }
.kmap .maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 0; }
.kmap .maplibregl-ctrl-bottom-left { left: 14px; bottom: 14px; }
.kmap .maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0; }
.kmap .maplibregl-ctrl-group { border-radius: 22px; overflow: hidden; background: var(--ksurf); box-shadow: 0 8px 24px -10px rgba(11,41,54,.45); }
.kmap .maplibregl-ctrl-group button { width: 44px; height: 44px; }
.kmap .maplibregl-ctrl-group button + button { border-top-color: var(--line); }
.kmap .maplibregl-ctrl-group button:hover { background: var(--tint); }
.theme-dark .kmap .maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) hue-rotate(180deg); }
.kmap .maplibregl-ctrl-attrib.maplibregl-compact { background: var(--ksurf); color: var(--muted); font-size: 11px; box-shadow: 0 6px 18px -10px rgba(11,41,54,.4); }
.kmap .maplibregl-ctrl-attrib a { color: inherit; }
.theme-dark .kmap .maplibregl-ctrl-attrib-button { filter: invert(1); }

/* Marker */
.kpin-wrap { width: 0; height: 0; cursor: pointer; }
.kpin-wrap[hidden] { display: none; }
.kpin svg { max-width: none; flex: none; }
.kpin-wrap--office.is-dim { opacity: .4; }
.kpin-wrap:focus { outline: none; }
.kpin { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px 0 6px; border-radius: 999px; background: #0b2936; color: #fff; font: 600 13px/1 var(--f); white-space: nowrap; letter-spacing: .005em; box-shadow: 0 0 0 2px #fff, 0 8px 18px -8px rgba(11,41,54,.7); cursor: pointer; transition: transform .22s var(--ease), background .2s, color .2s, padding .2s; }
.kpin > i { width: 22px; height: 22px; border-radius: 50%; background: #43f5b9; color: #0b2936; display: grid; place-items: center; flex: none; }
.kpin > i svg { width: 12px; height: 12px; }
.kpin--plan > i { background: #f2b33d; }
.kpin--prep > i { background: #c5d0d1; }
.kpin--approx { background: #fff; color: #0b2936; box-shadow: 0 0 0 1.5px #0b2936 inset, 0 8px 18px -8px rgba(11,41,54,.5); outline: 2px dashed rgba(11,41,54,.35); outline-offset: 2px; }
.kpin-wrap:hover .kpin, .kpin-wrap:focus-visible .kpin, .kpin.is-hot { background: #43f5b9; color: #0b2936; transform: translate(-50%, -50%) scale(1.1); }
.kpin.is-hot > i, .kpin-wrap:hover .kpin > i { background: #0b2936; color: #43f5b9; }
.kpin-wrap:focus-visible .kpin { box-shadow: 0 0 0 2px #fff, 0 0 0 5px #118a91; }
.kpin--office { height: 30px; padding: 0 11px 0 8px; border-radius: 8px; background: #fff; color: #0b2936; box-shadow: 0 0 0 2px #0b2936 inset, 0 8px 18px -10px rgba(11,41,54,.5); font-weight: 600; }
.kpin--office svg { width: 15px; height: 15px; }
.kpin--hq { background: #0b2936; color: #fff; box-shadow: 0 0 0 2px #43f5b9 inset, 0 8px 18px -10px rgba(11,41,54,.6); }
.kpin-wrap:hover .kpin--office { background: #0b2936; color: #fff; transform: translate(-50%, -50%) scale(1.06); }
/* Standorte: bis Zoom 11 nur Symbol, Name bei Hover */
.kmap:not(.is-near) .kpin--office > span { display: none; }
.kmap:not(.is-near) .kpin--office { padding: 0 6px; }
.kmap:not(.is-near) .kpin-wrap--office:hover .kpin--office > span { display: inline; }
.kmap:not(.is-near) .kpin-wrap--office:hover .kpin--office { padding: 0 11px 0 8px; }
/* Cluster */
.kpin--cluster { padding: 0 14px 0 4px; height: 38px; background: #0b2936; color: #fff; box-shadow: 0 0 0 3px #43f5b9, 0 0 0 9px rgba(67,245,185,.22), 0 10px 22px -8px rgba(11,41,54,.7); }
.kpin--cluster b { width: 30px; height: 30px; border-radius: 50%; background: #43f5b9; color: #0b2936; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.kpin-wrap:hover .kpin--cluster > b, .kpin--cluster.is-hot > b { background: #0b2936; color: #43f5b9; }
.kmap.is-far .kpin--cluster:not(.is-hot) { padding: 0 4px; height: 38px; }
/* fern: kompakte Punkte, Beschriftung bei Hover/aktiv */
.kmap.is-far .kpin:not(.is-hot) > span { display: none; }
.kmap.is-far .kpin:not(.is-hot) { padding: 0 4px; height: 30px; }
.kmap.is-far .kpin:not(.is-hot) > i { width: 22px; height: 22px; }
.kmap.is-far .kpin--office:not(.is-hot) { padding: 0 6px; height: 28px; }
.kmap.is-far .kpin-wrap:hover .kpin > span { display: inline; }
.kmap.is-far .kpin-wrap:hover .kpin { padding: 0 13px 0 6px; }

/* Popup */
.kpopup { z-index: 20; }
.kpopup .maplibregl-popup-content { padding: 0; border-radius: 16px; overflow: hidden; background: var(--ksurf); color: var(--text); box-shadow: 0 28px 60px -20px rgba(11,41,54,.55); width: 280px; font-family: var(--f); line-height: 1.5; animation: kpop-up .22s var(--ease); }
.kpopup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .kpopup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .kpopup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--ksurf); }
.kpopup.maplibregl-popup-anchor-top .maplibregl-popup-tip, .kpopup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .kpopup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--ksurf); }
.kpopup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--ksurf); }
.kpopup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--ksurf); }
.kpopup .maplibregl-popup-close-button { top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.95); color: #0b2936; font: 400 22px/30px var(--f); box-shadow: 0 4px 12px -6px rgba(0,0,0,.4); z-index: 2; }
.kpopup .maplibregl-popup-close-button:hover { background: #43f5b9; color: #0b2936; }
@keyframes kpop-up { from { opacity: 0; transform: translateY(8px); } }
.kpop-card__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--tint); }
.kpop-card__img img { width: 100%; height: 100%; object-fit: cover; }
.kpop-card__img .kbadge { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; }
.kpop-card__body { padding: 16px 18px 18px; }
.kpop-card--office .kpop-card__body { padding-top: 20px; padding-right: 48px; }
.kpop-card__kick { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin: 0 0 4px !important; }
.kpop-card strong { display: block; font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; line-height: 1.3; }
.kpop-card__loc { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin: 6px 0 0 !important; }
.kpop-card__loc svg { width: 14px; height: 14px; flex: none; }
.kpop-card__facts { font-size: 13.5px; color: var(--text); margin: 2px 0 0 !important; }
.kpop-card a.kpop-card__link { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 13.5px; font-weight: 600; }
.kpop-card a.kpop-card__link svg { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.kpop-card a.kpop-card__link:hover { background: #118a91; }
.kpop-card a.kpop-card__link:hover svg { transform: translateX(3px); }
.theme-dark .kpop-card a.kpop-card__link { background: var(--red); color: var(--on-accent, #062029); }

/* Mobile/Vollbild-Umschalter */
.kfab { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1150; display: none; align-items: center; gap: 10px; height: 50px; padding: 0 22px; border-radius: 999px; background: #0b2936; color: #fff; font-size: 15px; font-weight: 600; box-shadow: 0 16px 36px -12px rgba(11,41,54,.7); transition: transform .2s var(--ease), background .2s; }
.kfab:hover { transform: translateX(-50%) scale(1.04); }
.kfab svg { width: 18px; height: 18px; }
.kfab b { min-width: 22px; height: 22px; border-radius: 999px; background: #43f5b9; color: #0b2936; font-size: 12px; display: grid; place-items: center; padding: 0 6px; }

/* ---------- Vollbild ---------- */
.kpage.is-full .kbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1110; }
.kpage.is-full .kmap { --kpad: 0px; position: fixed; top: var(--kbar-h); left: 0; right: 0; bottom: 0; height: auto; z-index: 1100; padding: 0; background: var(--ksurf); animation: kfull-in .28s var(--ease); }
.kpage.is-full .kmap__canvas { border-radius: 0; }
.kpage.is-full .kfab { display: inline-flex; }
.kpage.is-full .kfab .i-map { display: none; }
.kpage:not(.is-full) .kfab .i-list { display: none; }
@keyframes kfull-in { from { opacity: 0; transform: scale(.985); } }
.kpage.is-full ~ .to-top, .kpage.is-full ~ .dsw { display: none; }

/* Dark */
.theme-dark .kseg button[aria-pressed="true"], .theme-dark .kchip.is-on, .theme-dark .kchip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: var(--on-accent, #062029); }
.theme-dark .kchip__n { background: var(--on-accent, #062029); color: var(--red); }
.theme-dark .kmap__here { background: var(--red); color: var(--on-accent, #062029); }
.theme-dark .kmap__btn:hover { background: var(--red); color: var(--on-accent, #062029); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .ksplit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 959px) {
  .kpage { --kbar-h: 64px; }
  .ksplit { display: block; }
  .kmap { display: none; }
  .kpage.is-full .kmap { display: block; }
  .kfab { display: inline-flex; }
  .kbar__title h1 { font-size: 17px; }
  .ksearch { min-width: 200px; height: 42px; }
  .kchip, .kseg button { height: 40px; }
  .kseg button { height: 34px; padding: 0 12px; }
  .kmap__sync { top: 14px; left: 12px; font-size: 13px; height: 38px; }
  .kmap__sync .t-long { display: none; }
  .kmap__here { top: 60px; }
  .kmap__tools { top: 14px; right: 12px; }
  .kmap__tools #k-full { display: none; }
  .kmap .maplibregl-ctrl-group { display: none; }
  .kmap .maplibregl-ctrl-bottom-left { bottom: 90px; }
  .kmap__legend { display: none; }
  .kpopup .maplibregl-popup-content { width: 260px; }
  .kfab { bottom: max(20px, env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .kbar__title { display: none; }
  .ksearch { min-width: 180px; flex-basis: 200px; }
  .kgrid { grid-template-columns: 1fr; }
  .kbar__sep, .kbar__title .kbar__back { display: none; }
  /* Filterleiste zweizeilig: Suche oben, Länder-Filter vollständig sichtbar */
  .kpage { --kbar-h: 108px; }
  .kbar__in { flex-wrap: wrap; align-content: center; row-gap: 8px; overflow: visible; }
  .ksearch { flex: 1 1 100%; min-width: 0; height: 40px; }
  .kseg { width: 100%; }
  .kseg button { flex: 1; padding: 0 8px; font-size: 13px; }
  .kbadge--note { font-size: 11.5px; }
}
/* Mobil: Legende kompakt statt ausgeblendet */
@media (max-width: 959px) {
  .kmap__legend { display: flex; flex-wrap: wrap; bottom: 96px; font-size: 12px; max-width: calc(100% - 28px); }
}
/* Tablet hochkant: Liste + Karte nebeneinander wie am Desktop */
@media (min-width: 768px) and (max-width: 959px) {
  .ksplit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kmap { display: block; }
  .kfab { display: none; }
  .kgrid { grid-template-columns: 1fr; }
  .kmap__legend { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .kpin, .kcard__img img, .kpage.is-full .kmap, .kpopup .maplibregl-popup-content, .kpop { transition: none; animation: none; }
}
.theme-dark :is(.kmap__sync, .kmap__btn, .kmap__legend, .kmap .maplibregl-ctrl-group, .kmap .maplibregl-ctrl-attrib.maplibregl-compact) { background: var(--surface-2, #113443); box-shadow: 0 0 0 1px var(--line-2), 0 10px 26px -12px rgba(0,0,0,.7); }

/* ---------- Mobil wie Airbnb: Karte füllt den Bildschirm, Liste als ziehbares Panel ---------- */
.ksheet__grip, .kmcard { display: none; }
@media (max-width: 767px) {
  html.k-sheet, html.k-sheet body { overflow: hidden; overscroll-behavior: none; }
  html.k-sheet .to-top { display: none; }
  .kpage.is-sheet .kmap { display: block; position: fixed; top: var(--ktop); left: 0; right: 0; bottom: 0; height: auto; padding: 0; z-index: 1; }
  .kpage.is-sheet .kmap__canvas { border-radius: 0; }
  .kpage.is-sheet .kfab { display: none; }
  .kpage.is-sheet[data-sheet="full"] .kfab { display: inline-flex; }
  .kpage.is-sheet[data-sheet="full"] .kfab .i-list { display: none; }
  .kpage.is-sheet[data-sheet="full"] .kfab .i-map { display: block; }
  .kpage.is-sheet .klist {
    position: fixed; z-index: 60; left: 0; right: 0; top: var(--ktop); bottom: 0; min-height: 0;
    padding: 0 var(--gut) calc(110px + env(safe-area-inset-bottom, 0px));
    background: var(--ksurf); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 34px -12px rgba(11,41,54,.35);
    overflow: hidden; touch-action: none; overscroll-behavior: contain;
    transition: transform .38s cubic-bezier(.22,.8,.26,1), border-radius .3s;
  }
  .kpage.is-sheet[data-sheet="full"] .klist { overflow-y: auto; touch-action: pan-y; border-radius: 0; box-shadow: none; }
  .kpage.is-sheet .ksheet__grip { display: block; position: sticky; top: 0; z-index: 2; width: calc(100% + 2 * var(--gut)); margin: 0 calc(-1 * var(--gut)); height: 26px; background: var(--ksurf); touch-action: none; cursor: grab; }
  .kpage.is-sheet .ksheet__grip::before { content: ""; position: absolute; left: 50%; top: 11px; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: var(--line-2); }
  .kpage.is-sheet .klist__head { position: sticky; top: 26px; z-index: 2; justify-content: center; margin: 0 calc(-1 * var(--gut)) 18px; padding: 4px var(--gut) 16px; background: var(--ksurf); text-align: center; touch-action: none; cursor: grab; }
  .kpage.is-sheet[data-sheet="full"] .klist__head { border-bottom: 1px solid var(--line); }
  .kpage.is-sheet .klist__head p { font-size: 15px; }
  .kpage.is-sheet .klist__head p span { display: none; }
  /* Projektkarte beim Antippen eines Pins */
  .kpage.is-sheet .kmcard { display: block; position: absolute; z-index: 40; left: 12px; right: 12px; bottom: calc(92px + 12px + env(safe-area-inset-bottom, 0px)); opacity: 0; transform: translateY(14px); transition: opacity .25s, transform .3s var(--ease); }
  .kpage.is-sheet .kmcard.is-on { opacity: 1; transform: none; }
  .kpage.is-sheet .kmcard[hidden] { display: none; }
  .kmcard .kpop-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); background: var(--ksurf); border-radius: 18px; overflow: hidden; box-shadow: 0 24px 50px -18px rgba(11,41,54,.55); cursor: pointer; }
  .kmcard .kpop-card--office { grid-template-columns: minmax(0, 1fr); }
  .kmcard .kpop-card__img { position: relative; height: 100%; min-height: 128px; aspect-ratio: auto; }
  .kmcard .kpop-card__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .kmcard .kpop-card__img .kbadge { left: 8px; top: 8px; font-size: 10.5px; padding: 4px 8px; }
  .kmcard .kpop-card__body { padding: 14px 44px 14px 14px; }
  .kmcard__x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: var(--tint); color: var(--ink); font-size: 22px; line-height: 30px; display: grid; place-items: center; }
  /* Kartenelemente über dem eingeklappten Panel */
  .kpage.is-sheet .kmap__legend { bottom: calc(92px + 12px); }
  .kpage.is-sheet:not([data-sheet="peek"]) .kmap__legend, .kpage.is-sheet .kmap.has-pop .kmap__legend, .kpage.is-sheet .kmap:has(.kmcard.is-on) .kmap__legend { opacity: 0; pointer-events: none; }
  .kpage.is-sheet .kmap .maplibregl-ctrl-bottom-left { bottom: calc(92px + 12px); }
  .kpage.is-sheet .kmap__tools #k-full { display: none; }
  @media (prefers-reduced-motion: reduce) { .kpage.is-sheet .klist, .kpage.is-sheet .kmcard { transition: none; } }
}
@media (max-width: 767px) {
  /* Design- und Chat-Button über der eingeklappten Liste */
  html.k-sheet .dsw { bottom: calc(92px + 14px); }
  html.k-sheet .bot { bottom: calc(92px + 14px); }
  html.k-sheet .kpage[data-sheet="full"] ~ .bot, html.k-sheet .kpage[data-sheet="full"] ~ .dsw { bottom: 84px; }
}
@media (max-width: 767px) {
  html.k-sheet:has(.kmcard.is-on) :is(.bot, .dsw) { opacity: 0; pointer-events: none; }
}
