html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #000;
}

form {
    min-height: 100%;
}

#map {
    position: fixed;
    top: var(--map-top, var(--navbar-height, 56px)); /* 避開導覽列（由 Master 動態量測） */
    left: 0;
    right: 0;
    bottom: 0; /* 其餘空間全滿 */
    width: 100vw;
    height: calc(var(--app-height, 100vh) - var(--map-top, var(--navbar-height, 56px)));
    background: #000;
}

@supports (height: 100dvh) {
    #map {
        height: calc(100dvh - var(--map-top, var(--navbar-height, 56px)));
    }
}

.ol-zoom {
    top: 16px; /* 距離地圖上緣保留操作空間 */
    left: auto; /* 取消左側定位 */
    right: calc(10px + env(safe-area-inset-right, 0px)); /* 改為靠右側 10px */
}

.panel-toggle {
    position: absolute;
    top: var(--map-control-top, calc(var(--map-top, var(--navbar-height, 56px)) + 16px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    z-index: 1100;
}

.floating-panel {
    position: absolute;
    top: calc(var(--map-control-top, calc(var(--map-top, var(--navbar-height, 56px)) + 16px)) + 42px);
    left: calc(12px + env(safe-area-inset-left, 0px));
    width: 320px;
    max-width: calc(100% - 24px);
    background: rgba(33, 37, 41, 0.85);
    color: #fff;
    border-radius: 12px;
    padding: 12px;
    z-index: 1099;
    backdrop-filter: blur(4px);
}

    .floating-panel h6 {
        margin: 0 0 8px 0;
    }

    .floating-panel .form-label {
        color: #adb5bd;
    }

    .floating-panel .btn-sm {
        padding-top: .25rem;
        padding-bottom: .25rem;
    }

.ol-tooltip {
    position: absolute;
    background: rgba(0, 60, 136, 0.7);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    transform: translate(-50%, -100%);
}

.ol-tooltip-measure {
    opacity: 0.9;
    font-size: 12px;
}

.ol-tooltip-static {
    background-color: rgba(255, 255, 255, 0.8);
    color: #111;
    border: 1px solid #ccc;
}
