﻿/* Cesium Viewer Styles */

:root {
    --header-height: 50px;
    --footer-height: 28px;
    --primary-color: #8B0000;
    --primary-color-rgb: 139, 0, 0;
    --primary-hover: #B22222;
    --iconbar-width: 48px;

    /* Ergebnis- und Schlüssel/Wert-Tabellen — identisch zu 2d/css/base.css,
       damit beide Clients gleich aussehen. Siehe doku/styleguide.md. */
    --table-font-size: 12px;
    --table-cell-padding: 5px 10px;
    --table-head-bg: #f5f5f5;
    --table-head-color: #444;
    --table-head-line: #ddd;
    --table-line: #eee;
    --table-row-hover: #fafafa;
    --table-action-size: 20px;
    --table-action-bg: #666;
    --table-action-bg-hover: #444;
    --table-action-bg-active: #333;
    --table-kv-font-size: 12px;
    --table-kv-cell-padding: 4px 8px;
    --table-zebra: #f8f8f8;
    --toolbar-bg: #fafafa;
    --toolbar-text: #555;
}

/* ============================================
   ICON SIDEBAR (Google Maps Style)
   ============================================ */
.sidebar-iconbar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--iconbar-width);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 6px;
    z-index: 1600;
    border-right: 1px solid #e0e0e0;
    pointer-events: auto;
    overflow: hidden;
}

.sidebar-iconbar::-webkit-scrollbar {
    width: 0;
}

.iconbar-btn {
    width: 40px;
    min-height: 40px;
    margin: 2px 0;
    padding: 6px 0 4px 0;
    background: transparent;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.2s ease;
    color: #5f6368;
    position: relative;
}

.iconbar-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

.iconbar-btn.active {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.1);
}

.iconbar-btn i {
    font-size: 18px;
    line-height: 1;
}

.iconbar-label {
    font-size: 9px;
    font-weight: 500;
    line-height: 1.1;
    max-width: 44px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

#cesiumContainer {
    position: relative;
    width: 100%;
    height: calc(100% - var(--header-height));
    margin-top: var(--header-height);
    overflow: hidden;
}

/* ============================================
   HEADER
   ============================================ */
#appHeader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 0 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.header-home-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
}

.header-logo {
    height: 35px;
    width: auto;
}

#appHeader h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--title-color, var(--primary-color));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Search Panel (unter Header) */
#searchPanel {
    position: fixed;
    top: var(--header-height);
    left: 300px; /* Control panel width */
    right: 0;
    background: transparent;
    padding: 12px 15px;
    z-index: 1900;
    transform: translateY(-100%);
    transition: transform 0.3s ease, left 0.3s ease;
    pointer-events: none;
}

#searchPanel.visible {
    transform: translateY(0);
}

#searchPanel .search-container {
    pointer-events: auto;
}

/* Adjust search panel when control panel is hidden */
#controlPanel:not(.panel-visible) ~ #cesiumContainer ~ #searchPanel,
body:has(#controlPanel:not(.panel-visible)) #searchPanel {
    left: 0;
}

.search-container {
    position: relative;
    width: 270px;
    margin: 0 auto; /* Center the search field */
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 21px;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

#placeSearch {
    width: 100%;
    padding: 10px 36px 10px 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    outline: none;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

#placeSearch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(var(--primary-color-rgb), 0.3);
}

#placeSearch::placeholder {
    color: #999;
}

.clear-search-btn {
    position: absolute;
    right: 6px;
    top: 21px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.clear-search-btn:hover {
    background: rgba(var(--primary-color-rgb), 0.15);
    color: var(--primary-hover);
}

.clear-search-btn.visible {
    display: flex;
}

/* Autocomplete Dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    margin-top: 4px;
}

.search-results.visible {
    display: block;
}

.search-results li {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #444;
}

.search-results li:last-child {
    border-bottom: none;
}

.search-results li:hover,
.search-results li.selected {
    background: rgba(var(--primary-color-rgb), 0.08);
}

.search-results li mark {
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== Adresssuche aus eigenen Tabellen (provider 'address', Klassen wie im 2D-Client) ===== */
.search-results li.alkis-street-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.alkis-street-icon {
    color: var(--primary-color);
    font-size: 14px;
    flex-shrink: 0;
}
/* Text der Trefferzeile als EIN Flex-Element (sonst Lücken um <mark>) */
.alkis-street-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-results li.alkis-houses-row {
    padding: 10px 14px 12px;
    cursor: default;
    background: #fafafa;
}
.search-results li.alkis-houses-row:hover {
    background: #fafafa;
}
.alkis-houses-label,
.alkis-houses-empty {
    font-size: 12px;
    color: #777;
    margin-bottom: 6px;
}
.alkis-houses-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.alkis-house-btn {
    min-width: 32px;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
}
.alkis-house-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.alkis-house-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ===== POI-Integration in der Ortssuche (2. Sektion) ===== */
.search-results li.search-section-header {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #888;
    background: #f3f5f7;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 6px;
}
.search-results li.search-section-header:hover {
    background: #f3f5f7;
}
.search-results li.search-poi-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-results li.search-poi-item .search-poi-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}
.search-results li.search-poi-item .search-poi-icon-fa {
    width: 20px;
    text-align: center;
    color: #888;
    flex-shrink: 0;
}
.search-poi-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-poi-badge {
    font-size: 10px;
    color: #666;
    background: #eef2f5;
    border-radius: 8px;
    padding: 1px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}
.search-results li.search-more-item {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    padding: 7px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.search-results li.search-more-item:hover {
    background: rgba(var(--primary-color-rgb), 0.08);
}

/* Header Tools Container */
.header-tools {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Header Tool Buttons (40x40px einheitlich) */
.header-tool-btn,
a.header-tool-btn,
button.header-tool-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-sizing: border-box;
    text-decoration: none;
    padding: 0;
    margin: 0;
    line-height: 1;
    flex-shrink: 0;
    flex-grow: 0;
}

.header-tool-btn:hover,
a.header-tool-btn:hover,
button.header-tool-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.header-tool-btn.active,
a.header-tool-btn.active,
button.header-tool-btn.active {
    background: var(--primary-color);
    color: #fff;
}

/* Hamburger Menu Button */
.menu-toggle {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.menu-toggle:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
}

.menu-toggle.active {
    background: rgba(var(--primary-color-rgb), 0.15);
}

/* ============================================
   USER MENU (Login/Logout)
   ============================================ */
.header-user-menu {
    position: relative;
    flex-shrink: 0;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    display: none;
    z-index: 3000;
    overflow: hidden;
}

.user-dropdown.visible {
    display: block;
}

.user-dropdown-header {
    padding: 12px 14px;
    background: rgba(var(--primary-color-rgb), 0.05);
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-weight: 500;
}

.user-dropdown-header i {
    font-size: 20px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #444;
    text-decoration: none;
    transition: background 0.2s;
}

.user-dropdown-item:hover {
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-color);
}

.user-dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ============================================
   CONTROL PANEL
   ============================================ */
#controlPanel {
    --panel-width: 300px; /* Fallback, wird per inline-style überschrieben */
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--panel-width);
    background: #fff;
    padding: 0;
    color: #333;
    font-family: Arial, sans-serif;
    z-index: 1500;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#controlPanel.panel-visible {
    transform: translateX(0);
}

/* Panel neben Iconbar positionieren */
#controlPanel.has-iconbar {
    left: var(--iconbar-width);
}

#controlPanel.has-iconbar:not(.panel-visible) {
    transform: translateX(calc(-100% - var(--iconbar-width)));
}

/* Resize Handle - außerhalb des Panels positioniert */
.panel-resize-handle {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    background: transparent;
    z-index: 1600;
    touch-action: none;
    /* Position wird per JS gesetzt, initial versteckt */
    left: -100px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.panel-resize-handle.visible {
    opacity: 1;
}

.panel-resize-handle:hover {
    background: rgba(0, 0, 0, 0.08);
}

.panel-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 24px;
    background: #bbb;
    border-radius: 2px;
}

.panel-resize-handle:hover::after {
    background: var(--primary-color);
}

/* Resize-Cursor für gesamten Body während Resize */
body.resizing-panel {
    cursor: col-resize !important;
    user-select: none;
}

body.resizing-panel * {
    cursor: col-resize !important;
}

/* Transition während Resize deaktivieren */
body.resizing-panel #controlPanel {
    transition: none !important;
}

/* Panel Header */
#panelHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 10px 15px;
    background: var(--primary-color);
    flex-shrink: 0;
}

#panelHeader .panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.panel-header-actions {
    display: flex;
    gap: 6px;
}

#layerSearchToggle,
#panelCloseBtn,
#sidebar-help-btn {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.add-wms-btn {
    height: 26px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 4px;
    padding: 0 8px 0 6px;
    transition: all 0.2s;
}

.add-wms-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.add-wms-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
}

#layerSearchToggle:hover,
#panelCloseBtn:hover,
#sidebar-help-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#layerSearchToggle.active {
    background: rgba(255, 255, 255, 0.4);
}

/* Panel Tabs (Legacy, ersetzt durch Iconbar) */

/* Tab Content */
.panel-tab-content {
    display: none;
}

.panel-tab-content.active {
    display: block;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

#tab-layers.panel-tab-content.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Wenn weder Tabs noch Iconbar vorhanden: tab-layers direkt anzeigen */
#controlPanel:not(.has-tabs):not(.has-iconbar) #tab-layers {
    display: block;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Tab-Content: Padding des Panels kompensieren */
#tab-alkis,
#tab-bebauungsplan,
#tab-routing,
#tab-weinlagen,
#tab-wea {
    margin: 0;
}

#tab-routing .routing-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 100px);
}

#tab-alkis .alkis-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 100px); /* Header + Tabs */
}

/* Suchformular-Styling wie im 2D-Client */
#tab-alkis .alkis-search-form {
    padding: 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

#tab-alkis .alkis-search-form.compact {
    padding: 10px 12px;
}

#tab-alkis .alkis-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#tab-alkis .alkis-form-group {
    flex: 1;
    margin-bottom: 0;
}

#tab-alkis .alkis-form-group.flex-2 {
    flex: 2;
}

#tab-alkis .alkis-form-group.flex-1 {
    flex: 1;
}

#tab-alkis .alkis-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

#tab-alkis .alkis-form-group input {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
}

#tab-alkis .alkis-form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
}

#tab-alkis .alkis-form-group input[readonly] {
    background: #f5f5f5;
    color: #888;
}

#tab-alkis .alkis-button-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

#tab-alkis .alkis-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#tab-alkis .alkis-btn-primary {
    flex: 1;
    background: var(--primary-color);
    color: #fff;
}

#tab-alkis .alkis-btn-primary:hover {
    background: var(--primary-hover);
}

#tab-alkis .alkis-btn-secondary {
    padding: 8px 12px;
    background: #e9ecef;
    color: #333;
}

#tab-alkis .alkis-btn-secondary:hover {
    background: #ddd;
}

/* Weinlagen-Suche Tab */
#tab-weinlagen .weinlagen-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 100px);
    overflow: visible;
}

#tab-weinlagen .weinlagen-search-form {
    padding: 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    overflow: visible;
}

#tab-weinlagen .weinlagen-search-form.compact {
    padding: 10px 12px;
}

#tab-weinlagen #weinlagen-results {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#tab-weinlagen #weinlagen-results-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 50px;
}

/* Weinlagen-Formular im 3D-Panel begrenzen */
#tab-weinlagen .weinlagen-form-group input,
#tab-weinlagen .weinlagen-form-group select {
    box-sizing: border-box;
}

#tab-weinlagen .weinlagen-autocomplete-results {
    min-width: 100%;
    max-width: calc(300px - 24px);
    box-sizing: border-box;
}

#tab-weinlagen .weinlagen-name-wrapper {
    position: relative;
    overflow: visible;
}

#tab-weinlagen .weinlagen-search-form {
    overflow-x: hidden;
}

/* Weinlagen Info-Modal Tabelle */
.weinlagen-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.weinlagen-info-table tr {
    border-bottom: 1px solid #eee;
}

.weinlagen-info-table tr:last-child {
    border-bottom: none;
}

.weinlagen-info-key {
    padding: 7px 10px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
    width: 1%;
    vertical-align: top;
}

.weinlagen-info-value {
    padding: 7px 10px;
    color: #333;
    word-break: break-word;
}

/* Layer Search */
#layerSearchContainer {
    /* Flex-Zeile: Suchfeld dehnbar, Baum-Buttons rechts daneben */
    display: flex;
    align-items: center;
    gap: 2px;
    position: relative;
    flex-shrink: 0;
    margin: 0;
    padding: 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

#layerSearchInput {
    width: 100%;
    padding: 8px 32px 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#layerSearchInput:focus {
    border-color: var(--primary-color);
}

#layerSearchContainer .layer-search-field {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

/* Baum auf-/zuklappen — sitzen in der Suchzeile, kosten keine zusaetzliche Hoehe. */
.tree-tools-btn {
    flex: 0 0 auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 6px;
    color: #9a9a9a;
    font-size: 12px;
    line-height: 1;
    border-radius: 3px;
}
.tree-tools-btn:hover { color: #444; background: #e8e8e8; }

#layerSearchClear {
    position: absolute;
    /* relativ zum Suchfeld, nicht zur Zeile — vertraegt die Buttons daneben */
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    font-size: 12px;
    display: none;
    transition: color 0.2s;
}

#layerSearchClear.visible {
    display: block;
}

#layerSearchClear:hover {
    color: #666;
}

/* Search Highlight */
.lt-search-highlight {
    background: #ffeb3b;
    color: #000;
    font-weight: 600;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Search Hidden */
.lt-search-hidden {
    display: none !important;
}

/* Search Match */
.lt-group.lt-search-match > .lt-group-header,
.lt-layer.lt-search-match {
    background: rgba(255, 235, 59, 0.15);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 15px 0;
    padding: 12px 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 600;
}

.close-panel-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-panel-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

#controlPanel h3 {
    margin: 0;
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 600;
}

/* ============================================
   FOLDER / ACCORDION STYLES
   ============================================ */
.folder {
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.folder-header {
    background: rgba(var(--primary-color-rgb), 0.08);
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
    color: var(--primary-color);
}

.folder-header:hover {
    background: rgba(var(--primary-color-rgb), 0.15);
}

.folder-header::after {
    content: 'â–¼';
    font-size: 10px;
    transition: transform 0.2s;
    color: var(--primary-color);
}

.folder.collapsed .folder-header::after {
    transform: rotate(-90deg);
}

.folder-content {
    padding: 10px;
    background: #fafafa;
}

.folder.collapsed .folder-content {
    display: none;
}

/* ============================================
   LAYER CONTROLS
   ============================================ */
.layer-control {
    margin: 8px 0;
    display: flex;
    align-items: center;
}

.layer-control label {
    margin-left: 8px;
    cursor: pointer;
    flex: 1;
    font-size: 13px;
    color: #333;
}

.layer-control input[type="checkbox"],
.layer-control input[type="radio"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

/* Farb-Indikator fÃ¼r GeoJSON Layer */
.layer-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Fly-To Button fÃ¼r Layer */
.layer-flyto-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px 6px;
    margin-left: 4px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.layer-flyto-btn:hover {
    background: var(--primary-color);
    color: white;
}

.layer-flyto-btn i {
    pointer-events: none;
}

/* ===== BASEMAP SELECTOR ===== */

#basemap-selector {
    padding: 8px 12px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

#basemap-selector:empty {
    display: none;
}

.basemap-selector-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
}

.basemap-selector-select {
    width: 100%;
    padding: 6px 28px 6px 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E") no-repeat right 8px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    color: #333;
}

.basemap-selector-select:focus {
    outline: none;
    border-color: var(--primary-color, #007acc);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.12);
}

/* Basemap Opacity Wrap */
.basemap-opacity-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    min-width: 0;
}

/* Basemap Opacity Slider */
.basemap-opacity-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: #ccc;
    outline: none;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.basemap-opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color, #007acc);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.basemap-opacity-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color, #007acc);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.basemap-opacity-slider::-webkit-slider-thumb:hover {
    background: var(--primary-hover, #005a9e);
    transform: scale(1.1);
}

.basemap-opacity-slider::-moz-range-thumb:hover {
    background: var(--primary-hover, #005a9e);
    transform: scale(1.1);
}

/* Basemap Info Button */
.basemap-info-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0 2px;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.basemap-info-btn:hover {
    color: var(--primary-color, #007acc);
}

/* ============================================
   LAYER TREE (Hierarchischer Layerbaum)
   ============================================ */
#layerTreeContainer {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    margin: 0;
    padding: 6px 0;
    padding-bottom: 40px;  /* Mehr Abstand zur Fußzeile für besseres Scrollen */
}

/* Gruppe */
.lt-group {
    margin-bottom: 2px;
}

.lt-group-header {
    display: flex;
    align-items: center;
    padding: 6px 6px;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.lt-group-header:hover {
    background: #eee;
}

/* Auf-/Zuklapp-Knopf (seit 26.10.2026 ein <button> statt eines <i>, Barrierefreiheit).
   Sieht aus wie vorher; gedreht wird nur das Icon, damit der Fokusrahmen gerade bleibt. */
.lt-toggle {
    width: 16px;
    font-size: 10px;
    color: #666;
    margin-right: 6px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}

.lt-toggle > i {
    transition: transform 0.2s ease;
}

.lt-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 2px;
}

.lt-group.collapsed .lt-toggle > i {
    transform: rotate(-90deg);
}

.lt-group-checkbox {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Visuelles Feedback fÃ¼r Gruppen mit aktiven Layern */
/* Deaktiviert - Schrift soll sich nicht ändern
.lt-group-header.has-active-layers .lt-group-name {
    font-weight: 600;
    color: var(--primary-color);
}

.lt-group-header.has-active-layers .lt-group-icon {
    color: var(--primary-color);
}
*/

.lt-group-icon {
    font-size: 12px;
    color: var(--primary-color);
    margin-right: 6px;
    width: 16px;
    text-align: center;
}

/* Ordner-Icon wechselt zwischen geschlossen und offen — wie im 2D-Client
   (.folder-icon in 2d/css/sidebar.css). Zwei bewusste Einschraenkungen:
   1. Nur das Standard-Icon (.fa-folder-closed, aus layertree.js) wird getauscht.
      Gruppen mit eigenem Icon aus der Dienst-Config (group.icon, z.B. fa-tree)
      behalten ihres — im 2D-Baum gibt es keine konfigurierbaren Gruppen-Icons,
      deshalb reicht dort die pauschale Regel.
   2. `> .lt-group-header` scopet auf die EIGENE Kopfzeile, damit eine zugeklappte
      Untergruppe innerhalb einer offenen Gruppe ihr geschlossenes Icon behaelt.
   Font Awesome 6 rendert ueber `content: var(--fa)`, deshalb wird --fa gesetzt
   und nicht content. */
.lt-group:not(.collapsed) > .lt-group-header .lt-group-icon.fa-folder-closed {
    --fa: "\f07c"; /* fa-folder-open */
}

.lt-group-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

/* Gruppen-Inhalt */
.lt-group-content {
    padding-left: 20px;
    margin-top: 2px;
    border-left: 1px solid #ddd;
    margin-left: 10px;
}

.lt-group.collapsed .lt-group-content {
    display: none;
}

/* Layer-Eintrag */
.lt-layer {
    margin: 2px 0;
}

.lt-layer-main {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s ease;
    /* min-width: 0 ist Pflicht damit Flex-Kinder mit overflow:hidden tatsächlich
       schrumpfen. Sonst übernimmt der intrinsische Content-Width den Vorrang,
       lange Layer-Namen schieben den Container nach rechts und drücken die
       Buttons (Transparenz, Zoom, Info, etc.) aus dem sichtbaren Bereich. */
    min-width: 0;
}

.lt-layer-main:hover {
    background: #f0f0f0;
}

.lt-layer-toggle {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.lt-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.lt-color-line {
    width: 16px;
    height: 3px;
    margin-right: 6px;
    border-radius: 1px;
    flex-shrink: 0;
}

.lt-color-polygon {
    width: 12px;
    height: 10px;
    margin-right: 6px;
    border: 2px solid;
    border-radius: 2px;
    flex-shrink: 0;
    opacity: 0.85;
}

.lt-legend-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    flex-shrink: 0;
    object-fit: contain;
}

/* Legenden-Icon mit Beschnitt (nur linker Teil sichtbar) */
.lt-legend-icon-crop {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    flex-shrink: 0;
    overflow: hidden;
    display: inline-block;
}

.lt-legend-icon-crop img {
    height: 16px;
    width: auto;
    object-fit: cover;
    object-position: left center;
}

/* Layer auÃŸerhalb des MaÃŸstabsbereichs */
.lt-layer.out-of-scale .lt-layer-main {
    opacity: 0.5;
}

.lt-layer.out-of-scale .lt-layer-name {
    font-style: italic;
}

.lt-scale-hint {
    font-size: 12px;
    color: var(--primary-color, #555);
    margin-left: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Loading Spinner fÃ¼r WFS-Layer */
.lt-loading-spinner {
    width: 12px;
    height: 12px;
    margin-left: 4px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: lt-spin 0.8s linear infinite;
    display: none;
    flex-shrink: 0;
}

.lt-loading-spinner.active {
    display: inline-block;
}

@keyframes lt-spin {
    to { transform: rotate(360deg); }
}

/* Tileset Loading-Anzeige für 3D Tiles */
.lt-tileset-loading {
    display: none;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    flex-shrink: 0;
}

.lt-tileset-loading.active {
    display: inline-flex;
}

.lt-tileset-loading .lt-loading-spinner {
    display: inline-block;
    width: 10px;
    height: 10px;
}

.lt-loading-text {
    font-size: 10px;
    color: #888;
}

.lt-layer-name {
    font-size: 12px;
    color: #444;
    flex: 1;
    /* Lange Layer-Namen kürzen statt die rechtsstehenden Buttons rauszudrücken.
       min-width: 0 ist im Flex-Container Pflicht, sonst greift overflow:hidden nicht. */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.lt-settings-btn,
.lt-info-btn,
.lt-flyto-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    transition: all 0.15s ease;
    opacity: 0;
}

.lt-flyto-btn {
    opacity: 0.6;
}

.lt-layer-main:hover .lt-settings-btn,
.lt-layer-main:hover .lt-info-btn,
.lt-layer-main:hover .lt-flyto-btn {
    opacity: 1;
}

.lt-settings-btn:hover {
    background: var(--primary-color, #007acc);
    color: white;
}

.lt-info-btn:hover {
    background: var(--primary-color, #007acc);
    color: white;
}

.lt-flyto-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Zahnrad-Menü einer Ebene (Auf Layer zoomen, Transparenz) - wie 2D Client */
.lt-settings-popup {
    position: fixed;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    min-width: 180px;
    border: 1px solid #ccc;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
}

.lt-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    background: none;
    border: none;
    text-align: left;
    font-size: 12px;
    color: #333;
    cursor: pointer;
}

.lt-menu-item i {
    width: 14px;
    text-align: center;
    color: #666;
}

.lt-menu-item:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color, #007acc);
}

.lt-menu-item:hover:not(:disabled) i {
    color: var(--primary-color, #007acc);
}

.lt-menu-item:disabled {
    color: #bbb;
    cursor: default;
}

.lt-menu-item:disabled i {
    color: #ccc;
}

.lt-menu-status {
    padding: 0 12px 6px 34px;
    font-size: 11px;
    color: #b45309;
    max-width: 220px;
}

.lt-menu-status[hidden] {
    display: none;
}

.lt-opacity-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-top: 1px solid #f0f0f0;
}

.lt-opacity-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 2px;
    cursor: pointer;
}

.lt-opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.lt-opacity-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.lt-opacity-value {
    font-size: 11px;
    color: #666;
    min-width: 32px;
    text-align: right;
}

/* Externe Layer Badge und Entfernen-Button */
.lt-external-badge {
    font-size: 9px;
    background: #607d8b;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    font-weight: 500;
}

.lt-remove-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    transition: all 0.15s ease;
    opacity: 0;
}

.lt-layer-main:hover .lt-remove-btn {
    opacity: 1;
}

.lt-remove-btn:hover {
    background: #f44336;
    color: white;
}

/* Verschachtelte Gruppen - Einrückung. Identisch zum 2D-Client
   (.layer-group .layer-group in 2d/css/sidebar.css) — der Unterordner wird so weit
   nach links gezogen, dass seine Checkbox exakt auf der Checkbox-Spalte seiner
   Geschwister-Ebenen sitzt (der Auf-/Zuklapp-Pfeil steht dann im linken Gutter —
   klassischer Baum-Look). Rechnung: Layer-Checkbox = 6px (padding .lt-layer-main);
   Ordner-Checkbox = margin + 6px (padding .lt-group-header) + 22px (.lt-toggle 16
   + margin-right 6). Gleichsetzen -> margin = 6 - 28 = -22px. Die Ebenen-Einrückung
   selbst bleibt unberührt. */
.lt-group .lt-group {
    margin-left: -22px;
}

.lt-group .lt-group > .lt-group-header {
    background: #fafafa;
}

.lt-group .lt-group .lt-group > .lt-group-header {
    background: #fff;
}

/* ============================================
   MODAL SYSTEM (Wiederverwendbar)
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 3000;
}

/* Kein Overlay - Hintergrund klickbar */
.modal-overlay.no-overlay {
    background: transparent;
    pointer-events: none;
}

.modal-overlay.no-overlay .modal-container {
    pointer-events: auto;
}

.modal-overlay.show {
    display: block;
}

.modal-container {
    position: absolute;
    top: 0;
    left: 0;
    max-height: calc(100vh - var(--header-height) - 30px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

/* Verschiebbare Modals */
.modal-container.draggable .modal-header {
    cursor: grab;
    user-select: none;
}

.modal-container.draggable .modal-header:active {
    cursor: grabbing;
}

.modal-container.dragging {
    transition: none;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

.modal-container.dragging .modal-header {
    cursor: grabbing;
}

/* GrÃ¶ÃŸenverÃ¤nderbare Modals */
.modal-container.resizable {
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-container.resizable .modal-body {
    flex: 1;
    overflow-y: auto;
}

.modal-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.15) 50%);
    border-radius: 0 0 10px 0;
}

.modal-resize-handle::before {
    content: '';
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(0,0,0,0.25);
    border-bottom: 2px solid rgba(0,0,0,0.25);
}

.modal-resize-handle:hover {
    background: linear-gradient(135deg, transparent 50%, rgba(var(--primary-color-rgb),0.3) 50%);
}

.modal-resize-handle:hover::before {
    border-color: var(--primary-color);
}

.modal-container.resizing {
    transition: none;
    user-select: none;
}

/* Positionen */
.modal-top-right .modal-container {
    top: calc(var(--header-height) + 15px);
    right: 15px;
    left: auto;
}

.modal-top-left .modal-container {
    top: calc(var(--header-height) + 15px);
    left: 15px;
    right: auto;
}

.modal-center .modal-container {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-center .modal-container {
    animation: modalCenterIn 0.2s ease-out;
}

@keyframes modalCenterIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-header {
    background: var(--primary-color);
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.modal-header h3 i {
    font-size: 14px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 15px;
    max-height: calc(100vh - var(--header-height) - 100px);
    overflow-y: auto;
}

/* Section-Styles fÃ¼r Modal-Inhalte */
.modal-section h4 {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* Kompakte Modal-Section */
.modal-section.compact {
    font-size: 11px;
}

.modal-section.compact h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    padding-bottom: 6px;
}

.quality-presets {
    margin-bottom: 15px;
}

.quality-presets.compact {
    margin-bottom: 10px;
}

.quality-presets > label {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 8px;
}

.preset-buttons {
    display: flex;
    gap: 6px;
}

.preset-btn {
    flex: 1;
    padding: 10px 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 11px;
    color: #555;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

/* Kompakte Preset-Buttons */
.quality-presets.compact .preset-btn {
    padding: 6px 4px;
    font-size: 10px;
    gap: 2px;
}

.quality-presets.compact .preset-btn i {
    font-size: 14px;
}

.preset-btn i {
    font-size: 16px;
    color: var(--primary-color);
}

.preset-btn:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-color: var(--primary-color);
}

.preset-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.preset-btn.active i {
    color: white;
}

.quality-slider-group {
    margin-bottom: 14px;
}

.quality-slider-group.compact {
    margin-bottom: 8px;
}

.quality-slider-group label {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 6px;
}

.quality-slider-group.compact label {
    font-size: 11px;
    margin-bottom: 3px;
}

.quality-slider-group label span {
    font-weight: 600;
    color: var(--primary-color);
}

.quality-slider-group input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
}

.quality-slider-group.compact input[type="range"] {
    height: 16px;
}

.slider-hint {
    display: block;
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

.settings-checkboxes {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.settings-checkboxes.compact {
    margin-top: 8px;
    padding-top: 8px;
}

.settings-checkboxes.compact .layer-control {
    margin: 4px 0;
}

.settings-checkboxes.compact .layer-control label {
    font-size: 11px;
}

.settings-checkboxes .layer-control {
    margin: 10px 0;
}

/* Info-Icon im Modal */
.modal-body .fa-circle-info {
    font-size: 11px;
    color: #999;
    margin-left: 4px;
    cursor: help;
}

/* Mobile Anpassungen fÃ¼r Modals - Breite beibehalten */
@media (max-width: 768px) {
    .modal-container {
        max-width: calc(100vw - 20px);
    }
}

/* ============================================
   FEATURE POPUP STYLES (fÃ¼r Modal-Inhalt)
   ============================================ */
.feature-toolbar {
    padding: 0 0 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
}

.feature-zoom-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.feature-zoom-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.3);
}

.feature-zoom-btn i {
    font-size: 13px;
}

.popup-attributes {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.popup-attributes tr {
    border-bottom: 1px solid #eee;
}

.popup-attributes tr:last-child {
    border-bottom: none;
}

.popup-attributes tr:hover {
    background: rgba(var(--primary-color-rgb), 0.04);
}

.popup-attributes td {
    padding: 10px 15px;
    vertical-align: top;
}

.popup-attributes .attr-label {
    color: #666;
    font-weight: 500;
    width: 45%;
    background: #f9f9f9;
}

.popup-attributes .attr-value {
    color: #333;
    word-break: break-word;
}

/* ============================================
   TERRAIN TOGGLE (im Hintergrundkarten-Panel)
   ============================================ */
.terrain-divider {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* ============================================
   SHADOW CONTROLS (Modal-Version - Kompakt)
   ============================================ */
.shadow-modal-content {
    padding: 0;
}

.shadow-modal-content.compact {
    font-size: 12px;
}

.shadow-modal-content > .layer-control:first-child {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

#sunControlsModal {
    margin-top: 6px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#sunControlsModal .compact-check {
    margin: 4px 0;
    padding: 2px 0;
}

#sunControlsModal .compact-check label {
    font-size: 11px;
}

#sunControlsModal label {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    color: #555;
}

/* Datum und Zeit nebeneinander */
.datetime-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.datetime-field {
    flex: 1;
}

.datetime-field label {
    margin-bottom: 2px;
}

#sunControlsModal input[type="date"],
#sunControlsModal input[type="time"] {
    width: 100%;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 11px;
    box-sizing: border-box;
}

#sunControlsModal input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
    height: 16px;
}

.time-slider-container.compact {
    margin: 4px 0;
}

.time-slider-container.compact .slider-wrapper {
    padding: 4px 0;
}

#timeDisplayModal {
    font-size: 11px;
    text-align: center;
    color: #333;
    font-weight: 600;
}

.intensity-row {
    margin: 6px 0;
}

.intensity-row label {
    margin-bottom: 2px;
}

#intensityDisplayModal {
    font-weight: 600;
    color: var(--primary-color);
}

#sunControlsModal > div {
    margin-bottom: 6px;
}

#sunControlsModal > div:last-child {
    margin-bottom: 0;
}

#sunControlsModal .layer-control {
    display: flex;
    align-items: center;
    padding: 2px 0;
}

#sunControlsModal .layer-control label {
    display: inline;
    margin-bottom: 0;
}

/* Time Slider mit Sonnenauf-/untergang */
.time-slider-container {
    position: relative;
}

.slider-wrapper {
    position: relative;
    padding: 8px 0;
}

.slider-wrapper input[type="range"] {
    width: 100%;
    margin: 0;
}

.sun-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 16px;
    border-radius: 1px;
    pointer-events: none;
    z-index: 1;
}

.sun-marker.sunrise {
    background: linear-gradient(to bottom, #FFD700, #FFA500);
    box-shadow: 0 0 4px rgba(255, 165, 0, 0.6);
}

.sun-marker.sunset {
    background: linear-gradient(to bottom, #FF6347, #8B0000);
    box-shadow: 0 0 4px rgba(255, 99, 71, 0.6);
}

.time-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    font-size: 11px;
}

.time-info #timeDisplay {
    font-weight: 600;
    font-size: 12px;
    color: #333;
}

.sunrise-time {
    color: #FF8C00;
    font-weight: 500;
}

.sunset-time {
    color: #CD5C5C;
    font-weight: 500;
}

/* ============================================
   LOADING INDICATOR
   ============================================ */
#loadingIndicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 20px 30px;
    border-radius: 10px;
    font-family: Arial, sans-serif;
    z-index: 500;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    text-align: center;
}

#loadingIndicator .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(var(--primary-color-rgb), 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px auto;
}

#loadingIndicator .loading-text {
    font-size: 13px;
    color: #555;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dezenter Mini-Spinner fÃ¼r Ebenen */
.mini-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(var(--primary-color-rgb), 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* ============================================
   ERROR PANEL
   ============================================ */
#errorPanel {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(220, 53, 69, 0.95);
    padding: 15px;
    border-radius: 5px;
    color: white;
    font-family: Arial, sans-serif;
    z-index: 1000;
    display: none;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#errorPanel h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
}

#errorPanel .error-content {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 10px;
}

#errorPanel button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 5px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

#errorPanel button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.error-message {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 5px;
}

/* ============================================
   CUSTOM NAVIGATION CONTROLS (zentriert Ã¼ber Kompass)
   ============================================ */
#customControls {
    position: absolute;
    bottom: 116px;
    right: 4px;
    width: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 1000;
}

#customControls button {
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    border-radius: 6px;
    color: var(--primary-color);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#customControls button:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.08);
}

#customControls button:active {
    transform: scale(0.95);
}

#customControls button.active {
    background: var(--primary-color);
    color: #fff;
}

/* ============================================
   COMPASS WIDGET (mit Drag-Rotation)
   ============================================ */
#compassWidget {
    position: absolute;
    bottom: 58px;
    right: 8px;
    width: 48px;
    height: 48px;
    cursor: grab;
    z-index: 1000;
    user-select: none;
}

#compassWidget:active {
    cursor: grabbing;
}

#compassRing {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(var(--primary-color-rgb), 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s;
}

#compassNeedle {
    width: 0;
    height: 0;
    position: relative;
}

#compassNeedle::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 18px solid rgba(var(--primary-color-rgb), 0.95);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

#compassNeedle::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 14px solid #bbb;
}

#compassNeedle .north {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    font-size: 12px;
    color: var(--primary-color);
    font-family: Arial, sans-serif;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 0 6px rgba(255,255,255,0.9);
}

#compassWidget:hover #compassRing {
    border-color: var(--primary-hover);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

/* Hinweis unter Kompass */
#compassWidget::after {
    content: 'Klick = Norden';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

#compassWidget:hover::after {
    opacity: 1;
}

/* ============================================
   SHARE MODAL
   ============================================ */
/* Share Modal Content (Ã¼ber ModalManager) */
.share-content {
    padding: 10px 0;
}

.share-qr-code,
#shareQrCode {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.share-qr-code img,
#shareQrCode img {
    border-radius: 8px;
    border: 4px solid #f5f5f5;
}

.qr-hint {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qr-hint i {
    color: var(--primary-color);
}

.share-marker-section {
    margin-bottom: 12px;
}

.share-marker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f5f7fa;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.share-marker-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #555;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}

.share-marker-btn:hover {
    background: #e8e8e8;
    border-color: #aaa;
}

.share-marker-btn.active {
    background: var(--primary-color, #007acc);
    color: #fff;
    border-color: var(--primary-color, #007acc);
}

.share-marker-btn i {
    color: var(--primary-color, #007acc);
}

.share-marker-btn.active i {
    color: #fff;
}

.share-marker-hint {
    font-size: 11px;
    color: #999;
    margin: 6px 0 8px;
    font-style: italic;
}

.share-marker-remove-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 7px;
    cursor: pointer;
    color: #999;
    font-size: 12px;
    transition: color 0.2s, border-color 0.2s;
}

.share-marker-remove-btn:hover {
    color: #e53935;
    border-color: #e53935;
}

.share-marker-info {
    font-size: 11px;
    color: #888;
    margin-left: auto;
    font-family: monospace;
}

.share-marker-map-remove {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    color: #888;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: color 0.2s, border-color 0.2s;
    padding: 0;
    z-index: 1000;
}

.share-marker-map-remove:hover {
    color: #e53935;
    border-color: #e53935;
}

.share-url-input,
#shareUrl {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #333;
    font-size: 12px;
    margin-bottom: 15px;
    word-break: break-all;
    box-sizing: border-box;
}

.share-url-input:focus,
#shareUrl:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Link-Feld + „Öffnen"-Button nebeneinander */
.share-url-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 15px;
}
.share-url-row .share-url-input,
.share-url-row #shareUrl {
    flex: 1;
    margin-bottom: 0;
}
.share-open-btn {
    flex: 0 0 auto;
    width: 42px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.share-open-btn:hover { opacity: 0.9; }

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-buttons button,
#btnCopyUrl {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    background: var(--primary-color);
    color: white;
}

.share-buttons button:hover,
#btnCopyUrl:hover {
    background: var(--primary-hover);
}

#copySuccess,
.copy-success {
    color: #4caf50;
    font-size: 12px;
    margin-top: 10px;
    display: none;
    text-align: center;
}

/* ============================================
   MEASURE TOOL STYLES (fÃ¼r Modal-Inhalt)
   ============================================ */

/* Tabs fÃ¼r HÃ¶hen-/Streckenmessung */
.measure-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 6px;
}

.measure-tab {
    flex: 1;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}

.measure-tab:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #333;
}

.measure-tab.active {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.measure-tab i {
    font-size: 11px;
}

/* Tab-Content */
.measure-content {
    display: none;
}

.measure-content.active {
    display: block;
}

.measure-instruction {
    font-size: 11px;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.measure-hint {
    font-size: 10px;
    color: #888;
    margin: 0 0 8px 0;
    line-height: 1.3;
    padding: 5px 7px;
    background: rgba(0, 123, 255, 0.08);
    border-radius: 4px;
    border-left: 3px solid rgba(0, 123, 255, 0.5);
}

.measure-hint i {
    color: #007bff;
    margin-right: 4px;
}

.measure-result {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

/* Kompakte kopierbare Werte */
.measure-copyable {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    color: #333;
    padding: 5px 7px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: all;
}

.measure-copyable:hover {
    background: #e7f3ff;
    border-color: #007bff;
}

.measure-copyable.copied {
    background: #d4edda;
    border-color: #28a745;
}

.measure-object-height {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    padding: 5px 7px;
    background: rgba(var(--primary-color-rgb), 0.08);
    border-radius: 3px;
    margin-top: 5px;
}

.result-section-header {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.result-section-header:not(:first-child) {
    margin-top: 10px;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 11px;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.result-row:not(:last-child) {
    margin-bottom: 6px;
}

.result-row.highlight {
    background: rgba(var(--primary-color-rgb), 0.1);
    margin: 6px -8px -8px -8px;
    padding: 8px;
    border-radius: 0 0 6px 6px;
}

.result-row.highlight .result-label,
.result-row.highlight .result-value {
    font-weight: 600;
    color: var(--primary-color);
}

.result-label {
    color: #666;
    font-size: 10px;
    white-space: nowrap;
    min-width: 90px;
    font-weight: 500;
}

.result-value {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 11px;
}

/* Input-Felder für kopierbare Werte */
.result-value-input {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    color: #333;
    padding: 4px 6px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-value-input:hover {
    background: #e7f3ff;
    border-color: #007bff;
}

.result-value-input:focus {
    outline: none;
    background: #e7f3ff;
    border-color: #007bff;
}

/* Messcursor wenn aktiv */
.measure-cursor {
    cursor: crosshair !important;
}

/* Reset Button */
.reset-measure-btn {
    width: 100%;
    margin-top: 8px;
    padding: 6px 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}

.reset-measure-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.reset-measure-btn i {
    font-size: 10px;
}

/* ============================================
   OVERVIEW MAP (Übersichtskarte)
   ============================================ */
#overviewMap {
    position: absolute;
    top: calc(var(--header-height) + 10px);
    right: 10px;
    width: 220px;
    height: 180px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

#overviewMap.visible {
    display: block;
}

/* Overview Modal - kein Padding, Karte füllt komplett */
#modal_overviewMap .modal-body {
    padding: 0;
    position: relative;
    height: 180px;
    overflow: hidden;
}

#modal_overviewMap #overviewMapContainer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

#modal_overviewMap .overview-controls {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 1001;
}

#btnCloseOverview {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    color: var(--primary-color);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#btnCloseOverview:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Overview Zoom Controls */
.overview-controls {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1001;
}

.overview-controls button {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 4px;
    color: var(--primary-color);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.overview-controls button:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Leaflet Overrides fÃ¼r Ãœbersichtskarte */
#overviewMapContainer .leaflet-control-zoom,
#overviewMapContainer .leaflet-control-attribution {
    display: none;
}

/* Kamera-Marker (Auge) */
.camera-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
    cursor: grab;
}

.camera-marker:active {
    cursor: grabbing;
}

.camera-marker i {
    background: #fff;
    border-radius: 50%;
    padding: 3px;
    pointer-events: none;
}

/* ============================================
   CESIUM UI OVERRIDES (Ion Controls entfernen)
   ============================================ */
.cesium-viewer-bottom {
    display: none !important;
}

.cesium-credit-logoContainer {
    display: none !important;
}

/* Cesium Standard-Controls ausblenden */
.cesium-viewer-toolbar {
    display: none !important;
}

.cesium-navigation-help-button {
    display: none !important;
}

.cesium-home-button {
    display: none !important;
}

.cesium-sceneModePicker-wrapper {
    display: none !important;
}

.cesium-fullscreenButton {
    display: none !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    #controlPanel {
        width: 280px;
    }

    #appHeader h1 {
        font-size: 16px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --header-height: 45px;
    }

    /* Footer eigenen Platz geben (WebGL-Canvas überdeckt fixed-Elemente auf Mobile) */
    #cesiumContainer {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: var(--footer-height);
        height: auto;
        margin-top: 0;
    }

    #controlPanel {
        bottom: var(--footer-height);
    }

    #appHeader h1 {
        font-size: 14px;
    }

    .header-logo {
        height: 28px;
    }

    .header-tools {
        gap: 6px;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* Search Panel Mobile */
    #searchPanel {
        padding: 10px 12px;
        left: 0; /* Full width on mobile */
    }

    .search-container {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    #placeSearch {
        font-size: 14px;
        padding: 9px 38px 9px 40px;
    }

    .search-icon {
        left: 12px;
        font-size: 14px;
        top: 20px;
    }

    .clear-search-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
        right: 5px;
        top: 20px;
    }

    .search-results {
        max-height: 250px;
    }

    .search-results li {
        padding: 10px 12px;
        font-size: 13px;
    }

    #controlPanel {
        width: 300px;
        max-width: 85vw;
        background: #fff;
    }

    /* Iconbar + Panel auf Mobile */
    .sidebar-iconbar {
        bottom: var(--footer-height);
    }

    #controlPanel.has-iconbar {
        width: calc(300px - var(--iconbar-width)) !important;
        max-width: calc(85vw - var(--iconbar-width));
    }

    #controlPanel.has-iconbar:not(.panel-visible) {
        transform: translateX(calc(-100% - var(--iconbar-width)));
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    :root {
        --iconbar-width: 42px;
    }

    .iconbar-btn {
        width: 36px;
        min-height: 36px;
    }

    .iconbar-btn i {
        font-size: 16px;
    }

    .iconbar-label {
        display: none;
    }

    #controlPanel.has-iconbar {
        width: calc(85vw - var(--iconbar-width)) !important;
    }
    #appHeader h1 {
        font-size: 12px;
    }

    .header-left {
        gap: 8px;
    }

    .header-logo {
        height: 24px;
    }

    .header-tools {
        gap: 3px;
    }

    .header-tool-btn,
    a.header-tool-btn,
    button.header-tool-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        max-width: 36px;
        max-height: 36px;
        font-size: 16px;
    }

    .menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Search Panel Small Mobile */
    #searchPanel {
        padding: 8px 10px;
    }

    .search-container {
        width: 100%;
        max-width: 260px;
    }

    #placeSearch {
        font-size: 13px;
        padding: 8px 36px 8px 38px;
        border-radius: 6px;
    }

    .search-icon {
        left: 10px;
        font-size: 13px;
        top: 19px;
    }

    .clear-search-btn {
        width: 26px;
        height: 26px;
        font-size: 13px;
        right: 4px;
        top: 19px;
    }

    .search-results {
        max-height: 200px;
        border-radius: 6px;
    }

    .search-results li {
        padding: 9px 10px;
        font-size: 12px;
    }

}

/* Panel Overlay fÃ¼r Mobile */
@media (max-width: 768px) {
    body.panel-open {
        overflow: hidden;
    }

    #controlPanel.panel-visible {
        background: #fff;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }
}

/* ============================================
   FOOTER
   ============================================ */
#appFooter {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: #fff;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    z-index: 9999;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

#appFooter .footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex: 1;
}

#appFooter span {
    color: #666;
}

#appFooter a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

#appFooter a:hover {
    color: var(--primary-color);
}

#appFooter .logout-area {
    position: absolute;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#appFooter .user-name {
    color: #888;
    font-size: 11px;
}

#appFooter .logout-link {
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

#appFooter .logout-link:hover {
    color: var(--primary-color);
}

/* Footer Links (Impressum, Datenschutz etc.) */
#appFooter .footer-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

#appFooter .footer-links a {
    padding: 2px 8px;
    border-radius: 3px;
    transition: all 0.2s;
}

#appFooter .footer-links a:hover {
    background: rgba(0, 0, 0, 0.05);
}

#appFooter .footer-separator {
    color: #bbb;
    font-size: 10px;
}

/* Info-Button im Footer */
.footer-info-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 5px;
    transition: color 0.2s;
    line-height: 1;
    margin-left: auto;
    flex-shrink: 0;
}
.footer-info-btn:hover {
    color: var(--primary-color);
}

/* NETGIS Info Modal */
.netgis-info-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.netgis-info-overlay.active {
    display: flex;
}
.netgis-info-modal {
    background: #fff;
    border-radius: 12px;
    padding: 35px 40px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.netgis-info-close {
    position: absolute;
    top: 10px; right: 15px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.netgis-info-close:hover {
    color: #333;
}
.netgis-info-logo {
    margin-bottom: 15px;
}
.netgis-info-logo img {
    max-height: 40px;
    width: auto;
}
.netgis-info-modal h3 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}
.netgis-info-version {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}
.netgis-info-build {
    display: block;
    font-size: 10px;
    color: #aaa;
    margin-bottom: 18px;
    font-family: 'Consolas', 'Monaco', monospace;
}
.netgis-info-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    transition: all 0.2s;
}
.netgis-info-link:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Language Selector */
#appFooter .language-selector {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    margin-left: 10px;
}

#appFooter .language-selector .fa-globe {
    font-size: 12px;
    color: #888;
}

#appFooter .language-selector select {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    color: #555;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, color 0.2s;
}

#appFooter .language-selector select:hover {
    border-color: #999;
    color: #333;
}

#appFooter .language-selector select:focus {
    border-color: var(--primary-color);
}

/* Data Copyright (über der Karte, rechts unten) */
#dataCopyright {
    position: absolute;
    bottom: 32px;
    right: 10px;
    font-size: 10px;
    color: #444;
    background: rgba(255, 255, 255, 0.75);
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 999;
    max-width: calc(100vw - 320px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#dataCopyright a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s;
}

#dataCopyright a:hover {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    #dataCopyright {
        right: 10px;
        bottom: 32px;
        max-width: calc(100vw - 120px);
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    #appFooter {
        font-size: 11px;
        padding: 0 10px;
    }

    #appFooter .footer-content {
        gap: 12px;
    }

    #dataCopyright {
        display: none;
    }
}

/* ============================================
   GPS INFO BAR (kompakte Leiste unten)
   ============================================ */
.gps-info-bar {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 11px;
    z-index: 2000;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.gps-info-icon {
    color: #2196F3;
    font-size: 12px;
}

.gps-info-text {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
}

.gps-follow-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #ccc;
    cursor: pointer;
    margin-left: 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 8px;
}

.gps-follow-label input[type="checkbox"] {
    width: 13px;
    height: 13px;
    cursor: pointer;
    accent-color: #2196F3;
}

.gps-close-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0 0 0 4px;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.gps-close-btn:hover {
    color: #fff;
}

/* Record-Toggle: Aufzeichnung der Bewegungs-Spur */
.gps-record-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 0 4px;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 4px;
    padding-left: 8px;
}
.gps-record-btn:hover { color: #fff; }
.gps-record-btn.recording {
    color: #ff3b30;
    animation: gpsRecPulse 1.2s infinite;
}
@keyframes gpsRecPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

.gps-save-btn {
    background: none;
    border: none;
    color: #4caf50;
    cursor: pointer;
    padding: 0 4px;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
}
.gps-save-btn:hover { color: #8bc34a; }

.gps-info-text.recording { color: #ff8a65; }

.gps-help-btn {
    background: none;
    border: none;
    color: #9bbcd6;
    cursor: pointer;
    padding: 0 4px;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
}
.gps-help-btn:hover { color: #fff; }

/* Save-Popover (dark theme, über dem Save-Button positioniert) */
.gps-save-popover {
    position: fixed;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.gps-save-popover button {
    background: none;
    border: none;
    color: #eee;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 12px;
    text-align: left;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.gps-save-popover button:hover { background: rgba(255, 255, 255, 0.1); }
.gps-save-popover .gps-save-clear {
    color: #ff8a80;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2px;
}
.gps-save-popover .gps-save-clear:hover { background: rgba(255, 138, 128, 0.15); }

/* Info-Modal: zentriertes Overlay, dark theme, Datenschutz-Sektion grün */
.gps-info-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gps-info-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.gps-info-modal-content {
    position: relative;
    background: #1f2937;
    color: #e5e7eb;
    border-radius: 8px;
    padding: 24px 28px 20px;
    max-width: 520px;
    width: calc(100% - 40px);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    font-size: 13px;
    line-height: 1.5;
}
.gps-info-modal-content h3 {
    margin: 0 0 16px;
    font-size: 16px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.gps-info-modal-content h3 i { color: #2196F3; }
.gps-info-modal-content h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}
.gps-info-section { margin-bottom: 18px; }
.gps-info-section ul { margin: 0; padding-left: 18px; }
.gps-info-section ul li { margin-bottom: 6px; }
.gps-info-section ul li:last-child { margin-bottom: 0; }
.gps-info-section strong { color: #fff; }
.gps-info-privacy {
    background: rgba(76, 175, 80, 0.08);
    border-left: 3px solid #4caf50;
    padding: 12px 14px;
    border-radius: 4px;
}
.gps-info-privacy h4 i { color: #4caf50; }
.gps-info-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
}
.gps-info-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.gps-info-modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}
.gps-info-modal-ok {
    background: #2196F3;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.gps-info-modal-ok:hover { background: #1976d2; }

/* ============================================
   INFO ICONS (Tooltips)
   ============================================ */
.info-icon {
    font-size: 10px;
    color: #999;
    cursor: help;
    margin-left: 4px;
    transition: color 0.2s;
}

.info-icon:hover {
    color: var(--primary-color);
}

/* ============================================
   WALK MODE (FuÃŸgÃ¤ngerperspektive)
   ============================================ */
.walk-mode-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(42, 42, 42, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-width: 90vw;
}

.walk-mode-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.walk-mode-toast i {
    font-size: 18px;
    color: var(--primary-color, #8B0000);
}

.walk-mode-toast span {
    font-size: 14px;
    white-space: nowrap;
}

.walk-mode-toast button {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.walk-mode-toast button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Speed Toast (Geschwindigkeits-Feedback) */
.speed-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.speed-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ============================================
   START-MODAL (Nutzungsbedingungen)
   ============================================ */
.start-modal-content {
    padding: 5px 0;
}

.start-modal-body {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    line-height: 1.6;
}

.start-modal-body h4 {
    margin: 15px 0 10px 0;
    color: var(--primary-color, #8B0000);
}

.start-modal-body ul {
    margin: 10px 0;
    padding-left: 20px;
}

.start-modal-body li {
    margin-bottom: 5px;
}

/* Links im Hinweistext in der Hausfarbe statt im Browser-Blau. Der Inhalt
   kommt als HTML aus der Dienstkonfiguration, die Farbe lässt sich dort
   also nicht sinnvoll pflegen — sie gehört ins Grundstyling. */
.start-modal-body a {
    color: var(--primary-color, #8B0000);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

.start-modal-body a:hover,
.start-modal-body a:focus-visible {
    color: var(--primary-hover, #B22222);
}

.start-modal-body a:focus-visible {
    outline: 2px solid var(--primary-color, #8B0000);
    outline-offset: 2px;
    border-radius: 2px;
}

.start-modal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.start-modal-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary-color, #8B0000);
}

.start-modal-checkbox label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    user-select: none;
    /* Nur leicht hervorgehoben: Die Zustimmung soll sich vom Fließtext
       abheben, aber nicht schreien. */
    font-weight: 500;
    color: var(--text-color, #333);
}

/* Der Text der Zustimmung kommt aus der Dienstkonfiguration und enthält dort
   häufig <strong> oder <b>. Das wirkte neben dem ohnehin kräftigen Rahmen zu
   fett, deshalb hier auf dasselbe mittlere Gewicht gebracht. */
.start-modal-checkbox label strong,
.start-modal-checkbox label b {
    font-weight: 500;
}

.start-modal-footer {
    display: flex;
    justify-content: center;
}

.start-modal-footer .btn-primary {
    padding: 12px 40px;
    font-size: 15px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color, #8B0000);
    color: white;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.start-modal-footer .btn-primary:hover:not(:disabled) {
    background: var(--primary-hover, #B22222);
}

.start-modal-footer .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#btnWalkMode.active {
    background: var(--primary-color, #8B0000);
    color: white;
}

/* Joystick Control */
.walk-joystick {
    position: fixed;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.walk-joystick.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.walk-joystick.dragging {
    opacity: 0.8;
}

.joystick-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 24px;
    background: rgba(42, 42, 42, 0.9);
    border-radius: 12px;
    cursor: grab;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.joystick-drag-handle:hover {
    background: rgba(60, 60, 60, 0.95);
    color: white;
}

.joystick-drag-handle:active {
    cursor: grabbing;
}

.joystick-base {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(42, 42, 42, 0.85);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: relative;
}

.joystick-base::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.joystick-base::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.joystick-knob {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary-color, #8B0000), #600000);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4),
                inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transition: transform 0.05s ease-out;
    pointer-events: none;
}

.joystick-speed {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(42, 42, 42, 0.9);
    padding: 8px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.joystick-speed input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.joystick-speed input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(145deg, var(--primary-color, #8B0000), #600000);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

.joystick-speed input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.joystick-speed input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(145deg, var(--primary-color, #8B0000), #600000);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.joystick-speed span {
    color: white;
    font-size: 12px;
    min-width: 55px;
    text-align: right;
}

/* Joystick Main Area (Joystick + Pitch-Slider nebeneinander) */
.joystick-main-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Pitch-Slider Container */
.joystick-pitch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pitch-label-top,
.pitch-label-bottom {
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
}

.pitch-track {
    width: 24px;
    height: 100px;
    background: rgba(42, 42, 42, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    touch-action: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pitch-handle {
    position: absolute;
    left: 50%;
    top: calc(50% - 8px); /* Mittig = horizontal */
    transform: translateX(-50%);
    width: 20px;
    height: 16px;
    background: linear-gradient(145deg, var(--primary-color, #8B0000), #600000);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4),
                inset 0 1px 2px rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

/* Mittelmarkierung auf dem Track */
.pitch-track::before {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    top: 50%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%);
}

/* Mobile Anpassung */
@media (max-width: 768px) {
    .walk-mode-toast {
        top: 60px;
        bottom: auto;
        padding: 10px 16px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        transform: translateY(-20px);
    }

    .walk-mode-toast.show {
        transform: translateY(0);
    }

    .walk-mode-toast span {
        font-size: 12px;
        white-space: normal;
        text-align: center;
        flex: 1;
    }

    .walk-joystick {
        bottom: 50px;
        left: 15px;
    }

    .joystick-base {
        width: 100px;
        height: 100px;
    }

    .joystick-knob {
        width: 40px;
        height: 40px;
    }

    .pitch-track {
        height: 80px;
    }
}

/* ============================================
   FLIGHT MODE (Flugmodus - Flugsimulator)
   ============================================ */
.flight-mode-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(42, 42, 42, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-width: 90vw;
}

.flight-mode-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.flight-mode-toast i {
    font-size: 18px;
    color: #4a90d9;
}

.flight-mode-toast span {
    font-size: 13px;
    white-space: nowrap;
}

.flight-mode-toast button {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.flight-mode-toast button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

#btnFlightMode.active {
    background: #4a90d9;
    color: white;
}

/* Flight Controls Container */
.flight-controls {
    position: fixed;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.flight-controls.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.flight-controls.dragging {
    opacity: 0.8;
}

.flight-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 24px;
    background: rgba(42, 42, 42, 0.9);
    border-radius: 12px;
    cursor: grab;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.flight-drag-handle:hover {
    background: rgba(60, 60, 60, 0.95);
    color: white;
}

.flight-drag-handle:active {
    cursor: grabbing;
}

.flight-panel {
    display: flex;
    gap: 20px;
    background: rgba(42, 42, 42, 0.9);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Flight Joystick */
.flight-joystick-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.flight-joystick-base {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(30, 30, 30, 0.9);
    border: 3px solid rgba(74, 144, 217, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
}

.flight-joystick-base::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.15);
}

.flight-joystick-base::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.flight-joystick-knob {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4a90d9, #2a5a8a);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4),
                inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transition: transform 0.05s ease-out;
    pointer-events: none;
}

.flight-joystick-labels {
    position: absolute;
    width: 100px;
    height: 100px;
    top: 0;
    left: 0;
    pointer-events: none;
}

.flight-joystick-labels span {
    position: absolute;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    text-align: center;
}

.flight-joystick-labels .label-up {
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
}

.flight-joystick-labels .label-down {
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
}

.flight-joystick-labels .label-left {
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
}

.flight-joystick-labels .label-right {
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
}

/* Throttle (Schubhebel) */
.flight-throttle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.throttle-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.throttle-track {
    width: 30px;
    height: 100px;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 15px;
    border: 2px solid rgba(74, 144, 217, 0.4);
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.throttle-fill {
    position: absolute;
    bottom: 0;
    left: 2px;
    right: 2px;
    height: 50%;
    background: linear-gradient(to top, #4a90d9, #6ab0f3);
    border-radius: 0 0 12px 12px;
    transition: height 0.1s ease;
}

.throttle-handle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(50% - 10px);
    width: 40px;
    height: 20px;
    background: linear-gradient(to bottom, #666, #444);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: ns-resize;
}

.throttle-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
}

.throttle-handle::after {
    content: '';
    position: absolute;
    top: calc(50% + 4px);
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
}

.throttle-speed {
    font-size: 11px;
    color: #4a90d9;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* Altitude Display (HÃ¶henanzeige) */
.flight-altitude-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.altitude-icon {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.altitude-value {
    font-size: 11px;
    color: #6ab0f3;
    font-weight: 600;
    min-width: 55px;
    text-align: center;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Mobile Anpassungen fÃ¼r Flight Mode */
@media (max-width: 768px) {
    .flight-mode-toast {
        top: 60px;
        bottom: auto;
        padding: 10px 16px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        transform: translateY(-20px);
    }

    .flight-mode-toast.show {
        transform: translateY(0);
    }

    .flight-mode-toast span {
        font-size: 11px;
        white-space: normal;
        text-align: center;
        flex: 1;
    }

    .flight-panel {
        padding: 12px 15px;
        gap: 15px;
    }

    .flight-joystick-base {
        width: 80px;
        height: 80px;
    }

    .flight-joystick-knob {
        width: 32px;
        height: 32px;
    }

    .throttle-track {
        height: 80px;
    }

    .flight-joystick-labels span {
        font-size: 8px;
    }
}

/* ============================================
   WERKZEUG MODAL (nutzt ModalManager)
   ============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-item:hover {
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-color);
}

.tool-item:hover i {
    color: var(--primary-color);
}

.tool-item:hover span {
    color: var(--primary-color);
}

.tool-item:active {
    transform: scale(0.98);
}

.tool-item.active {
    background: rgba(74, 144, 217, 0.3);
    border-color: #4a90d9;
    color: white;
}

.tool-item.active i {
    color: #4a90d9;
}

.tool-item i {
    font-size: 24px;
    transition: color 0.2s;
}

.tool-item span {
    font-size: 12px;
    font-weight: 500;
}

/* Mobile Anpassungen für Tools-Grid */
@media (max-width: 480px) {
    .tools-grid {
        gap: 10px;
    }

    .tool-item {
        padding: 16px 12px;
    }

    .tool-item i {
        font-size: 20px;
    }

    .tool-item span {
        font-size: 11px;
    }
}

/* ============================================
   PRINT FORM (PDF Export - nutzt ModalManager)
   ============================================ */
.print-form {
    padding: 5px 0;
}

.print-form-group {
    margin-bottom: 15px;
}

.print-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #ccc;
    font-size: 13px;
}

.print-select,
.print-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.print-select {
    cursor: pointer;
}

.print-select:focus,
.print-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.print-select option {
    background: #fff;
    color: #333;
}

.print-textarea {
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
}

.print-textarea::placeholder {
    color: #999;
}

.print-char-counter {
    display: block;
    text-align: right;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.print-actions {
    margin-top: 15px;
}

.print-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.print-btn-primary {
    background: var(--primary-color);
    color: white;
}

.print-btn-primary:hover {
    background: var(--primary-hover);
}

.print-btn-primary:disabled {
    background: #666;
    cursor: not-allowed;
}

/* ============================================
   QUERY RESULTS (Feature-Info)
   ============================================ */
.query-result {
    padding: 5px 0;
}

.query-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.query-zoom-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.query-zoom-btn:hover {
    background: var(--primary-hover);
}

.query-zoom-btn i {
    font-size: 12px;
}

/* Höhenprofil-Button im Abfrageergebnis (Primärfarbe) */
.query-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    background: var(--primary-color);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.query-profile-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.query-profile-btn:active {
    filter: brightness(0.95);
}

.query-profile-btn i {
    color: #fff;
    font-size: 12px;
}

.query-feature-name {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.query-subtitle {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

.query-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--table-kv-font-size, 12px);
}

.query-table th,
.query-table td {
    padding: var(--table-kv-cell-padding, 4px 8px);
    text-align: left;
    border-bottom: 1px solid var(--table-line, #eee);
    color: #333;
}

/* Wie im 2D-Client: jede zweite Zeile getönt und eine Trennlinie zwischen
   Schlüssel und Wert — bei vielen Attributen liest sich das deutlich leichter. */
.query-table tr:nth-child(even) {
    background: var(--table-zebra, #f8f8f8);
}

.query-table th {
    width: 35%;
    font-weight: 500;
    color: #555;
    vertical-align: top;
    border-right: 1px solid var(--table-line, #eee);
}

.query-table a,
.query-description a {
    color: var(--primary-color);
    text-decoration: none;
}

.query-table a:hover,
.query-description a:hover {
    text-decoration: underline;
}

.query-table a:hover,
.query-description a:hover {
    color: var(--primary-hover);
}

.query-description {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

.query-empty {
    color: #999;
    font-style: italic;
}

.query-loading {
    color: #666;
    padding: 20px 0;
    text-align: center;
}

.query-loading i {
    margin-right: 8px;
    color: var(--primary-color);
}

.query-error {
    color: #dc3545;
    padding: 15px;
    background: #f8d7da;
    border-radius: 4px;
    text-align: center;
}

.query-error i {
    margin-right: 8px;
}

.query-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.query-actions a {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.2s;
}

.query-actions a:hover {
    background: var(--primary-hover);
    text-decoration: none;
}

/* WMS GetFeatureInfo / Abfrageergebnis — übernommen aus 2d/css/windows.css („WMS INFO MODAL"),
   damit das Abfragefenster in beiden Clients gleich aussieht (seit 10.11.2026). Änderungen dort
   hier nachziehen. Ohne die 2D-Teile für POI, Modul-Hinweise und Höhenprofil (gibt es in 3D nicht). */
.wms-info-content {
    min-height: 100px;
}

/* View-Mode-Umschalter (Karten <-> Tabellenansicht) */
.wms-info-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 6px 4px;
    margin-bottom: 6px;
    border-bottom: 1px solid #eee;
}
.wms-info-toolbar-label {
    margin-right: 6px;
    color: #888;
    font-size: 12px;
}
.wms-info-view-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    padding: 4px 9px;
    font-size: 13px;
    line-height: 1;
    transition: all 0.15s;
}
.wms-info-view-btn:hover {
    background: #f0f0f0;
    color: #444;
}
.wms-info-view-btn.active {
    background: var(--primary-color, #9e5427);
    border-color: var(--primary-color, #9e5427);
    color: #fff;
}

/* Tabellenansicht: alle Features eines Layers in einer breiten Tabelle.
   Eigener vertikaler Scrollcontainer mit max-height, damit der horizontale
   Scrollbalken am unteren Rand der Tabelle stets sichtbar bleibt — sonst
   sitzt er weit unten am Wrap-Ende und der Nutzer muss erst vertikal scrollen,
   bevor er ihn erreicht. */
.wms-info-grid-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    max-height: 60vh;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
}
.wms-info-results-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--table-font-size, 12px);
    line-height: 1.3;
}
.wms-info-results-grid th {
    background: var(--table-head-bg, #f5f5f5);
    text-align: left;
    padding: 4px 8px;
    border-bottom: 2px solid var(--table-head-line, #ddd);
    border-right: 1px solid var(--table-line, #eee);
    font-weight: 600;
    color: var(--table-head-color, #444);
    white-space: nowrap;
    line-height: 1.2;
    position: sticky;
    top: 0;
    z-index: 1;
}
.wms-info-results-grid th:last-child {
    border-right: none;
}

/* Zellen tragen nur Padding + Trenner. Die eigentliche Höhe wird über den
   inneren Wrapper-DIV gesteuert — auf <td> wirkt `height` nur als Mindestmaß,
   das ist im Tabellen-Layout-Algorithmus so vorgesehen. */
.wms-info-results-grid td {
    padding: var(--table-cell-padding, 5px 10px);
    border-bottom: 1px solid var(--table-line, #eee);
    border-right: 1px solid var(--table-line, #eee);   /* Spalten-Trenner */
    vertical-align: middle;
    box-sizing: border-box;
}
.wms-info-results-grid td:last-child {
    border-right: none;
}
.wms-info-results-grid tr:hover td {
    background: var(--table-row-hover, #fafafa);
}

/* Innerer Cell-Wrapper: erzwingt die kompakte Zeilenhöhe als Block-Element.
   Damit kann kein Kindelement die Zeile aufpumpen — alles wird in 22 px
   gerendert (oder via overflow:hidden abgeschnitten). */
.wms-info-cell-inner {
    display: block;
    height: 22px;
    max-height: 22px;
    line-height: 22px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wms-info-cell-inner > * {
    line-height: 22px;
    vertical-align: middle;
}

/* Aktions-Spalte: Zoom und Edit nebeneinander, einheitlich gestylt
   (analog zur Feature-Toolbar in der Detailansicht). Die Buttons stehen in
   einem Flex-Wrapper-DIV; damit ist die Layoutachse unabhängig vom display
   der Buttons selbst (Basis-CSS setzt display:flex auf die Buttons). */
.wms-info-results-grid .wms-info-action-col {
    width: 1%;                 /* Spalte so schmal wie nötig */
    white-space: nowrap;
    padding: 2px 6px;
}
.wms-info-results-grid .wms-info-action-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}
.wms-info-results-grid .wms-info-action-col .wms-info-zoom-btn,
.wms-info-results-grid .wms-info-action-col .wms-info-edit-btn {
    width: var(--table-action-size, 20px);
    height: var(--table-action-size, 20px);
    min-width: var(--table-action-size, 20px);
    min-height: var(--table-action-size, 20px);
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 3px;
    background: var(--table-action-bg, #666);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    transition: all 0.2s;
    vertical-align: middle;
}
.wms-info-results-grid .wms-info-action-col .wms-info-zoom-btn:hover,
.wms-info-results-grid .wms-info-action-col .wms-info-edit-btn:hover {
    background: var(--table-action-bg-hover, #444);
}
.wms-info-results-grid .wms-info-action-col .wms-info-zoom-btn:active,
.wms-info-results-grid .wms-info-action-col .wms-info-edit-btn:active {
    background: var(--table-action-bg-active, #333);
}
.wms-info-results-grid .wms-info-action-col .wms-info-zoom-btn i,
.wms-info-results-grid .wms-info-action-col .wms-info-edit-btn i {
    font-size: 10px;
    color: #fff;
    transform: none !important;
}

.wms-info-results-grid .wms-info-empty {
    color: #bbb;
}

/* Links in der Tabellenansicht wie in der Detailansicht: Hausfarbe, Unterstrich
   erst beim Überfahren. In der Detailansicht kommt das von `.wms-info-value a`;
   die Tabellenzellen tragen diese Klasse nicht, dort blieb deshalb das
   Browser-Blau mit fester Unterstreichung stehen. */
.wms-info-results-grid td a {
    color: var(--primary-color);
    text-decoration: none;
}

.wms-info-results-grid td a:hover {
    text-decoration: underline;
}

.wms-info-placeholder,
.wms-info-empty,
.wms-info-loading,
.wms-info-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    color: #666;
}

.wms-info-placeholder i,
.wms-info-empty i,
.wms-info-loading i,
.wms-info-error i {
    font-size: 32px;
    margin-bottom: 12px;
    color: #aaa;
}

.wms-info-loading i {
    color: var(--primary-color);
}

.wms-info-error i {
    color: #e74c3c;
}

.wms-info-placeholder p,
.wms-info-empty p,
.wms-info-loading p,
.wms-info-error p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.wms-info-empty small {
    display: block;
    margin-top: 10px;
    font-size: 11px;
    color: #999;
}

/* Layer Header (Akkordeon) */
.wms-info-layer {
    margin-bottom: 12px;
}

.wms-info-layer:last-child {
    margin-bottom: 0;
}

.wms-info-layer-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-radius 0.2s;
    user-select: none;
}

.wms-info-layer-header:hover {
    background: var(--primary-hover, #B22222);
}

.wms-info-layer-header.open {
    border-radius: 6px 6px 0 0;
}

/* Pfeil ist seit 26.10.2026 ein <button> (Barrierefreiheit) — sieht aus wie vorher */
.wms-info-layer-toggle {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
}

.wms-info-layer-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 2px;
}

.wms-info-layer-header > i.fa-chevron-right,
.wms-info-layer-toggle > i.fa-chevron-right {
    font-size: 10px;
    opacity: 0.8;
    transition: transform 0.2s;
}

.wms-info-layer-header.open > i.fa-chevron-right,
.wms-info-layer-header.open > .wms-info-layer-toggle > i.fa-chevron-right {
    transform: rotate(90deg);
}

.wms-info-layer-header i.fa-layer-group {
    font-size: 12px;
    opacity: 0.8;
}

.wms-info-type {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.7;
}

.wms-info-count {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    white-space: nowrap;
}

/* Layer Zoom Button (auf alle Objekte zoomen) */
.wms-info-layer-zoom-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 3px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 4px;
}

.wms-info-layer-zoom-btn:hover {
    background: rgba(255,255,255,0.4);
}

/* Export-Zeile ÜBER der Tabelle (beschrifteter Button, heller Hintergrund) */
.wms-info-export-row {
    padding: 6px 8px 4px;
}

.wms-info-layer-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f5f5f5;
    color: #333;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.2s;
}

.wms-info-layer-export-btn:hover {
    background: #e8e8e8;
}

.wms-info-layer-zoom-btn:active {
    background: rgba(255,255,255,0.5);
}

/* Features Container */
.wms-info-features {
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: #fafafa;
}

/* Single Feature (kompakt mit Rand) */
.wms-info-feature {
    border: none;
    border-bottom: 1px solid #e8e8e8;
    margin: 0 8px;
    padding: 8px 0;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
}

.wms-info-feature:first-child {
    margin-top: 0;
}

.wms-info-feature:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Feature Toolbar (grauer Header mit Zoom-Button) */
.wms-info-feature-toolbar {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    background: #e8e8e8;
    border-bottom: 1px solid #ccc;
}

/* Zoom-Button Icon nicht rotieren */
.wms-info-zoom-btn i,
.wms-info-layer-zoom-btn i {
    transform: none !important;
    color: white;
}

.wms-info-zoom-btn i {
    font-size: 10px;
}

.wms-info-layer-zoom-btn i {
    font-size: 12px;
}

/* Zoom Button (einzelnes Feature) */
.wms-info-zoom-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 3px;
    background: #666;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.wms-info-zoom-btn:hover {
    background: #444;
}

.wms-info-zoom-btn:active {
    background: #333;
}

/* Properties Table (kompakt) */
.wms-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--table-kv-font-size, 12px);
    /* Feste Spaltenbreiten: ohne das zieht ein einzelnes langes Attribut-Label die
       Schluesselspalte auf, die Wertspalte wird gequetscht und Werte brechen mitten
       im Wort um (z.B. "2008-01-0 1"). */
    table-layout: fixed;
}

.wms-info-table tr:nth-child(even) {
    background: var(--table-zebra, #f8f8f8);
}

.wms-info-table td {
    padding: var(--table-kv-cell-padding, 4px 8px);
    border-bottom: 1px solid var(--table-line, #eee);
    vertical-align: top;
}

.wms-info-table tr:last-child td {
    border-bottom: none;
}

.wms-info-key {
    color: #555;
    font-weight: 500;
    width: 35%;
    /* Lange Feldbezeichnungen umbrechen statt abschneiden. */
    word-break: break-word;
    overflow-wrap: break-word;
    border-right: 1px solid var(--table-line, #eee);
}

.wms-info-value {
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
}

.wms-info-value a {
    color: var(--primary-color);
    text-decoration: none;
}

.wms-info-value a:hover {
    text-decoration: underline;
}

/* Inline-Leerwert (—) in einer Wert-Zelle darf NICHT das große, zentrierte
   Empty-State-Panel-Styling (.wms-info-empty) erben — sonst wird die Zeile viel
   zu hoch (z.B. Flurstück ohne Nenner). Hier bewusst nur inline + ohne Padding. */
.wms-info-value .wms-info-empty {
    display: inline;
    padding: 0;
    color: #999;
}

/* Raw HTML/Text Anzeige */
.wms-info-raw-html {
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
}

.wms-info-raw-html h1 {
    font-size: 15px;
    font-weight: 700;
    margin: 10px 0 6px;
    color: #222;
    border-bottom: 2px solid var(--primary-color, #007acc);
    padding-bottom: 4px;
}

.wms-info-raw-html h2 {
    font-size: 13.5px;
    font-weight: 600;
    margin: 8px 0 5px;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 3px;
}

.wms-info-raw-html h3 {
    font-size: 11px;
    font-weight: 600;
    margin: 4px 0 2px;
    color: #555;
}

.wms-info-raw-html h4,
.wms-info-raw-html h5,
.wms-info-raw-html h6 {
    font-size: 12px;
    font-weight: 600;
    margin: 4px 0 3px;
    color: #555;
}

.wms-info-raw-html a {
    color: var(--primary-color, #007acc);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.wms-info-raw-html a:hover {
    color: var(--primary-hover, #005fa3);
    border-bottom-color: var(--primary-color, #007acc);
}

.wms-info-raw-html a:visited {
    color: var(--primary-color, #007acc);
    opacity: 0.85;
}

.wms-info-raw-html img {
    max-width: 100%;
    height: auto;
}

.wms-info-raw-html table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.wms-info-raw-html table th,
.wms-info-raw-html table td {
    padding: 6px 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.wms-info-raw-html table th {
    background: #f5f5f5;
    font-weight: 600;
}

.wms-info-raw-html table tr:nth-child(even) {
    background: #fafafa;
}

.wms-info-raw-text {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    background: #f8f8f8;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* Mobile Anpassungen für WMS Info */
@media (max-width: 768px) {
    .wms-info-layer-header {
        padding: 12px;
        font-size: 14px;
    }

    .wms-info-feature {
        margin: 8px;
    }

    .wms-info-table {
        font-size: 12px;
    }

    .wms-info-table td {
        padding: 5px 8px;
    }
}

.wms-info-limit-notice {
    padding: 6px 8px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #8a5a00;
    background: #fff8e5;
    border: 1px solid #f0d9a8;
    border-radius: 4px;
}

/* ============================================
   LAYER-METADATEN MODAL
   ============================================ */
.layer-metadata-content {
    padding: 5px 0;
}

.metadata-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.metadata-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.metadata-section h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metadata-section h4 i {
    color: #6b7280;
    font-size: 12px;
}

.metadata-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.metadata-table tr {
    border-bottom: 1px solid #f3f4f6;
}

.metadata-table tr:last-child {
    border-bottom: none;
}

.metadata-table td {
    padding: 6px 0;
    vertical-align: top;
}

.metadata-table td:first-child {
    width: 90px;
    font-weight: 500;
    color: #6b7280;
    padding-right: 10px;
}

.metadata-table td:last-child {
    color: #111827;
}

.metadata-url {
    word-break: break-all;
    font-size: 11px;
    color: #6b7280 !important;
}

.metadata-legend {
    text-align: center;
    padding: 10px;
    background: #f9fafb;
    border-radius: 4px;
    min-height: 40px;
}

.metadata-legend img {
    max-width: 100%;
    height: auto;
    max-height: 200px;
}

.metadata-legend .no-legend {
    color: #9ca3af;
    font-size: 12px;
    font-style: italic;
}

/* ArcGIS REST Legende */
.arcgis-legend {
    max-height: 300px;
    overflow-y: auto;
}
.arcgis-legend-sublayer {
    margin-bottom: 10px;
}
.arcgis-legend-sublayer:last-child {
    margin-bottom: 0;
}
.arcgis-legend-sublayer-title {
    font-weight: 600;
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    padding-bottom: 2px;
    border-bottom: 1px dashed #e0e0e0;
}
.arcgis-legend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.arcgis-legend-table td {
    padding: 3px 4px;
    vertical-align: middle;
}

.legend-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.legend-fullscreen-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
}

.legend-fullscreen-content img {
    display: block;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
}

.legend-fullscreen-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 28px;
    height: 28px;
    background: var(--primary-color, #005578);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.metadata-external-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 10px;
    background: #eff6ff;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.metadata-external-link:hover {
    background: #dbeafe;
    text-decoration: none;
}

/* Metadaten-View im Modal (aus metadata_html_view.php) */
.metadata-view-content .section {
    padding: 12px 16px;
    border-bottom: 1px solid #374151;
}
.metadata-view-content .section:last-child {
    border-bottom: none;
}
.metadata-view-content .section h2 {
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
    margin: 0 0 10px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid #e67e22;
    display: inline-block;
}
.metadata-view-content .field {
    display: flex;
    margin-bottom: 6px;
    font-size: 12px;
}
.metadata-view-content .field .label {
    flex: 0 0 180px;
    font-weight: 500;
    color: #9ca3af;
    padding-right: 10px;
}
.metadata-view-content .field .value {
    flex: 1;
    color: #d1d5db;
    word-break: break-word;
}
.metadata-view-content .field .value a {
    color: #60a5fa;
}
.metadata-view-content .badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
}
.metadata-view-content .badge-success { background: #065f46; color: #a7f3d0; }
.metadata-view-content .badge-info { background: #1e3a5f; color: #93c5fd; }
.metadata-view-content .keyword {
    display: inline-block;
    padding: 1px 6px;
    background: #44320a;
    border: 1px solid #78560c;
    border-radius: 10px;
    font-size: 11px;
    color: #fbbf24;
    margin: 2px;
}

.metadata-loading {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

.metadata-loading i {
    margin-right: 8px;
}

.metadata-error {
    text-align: center;
    padding: 20px;
    color: #dc2626;
}

.metadata-error i {
    margin-right: 6px;
}

.metadata-section .metadata-text,
.metadata-section .metadata-text * {
    font-size: 12px !important;
    line-height: 1.5 !important;
    color: #374151;
}

.metadata-section .metadata-text p {
    margin: 0 0 8px 0;
}

.metadata-section .metadata-text p:last-child {
    margin-bottom: 0;
}

/* ============================================
   VIEWSHED-MODUL (Sichtbarkeitsanalyse)
   ============================================ */
.viewshed-modal-content {
    padding: 5px 0;
}

.viewshed-slider-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
}

.viewshed-slider-row label {
    flex: 0 0 85px;
    font-size: 11px;
    color: #555;
}

.viewshed-slider-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: var(--primary-color, #722f37);
    border-radius: 2px;
    outline: none;
    min-width: 100px;
    opacity: 0.7;
}

.viewshed-slider-row input[type="range"]:hover {
    opacity: 1;
}

.viewshed-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #666;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.viewshed-slider-row input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #666;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.viewshed-slider-row span {
    flex: 0 0 auto;
    min-width: 55px;
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.viewshed-button-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.viewshed-btn {
    flex: 1;
    padding: 6px 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.viewshed-btn:hover:not(:disabled) {
    background: #e8e8e8;
    border-color: #ccc;
}

.viewshed-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.viewshed-hint {
    margin-top: 8px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 10px;
    color: #666;
    text-align: center;
    line-height: 1.3;
}

.viewshed-loading {
    text-align: center;
    padding: 10px;
    color: #666;
}

.viewshed-loading i {
    margin-right: 8px;
    color: var(--primary-color);
}

/* ============================================
   DREHLEITER-MODUL (Feuerwehr)
   ============================================ */
.turntable-ladder-modal-content {
    padding: 5px 0;
}

.ladder-info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    color: white;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 500;
}

.ladder-info-box i {
    font-size: 16px;
}

.ladder-slider-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.ladder-slider-row label {
    flex: 0 0 110px;
    font-size: 11px;
    color: #555;
}

.ladder-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.ladder-select:focus {
    outline: none;
    border-color: #c62828;
}

.ladder-slider-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #c62828;
    border-radius: 2px;
    outline: none;
    min-width: 80px;
    opacity: 0.7;
}

.ladder-slider-row input[type="range"]:hover {
    opacity: 1;
}

.ladder-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #c62828;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.ladder-slider-row input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #c62828;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.ladder-slider-row span {
    flex: 0 0 auto;
    min-width: 60px;
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.ladder-specs {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    font-size: 11px;
    color: #666;
}

.spec-value {
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

.ladder-legend {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 12px 0;
}

.legend-title {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 10px;
    color: #555;
}

.legend-color {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.2);
}

.ladder-button-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.ladder-btn {
    flex: 1;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.ladder-btn:hover:not(:disabled) {
    background: #c62828;
    border-color: #c62828;
    color: white;
}

.ladder-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ladder-hint {
    margin-top: 10px;
    padding: 8px 10px;
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 4px;
    font-size: 10px;
    color: #e65100;
    text-align: center;
    line-height: 1.4;
}

/* ============================================
   EXTERNE WMS DIENSTE
   ============================================ */
.external-wms-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wms-url-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wms-url-section label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.wms-url-input-wrapper {
    display: flex;
    gap: 8px;
}

.wms-url-input-wrapper input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.wms-url-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.wms-clear-btn {
    padding: 8px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.wms-clear-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.wms-load-btn {
    padding: 8px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.wms-load-btn:hover {
    background: var(--primary-hover);
}

.wms-url-hint {
    font-size: 10px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wms-url-hint i {
    color: var(--primary-color);
}

.wms-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    color: var(--primary-color);
    font-size: 12px;
}

.wms-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    color: #c62828;
    font-size: 11px;
}

.wms-layers-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wms-service-info {
    padding: 8px 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.wms-service-info h4 {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: var(--primary-color);
}

.wms-service-info small {
    color: #666;
    font-size: 10px;
    line-height: 1.3;
}

.wms-layers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wms-layers-header span {
    font-weight: 600;
    font-size: 12px;
    color: #333;
}

.wms-select-btn {
    background: transparent;
    border: 1px solid #ddd;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    color: #666;
    cursor: pointer;
}

.wms-select-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.wms-layers-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.wms-layer-item {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
}

.wms-layer-item:last-child {
    border-bottom: none;
}

.wms-layer-item:hover {
    background: #f0f0f0;
}

.wms-layer-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 11px;
    color: #333;
}

.wms-layer-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary-color);
}

.wms-layer-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wms-layer-abstract {
    display: block;
    margin-top: 3px;
    margin-left: 20px;
    font-size: 9px;
    color: #888;
    line-height: 1.3;
}

.wms-actions {
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.wms-action-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wms-action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.wms-action-btn.primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.wms-action-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ============================================
   KAMERADATEN MODAL
   ============================================ */
.camera-info-content {
    padding: 5px 0;
}

.camera-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.camera-section:last-of-type {
    border-bottom: none;
    margin-bottom: 10px;
}

.camera-section h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.camera-code {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    margin: 0 0 8px 0;
    color: #333;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary-hover);
}

.copy-btn.copied {
    background: #28a745;
}

.scale-display {
    background: #f0f7ff;
    border: 1px solid #b8d4f0;
    border-radius: 4px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.scale-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a5a96;
}

.scale-hint {
    font-size: 12px;
    color: #666;
    font-family: 'Consolas', 'Monaco', monospace;
}

.camera-refresh {
    text-align: center;
    padding-top: 10px;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.refresh-btn:hover {
    background: #5a6268;
}

/* ============================================
   WEA-SUCHE (Windenergieanlagen durchsuchen)
   ============================================ */
#wea-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 100px);
    padding: 12px;
}

.wea-search-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

/* Filter-Bereich */
.wea-search-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.wea-filter-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wea-filter-row label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.wea-filter-select,
.wea-filter-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    transition: border-color 0.2s;
}

.wea-filter-select:focus,
.wea-filter-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.wea-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.wea-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.wea-btn-primary {
    background: var(--primary-color);
    color: white;
}

.wea-btn-primary:hover {
    background: var(--primary-hover);
}

.wea-btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.wea-btn-secondary:hover {
    background: #d0d0d0;
}

/* Ergebnis-Bereich */
.wea-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wea-results-header {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.wea-search-results {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.wea-results-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fafafa;
}

.wea-results-hint,
.wea-loading,
.wea-error,
.wea-no-results {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.wea-results-hint i,
.wea-loading i,
.wea-error i,
.wea-no-results i {
    margin-right: 6px;
}

.wea-error {
    color: #c0392b;
}

/* Ergebnisliste */
.wea-result-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wea-result-item {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.wea-result-item:last-child {
    border-bottom: none;
}

.wea-result-item:hover {
    background: #f0f0f0;
}

.wea-result-item.selected {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-left: 3px solid var(--primary-color);
}

.wea-result-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* Farbiger Punkt wie im Layerbaum */
.wea-result-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #888;
    flex-shrink: 0;
    margin-top: 5px;
}

/* Farbcodierung nach Planstand - wie in config.php definiert */
.wea-status-amnetz .wea-result-dot {
    background: #0055ff;
}

.wea-status-genehmigt .wea-result-dot {
    background: #00aa00;
}

.wea-status-beantragt .wea-result-dot {
    background: #ffaa00;
}

.wea-status-geplant .wea-result-dot {
    background: #ffebaf;
    border: 1px solid #ccc;
}

.wea-result-info {
    flex: 1;
    min-width: 0;
}

.wea-result-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wea-result-subtitle {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wea-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wea-meta-item {
    font-size: 10px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 3px;
}

.wea-meta-item i {
    font-size: 9px;
    color: #aaa;
}

.wea-result-betreiber {
    font-size: 10px;
    color: #666;
    font-style: italic;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wea-zoom-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    opacity: 0.7;
}

.wea-result-item:hover .wea-zoom-btn {
    opacity: 1;
}

.wea-zoom-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.wea-zoom-btn i {
    font-size: 12px;
}

/* Scrollbar für Ergebnisliste */
.wea-results-list::-webkit-scrollbar {
    width: 6px;
}

.wea-results-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.wea-results-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.wea-results-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ============================================
   EXTERNAL WMS POPUP (FeatureInfo Fallback)
   ============================================ */
.external-wms-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    min-width: 300px;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.external-wms-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.external-wms-popup-header button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.external-wms-popup-header button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.external-wms-popup-content {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(80vh - 50px);
    font-size: 13px;
    line-height: 1.5;
}

.external-wms-popup-content table {
    width: 100%;
    border-collapse: collapse;
}

.external-wms-popup-content th,
.external-wms-popup-content td {
    padding: 6px 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.external-wms-popup-content th {
    background: #f5f5f5;
    font-weight: 600;
}

.external-wms-popup-content tr:hover {
    background: #f9f9f9;
}

/* Gruppen-Entfernen-Button für externe Dienste */
.lt-group-remove-btn {
    margin-left: auto;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #999;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.lt-group-remove-btn:hover {
    background: #f44336;
    color: white;
}

.lt-group-remove-btn i {
    font-size: 12px;
}

/* FeatureInfo Modal für externe WMS */
.external-featureinfo-content {
    padding: 0;
}

#external-featureinfo-body {
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
}

#external-featureinfo-body table {
    width: 100%;
    border-collapse: collapse;
}

#external-featureinfo-body th,
#external-featureinfo-body td {
    padding: 6px 10px;
    border: 1px solid #ddd;
    text-align: left;
}

#external-featureinfo-body th {
    background: #f5f5f5;
    font-weight: 600;
}

#external-featureinfo-body tr:hover {
    background: #f9f9f9;
}

#external-featureinfo-body img {
    max-width: 100%;
    height: auto;
}

/* Nur für Screenreader: unsichtbar, aber im Accessibility Tree vorhanden (Skill netgis-barrierefreiheit).
   Für Statuszeile (aria-live) und versteckte Beschriftungen — NICHT display:none, das entfernt das
   Element auch für Hilfstechnologien. */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
