html,
body {
    height: 100%;
}

body.wvmap-body {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.wvmap-app {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: #111;
    padding:
        env(safe-area-inset-top)
        env(safe-area-inset-right)
        env(safe-area-inset-bottom)
        env(safe-area-inset-left);
    box-sizing: border-box;
}

.wvmap-map {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background: #d9d9d9;
    touch-action: pan-x pan-y;
}

.wvmap-loading,
.wvmap-error {
    position: absolute;
    left: 50%;
    top: calc(env(safe-area-inset-top) + 16px);
    transform: translateX(-50%);
    z-index: 10000;
    max-width: min(90vw, 420px);
    border-radius: 12px;
    padding: 10px 14px;
    font: 600 14px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
    backdrop-filter: blur(8px);
}

.wvmap-loading {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #111;
    background: rgba(255, 255, 255, .92);
}

.wvmap-error {
    color: #fff;
    background: rgba(150, 25, 25, .95);
}

.wvmap-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid rgba(0, 0, 0, .18);
    border-top-color: rgba(0, 0, 0, .7);
    border-radius: 50%;
    animation: wvmap-spin .8s linear infinite;
}

@keyframes wvmap-spin {
    to { transform: rotate(360deg); }
}

.wvmap-pw-label {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #fff;
    font: 800 18px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-shadow:
        0 1px 2px rgba(0,0,0,.95),
        0 0 5px rgba(0,0,0,.85);
    white-space: nowrap;
    text-align: center;
    transform: translate(-50%, -50%);
}

.wvmap-pw-label::before {
    display: none;
}

.wvmap-ba-label {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #fff;
    font: 800 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-shadow:
        -1px -1px 1px rgba(0,0,0,.9),
         1px -1px 1px rgba(0,0,0,.9),
        -1px  1px 1px rgba(0,0,0,.9),
         1px  1px 1px rgba(0,0,0,.9),
         0 0 5px rgba(0,0,0,.95);
    white-space: nowrap;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, -50%);
}

/* Klickbarkeit der Pumpwerksflächen auf Desktop kenntlich machen. */
.wvmap-mode-overview .leaflet-interactive {
    cursor: pointer;
}

.wvmap-app .leaflet-control-zoom a {
    width: 42px;
    height: 42px;
    line-height: 42px;
    font-size: 24px;
}

.wvmap-app .leaflet-control-attribution {
    font-size: 10px;
    background: rgba(255,255,255,.78);
}

@media (max-width: 600px) {
    .wvmap-pw-label {
        font-size: 16px;
    }

    .wvmap-ba-label {
        font-size: 11px;
    }
}


.wvmap-ts-label {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #fff;
    font: 800 12px/1.05 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-shadow:
        -1px -1px 1px rgba(0,0,0,.95),
         1px -1px 1px rgba(0,0,0,.95),
        -1px  1px 1px rgba(0,0,0,.95),
         1px  1px 1px rgba(0,0,0,.95),
         0 0 5px rgba(0,0,0,1);
    white-space: nowrap;
    pointer-events: none;
    text-align: left;
    transform: translate(9px, -50%);
}

@media (max-width: 600px) {
    .wvmap-ts-label {
        font-size: 11px;
        transform: translate(8px, -50%);
    }
}


.wvmap-ts-sheet {
    position: absolute;
    left: 50%;
    bottom: env(safe-area-inset-bottom);
    z-index: 12000;
    width: min(560px, calc(100% - 24px));
    max-height: min(52dvh, 520px);
    box-sizing: border-box;
    color: #151515;
    background: rgba(255, 255, 255, .97);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .28);
    transform: translate(-50%, calc(100% + 32px));
    opacity: 0;
    visibility: hidden;
    transition:
        transform .22s ease,
        opacity .18s ease,
        visibility 0s linear .22s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wvmap-ts-sheet.is-open {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    transition:
        transform .22s ease,
        opacity .18s ease;
}

.wvmap-ts-sheet__handle {
    width: 44px;
    height: 5px;
    margin: 9px auto 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .20);
}

.wvmap-ts-sheet__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #222;
    background: #ececec;
    font: 400 30px/38px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-ts-sheet__content {
    padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
}

.wvmap-ts-sheet__title {
    margin: 0 52px 18px 0;
    color: #171717;
    font-size: 22px;
    line-height: 1.15;
    font-weight: 800;
}

.wvmap-ts-sheet__meta {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.wvmap-ts-sheet__meta > div {
    display: grid;
    grid-template-columns: minmax(100px, 34%) 1fr;
    gap: 12px;
    align-items: baseline;
}

.wvmap-ts-sheet__meta dt {
    margin: 0;
    color: #666;
    font-size: 14px;
    font-weight: 700;
}

.wvmap-ts-sheet__meta dd {
    margin: 0;
    color: #171717;
    font-size: 16px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.wvmap-ts-sheet__nav {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 11px 16px;
    border-radius: 12px;
    color: #fff !important;
    background: #1769e0;
    text-decoration: none !important;
    font-size: 17px;
    font-weight: 800;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-ts-sheet__nav.is-disabled {
    pointer-events: none;
    opacity: .45;
}

@media (min-width: 700px) {
    .wvmap-ts-sheet {
        bottom: 18px;
        border-radius: 18px;
    }
}

@media (max-width: 600px) {
    .wvmap-ts-sheet {
        width: calc(100% - 12px);
        max-height: 48dvh;
    }

    .wvmap-ts-sheet__content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .wvmap-ts-sheet__title {
        font-size: 20px;
    }
}


.wvmap-ts-photo {
    margin: 4px 0 16px;
    overflow: hidden;
    border-radius: 12px;
    background: #e9e9e9;
}

.wvmap-ts-photo img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-ts-photo-empty {
    margin: 4px 0 16px;
    padding: 14px;
    border-radius: 10px;
    color: #666;
    background: #f0f0f0;
    font-size: 14px;
    text-align: center;
}

.wvmap-photo-lightbox {
    position: absolute;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        calc(12px + env(safe-area-inset-top))
        calc(12px + env(safe-area-inset-right))
        calc(12px + env(safe-area-inset-bottom))
        calc(12px + env(safe-area-inset-left));
    box-sizing: border-box;
    background: rgba(0, 0, 0, .94);
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s ease, visibility 0s linear .16s;
}

.wvmap-photo-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity .16s ease;
}

.wvmap-photo-lightbox img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
}

.wvmap-photo-lightbox__close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    z-index: 1;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(40, 40, 40, .82);
    font: 400 32px/42px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}


.wvmap-gps-ui {
    position: absolute;
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 11000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.wvmap-gps-button,
.wvmap-gps-status {
    pointer-events: auto;
}

.wvmap-gps-button {
    display: flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 14px;
    color: #151515;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .28);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-gps-button:disabled {
    cursor: default;
}

.wvmap-gps-button__icon {
    display: block;
    font: 700 30px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transform: translateY(-1px);
}

.wvmap-gps-button.is-loading .wvmap-gps-button__icon {
    animation: wvmap-gps-pulse .8s ease-in-out infinite alternate;
}

@keyframes wvmap-gps-pulse {
    from {
        opacity: .35;
        transform: translateY(-1px) scale(.9);
    }
    to {
        opacity: 1;
        transform: translateY(-1px) scale(1.08);
    }
}

.wvmap-gps-status {
    max-width: min(76vw, 300px);
    box-sizing: border-box;
    padding: 8px 11px;
    border-radius: 10px;
    color: #161616;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .22);
    font: 700 13px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: right;
}

.wvmap-gps-status.is-error {
    color: #fff;
    background: rgba(150, 25, 25, .96);
}

@media (min-width: 700px) {
    .wvmap-gps-ui {
        right: 18px;
        bottom: 18px;
    }
}


.wvmap-location-info {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    z-index: 11500;
    min-width: 180px;
    max-width: min(78vw, 430px);
    box-sizing: border-box;
    padding: 9px 14px;
    border-radius: 12px;
    color: #151515;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 3px 16px rgba(0, 0, 0, .28);
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    pointer-events: none;
}

.wvmap-location-info.is-warning {
    color: #412c00;
    background: rgba(255, 238, 190, .97);
}

.wvmap-location-info__main {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
}

.wvmap-location-info__sub {
    margin-top: 2px;
    color: #666;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 650;
}

.wvmap-location-info.is-warning .wvmap-location-info__sub {
    color: #654d13;
}


.wvmap-layer-ui {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    z-index: 11800;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wvmap-layer-button {
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #171717;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .28);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-layer-icon {
    position: relative;
    display: block;
    width: 24px;
    height: 22px;
}

.wvmap-layer-icon span {
    position: absolute;
    left: 2px;
    width: 20px;
    height: 11px;
    border: 2px solid currentColor;
    border-radius: 2px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, .75);
    transform: rotate(-18deg) skewX(18deg);
}

.wvmap-layer-icon span:nth-child(1) {
    top: 0;
}

.wvmap-layer-icon span:nth-child(2) {
    top: 5px;
}

.wvmap-layer-icon span:nth-child(3) {
    top: 10px;
}

.wvmap-layer-panel {
    width: min(280px, calc(100vw - 24px));
    margin-top: 8px;
    padding: 12px;
    box-sizing: border-box;
    border-radius: 14px;
    color: #171717;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .30);
}

.wvmap-layer-panel__heading {
    margin: 1px 4px 7px;
    color: #555;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.wvmap-layer-panel__divider {
    height: 1px;
    margin: 10px 2px;
    background: #dedede;
}

.wvmap-layer-option {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 10px;
    padding: 2px 5px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 650;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-layer-option:hover {
    background: #f2f2f2;
}

.wvmap-layer-option input {
    width: 19px;
    height: 19px;
    margin: 0;
    accent-color: #1769e0;
}

.wvmap-layer-panel__hint {
    margin: 9px 5px 2px;
    color: #777;
    font-size: 11px;
    line-height: 1.3;
}

@media (max-width: 600px) {
    .wvmap-layer-ui {
        top: calc(10px + env(safe-area-inset-top));
        right: calc(10px + env(safe-area-inset-right));
    }

    .wvmap-layer-button {
        width: 46px;
        height: 46px;
    }
}


/* Suche ---------------------------------------------------- */

.wvmap-search-ui {
    position: absolute;
    top: calc(108px + env(safe-area-inset-top));
    left: calc(12px + env(safe-area-inset-left));
    z-index: 11850;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wvmap-search-button {
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #171717;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .28);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-search-icon {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
    box-sizing: border-box;
    border: 3px solid currentColor;
    border-radius: 50%;
}

.wvmap-search-icon::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: -5px;
    width: 9px;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: left center;
}

.wvmap-search-panel {
    width: min(360px, calc(100vw - 24px));
    margin-top: 8px;
    overflow: hidden;
    border-radius: 14px;
    color: #171717;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .30);
}

.wvmap-search-field {
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 6px;
    padding: 10px;
    border-bottom: 1px solid #e2e2e2;
}

.wvmap-search-field input {
    min-width: 0;
    height: 42px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid #cfcfcf;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: #171717;
    font: 600 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wvmap-search-field input:focus {
    border-color: #1769e0;
    box-shadow: 0 0 0 2px rgba(23, 105, 224, .15);
}

.wvmap-search-close {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    color: #222;
    background: #ededed;
    font: 400 28px/38px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
}

.wvmap-search-results {
    max-height: min(52dvh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.wvmap-search-empty {
    padding: 18px 14px;
    color: #666;
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
}

.wvmap-search-result {
    display: grid;
    width: 100%;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #ececec;
    color: #171717;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.wvmap-search-result:last-child {
    border-bottom: 0;
}

.wvmap-search-result:active {
    background: #ededed;
}

.wvmap-search-result__badge {
    display: flex;
    width: 38px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    background: #555;
    font-size: 11px;
    font-weight: 850;
}

.wvmap-search-result__badge.is-ba {
    background: #5c7c30;
}

.wvmap-search-result__badge.is-ts {
    background: #b51d1d;
}

.wvmap-search-result__badge.is-pw {
    background: #356a9b;
}

.wvmap-search-result__text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.wvmap-search-result__text strong {
    overflow: hidden;
    color: #171717;
    font-size: 15px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wvmap-search-result__text small {
    overflow: hidden;
    color: #6a6a6a;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* BA-Trennschieberliste ------------------------------------ */

.wvmap-ba-ts-sheet {
    position: absolute;
    left: 50%;
    bottom: calc(6px + env(safe-area-inset-bottom));
    z-index: 11900;
    width: min(620px, calc(100% - 20px));
    max-height: min(58dvh, 570px);
    overflow: hidden;
    box-sizing: border-box;
    border-radius: 16px;
    color: #171717;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .28);
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wvmap-ba-ts-toggle {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border: 0;
    color: #171717;
    background: transparent;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-ba-ts-toggle > span:first-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.wvmap-ba-ts-toggle strong {
    overflow: hidden;
    font-size: 15px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wvmap-ba-ts-toggle small {
    color: #6d6d6d;
    font-size: 11px;
    line-height: 1.2;
}

.wvmap-ba-ts-chevron {
    flex: 0 0 auto;
    font-size: 23px;
    line-height: 1;
    transition: transform .18s ease;
}

.wvmap-ba-ts-sheet.is-expanded .wvmap-ba-ts-chevron {
    transform: rotate(180deg);
}

.wvmap-ba-ts-body {
    max-height: calc(min(58dvh, 570px) - 58px);
    overflow-y: auto;
    border-top: 1px solid #e2e2e2;
    overscroll-behavior: contain;
}

.wvmap-ba-ts-list {
    display: grid;
}

.wvmap-ba-ts-empty {
    padding: 20px 14px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

.wvmap-ba-ts-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    padding: 8px 10px;
    border-bottom: 1px solid #ececec;
}

.wvmap-ba-ts-item:last-child {
    border-bottom: 0;
}

.wvmap-ba-ts-item__main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    border: 0;
    color: #171717;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.wvmap-ba-ts-item__title {
    overflow: hidden;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wvmap-ba-ts-item__meta {
    overflow: hidden;
    color: #6b6b6b;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wvmap-ba-ts-item__nav {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 0 12px;
    border-radius: 10px;
    color: #fff !important;
    background: #1769e0;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .wvmap-search-ui {
        top: calc(104px + env(safe-area-inset-top));
        left: calc(10px + env(safe-area-inset-left));
    }

    .wvmap-search-button {
        width: 46px;
        height: 46px;
    }

    .wvmap-ba-ts-sheet {
        width: calc(100% - 12px);
        bottom: calc(4px + env(safe-area-inset-bottom));
    }

    .wvmap-ba-ts-item {
        padding-left: 8px;
        padding-right: 8px;
    }

    .wvmap-ba-ts-item__nav {
        padding-left: 10px;
        padding-right: 10px;
    }
}

.wvmap-app.wvmap-has-ba-ts .wvmap-gps-ui {
    bottom: calc(82px + env(safe-area-inset-bottom));
}


/* ==========================================================
   WV MAP UI 0.10 – gemeinsames modernes Designsystem
   ========================================================== */

.wvmap-app {
    --wvmap-accent: #2d8da8;
    --wvmap-accent-strong: #23768e;
    --wvmap-text: #172126;
    --wvmap-muted: #66727a;
    --wvmap-line: rgba(20, 35, 44, .10);
    --wvmap-surface: rgba(252, 253, 253, .90);
    --wvmap-surface-strong: rgba(255, 255, 255, .97);
    --wvmap-soft: rgba(235, 241, 243, .92);
    --wvmap-radius-control: 15px;
    --wvmap-radius-panel: 21px;
    --wvmap-shadow-control:
        0 8px 24px rgba(24, 39, 47, .13),
        0 2px 6px rgba(24, 39, 47, .10);
    --wvmap-shadow-panel:
        0 18px 48px rgba(24, 39, 47, .18),
        0 3px 10px rgba(24, 39, 47, .09);
    color: var(--wvmap-text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Text",
        "Segoe UI",
        sans-serif;
}

/* Gemeinsame Glasoberfläche */
.wvmap-layer-button,
.wvmap-search-button,
.wvmap-gps-button,
.wvmap-location-info,
.wvmap-layer-panel,
.wvmap-search-panel,
.wvmap-ba-ts-sheet,
.wvmap-ts-sheet,
.wvmap-gps-status {
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
}

/* ----------------------------------------------------------
   Leaflet Zoom – gleiche Sprache wie unsere eigenen Buttons
   ---------------------------------------------------------- */

.wvmap-app .leaflet-top.leaflet-left {
    top: calc(10px + env(safe-area-inset-top));
    left: calc(10px + env(safe-area-inset-left));
}

.wvmap-app .leaflet-control-zoom {
    margin: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72) !important;
    border-radius: var(--wvmap-radius-control) !important;
    background: var(--wvmap-surface) !important;
    box-shadow: var(--wvmap-shadow-control) !important;
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
}

.wvmap-app .leaflet-control-zoom a {
    width: 46px;
    height: 46px;
    border: 0 !important;
    border-bottom: 1px solid var(--wvmap-line) !important;
    color: var(--wvmap-text) !important;
    background: transparent !important;
    font-size: 26px;
    font-weight: 450;
    line-height: 44px;
    transition: background .12s ease, transform .12s ease;
}

.wvmap-app .leaflet-control-zoom a:last-child {
    border-bottom: 0 !important;
}

.wvmap-app .leaflet-control-zoom a:active {
    background: rgba(225, 233, 236, .92) !important;
}

.wvmap-app .leaflet-control-zoom a.leaflet-disabled {
    color: rgba(23, 33, 38, .25) !important;
    background: transparent !important;
}

/* ----------------------------------------------------------
   Floating buttons
   ---------------------------------------------------------- */

.wvmap-layer-ui {
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
}

.wvmap-search-ui {
    top: calc(112px + env(safe-area-inset-top));
    left: calc(10px + env(safe-area-inset-left));
}

.wvmap-layer-button,
.wvmap-search-button,
.wvmap-gps-button {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: var(--wvmap-radius-control);
    color: var(--wvmap-text);
    background: var(--wvmap-surface);
    box-shadow: var(--wvmap-shadow-control);
    transition:
        transform .12s ease,
        background .12s ease,
        box-shadow .12s ease;
}

.wvmap-layer-button:active,
.wvmap-search-button:active,
.wvmap-gps-button:active {
    transform: scale(.96);
    background: rgba(237, 243, 245, .96);
}

.wvmap-search-icon {
    width: 20px;
    height: 20px;
    border-width: 2.7px;
}

.wvmap-search-icon::after {
    right: -6px;
    bottom: -4px;
    width: 8px;
    height: 2.7px;
}

.wvmap-layer-icon {
    width: 23px;
    height: 21px;
}

.wvmap-layer-icon span {
    left: 2px;
    width: 19px;
    height: 10px;
    border-width: 1.8px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .30);
}

.wvmap-gps-ui {
    right: calc(10px + env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
}

.wvmap-gps-button__icon {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
    box-sizing: border-box;
    border: 2.2px solid currentColor;
    border-radius: 50%;
}

.wvmap-gps-button__icon::before,
.wvmap-gps-button__icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.wvmap-gps-button__icon::before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.wvmap-gps-button__icon::after {
    width: 30px;
    height: 2px;
    background:
        linear-gradient(
            to right,
            currentColor 0 6px,
            transparent 6px 24px,
            currentColor 24px 30px
        );
}

.wvmap-gps-button {
    overflow: visible;
}

.wvmap-gps-button::before {
    content: "";
    position: absolute;
    width: 2px;
    height: 30px;
    background:
        linear-gradient(
            to bottom,
            currentColor 0 6px,
            transparent 6px 24px,
            currentColor 24px 30px
        );
}

/* ----------------------------------------------------------
   Aktuelle Auswahl / GPS-Status oben
   ---------------------------------------------------------- */

.wvmap-location-info {
    top: calc(10px + env(safe-area-inset-top));
    min-width: 0;
    max-width: calc(100vw - 152px);
    padding: 9px 15px 8px;
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 17px;
    color: var(--wvmap-text);
    background: var(--wvmap-surface);
    box-shadow: var(--wvmap-shadow-control);
}

.wvmap-location-info__main {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.18;
    font-weight: 780;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wvmap-location-info__sub {
    margin-top: 2px;
    color: var(--wvmap-muted);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
}

.wvmap-location-info.is-warning {
    border-color: rgba(198, 142, 20, .28);
    color: #4a3710;
    background: rgba(255, 246, 218, .94);
}

.wvmap-gps-status {
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 12px;
    color: var(--wvmap-text);
    background: var(--wvmap-surface);
    box-shadow: var(--wvmap-shadow-control);
    font-size: 12px;
    font-weight: 700;
}

/* ----------------------------------------------------------
   Layer Panel
   ---------------------------------------------------------- */

.wvmap-layer-panel {
    width: min(300px, calc(100vw - 20px));
    margin-top: 9px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: var(--wvmap-radius-panel);
    color: var(--wvmap-text);
    background: var(--wvmap-surface-strong);
    box-shadow: var(--wvmap-shadow-panel);
}

.wvmap-layer-panel__heading {
    margin: 2px 4px 9px;
    color: var(--wvmap-muted);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: .055em;
}

.wvmap-layer-panel__divider {
    height: 1px;
    margin: 13px 2px 12px;
    background: var(--wvmap-line);
}

.wvmap-basemap-segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
    border-radius: 13px;
    background: rgba(226, 233, 236, .82);
}

.wvmap-basemap-option {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-basemap-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wvmap-basemap-option span {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 10px;
    color: var(--wvmap-muted);
    font-size: 14px;
    font-weight: 720;
    transition:
        color .14s ease,
        background .14s ease,
        box-shadow .14s ease;
}

.wvmap-basemap-option input:checked + span {
    color: var(--wvmap-text);
    background: rgba(255, 255, 255, .98);
    box-shadow:
        0 2px 7px rgba(25, 39, 47, .11),
        inset 0 0 0 1px rgba(20, 35, 44, .05);
}

.wvmap-layer-option.wvmap-toggle-option {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 4px;
    border-radius: 10px;
    color: var(--wvmap-text);
    font-size: 14px;
    font-weight: 680;
}

.wvmap-layer-option.wvmap-toggle-option:hover {
    background: transparent;
}

.wvmap-toggle-option input[type="checkbox"] {
    position: relative;
    width: 44px;
    height: 26px;
    flex: 0 0 44px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background: #d8dfe2;
    cursor: pointer;
    transition: background .18s ease;
}

.wvmap-toggle-option input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
    transition: transform .18s ease;
}

.wvmap-toggle-option input[type="checkbox"]:checked {
    background: var(--wvmap-accent);
}

.wvmap-toggle-option input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}

.wvmap-layer-panel__hint {
    margin: 10px 4px 1px;
    color: #7a858b;
    font-size: 11px;
    line-height: 1.35;
}

/* ----------------------------------------------------------
   Suche
   ---------------------------------------------------------- */

.wvmap-search-panel {
    width: min(390px, calc(100vw - 20px));
    margin-top: 9px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: var(--wvmap-radius-panel);
    color: var(--wvmap-text);
    background: var(--wvmap-surface-strong);
    box-shadow: var(--wvmap-shadow-panel);
}

.wvmap-search-field {
    grid-template-columns: 1fr 40px;
    gap: 7px;
    padding: 10px;
    border-bottom: 1px solid var(--wvmap-line);
}

.wvmap-search-field input {
    height: 42px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(235, 241, 243, .84);
    color: var(--wvmap-text);
    font-size: 16px;
    font-weight: 580;
    transition:
        background .14s ease,
        box-shadow .14s ease;
}

.wvmap-search-field input::placeholder {
    color: #8b959a;
    opacity: 1;
}

.wvmap-search-field input:focus {
    border-color: transparent;
    background: #fff;
    box-shadow: 0 0 0 2.5px rgba(45, 141, 168, .25);
}

.wvmap-search-close,
.wvmap-ts-sheet__close {
    color: var(--wvmap-text);
    background: rgba(231, 236, 238, .94);
    transition: transform .12s ease, background .12s ease;
}

.wvmap-search-close {
    width: 40px;
    height: 40px;
    align-self: center;
    border-radius: 12px;
    font-size: 26px;
    line-height: 38px;
}

.wvmap-search-close:active,
.wvmap-ts-sheet__close:active {
    transform: scale(.95);
    background: #dce4e7;
}

.wvmap-search-results {
    max-height: min(48dvh, 430px);
}

.wvmap-search-empty {
    padding: 20px 16px;
    color: var(--wvmap-muted);
    font-size: 13px;
}

.wvmap-search-result {
    grid-template-columns: 42px 1fr;
    gap: 11px;
    min-height: 58px;
    padding: 8px 13px;
    border-bottom: 1px solid var(--wvmap-line);
}

.wvmap-search-result:active {
    background: rgba(230, 237, 240, .88);
}

.wvmap-search-result__badge {
    width: 38px;
    height: 29px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
}

.wvmap-search-result__badge.is-ba {
    background: #628b42;
}

.wvmap-search-result__badge.is-ts {
    background: #a92a2a;
}

.wvmap-search-result__badge.is-pw {
    background: var(--wvmap-accent-strong);
}

.wvmap-search-result__text strong {
    color: var(--wvmap-text);
    font-size: 14px;
    font-weight: 750;
}

.wvmap-search-result__text small {
    color: var(--wvmap-muted);
    font-size: 11px;
}

/* ----------------------------------------------------------
   BA-Trennschieber Bottom Sheet
   ---------------------------------------------------------- */

.wvmap-ba-ts-sheet {
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: min(620px, calc(100% - 16px));
    max-height: min(56dvh, 560px);
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 22px;
    background: var(--wvmap-surface-strong);
    box-shadow: var(--wvmap-shadow-panel);
}

.wvmap-ba-ts-toggle {
    min-height: 62px;
    gap: 12px;
    padding: 10px 16px;
}

.wvmap-ba-ts-toggle strong {
    color: var(--wvmap-text);
    font-size: 16px;
    line-height: 1.2;
    font-weight: 790;
    letter-spacing: -.01em;
}

.wvmap-ba-ts-toggle small {
    color: var(--wvmap-muted);
    font-size: 11px;
    font-weight: 580;
}

.wvmap-ba-ts-chevron {
    display: flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--wvmap-text);
    background: rgba(232, 238, 240, .80);
    font-size: 20px;
    font-weight: 650;
}

.wvmap-ba-ts-body {
    max-height: calc(min(56dvh, 560px) - 62px);
    border-top: 1px solid var(--wvmap-line);
}

.wvmap-ba-ts-item {
    min-height: 66px;
    gap: 10px;
    padding: 8px 12px 8px 15px;
    border-bottom: 1px solid var(--wvmap-line);
}

.wvmap-ba-ts-item__main {
    gap: 4px;
    padding: 7px 0;
}

.wvmap-ba-ts-item__title {
    color: var(--wvmap-text);
    font-size: 15px;
    line-height: 1.2;
    font-weight: 780;
}

.wvmap-ba-ts-item__meta {
    color: var(--wvmap-muted);
    font-size: 11px;
}

.wvmap-ba-ts-item__nav {
    min-height: 40px;
    padding: 0 13px;
    border-radius: 12px;
    background: var(--wvmap-accent-strong);
    box-shadow: 0 3px 10px rgba(35, 118, 142, .18);
    font-size: 12px;
    font-weight: 760;
}

.wvmap-ba-ts-item__nav:active {
    transform: scale(.97);
}

/* ----------------------------------------------------------
   Trennschieber Detail Sheet
   ---------------------------------------------------------- */

.wvmap-ts-sheet {
    width: min(600px, calc(100% - 12px));
    max-height: min(58dvh, 560px);
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 24px 24px 0 0;
    background: var(--wvmap-surface-strong);
    box-shadow: var(--wvmap-shadow-panel);
}

.wvmap-ts-sheet__handle {
    width: 38px;
    height: 4px;
    margin: 9px auto 2px;
    background: rgba(70, 83, 90, .20);
}

.wvmap-ts-sheet__close {
    top: 12px;
    right: 13px;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 27px;
    line-height: 38px;
}

.wvmap-ts-sheet__content {
    padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
}

.wvmap-ts-sheet__title {
    margin: 0 52px 17px 0;
    color: var(--wvmap-text);
    font-size: 21px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.02em;
}

.wvmap-ts-sheet__meta {
    gap: 8px;
    margin-bottom: 15px;
}

.wvmap-ts-sheet__meta > div {
    grid-template-columns: minmax(104px, 32%) 1fr;
    gap: 11px;
    min-height: 30px;
    align-items: center;
}

.wvmap-ts-sheet__meta dt {
    color: var(--wvmap-muted);
    font-size: 13px;
    font-weight: 650;
}

.wvmap-ts-sheet__meta dd {
    color: var(--wvmap-text);
    font-size: 15px;
    font-weight: 720;
}

.wvmap-ts-photo {
    margin: 3px 0 15px;
    border: 1px solid var(--wvmap-line);
    border-radius: 15px;
    background: var(--wvmap-soft);
}

.wvmap-ts-photo img {
    max-height: 230px;
}

.wvmap-ts-photo-empty {
    margin: 3px 0 15px;
    padding: 17px 14px;
    border: 1px solid var(--wvmap-line);
    border-radius: 14px;
    color: var(--wvmap-muted);
    background: rgba(238, 242, 244, .82);
    font-size: 13px;
}

.wvmap-ts-sheet__nav {
    min-height: 50px;
    border-radius: 14px;
    background: var(--wvmap-accent-strong);
    box-shadow: 0 5px 16px rgba(35, 118, 142, .22);
    font-size: 16px;
    font-weight: 780;
}

/* ----------------------------------------------------------
   Attribution dezenter, aber weiterhin gut lesbar
   ---------------------------------------------------------- */

.wvmap-app .leaflet-control-attribution {
    padding: 2px 5px;
    border-radius: 7px 0 0 0;
    color: #5f6a70;
    background: rgba(255, 255, 255, .78);
    font-size: 9px;
    line-height: 1.2;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* ----------------------------------------------------------
   iPhone / schmale Displays
   ---------------------------------------------------------- */

@media (max-width: 600px) {
    .wvmap-location-info {
        max-width: calc(100vw - 146px);
        padding-left: 12px;
        padding-right: 12px;
    }

    .wvmap-search-panel {
        width: calc(100vw - 20px);
    }

    .wvmap-layer-panel {
        width: min(294px, calc(100vw - 20px));
    }

    .wvmap-ba-ts-sheet {
        width: calc(100% - 12px);
        bottom: calc(6px + env(safe-area-inset-bottom));
    }

    .wvmap-ts-sheet {
        width: calc(100% - 8px);
        max-height: 55dvh;
    }

    .wvmap-app.wvmap-has-ba-ts .wvmap-gps-ui {
        bottom: calc(84px + env(safe-area-inset-bottom));
    }
}

@media (min-width: 700px) {
    .wvmap-ts-sheet {
        bottom: 16px;
        border-radius: 24px;
    }
}


/* ==========================================================
   WV MAP UI 0.10.1 – echte SVG-Icons
   Safari/iPhone-sicher, keine zusammengesetzten CSS-Formen.
   ========================================================== */

.wvmap-ui-icon {
    display: block;
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.wvmap-ui-icon path,
.wvmap-ui-icon circle {
    vector-effect: non-scaling-stroke;
}

.wvmap-ui-icon__fill {
    fill: currentColor;
    stroke: none;
}

.wvmap-ui-icon--search {
    width: 24px;
    height: 24px;
}

.wvmap-ui-icon--gps {
    width: 25px;
    height: 25px;
}

.wvmap-ui-icon--layers {
    width: 25px;
    height: 25px;
}

.wvmap-ui-icon--close {
    width: 22px;
    height: 22px;
    stroke-width: 2.25;
}

.wvmap-ui-icon--chevron {
    width: 20px;
    height: 20px;
    stroke-width: 2.25;
}

/* Alte CSS-Zeichnungen vollständig deaktivieren */
.wvmap-search-icon,
.wvmap-layer-icon,
.wvmap-gps-button__icon {
    display: none !important;
}

.wvmap-search-icon::before,
.wvmap-search-icon::after,
.wvmap-layer-icon::before,
.wvmap-layer-icon::after,
.wvmap-gps-button__icon::before,
.wvmap-gps-button__icon::after,
.wvmap-gps-button::before {
    content: none !important;
    display: none !important;
}

/* Exakte Zentrierung in allen Floating Buttons */
.wvmap-search-button,
.wvmap-layer-button,
.wvmap-gps-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.wvmap-search-button > .wvmap-ui-icon,
.wvmap-layer-button > .wvmap-ui-icon,
.wvmap-gps-button > .wvmap-ui-icon {
    margin: 0;
    transform: none;
}

/* Loading verändert nur die Opacity, nicht die Geometrie */
.wvmap-gps-button.is-loading > .wvmap-ui-icon {
    animation: wvmap-svg-icon-pulse .8s ease-in-out infinite alternate;
}

@keyframes wvmap-svg-icon-pulse {
    from {
        opacity: .42;
        transform: scale(.92);
    }
    to {
        opacity: 1;
        transform: scale(1.04);
    }
}

/* X-Buttons mit echtem SVG statt Textzeichen */
.wvmap-search-close,
.wvmap-ts-sheet__close,
.wvmap-photo-lightbox__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

/* Chevron bleibt mittig, Rotation weiterhin über den Container */
.wvmap-ba-ts-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.wvmap-ba-ts-chevron .wvmap-ui-icon {
    width: 19px;
    height: 19px;
}

/* Safari kann Inline-SVG sonst minimal auf der Text-Baseline verschieben */
.wvmap-ui-icon {
    vertical-align: middle;
}


/* ==========================================================
   WV MAP UI 0.10.2 – Trennschieber-Detail mit Foto
   Inhalt bleibt innerhalb des Bottom-Sheets und ist scrollbar.
   ========================================================== */

.wvmap-ts-sheet {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wvmap-ts-sheet.is-open {
    display: flex;
}

/* Der Handle bleibt immer sichtbar, nur der Inhalt scrollt. */
.wvmap-ts-sheet__handle {
    flex: 0 0 auto;
}

.wvmap-ts-sheet__content {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
}

/* Foto darf groß sein, zwingt das Sheet aber nicht mehr über seine Grenze. */
.wvmap-ts-photo img {
    width: 100%;
    height: auto;
    max-height: min(34dvh, 300px);
    object-fit: cover;
}

/* Navigation bleibt beim Scrollen immer erreichbar. */
.wvmap-ts-sheet__nav {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: 14px;
    box-shadow:
        0 -10px 18px rgba(252, 253, 253, .90),
        0 5px 16px rgba(35, 118, 142, .22);
}

/* Etwas Platz, damit der Sticky-Button am Ende nicht auf Inhalt klebt. */
.wvmap-ts-sheet__content::after {
    content: "";
    display: block;
    height: 2px;
}

@media (max-width: 600px) {
    .wvmap-ts-sheet {
        /* Genug Karte bleibt sichtbar; größere Inhalte scrollen intern. */
        max-height: min(58dvh, 650px);
    }

    .wvmap-ts-sheet__content {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .wvmap-ts-photo img {
        max-height: min(31dvh, 280px);
    }
}

@media (min-width: 700px) {
    .wvmap-ts-sheet {
        max-height: min(70dvh, 700px);
    }
}


/* ==========================================================
   WV MAP UI 0.10.3 – draggable Trennschieber Bottom-Sheet
   ========================================================== */

/* 0.10.2 scroll behavior is intentionally overridden. */
.wvmap-ts-sheet {
    --wvmap-ts-drag-y: 0px;
    display: flex;
    flex-direction: column;
    max-height: min(58dvh, 650px);
    overflow: hidden;
    transform:
        translate(
            -50%,
            calc(100% + 32px + var(--wvmap-ts-drag-y))
        );
    transition:
        transform .24s cubic-bezier(.2, .8, .2, 1),
        height .24s cubic-bezier(.2, .8, .2, 1),
        max-height .24s cubic-bezier(.2, .8, .2, 1),
        opacity .18s ease,
        visibility 0s linear .24s;
}

.wvmap-ts-sheet.is-open {
    transform: translate(-50%, var(--wvmap-ts-drag-y));
    opacity: 1;
    visibility: visible;
    transition:
        transform .24s cubic-bezier(.2, .8, .2, 1),
        height .24s cubic-bezier(.2, .8, .2, 1),
        max-height .24s cubic-bezier(.2, .8, .2, 1),
        opacity .18s ease;
}

.wvmap-ts-sheet.is-expanded {
    height: calc(
        100dvh
        - env(safe-area-inset-top)
        - env(safe-area-inset-bottom)
        - 82px
    );
    max-height: calc(
        100dvh
        - env(safe-area-inset-top)
        - env(safe-area-inset-bottom)
        - 82px
    );
}

.wvmap-ts-sheet.is-dragging {
    transition: none !important;
}

/* Large touch area; only the visible bar itself stays small. */
.wvmap-ts-sheet__handle-zone {
    position: relative;
    z-index: 20;
    display: flex;
    min-height: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.wvmap-ts-sheet__handle-zone:active {
    cursor: grabbing;
}

.wvmap-ts-sheet__handle {
    width: 40px;
    height: 4px;
    flex: 0 0 auto;
    margin: 0;
    border-radius: 999px;
    background: rgba(70, 83, 90, .24);
}

/* No inner scrolling. The user enlarges the sheet instead. */
.wvmap-ts-sheet__content {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden !important;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    touch-action: auto;
    scrollbar-width: none;
}

.wvmap-ts-sheet__content::-webkit-scrollbar {
    display: none;
}

/* X must remain above every content layer and receive touch events. */
.wvmap-ts-sheet__close {
    z-index: 40;
    pointer-events: auto;
    touch-action: manipulation;
}

/* The navigation button is part of the normal layout again. */
.wvmap-ts-sheet__nav {
    position: static !important;
    bottom: auto !important;
    z-index: auto;
    margin-top: 14px;
    box-shadow: 0 5px 16px rgba(35, 118, 142, .22);
}

.wvmap-ts-sheet__content::after {
    display: none !important;
}

/* Compact sheet: picture stays compact. */
.wvmap-ts-photo img {
    width: 100%;
    height: auto;
    max-height: min(24dvh, 230px);
    object-fit: cover;
}

/* Expanded sheet: larger picture while keeping all controls visible. */
.wvmap-ts-sheet.is-expanded .wvmap-ts-photo img {
    max-height: min(36dvh, 340px);
}

.wvmap-ts-sheet.is-expanded .wvmap-ts-sheet__content {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

@media (max-width: 600px) {
    .wvmap-ts-sheet {
        max-height: min(58dvh, 650px);
    }

    .wvmap-ts-sheet.is-expanded {
        height: calc(
            100dvh
            - env(safe-area-inset-top)
            - env(safe-area-inset-bottom)
            - 76px
        );
        max-height: calc(
            100dvh
            - env(safe-area-inset-top)
            - env(safe-area-inset-bottom)
            - 76px
        );
    }

    .wvmap-ts-sheet.is-expanded .wvmap-ts-photo img {
        max-height: min(34dvh, 330px);
    }
}

@media (min-width: 700px) {
    .wvmap-ts-sheet.is-expanded {
        height: min(78dvh, 760px);
        max-height: min(78dvh, 760px);
    }
}


/* ==========================================================
   WV MAP UI 0.10.5 – Layerbutton bleibt beim Öffnen fest
   ========================================================== */

.wvmap-layer-ui {
    width: 46px;
    height: 46px;
}

/* Der Button definiert allein die Position des Controls. */
.wvmap-layer-button {
    position: relative;
    z-index: 2;
    margin-left: 0 !important;
}

/* Das Panel nimmt keinen Platz im Container ein und kann den
   Button deshalb weder verschieben noch dessen Position verändern. */
.wvmap-layer-panel {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    margin-top: 0 !important;
}

/* Auf schmalen iPhones bleibt das Panel innerhalb des Viewports. */
@media (max-width: 600px) {
    .wvmap-layer-ui {
        width: 46px;
        height: 46px;
    }

    .wvmap-layer-panel {
        right: 0;
        width: min(300px, calc(100vw - 20px));
    }
}


/* ==========================================================
   WV MAP UI 0.11 – Login / Access / Account
   ========================================================== */

.wvmap-auth-page {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    min-height: 100dvh;
    overflow: hidden;
    padding:
        calc(24px + env(safe-area-inset-top))
        calc(18px + env(safe-area-inset-right))
        calc(24px + env(safe-area-inset-bottom))
        calc(18px + env(safe-area-inset-left));
    color: #172126;
    background:
        radial-gradient(circle at 18% 12%, rgba(56, 164, 194, .16), transparent 34%),
        radial-gradient(circle at 88% 86%, rgba(106, 174, 48, .13), transparent 32%),
        linear-gradient(145deg, #eef4f5 0%, #f8faf9 48%, #edf3ef 100%);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Text",
        "Segoe UI",
        sans-serif;
}

.wvmap-auth-backdrop {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.wvmap-auth-backdrop::before,
.wvmap-auth-backdrop::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(56, 164, 194, .10);
    border-radius: 50%;
}

.wvmap-auth-backdrop::before {
    width: 540px;
    height: 540px;
    top: -300px;
    right: -190px;
}

.wvmap-auth-backdrop::after {
    width: 420px;
    height: 420px;
    bottom: -260px;
    left: -180px;
    border-color: rgba(106, 174, 48, .11);
}

.wvmap-auth-backdrop__field {
    position: absolute;
    width: 430px;
    height: 90px;
    border-top: 1px solid rgba(173, 146, 103, .13);
    border-radius: 50%;
    transform: rotate(-13deg);
}

.wvmap-auth-backdrop .field-a {
    top: 18%;
    left: -90px;
}

.wvmap-auth-backdrop .field-b {
    top: 24%;
    left: -60px;
    opacity: .75;
}

.wvmap-auth-backdrop .field-c {
    right: -110px;
    bottom: 18%;
    transform: rotate(16deg);
    opacity: .7;
}

.wvmap-auth-card {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    box-sizing: border-box;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 28px;
    background: rgba(255, 255, 255, .86);
    box-shadow:
        0 28px 72px rgba(31, 54, 63, .15),
        0 4px 18px rgba(31, 54, 63, .07);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
    backdrop-filter: blur(24px) saturate(145%);
}

.wvmap-auth-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 31px;
}

.wvmap-auth-logo {
    display: block;
    width: auto;
    max-width: 112px;
    height: 62px;
    object-fit: contain;
    object-position: left center;
}

.wvmap-auth-mark {
    display: grid;
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background:
        linear-gradient(
            145deg,
            #38a4c2 0%,
            #2d8da8 52%,
            #267b92 100%
        );
    box-shadow:
        0 10px 24px rgba(45, 141, 168, .25),
        inset 0 1px 0 rgba(255, 255, 255, .22);
}

.wvmap-auth-mark svg {
    width: 39px;
    height: 39px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wvmap-auth-mark .water {
    fill: rgba(255, 255, 255, .09);
}

.wvmap-auth-mark .field {
    stroke-width: 2;
}

.wvmap-auth-brand__text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.wvmap-auth-brand__text span {
    color: #637078;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 680;
}

.wvmap-auth-brand__text strong {
    color: #172126;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 810;
    letter-spacing: -.018em;
}

.wvmap-auth-heading {
    margin-bottom: 22px;
}

.wvmap-auth-heading h1 {
    margin: 0 0 6px;
    color: #172126;
    font-size: 27px;
    line-height: 1.1;
    font-weight: 820;
    letter-spacing: -.035em;
}

.wvmap-auth-heading p {
    margin: 0;
    color: #6b777d;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 510;
}

.wvmap-auth-alert {
    display: grid;
    grid-template-columns: 21px 1fr;
    gap: 9px;
    align-items: center;
    margin: -3px 0 17px;
    padding: 11px 12px;
    border: 1px solid rgba(174, 63, 63, .17);
    border-radius: 13px;
    color: #7c3030;
    background: rgba(252, 238, 238, .92);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 650;
}

.wvmap-auth-alert svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
}

.wvmap-auth-form {
    display: grid;
    gap: 15px;
}

.wvmap-auth-field {
    display: grid;
    gap: 7px;
}

.wvmap-auth-field > span {
    padding-left: 2px;
    color: #536068;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 720;
}

.wvmap-auth-input {
    position: relative;
    display: flex;
    align-items: center;
}

.wvmap-auth-input svg {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: #7b878d;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.wvmap-auth-input input {
    width: 100%;
    height: 51px;
    box-sizing: border-box;
    padding: 0 14px 0 44px;
    border: 1px solid rgba(48, 67, 76, .10);
    border-radius: 14px;
    outline: none;
    color: #172126;
    background: rgba(235, 241, 243, .78);
    font: 650 16px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    transition:
        border-color .14s ease,
        background .14s ease,
        box-shadow .14s ease;
}

.wvmap-auth-input input:focus {
    border-color: rgba(45, 141, 168, .40);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45, 141, 168, .13);
}

.wvmap-auth-submit {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-sizing: border-box;
    margin-top: 3px;
    padding: 10px 16px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background:
        linear-gradient(
            145deg,
            #2f94af,
            #267b92
        );
    box-shadow:
        0 9px 20px rgba(38, 123, 146, .22),
        inset 0 1px 0 rgba(255, 255, 255, .18);
    font: 780 16px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s ease, box-shadow .12s ease;
}

.wvmap-auth-submit:active {
    transform: scale(.985);
    box-shadow:
        0 5px 13px rgba(38, 123, 146, .20),
        inset 0 1px 0 rgba(255, 255, 255, .18);
}

.wvmap-auth-submit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wvmap-auth-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 22px;
    color: #829097;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
}

.wvmap-auth-note svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #6aae30;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wvmap-auth-card--denied {
    text-align: center;
}

.wvmap-auth-mark--denied {
    margin: 0 auto 21px;
    color: #8a4545;
    background: rgba(249, 232, 232, .95);
    box-shadow: none;
}

.wvmap-auth-mark--denied svg {
    width: 34px;
    height: 34px;
}

/* Layer panel account / logout */
.wvmap-account {
    display: grid;
    gap: 11px;
    padding: 1px 3px 0;
}

.wvmap-account__user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.wvmap-account__avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 11px;
    color: #267b92;
    background: rgba(45, 141, 168, .10);
}

.wvmap-account__avatar svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wvmap-account__user > span:last-child {
    display: grid;
    min-width: 0;
}

.wvmap-account__user small {
    color: #7b868c;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 620;
}

.wvmap-account__user strong {
    overflow: hidden;
    color: #253138;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wvmap-logout-form {
    margin: 0;
}

.wvmap-logout-button {
    display: flex;
    width: 100%;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid rgba(118, 60, 60, .11);
    border-radius: 12px;
    color: #8a3d3d;
    background: rgba(249, 238, 238, .80);
    font: 720 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-logout-button:active {
    background: rgba(244, 225, 225, .95);
}

.wvmap-logout-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 600px) {
    .wvmap-auth-page {
        padding:
            calc(18px + env(safe-area-inset-top))
            calc(14px + env(safe-area-inset-right))
            calc(18px + env(safe-area-inset-bottom))
            calc(14px + env(safe-area-inset-left));
    }

    .wvmap-auth-card {
        padding: 24px 20px 22px;
        border-radius: 24px;
    }

    .wvmap-auth-brand {
        margin-bottom: 27px;
    }

    .wvmap-auth-mark {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
        border-radius: 17px;
    }

    .wvmap-auth-heading h1 {
        font-size: 25px;
    }
}


/* ==========================================================
   WV MAP UI 0.11.1 – Login Logo zentriert
   ========================================================== */

.wvmap-auth-brand--logo-only {
    justify-content: center;
    margin-bottom: 34px;
    text-align: center;
}

.wvmap-auth-brand--logo-only .wvmap-auth-logo {
    width: auto;
    max-width: min(220px, 72vw);
    height: auto;
    max-height: 86px;
    object-fit: contain;
    object-position: center;
}

.wvmap-auth-brand--logo-only .wvmap-auth-mark {
    margin: 0 auto;
}

@media (max-width: 600px) {
    .wvmap-auth-brand--logo-only {
        margin-bottom: 30px;
    }

    .wvmap-auth-brand--logo-only .wvmap-auth-logo {
        max-width: min(210px, 72vw);
        max-height: 80px;
    }
}


/* ==========================================================
   WV MAP UI 0.12 – Trennschieberstatus
   ========================================================== */

.wvmap-ts-status-card {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
    margin: 4px 0 15px;
    padding: 11px 13px;
    border: 1px solid rgba(35, 50, 58, .09);
    border-radius: 15px;
    background: rgba(238, 243, 244, .78);
    transition:
        background .16s ease,
        border-color .16s ease;
}

.wvmap-ts-status-card.is-open {
    border-color: rgba(85, 166, 48, .18);
    background: rgba(85, 166, 48, .08);
}

.wvmap-ts-status-card.is-closed {
    border-color: rgba(213, 43, 43, .17);
    background: rgba(213, 43, 43, .07);
}

.wvmap-ts-status-card.is-pending {
    opacity: .72;
}

.wvmap-ts-status-card__text {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.wvmap-ts-status-card__text > span {
    color: #6b777d;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 670;
}

.wvmap-ts-status-card__text strong {
    color: #55a630;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -.01em;
}

.wvmap-ts-status-card__text strong.is-closed {
    color: #c92c2c;
}

.wvmap-ts-status-card__text small {
    min-height: 13px;
    color: #7b878d;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 600;
}

.wvmap-ts-status-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-ts-status-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.wvmap-ts-status-switch__track {
    position: relative;
    display: block;
    width: 58px;
    height: 34px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #d52b2b;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, .06),
        0 2px 6px rgba(28, 42, 49, .10);
    transition: background .18s ease;
}

.wvmap-ts-status-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    box-shadow:
        0 2px 6px rgba(22, 34, 40, .22),
        inset 0 0 0 1px rgba(0, 0, 0, .03);
    transition: transform .18s ease;
}

.wvmap-ts-status-switch input:checked + .wvmap-ts-status-switch__track {
    background: #55a630;
}

.wvmap-ts-status-switch input:checked
+ .wvmap-ts-status-switch__track
.wvmap-ts-status-switch__thumb {
    transform: translateX(24px);
}

.wvmap-ts-status-switch input:focus-visible
+ .wvmap-ts-status-switch__track {
    box-shadow:
        0 0 0 3px rgba(45, 141, 168, .20),
        inset 0 0 0 1px rgba(0, 0, 0, .06);
}

.wvmap-ts-status-switch input:disabled
+ .wvmap-ts-status-switch__track {
    cursor: wait;
}



/* ==========================================================
   WV MAP UI 0.12.1 – Liste geschlossener Trennschieber
   ========================================================== */

.wvmap-closed-ts-ui {
    position: absolute;
    top: calc(166px + env(safe-area-inset-top));
    left: calc(10px + env(safe-area-inset-left));
    z-index: 11845;
    width: 46px;
    height: 46px;
}

.wvmap-closed-ts-button {
    position: relative;
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: var(--wvmap-radius-control);
    color: var(--wvmap-text);
    background: var(--wvmap-surface);
    box-shadow: var(--wvmap-shadow-control);
    cursor: pointer;
    line-height: 0;
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-tap-highlight-color: transparent;
    transition:
        transform .12s ease,
        background .12s ease,
        color .12s ease;
}

.wvmap-closed-ts-button:active {
    transform: scale(.96);
    background: rgba(237, 243, 245, .96);
}

.wvmap-closed-ts-button.has-closed {
    color: #b42323;
}

.wvmap-ui-icon--valve {
    width: 25px;
    height: 25px;
    stroke-width: 1.95;
}

.wvmap-closed-ts-badge {
    position: absolute;
    top: -6px;
    right: -7px;
    display: grid;
    min-width: 19px;
    height: 19px;
    place-items: center;
    box-sizing: border-box;
    padding: 0 5px;
    border: 2px solid rgba(255, 255, 255, .98);
    border-radius: 999px;
    color: #fff;
    background: #d52b2b;
    box-shadow: 0 2px 7px rgba(77, 25, 25, .24);
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
}

.wvmap-closed-ts-sheet {
    z-index: 11910;
}

.wvmap-closed-ts-item {
    grid-template-columns: minmax(0, 1fr) auto;
    transition:
        opacity .15s ease,
        background .15s ease;
}

.wvmap-closed-ts-item.is-saving {
    opacity: .55;
}

.wvmap-closed-ts-item.is-error {
    background: rgba(213, 43, 43, .08);
}

.wvmap-closed-ts-item__actions {
    display: grid;
    grid-template-columns: auto;
    gap: 7px;
    align-content: center;
    justify-items: end;
}

.wvmap-ts-status-switch--small
.wvmap-ts-status-switch__track {
    width: 46px;
    height: 28px;
}

.wvmap-ts-status-switch--small
.wvmap-ts-status-switch__thumb {
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
}

.wvmap-ts-status-switch--small
input:checked
+ .wvmap-ts-status-switch__track
.wvmap-ts-status-switch__thumb {
    transform: translateX(18px);
}

.wvmap-closed-ts-item__nav {
    min-height: 35px;
    padding: 0 10px;
    font-size: 11px;
}

.wvmap-closed-ts-empty {
    min-height: 72px;
    display: grid;
    place-items: center;
}

/* GPS button stays clear of either bottom list. */
.wvmap-app.wvmap-has-closed-ts .wvmap-gps-ui {
    bottom: calc(84px + env(safe-area-inset-bottom));
}

@media (max-width: 600px) {
    .wvmap-closed-ts-ui {
        top: calc(166px + env(safe-area-inset-top));
        left: calc(10px + env(safe-area-inset-left));
    }

    .wvmap-closed-ts-sheet {
        width: calc(100% - 12px);
        bottom: calc(6px + env(safe-area-inset-bottom));
    }

    .wvmap-closed-ts-item {
        min-height: 74px;
        padding-right: 10px;
    }
}


/* ==========================================================
   WV MAP UI 0.13.0 – iPhone / Standalone / Bottom-Sheet-System
   Final authoritative overrides for mobile controls and sheets.
   ========================================================== */

.wvmap-app {
    /* The map itself fills the screen; every interactive UI element handles
       its own safe-area. This avoids double-insetting in iOS standalone mode. */
    padding: 0;
    --wvmap-ui-safe-bottom: max(env(safe-area-inset-bottom), 12px);
    --wvmap-ui-safe-top: max(env(safe-area-inset-top), 0px);
    --wvmap-sheet-drag-y: 0px;
}

.wvmap-app.wvmap-standalone {
    /* Fallback for iOS web clips where safe-area-inset-bottom can briefly be
       reported as 0 while Safari chrome is absent. */
    --wvmap-ui-safe-bottom: max(env(safe-area-inset-bottom), 28px);
}

.wvmap-map {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
}

/* ---------- Common bottom-sheet mechanics ---------- */

.wvmap-bottom-sheet {
    --wvmap-sheet-drag-y: 0px;
}

.wvmap-bottom-sheet.is-dragging {
    transition: none !important;
}

.wvmap-sheet-handle-zone {
    position: relative;
    z-index: 24;
    display: flex;
    min-height: 28px;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.wvmap-sheet-handle-zone:active {
    cursor: grabbing;
}

.wvmap-sheet-handle {
    width: 40px;
    height: 4px;
    flex: 0 0 auto;
    margin: 0;
    border-radius: 999px;
    background: rgba(70, 83, 90, .24);
}

/* List sheets always show a useful compact list. The arrow/gesture only
   changes the available height; it no longer toggles the body to display:none. */
.wvmap-list-sheet {
    display: flex;
    flex-direction: column;
    width: min(640px, calc(100% - 12px));
    max-height: none;
    overflow: hidden;
    transform: translate(-50%, var(--wvmap-sheet-drag-y));
    transition:
        height .24s cubic-bezier(.2, .8, .2, 1),
        transform .18s ease;
}

.wvmap-list-sheet .wvmap-ba-ts-toggle {
    min-height: 58px;
    flex: 0 0 58px;
}

.wvmap-list-sheet .wvmap-ba-ts-body {
    display: block;
    min-height: 0;
    max-height: min(30dvh, 270px);
    flex: 0 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.wvmap-list-sheet.is-expanded {
    height: calc(
        100dvh
        - var(--wvmap-ui-safe-top)
        - var(--wvmap-ui-safe-bottom)
        - 72px
    );
    max-height: calc(
        100dvh
        - var(--wvmap-ui-safe-top)
        - var(--wvmap-ui-safe-bottom)
        - 72px
    );
}

.wvmap-list-sheet.is-expanded .wvmap-ba-ts-body {
    max-height: none;
    flex: 1 1 auto;
}

.wvmap-list-sheet .wvmap-ba-ts-chevron {
    transform: rotate(0deg);
    transition: transform .18s ease;
}

.wvmap-list-sheet.is-expanded .wvmap-ba-ts-chevron {
    transform: rotate(180deg);
}

/* Detail sheet uses the same drag variable and an explicit arrow. */
.wvmap-ts-sheet {
    transform:
        translate(
            -50%,
            calc(100% + 32px + var(--wvmap-sheet-drag-y))
        );
}

.wvmap-ts-sheet.is-open {
    transform: translate(-50%, var(--wvmap-sheet-drag-y));
}

.wvmap-ts-sheet__expand {
    position: absolute;
    top: 34px;
    right: 60px;
    z-index: 40;
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 13px;
    color: var(--wvmap-text);
    background: rgba(231, 236, 238, .94);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-ts-sheet__expand .wvmap-ui-icon {
    width: 19px;
    height: 19px;
    transition: transform .18s ease;
}

.wvmap-ts-sheet.is-expanded
.wvmap-ts-sheet__expand
.wvmap-ui-icon {
    transform: rotate(180deg);
}

.wvmap-ts-sheet__close {
    top: 34px;
}

.wvmap-ts-sheet__title {
    margin-right: 96px;
}

/* ---------- Mobile control sizing ---------- */

@media (max-width: 600px) {
    .wvmap-app {
        --wvmap-mobile-control: 54px;
        --wvmap-mobile-gap: 10px;
        --wvmap-mobile-edge: 12px;
    }

    .wvmap-app .leaflet-top.leaflet-left {
        top: calc(var(--wvmap-ui-safe-top) + var(--wvmap-mobile-edge));
        left: calc(env(safe-area-inset-left) + var(--wvmap-mobile-edge));
    }

    .wvmap-app .leaflet-control-zoom a {
        width: var(--wvmap-mobile-control);
        height: var(--wvmap-mobile-control);
        line-height: calc(var(--wvmap-mobile-control) - 2px);
        font-size: 30px;
    }

    .wvmap-layer-ui,
    .wvmap-layer-button,
    .wvmap-search-button,
    .wvmap-gps-button,
    .wvmap-closed-ts-ui,
    .wvmap-closed-ts-button {
        width: var(--wvmap-mobile-control);
        height: var(--wvmap-mobile-control);
    }

    .wvmap-layer-ui {
        top: calc(var(--wvmap-ui-safe-top) + var(--wvmap-mobile-edge));
        right: calc(env(safe-area-inset-right) + var(--wvmap-mobile-edge));
    }

    /* Two 54px zoom cells + one gap below them. */
    .wvmap-search-ui {
        top: calc(
            var(--wvmap-ui-safe-top)
            + var(--wvmap-mobile-edge)
            + var(--wvmap-mobile-control)
            + var(--wvmap-mobile-control)
            + var(--wvmap-mobile-gap)
        );
        left: calc(env(safe-area-inset-left) + var(--wvmap-mobile-edge));
    }

    .wvmap-closed-ts-ui {
        top: calc(
            var(--wvmap-ui-safe-top)
            + var(--wvmap-mobile-edge)
            + var(--wvmap-mobile-control)
            + var(--wvmap-mobile-control)
            + var(--wvmap-mobile-control)
            + var(--wvmap-mobile-gap)
            + var(--wvmap-mobile-gap)
        );
        left: calc(env(safe-area-inset-left) + var(--wvmap-mobile-edge));
    }

    .wvmap-ui-icon--search,
    .wvmap-ui-icon--gps,
    .wvmap-ui-icon--layers,
    .wvmap-ui-icon--valve {
        width: 29px;
        height: 29px;
    }

    .wvmap-gps-ui {
        right: calc(env(safe-area-inset-right) + var(--wvmap-mobile-edge));
        bottom: calc(var(--wvmap-ui-safe-bottom) + 12px);
    }

    /* In standalone mode give the rounded lower corners even more room. */
    .wvmap-app.wvmap-standalone .wvmap-gps-ui {
        bottom: calc(var(--wvmap-ui-safe-bottom) + 14px);
    }

    .wvmap-location-info {
        max-width: calc(100vw - 168px);
    }

    .wvmap-list-sheet,
    .wvmap-ts-sheet {
        bottom: calc(var(--wvmap-ui-safe-bottom) + 4px);
        width: calc(100% - 12px);
        border-radius: 22px;
    }

    .wvmap-list-sheet.is-expanded,
    .wvmap-ts-sheet.is-expanded {
        height: calc(
            100dvh
            - var(--wvmap-ui-safe-top)
            - var(--wvmap-ui-safe-bottom)
            - 68px
        );
        max-height: calc(
            100dvh
            - var(--wvmap-ui-safe-top)
            - var(--wvmap-ui-safe-bottom)
            - 68px
        );
    }

    /* Compact lists show several entries but leave most of the map visible. */
    .wvmap-list-sheet:not(.is-expanded) .wvmap-ba-ts-body {
        max-height: min(29dvh, 255px);
    }

    /* When a compact list is visible, keep GPS above it. Expanded sheets hide
       the GPS control to prevent an unreachable/overlapping floating button. */
    .wvmap-app.wvmap-has-ba-ts:not(.wvmap-sheet-expanded) .wvmap-gps-ui,
    .wvmap-app.wvmap-has-closed-ts:not(.wvmap-sheet-expanded) .wvmap-gps-ui {
        bottom: calc(
            var(--wvmap-ui-safe-bottom)
            + min(29dvh, 255px)
            + 104px
        );
    }

    .wvmap-app.wvmap-sheet-expanded .wvmap-gps-ui {
        opacity: 0;
        pointer-events: none;
    }

    .wvmap-ts-sheet__expand,
    .wvmap-ts-sheet__close {
        top: 32px;
        width: 42px;
        height: 42px;
    }

    .wvmap-ts-sheet__expand {
        right: 62px;
    }

    .wvmap-ts-sheet__close {
        right: 12px;
    }
}


/* ==========================================================
   WV MAP UI 0.13.1 – inhaltsabhängige Bottom-Sheets
   ========================================================== */

/* Listen sind minimiert wirklich nur die Kopfzeile. */
.wvmap-list-sheet:not(.is-expanded) .wvmap-ba-ts-body {
    display: none !important;
}

.wvmap-list-sheet:not(.is-expanded) .wvmap-ba-ts-toggle small {
    display: none;
}

.wvmap-list-sheet:not(.is-expanded) {
    height: auto !important;
    max-height: none !important;
}

/*
 * Maximiert heißt nicht mehr "fast voller Bildschirm".
 * Die Höhe wird ausschließlich vom tatsächlichen Inhalt bestimmt.
 * Erst bei sehr vielen Einträgen greift die maximale Viewport-Höhe.
 */
.wvmap-list-sheet.is-expanded {
    height: auto !important;
    max-height: calc(
        100dvh
        - var(--wvmap-ui-safe-top)
        - var(--wvmap-ui-safe-bottom)
        - 68px
    ) !important;
}

.wvmap-list-sheet.is-expanded .wvmap-ba-ts-body {
    display: block;
    flex: 0 1 auto;
    max-height: calc(
        100dvh
        - var(--wvmap-ui-safe-top)
        - var(--wvmap-ui-safe-bottom)
        - 68px
        - 86px
    );
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Die Kopfzeile soll in beiden Zuständen nur so hoch wie nötig sein. */
.wvmap-list-sheet .wvmap-ba-ts-toggle {
    min-height: 58px;
    flex: 0 0 auto;
}

/* Status + Navigation auch in der BA-Trennschieberliste. */
.wvmap-ba-status-item {
    grid-template-columns: minmax(0, 1fr) auto;
}

.wvmap-ba-ts-item__actions {
    display: grid;
    grid-template-columns: auto;
    gap: 7px;
    align-content: center;
    justify-items: end;
}

.wvmap-ba-status-item.is-saving {
    opacity: .55;
}

.wvmap-ba-status-item.is-error {
    background: rgba(213, 43, 43, .08);
}

/*
 * Detail-Sheet: beim Aufziehen nur die tatsächlich benötigte Höhe.
 * Kein künstliches "Vollbild-Sheet" und damit kein weißer Leerraum.
 */
.wvmap-ts-sheet.is-expanded {
    height: auto !important;
    max-height: calc(
        100dvh
        - var(--wvmap-ui-safe-top)
        - var(--wvmap-ui-safe-bottom)
        - 68px
    ) !important;
}

/* Das Detail selbst bleibt ohne bewusstes inneres Scrollfenster. */
.wvmap-ts-sheet.is-expanded .wvmap-ts-sheet__content {
    flex: 0 1 auto;
    overflow: hidden !important;
}

/*
 * Fotos werden im großen Detail so begrenzt, dass Metadaten,
 * Status und Navigation auf einem typischen iPhone gemeinsam
 * in das Sheet passen. Kleinere Inhalte erzeugen keinen Leerraum.
 */
.wvmap-ts-sheet.is-expanded .wvmap-ts-photo img {
    width: 100%;
    height: auto;
    max-height: min(28dvh, 270px);
    object-fit: contain;
}

/*
 * Bei kompakten Listen sitzt GPS nur über der Kopfzeile,
 * nicht mehr über einer angenommenen 255px-Liste.
 */
.wvmap-app.wvmap-has-ba-ts:not(.wvmap-sheet-expanded) .wvmap-gps-ui,
.wvmap-app.wvmap-has-closed-ts:not(.wvmap-sheet-expanded) .wvmap-gps-ui {
    bottom: calc(
        var(--wvmap-ui-safe-bottom)
        + 106px
    ) !important;
}

@media (max-width: 600px) {
    .wvmap-list-sheet.is-expanded,
    .wvmap-ts-sheet.is-expanded {
        height: auto !important;
        max-height: calc(
            100dvh
            - var(--wvmap-ui-safe-top)
            - var(--wvmap-ui-safe-bottom)
            - 68px
        ) !important;
    }

    .wvmap-list-sheet.is-expanded .wvmap-ba-ts-body {
        max-height: calc(
            100dvh
            - var(--wvmap-ui-safe-top)
            - var(--wvmap-ui-safe-bottom)
            - 154px
        );
    }

    .wvmap-ts-sheet.is-expanded .wvmap-ts-photo img {
        max-height: min(27dvh, 250px);
    }
}


/* ==========================================================
   WV MAP UI 0.13.2 – TS-Detail standardmäßig vollständig
   ========================================================== */

/* Vollansicht: Höhe nur nach Inhalt, begrenzt durch sichtbaren Bildschirm. */
.wvmap-ts-sheet.is-open.is-expanded {
    height: auto !important;
    max-height: calc(
        100dvh
        - var(--wvmap-ui-safe-top)
        - var(--wvmap-ui-safe-bottom)
        - 20px
    ) !important;
}

.wvmap-ts-sheet.is-open.is-expanded .wvmap-ts-sheet__content {
    flex: 0 1 auto;
    overflow: hidden !important;
    padding-bottom: calc(
        16px + var(--wvmap-ui-safe-bottom)
    );
}

/*
 * Das Foto bleibt wie in der ursprünglichen Ansicht vollbreit.
 * Kein contain-Modus und damit keine grauen Seitenränder.
 */
.wvmap-ts-sheet.is-open.is-expanded .wvmap-ts-photo {
    overflow: hidden;
}

.wvmap-ts-sheet.is-open.is-expanded .wvmap-ts-photo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(30dvh, 290px);
    object-fit: cover !important;
    object-position: center;
}

/* Navigation gehört immer zur vollständigen Detailansicht. */
.wvmap-ts-sheet.is-open.is-expanded .wvmap-ts-sheet__nav {
    display: flex !important;
}

/*
 * Minimiert = nur Kopfzeile mit TS-Name.
 * Auswahl/Marker bleiben aktiv; nur der Detailinhalt wird ausgeblendet.
 */
.wvmap-ts-sheet.is-open:not(.is-expanded) {
    height: auto !important;
    max-height: none !important;
}

.wvmap-ts-sheet.is-open:not(.is-expanded) .wvmap-ts-sheet__content {
    min-height: 56px;
    flex: 0 0 auto;
    overflow: hidden !important;
    padding-top: 8px;
    padding-bottom: 12px;
}

.wvmap-ts-sheet.is-open:not(.is-expanded) .wvmap-ts-sheet__title {
    margin-top: 0;
    margin-bottom: 0;
}

.wvmap-ts-sheet.is-open:not(.is-expanded) .wvmap-ts-sheet__meta,
.wvmap-ts-sheet.is-open:not(.is-expanded) .wvmap-ts-status-card,
.wvmap-ts-sheet.is-open:not(.is-expanded) .wvmap-ts-photo,
.wvmap-ts-sheet.is-open:not(.is-expanded) .wvmap-ts-photo-empty,
.wvmap-ts-sheet.is-open:not(.is-expanded) .wvmap-ts-sheet__nav {
    display: none !important;
}

/* Pfeil: Vollansicht nach unten (= minimieren), kompakt nach oben. */
.wvmap-ts-sheet.is-expanded
.wvmap-ts-sheet__expand
.wvmap-ui-icon {
    transform: rotate(180deg);
}

.wvmap-ts-sheet:not(.is-expanded)
.wvmap-ts-sheet__expand
.wvmap-ui-icon {
    transform: rotate(0deg);
}

@media (max-width: 600px) {
    .wvmap-ts-sheet.is-open.is-expanded {
        max-height: calc(
            100dvh
            - var(--wvmap-ui-safe-top)
            - var(--wvmap-ui-safe-bottom)
            - 14px
        ) !important;
    }

    .wvmap-ts-sheet.is-open.is-expanded .wvmap-ts-photo img {
        max-height: min(29dvh, 275px);
        object-fit: cover !important;
    }
}


/* ==========================================================
   WV MAP UI 0.13.4 – Desktop Hover
   ========================================================== */

@media (hover: hover) and (pointer: fine) {
    .wvmap-app .leaflet-wvmap-bas-pane .leaflet-interactive,
    .wvmap-app .leaflet-wvmap-trennschieber-pane .leaflet-interactive {
        cursor: pointer;
    }
}


/* ==========================================================
   WV MAP UI 0.13.5 – Hover-Info oben
   ========================================================== */

.wvmap-location-info.is-hover-info {
    border-color: rgba(45, 141, 168, .24);
    box-shadow:
        0 10px 28px rgba(24, 39, 47, .16),
        0 2px 7px rgba(24, 39, 47, .10);
}

.wvmap-location-info.is-hover-info .wvmap-location-info__sub {
    color: #2d8da8;
}

@media (hover: none), (pointer: coarse) {
    .wvmap-location-info.is-hover-info {
        /* Sollte auf Touch nie gesetzt werden; Defense in depth. */
        border-color: rgba(255, 255, 255, .76);
    }
}


/* ==========================================================
   WV MAP UI 0.13.7 – Statusverlauf
   ========================================================== */

.wvmap-ts-history-link {
    display: flex;
    width: 100%;
    min-height: 39px;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    margin: -3px 0 13px;
    padding: 7px 9px;
    border: 0;
    border-radius: 10px;
    color: #5d6c74;
    background: transparent;
    font: 680 12px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wvmap-ts-history-link:hover {
    color: #267b92;
    background: rgba(45, 141, 168, .06);
}

.wvmap-ts-history-link:active {
    background: rgba(45, 141, 168, .10);
}

.wvmap-ts-history-link svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wvmap-ts-history-link__chevron {
    margin-left: auto;
    width: 16px !important;
    height: 16px !important;
}

.wvmap-ts-sheet.is-open:not(.is-expanded) .wvmap-ts-history-link {
    display: none !important;
}

.wvmap-history-modal[hidden] {
    display: none !important;
}

.wvmap-history-modal {
    position: fixed;
    inset: 0;
    z-index: 15050;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    padding:
        calc(18px + var(--wvmap-ui-safe-top))
        calc(14px + var(--wvmap-ui-safe-right))
        calc(18px + var(--wvmap-ui-safe-bottom))
        calc(14px + var(--wvmap-ui-safe-left));
}

.wvmap-history-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 29, 35, .34);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.wvmap-history-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    max-height: min(72dvh, 650px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 23px;
    color: #172126;
    background: rgba(255, 255, 255, .97);
    box-shadow:
        0 24px 64px rgba(20, 36, 44, .24),
        0 4px 14px rgba(20, 36, 44, .10);
}

.wvmap-history-modal__header {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 15px 11px 18px;
    border-bottom: 1px solid rgba(20, 35, 44, .08);
}

.wvmap-history-modal__header > div:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.wvmap-history-modal__header small {
    color: #78858b;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
}

.wvmap-history-modal__header h2 {
    overflow: hidden;
    margin: 0;
    color: #172126;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 810;
    letter-spacing: -.018em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wvmap-history-modal__close {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: #28353b;
    background: rgba(231, 236, 238, .94);
    cursor: pointer;
}

.wvmap-history-modal__close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
}

.wvmap-history-current {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: 14px 16px 11px;
    padding: 12px 13px;
    border: 1px solid rgba(25, 42, 50, .07);
    border-radius: 14px;
    background: rgba(238, 243, 244, .72);
}

.wvmap-history-current__status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 790;
}

.wvmap-history-current__status.is-open {
    color: #4c932b;
}

.wvmap-history-current__status.is-closed {
    color: #c72e2e;
}

.wvmap-history-current__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .72);
}

.wvmap-history-current__meta {
    display: grid;
    gap: 2px;
    color: #69767c;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 600;
}

.wvmap-history-list {
    max-height: min(44dvh, 390px);
    overflow-y: auto;
    padding: 0 16px 15px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.wvmap-history-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    min-height: 58px;
    padding: 9px 1px;
    border-bottom: 1px solid rgba(20, 35, 44, .07);
}

.wvmap-history-item:last-child {
    border-bottom: 0;
}

.wvmap-history-item__transition {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wvmap-history-pill {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1;
    font-weight: 760;
}

.wvmap-history-pill.is-open {
    color: #477f2b;
    background: rgba(85, 166, 48, .11);
}

.wvmap-history-pill.is-closed {
    color: #a72a2a;
    background: rgba(213, 43, 43, .10);
}

.wvmap-history-item__arrow {
    color: #8b969b;
    font-size: 13px;
}

.wvmap-history-item__meta {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.wvmap-history-item__meta strong {
    color: #3b484e;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 720;
}

.wvmap-history-item__meta span {
    overflow: hidden;
    color: #7a868c;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 590;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wvmap-history-empty,
.wvmap-history-message {
    padding: 20px 17px 22px;
    color: #748188;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 590;
    text-align: center;
}

.wvmap-history-message:empty {
    display: none;
}

body.wvmap-history-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .wvmap-history-modal {
        align-items: end;
        padding:
            var(--wvmap-ui-safe-top)
            8px
            calc(8px + var(--wvmap-ui-safe-bottom))
            8px;
    }

    .wvmap-history-modal__dialog {
        width: 100%;
        max-height: min(74dvh, 690px);
        border-radius: 23px;
    }

    .wvmap-history-list {
        max-height: min(45dvh, 420px);
    }
}


/* ==========================================================
   WV MAP 1.0.0 – PWA / Home-Screen polish
   ========================================================== */

/*
 * Installed app mode is already detected in app.js.
 * This final release gives the standalone page a deterministic system
 * background around iOS safe areas without changing the map itself.
 */
html,
body {
    background: #eef4f5;
}

.wvmap-app.wvmap-standalone {
    -webkit-user-select: none;
    user-select: none;
}

/*
 * Inputs and selectable result text remain usable despite the app-like
 * default above.
 */
.wvmap-app.wvmap-standalone input,
.wvmap-app.wvmap-standalone textarea,
.wvmap-app.wvmap-standalone .wvmap-search-results,
.wvmap-auth-page input {
    -webkit-user-select: text;
    user-select: text;
}


/* ==========================================================
   v1.1.0 - BA-Detail: Stammdaten + kompakte 2-Zeilen-Kopfzeile
   ========================================================== */

/* Im BA-Sheet bleibt die zweite Kopfzeile (Anzahl TS) auch minimiert sichtbar. */
#wvmap-ba-ts-sheet:not(.is-expanded) .wvmap-ba-ts-toggle small {
    display: block !important;
}

#wvmap-ba-ts-sheet .wvmap-ba-ts-toggle > span:first-child {
    min-width: 0;
}

#wvmap-ba-ts-sheet .wvmap-ba-ts-toggle strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wvmap-ba-ts-sheet .wvmap-ba-ts-toggle small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.25;
    color: rgba(38, 50, 56, .68);
}

.wvmap-ba-meta {
    padding: 2px 16px 10px;
    border-bottom: 1px solid rgba(38, 50, 56, .10);
}

.wvmap-ba-meta__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 7px 0;
}

.wvmap-ba-meta__row span {
    font-size: 11px;
    line-height: 1.2;
    color: rgba(38, 50, 56, .62);
}

.wvmap-ba-meta__row strong {
    font-size: 14px;
    line-height: 1.3;
    color: #263238;
    font-weight: 700;
}

.wvmap-ba-ts-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px 6px;
}

.wvmap-ba-ts-list-head strong {
    font-size: 13px;
    color: #263238;
}

.wvmap-ba-ts-list-head small {
    font-size: 11px;
    color: rgba(38, 50, 56, .58);
    text-align: right;
}

@media (min-width: 720px) {
    .wvmap-ba-meta__row {
        grid-template-columns: 160px minmax(0, 1fr);
        align-items: baseline;
        gap: 12px;
    }
}

/* v1.1.1 - BA-Kopfzeile nach Schema PW - BA - Zusatzbezeichnung */


/* ==========================================================
   v1.1.2 - BA-Detail: klare Informationshierarchie
   ========================================================== */

/*
 * Kopf des BA-Sheets:
 * 1. Zeile: PW - BA Zusatzbezeichnung
 * 2. Zeile: Anzahl Trennschieber
 * Beide Zeilen bleiben auch im minimierten Zustand sichtbar.
 */
#wvmap-ba-ts-sheet .wvmap-ba-ts-toggle {
    align-items: center;
    padding: 10px 16px 11px;
    min-height: 72px;
}

#wvmap-ba-ts-sheet .wvmap-ba-ts-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}

#wvmap-ba-ts-sheet .wvmap-ba-ts-heading strong,
#wvmap-ba-ts-sheet #wvmap-ba-ts-title {
    display: block;
    max-width: 100%;
    margin: 0;
    color: #263238;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 750;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wvmap-ba-ts-sheet .wvmap-ba-ts-count,
#wvmap-ba-ts-sheet #wvmap-ba-ts-sort {
    display: block !important;
    margin: 0;
    color: #263238;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.005em;
}

/*
 * Aufgeklappte Zusatzinformationen bewusst zurückhaltend wie die bisherige
 * Sortierzeile. Keine Karten-/Formularoptik und keine unnötige Überschrift.
 */
#wvmap-ba-ts-sheet .wvmap-ba-meta {
    padding: 1px 16px 10px;
    border-bottom: 1px solid rgba(38, 50, 56, .12);
}

#wvmap-ba-ts-sheet .wvmap-ba-meta__line,
#wvmap-ba-ts-sheet .wvmap-ba-meta__sort {
    display: block;
    padding: 0;
    margin: 0;
    color: rgba(38, 50, 56, .62);
    font-size: 11px;
    line-height: 1.45;
    font-weight: 400;
}

#wvmap-ba-ts-sheet .wvmap-ba-meta__line + .wvmap-ba-meta__line {
    margin-top: 1px;
}

#wvmap-ba-ts-sheet .wvmap-ba-meta__sort {
    margin-top: 5px;
}

#wvmap-ba-ts-sheet .wvmap-ba-meta__line span {
    display: inline;
    color: inherit;
    font: inherit;
}

/* Alte v1.1.0-Strukturen werden in v1.1.2 nicht mehr verwendet. */
#wvmap-ba-ts-sheet .wvmap-ba-ts-list-head {
    display: none !important;
}

/* Die erste TS-Zeile beginnt direkt nach der Trennlinie der Metadaten. */
#wvmap-ba-ts-sheet .wvmap-ba-ts-list {
    padding-top: 0;
}

/* Auf kleineren iPhones nicht unnötig viel Höhe im Kopf verschenken. */
@media (max-width: 430px) {
    #wvmap-ba-ts-sheet .wvmap-ba-ts-toggle {
        min-height: 68px;
        padding-top: 8px;
        padding-bottom: 9px;
    }

    #wvmap-ba-ts-sheet .wvmap-ba-ts-heading strong,
    #wvmap-ba-ts-sheet #wvmap-ba-ts-title {
        font-size: 15px;
    }

    #wvmap-ba-ts-sheet .wvmap-ba-ts-count,
    #wvmap-ba-ts-sheet #wvmap-ba-ts-sort {
        font-size: 14px;
    }
}


/* ==========================================================
   v1.1.3 - iPhone BA-Sheet: kompakter Kopf + kompakte TS-Zeilen
   ========================================================== */

/*
 * Der Griff soll sichtbar bleiben, im minimierten Zustand aber keinen großen
 * weißen Leerraum oberhalb der BA-Bezeichnung erzeugen.
 */


#wvmap-ba-ts-sheet #wvmap-ba-ts-handle {
    min-height: 20px;
    flex-basis: 20px;
}

#wvmap-ba-ts-sheet:not(.is-expanded) #wvmap-ba-ts-handle {
    min-height: 15px;
    flex-basis: 15px;
}

#wvmap-ba-ts-sheet #wvmap-ba-ts-handle .wvmap-sheet-handle {
    width: 36px;
    height: 4px;
}

/* Zwei klare Kopfzeilen, ohne unnötige Höhe. */
#wvmap-ba-ts-sheet .wvmap-ba-ts-toggle {
    min-height: 62px;
    padding: 6px 16px 9px;
}

#wvmap-ba-ts-sheet:not(.is-expanded) .wvmap-ba-ts-toggle {
    min-height: 60px;
    padding-top: 4px;
    padding-bottom: 8px;
}

#wvmap-ba-ts-sheet .wvmap-ba-ts-heading {
    gap: 3px;
}

/*
 * Zusatzdaten mit etwas Luft zur oberen und unteren Trennlinie. Sortierung
 * bleibt die letzte Information vor der Linie zur TS-Liste.
 */
#wvmap-ba-ts-sheet .wvmap-ba-meta {
    padding: 8px 16px 13px;
    border-bottom: 1px solid rgba(38, 50, 56, .12);
}

#wvmap-ba-ts-sheet .wvmap-ba-meta__line,
#wvmap-ba-ts-sheet .wvmap-ba-meta__sort {
    font-size: 12px;
    line-height: 1.42;
}

#wvmap-ba-ts-sheet .wvmap-ba-meta__line + .wvmap-ba-meta__line {
    margin-top: 2px;
}

#wvmap-ba-ts-sheet .wvmap-ba-meta__sort {
    margin-top: 8px;
}

/*
 * Links Name + Status/ID, rechts Navigation + Offen/Zu nebeneinander.
 * Dadurch ist die gesamte Zeile nur ungefähr so hoch wie die zwei Textzeilen.
 */
#wvmap-ba-ts-sheet .wvmap-ba-ts-item {
    min-height: 66px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 15px;
}

#wvmap-ba-ts-sheet .wvmap-ba-ts-item__main {
    min-height: 50px;
    gap: 4px;
    padding: 5px 0;
}

#wvmap-ba-ts-sheet .wvmap-ba-ts-item__actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    align-self: center;
    white-space: nowrap;
}

#wvmap-ba-ts-sheet .wvmap-ba-ts-item__nav,
#wvmap-ba-ts-sheet .wvmap-closed-ts-item__nav {
    min-height: 42px;
    height: 42px;
    box-sizing: border-box;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 12px;
}

#wvmap-ba-ts-sheet .wvmap-ts-status-switch--small .wvmap-ts-status-switch__track {
    width: 50px;
    height: 30px;
}

#wvmap-ba-ts-sheet .wvmap-ts-status-switch--small .wvmap-ts-status-switch__thumb {
    width: 24px;
    height: 24px;
}

#wvmap-ba-ts-sheet .wvmap-ts-status-switch--small input:checked
+ .wvmap-ts-status-switch__track .wvmap-ts-status-switch__thumb {
    transform: translateX(20px);
}

/*
 * Auf dem iPhone darf eine lange BA-Liste nicht fast die ganze Karte belegen.
 * Bei vielen TS scrollt nur die Liste innerhalb des Sheets.
 */
@media (max-width: 600px) {
    #wvmap-ba-ts-sheet.is-expanded {
        max-height: min(48dvh, 500px) !important;
    }

    #wvmap-ba-ts-sheet.is-expanded .wvmap-ba-ts-body {
        max-height: calc(min(48dvh, 500px) - 82px) !important;
    }

    #wvmap-ba-ts-sheet .wvmap-ba-ts-toggle {
        min-height: 60px;
        padding-left: 14px;
        padding-right: 12px;
    }

    #wvmap-ba-ts-sheet .wvmap-ba-ts-item {
        min-height: 64px;
        padding-left: 14px;
        padding-right: 10px;
    }

    #wvmap-ba-ts-sheet .wvmap-ba-ts-item__title {
        font-size: 15px;
    }

    #wvmap-ba-ts-sheet .wvmap-ba-ts-item__meta {
        font-size: 11px;
    }

    #wvmap-ba-ts-sheet .wvmap-ba-ts-item__nav,
    #wvmap-ba-ts-sheet .wvmap-closed-ts-item__nav {
        min-height: 40px;
        height: 40px;
        padding: 0 10px;
        font-size: 11px;
    }

    #wvmap-ba-ts-sheet .wvmap-ts-status-switch--small .wvmap-ts-status-switch__track {
        width: 48px;
        height: 30px;
    }

    #wvmap-ba-ts-sheet .wvmap-ts-status-switch--small input:checked
    + .wvmap-ts-status-switch__track .wvmap-ts-status-switch__thumb {
        transform: translateX(18px);
    }
}
