/* ═══════════════════════════════════════════════════════════════════
   GeoFinder – style.css
   Font:    'Segoe UI', Roboto, Arial, sans-serif
   Palette: #002643  SWIE Blau
            #14547b  Blau hell
            #0b3b5c  Blau mittel
            #00192a  Blau dunkel
            #ec6726  SWIE Orange
            #202124  Schwarz
            #5f6368  Dunkelgrau
            #9aa0a6  Hellgrau
            #e0e0e0  Trennlinien
            #fff     Weiß
═══════════════════════════════════════════════════════════════════ */

/* ── 1. RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height:      100%;
    width:       100%;
    margin:      0;
    padding:     0;
    overflow:    hidden;
    position:    relative;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background:  #f0f2f5;
    color:       #202124;
    -webkit-font-smoothing: antialiased;
}

/* ── 2. KARTE ──────────────────────────────────────────────────── */
#map {
    position:   absolute;
    top:        0;
    left:       0;
    right:      0;
    bottom:     0;
    min-height: 100px;
    z-index:    1;
}

/* ── 3. SUCHLEISTE ─────────────────────────────────────────────── */
#searchBar {
    position:  absolute;
    top:       14px;
    left:      50%;
    transform: translateX(-50%);
    width:     94%;
    max-width: 540px;
    z-index:   1000;
    filter:    drop-shadow(0 2px 10px rgba(0,0,0,.18));
}

#modeRow {
    display:       flex;
    gap:           6px;
    background:    #fff;
    border-radius: 12px 12px 0 0;
    padding:       7px 14px 6px;
    border:        1px solid #e0e0e0;
    border-bottom: none;
}

.modeBtn {
    display:       flex;
    align-items:   center;
    gap:           5px;
    font-size:     13px;
    font-weight:   500;
    color:         #5f6368;
    cursor:        pointer;
    user-select:   none;
    padding:       3px 8px;
    border-radius: 6px;
    transition:    background .15s, color .15s;
    font-family:   inherit;
}
.modeBtn:hover             { background: #f1f3f4; color: #202124; }
.modeBtn input[type=radio] { margin: 0; cursor: pointer; accent-color: #002643; }

#searchWrapper {
    display:       flex;
    align-items:   center;
    background:    #fff;
    border:        1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
}

#searchInput {
    flex:        1;
    border:      none;
    outline:     none;
    padding:     11px 14px;
    font-family: inherit;
    font-size:   14px;
    color:       #202124;
    background:  transparent;
    min-width:   0;
}
#searchInput::placeholder { color: #bdbdbd; }

#searchClear {
    display:     none;
    background:  none;
    border:      none;
    padding:     0 14px;
    cursor:      pointer;
    font-size:   16px;
    color:       #bdbdbd;
    line-height: 1;
    flex-shrink: 0;
    transition:  color .15s;
}
#searchClear:hover { color: #5f6368; }

#searchResults {
    display:       none;
    background:    #fff;
    border-radius: 0 0 12px 12px;
    box-shadow:    0 6px 20px rgba(0,0,0,.15);
    margin-top:    2px;
    max-height:    380px;
    overflow-y:    auto;
    border:        1px solid #e0e0e0;
    border-top:    none;
}

.sr-item {
    padding:       9px 14px;
    cursor:        pointer;
    border-bottom: 1px solid #f1f3f4;
    transition:    background .1s;
    text-align:    left;
}
.sr-item:last-child          { border-bottom: none; }
.sr-item:hover, .sr-item.akt { background: #f1f3f4; }

.sr-name {
    font-size:   14px;
    font-weight: 600;
    color:       #202124;
    display:     flex;
    align-items: center;
    gap:         6px;
    font-family: inherit;
}
.sr-type {
    font-size:     11px;
    font-weight:   500;
    color:         #002643;
    background:    #e8eef4;
    padding:       2px 7px;
    border-radius: 4px;
}
.sr-detail {
    font-size:     12px;
    color:         #9aa0a6;
    margin-top:    2px;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
}
.sr-source { font-size: 10px; color: #bdbdbd; margin-top: 2px; }
.sr-dbg    { font-size: 11px; color: #9aa0a6; padding: 4px 14px; }

/* ── 4. KONTEXTMENÜ ────────────────────────────────────────────── */
#contextMenu {
    display:       none;
    position:      fixed;
    background:    #fff;
    border-radius: 14px;
    box-shadow:    0 8px 32px rgba(0,0,0,.18), 0 1px 6px rgba(0,0,0,.10);
    border:        1px solid rgba(0,0,0,.08);
    min-width:     290px;
    max-width:     370px;
    z-index:       9999;
    font-family:   inherit;
    color:         #202124;
    user-select:   none;
    overflow:      hidden;
    animation:     ctxSlideIn .15s ease;
}

@keyframes ctxSlideIn {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ── 4a. Header ────────────────────────────────────────────────── */
.ctx-header,
.ctx-poi-float-header {
    position:        relative;
    overflow:        hidden;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             8px;
    padding:         11px 14px;
    background:      linear-gradient(135deg, #14547b 0%, #0b3b5c 18%, #002643 58%, #00192a 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.24),
        inset 0 10px 18px rgba(255,255,255,.05),
        inset 0 -10px 18px rgba(0,0,0,.22),
        0 2px 8px rgba(0,0,0,.10);
    border-bottom:   1px solid rgba(255,255,255,.07);
    user-select:     none;
    flex-shrink:     0;
}

.ctx-header {
    cursor:        grab;
    border-radius: 13px 13px 0 0;
}
.ctx-header:active,
.ctx-header.dragging { cursor: grabbing; }

.ctx-poi-float-header {
    cursor:        grab;
    border-radius: 13px 13px 0 0;
}
.ctx-poi-float-header:active,
.ctx-poi-float-header.dragging { cursor: grabbing; }

.ctx-header::before,
.ctx-poi-float-header::before {
    content:    "";
    position:   absolute;
    top:        -18px;
    left:       -30px;
    width:      180px;
    height:     70px;
    background: radial-gradient(
        ellipse at center,
        rgba(255,255,255,.18) 0%,
        rgba(255,255,255,.08) 35%,
        rgba(255,255,255,0)   75%
    );
    pointer-events: none;
}

.ctx-header::after,
.ctx-poi-float-header::after {
    content:    "";
    position:   absolute;
    top:        0;
    left:       0;
    right:      0;
    height:     58%;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,.18) 0%,
        rgba(255,255,255,.08) 28%,
        rgba(255,255,255,.03) 48%,
        rgba(255,255,255,0)   100%
    );
    pointer-events: none;
}

.ctx-header-icon {
    font-size:   17px;
    flex-shrink: 0;
    position:    relative;
    z-index:     1;
}

.ctx-header-name,
.ctx-poi-float-title {
    color:          #ffffff;
    letter-spacing: .2px;
    text-shadow:    0 1px 2px rgba(0,0,0,.22);
    position:       relative;
    z-index:        1;
    display:        block;
}

.ctx-header-name {
    flex:          1;
    font-size:     14px;
    font-weight:   700;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
    line-height:   1.2;
}

.ctx-poi-float-title {
    font-size:   13px;
    font-weight: 700;
}

.ctx-header-close,
.ctx-poi-float-close {
    background:    none;
    border:        none;
    color:         #ffffff;
    font-size:     18px;
    cursor:        pointer;
    padding:       2px 6px;
    border-radius: 4px;
    line-height:   1;
    flex-shrink:   0;
    transition:    background .15s;
    position:      relative;
    z-index:       1;
}
.ctx-header-close:hover,
.ctx-poi-float-close:hover { background: rgba(255,255,255,.20); }

/* ── 4b. Adressblock ───────────────────────────────────────────── */
.ctx-addr-block {
    padding: 4px 0;
}

.ctx-poi-name-line { display: none; }

.ctx-status-wrap {
    display:     flex;
    align-items: center;
    gap:         8px;
    padding:     7px 14px 5px;
}

.ctx-status {
    font-size:   12px;
    color:       #5f6368;
    font-style:  italic;
    font-family: inherit;
}

.ctx-mini-spinner {
    width:         12px;
    height:        12px;
    border:        2px solid #e0e0e0;
    border-top:    2px solid #002643;
    border-radius: 50%;
    animation:     gfSpin .7s linear infinite;
    flex-shrink:   0;
}

@keyframes gfSpin {
    from { transform: rotate(0deg);   }
    to   { transform: rotate(360deg); }
}

/*
 * KERN DER AUSRICHTUNGS-LÖSUNG:
 * .ctx-coords-line und .ctx-adr-line — identische Layout-Eigenschaften.
 * Einzige Ausnahme: coords-line hat border-bottom als Trenner.
 */
.ctx-coords-line {
    display:       flex;
    align-items:   baseline;
    gap:           20px;
    padding:       2px 14px 5px;
    font-size:     12px;
    font-family:   inherit;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 2px;
}

.ctx-adr-line {
    display:     flex;
    align-items: baseline;
    gap:         20px;
    padding:     2px 14px;
    font-size:   12px;
    font-family: inherit;
}

/* Feste Label-Breite — Schlüssel zur Ausrichtung */
.ctx-adr-label {
    width:       110px;
    flex-shrink: 0;
    color:       #5f6368;
    font-weight: 600;
}

.ctx-adr-value {
    flex:       1;
    color:      #202124;
    word-break: break-word;
}

/* ── 4c. Trennlinien ───────────────────────────────────────────── */
.ctx-separator {
    height:     1px;
    background: #f0f0f0;
    margin:     4px 14px;
}

.ctx-divider-thick {
    height:     1px;
    background: #e0e0e0;
    margin:     6px 14px 2px;
}

/* ── 4d. Button-Gruppe ─────────────────────────────────────────── */
.ctx-btn-group {
    padding:        6px 14px 12px;
    display:        flex;
    flex-direction: column;
    gap:            7px;
}

/* ── 4e. Aktions-Buttons ───────────────────────────────────────── */
.ctx-accept {
    display:        flex;
    align-items:    center;
    gap:            10px;
    padding:        10px 14px;
    cursor:         pointer;
    font-family:    inherit;
    font-size:      13px;
    font-weight:    600;
    color:          #ffffff;
    background:     #002643;
    border:         none;
    border-radius:  9px;
    box-shadow:     0 2px 6px rgba(0,0,0,.18);
    transition:     background .15s, box-shadow .15s, transform .1s;
    user-select:    none;
    text-align:     left;
    outline:        none;
    letter-spacing: .1px;
}
.ctx-accept:hover  { background: #0b3b5c; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.ctx-accept:active { background: #00192a; transform: scale(.98); box-shadow: none; }
.ctx-accept:focus-visible {
    outline:        2px solid #002643;
    outline-offset: 3px;
    box-shadow:     0 0 0 4px rgba(0,38,67,.25);
}

.ctx-accept-icon {
    font-size:   15px;
    flex-shrink: 0;
    line-height: 1;
}

.ctx-poi-trigger { background: #002643; }
.ctx-poi-trigger:hover  { background: #0b3b5c; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.ctx-poi-trigger:active { background: #00192a; }

/* ── 5. POI-LISTE ──────────────────────────────────────────────── */
#ctxPoiList {
    max-height: 230px;
    overflow-y: auto;
}

#ctxPoiList::-webkit-scrollbar       { width: 4px; }
#ctxPoiList::-webkit-scrollbar-track { background: transparent; }
#ctxPoiList::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 2px; }

.ctx-section {
    padding-bottom: 4px;
}

.ctx-poi-item {
    display:       flex;
    align-items:   flex-start;
    gap:           9px;
    padding:       9px 14px;
    cursor:        pointer;
    border-bottom: 1px solid #f5f5f5;
    transition:    background .1s;
    text-align:    left;
}
.ctx-poi-item:last-child { border-bottom: none; }
.ctx-poi-item:hover      { background: #f4f7fa; }
.ctx-poi-item:active     { background: #e8eef4; }

.ctx-poi-item.selected {
    background:   #e8eef4;
    border-left:  3px solid #002643;
    padding-left: 11px;
}

.ctx-poi-icon {
    font-size:   16px;
    width:       22px;
    text-align:  center;
    flex-shrink: 0;
    margin-top:  1px;
    line-height: 1;
}

.ctx-poi-info {
    flex:      1;
    min-width: 0;
}

.ctx-poi-name {
    font-size:     13px;
    font-weight:   600;
    color:         #202124;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
}

.ctx-poi-type {
    font-size:  11px;
    color:      #002643;
    margin-top: 1px;
}

.ctx-poi-meta-line {
    display:     flex;
    align-items: flex-start;
    gap:         3px;
    font-size:   11px;
    color:       #9aa0a6;
    line-height: 1.4;
    margin-top:  1px;
    word-break:  break-word;
}

.ctx-poi-meta-link {
    color:           #5f6368;
    text-decoration: none;
    word-break:      break-all;
}
.ctx-poi-meta-link:hover {
    color:           #002643;
    text-decoration: underline;
}

/* ── 6. POI DETAIL PANEL ───────────────────────────────────────── */
.ctx-poi-float {
    position:      fixed;
    z-index:       10000;
    background:    #fff;
    border-radius: 14px;
    box-shadow:    0 8px 32px rgba(0,0,0,.20), 0 1px 6px rgba(0,0,0,.10);
    border:        1px solid rgba(0,0,0,.08);
    min-width:     270px;
    max-width:     340px;
    max-height:    80vh;
    overflow-y:    auto;
    font-family:   'Segoe UI', Roboto, Arial, sans-serif;
    color:         #202124;
    animation:     ctxSlideIn .15s ease;
}

.ctx-poi-float::-webkit-scrollbar       { width: 4px; }
.ctx-poi-float::-webkit-scrollbar-track { background: transparent; }
.ctx-poi-float::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 2px; }

.ctx-poi-float-body {
    display:        flex;
    flex-direction: column;
}

.ctx-poi-float-detail {
    padding: 12px 14px 6px;
}

.ctx-poi-float-name {
    font-size:     14px;
    font-weight:   700;
    color:         #202124;
    margin-bottom: 6px;
    display:       flex;
    align-items:   center;
    gap:           6px;
    line-height:   1.3;
}

.ctx-poi-float-row {
    font-size:   12px;
    color:       #5f6368;
    line-height: 1.65;
    word-break:  break-word;
    display:     flex;
    align-items: flex-start;
    gap:         5px;
}

.ctx-poi-float-cat {
    font-size:     11px;
    color:         #002643;
    background:    #e8eef4;
    padding:       2px 7px;
    border-radius: 4px;
    display:       inline-block;
    margin-top:    2px;
}

.ctx-poi-float-divider {
    height:     1px;
    background: #f0f0f0;
    margin:     8px 14px;
}

.ctx-poi-float-actions {
    padding:        6px 14px 14px;
    display:        flex;
    flex-direction: column;
    gap:            7px;
}

.ctx-poi-submenu-item {
    display:        flex;
    align-items:    center;
    gap:            10px;
    padding:        10px 14px;
    cursor:         pointer;
    font-family:    inherit;
    font-size:      13px;
    font-weight:    600;
    color:          #ffffff;
    background:     #002643;
    border:         none;
    border-radius:  9px;
    box-shadow:     0 2px 6px rgba(0,0,0,.18);
    transition:     background .15s, transform .1s, box-shadow .15s;
    user-select:    none;
    text-align:     left;
    width:          100%;
    letter-spacing: .1px;
}
.ctx-poi-submenu-item:hover  { background: #0b3b5c; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.ctx-poi-submenu-item:active { background: #00192a; transform: scale(.98); }

.ctx-poi-submenu-item .sm-icon {
    font-size:   15px;
    width:       18px;
    text-align:  center;
    flex-shrink: 0;
    line-height: 1;
}

/* ── 7. KATASTER TOGGLE-BUTTON ─────────────────────────────────── */
.gf-kataster-btn {
    margin-top: 10px;
}

.gf-kataster-btn button {
    display:        flex;
    align-items:    center;
    gap:            6px;
    background:     #fff;
    border:         2px solid rgba(0,0,0,.2);
    border-radius:  6px;
    padding:        5px 10px;
    font-family:    'Segoe UI', Roboto, Arial, sans-serif;
    font-size:      12px;
    font-weight:    600;
    color:          #202124;
    cursor:         pointer;
    box-shadow:     0 2px 6px rgba(0,0,0,.15);
    transition:     background .15s, border-color .15s, color .15s;
    white-space:    nowrap;
}

.gf-kataster-btn button:hover {
    background:   #f1f3f4;
    border-color: rgba(0,0,0,.35);
}

/* Aktiv */
.gf-kataster-btn button.gf-kataster-active {
    background:   #002643;
    color:        #fff;
    border-color: #002643;
    box-shadow:   0 2px 8px rgba(0,38,67,.35);
}

.gf-kataster-btn button.gf-kataster-active:hover {
    background: #0b3b5c;
}

/* Zoom-Warnung */
.gf-kataster-btn button.gf-kataster-zoom-warn {
    border-color: #ec6726;
    color:        #ec6726;
}

.gf-kataster-btn button.gf-kataster-active.gf-kataster-zoom-warn {
    background:   #ec6726;
    color:        #fff;
    border-color: #ec6726;
}

.gf-kataster-icon {
    font-size:   14px;
    line-height: 1;
}

/* ── 8. TOAST ──────────────────────────────────────────────────── */
#toast {
    display:       none;
    position:      fixed;
    bottom:        24px;
    left:          24px;
    right:         auto;
    width:         auto;
    max-width:     80%;
    margin:        0;
    background:    #202124;
    color:         #fff;
    padding:       10px 22px;
    border-radius: 24px;
    font-size:     13px;
    font-weight:   500;
    z-index:       99999;
    white-space:   nowrap;
    box-shadow:    0 4px 16px rgba(0,0,0,.25);
    animation:     toastIn .2s ease;
    font-family:   inherit;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* ── 9. FOOTER ─────────────────────────────────────────────────── */
#swieFooter {
    position:       absolute;
    left:           0;
    bottom:         0;
    z-index:        1000;
    font-size:      10px;
    color:          rgba(60,60,60,0.85);
    font-family:    Arial, sans-serif;
    pointer-events: none;
    user-select:    none;
    background:     rgba(255,255,255,0.70);
    padding:        2px 8px;
    border-radius:  0 4px 0 0;
	