.refmap { position: relative; width: 100%; display: flex; flex-direction: column; gap: 12px; font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; }
/* [hidden] muss die display-Regeln unten schlagen (Toolbar/Button/Chips setzen display) */
.refmap [hidden] { display: none !important; }

/* Kartenbox (früher .refmap selbst) */
.refmap__mapwrap { position: relative; flex: 1 1 auto; min-width: 0; aspect-ratio: 16 / 9; min-height: 380px; overflow: hidden; border-radius: 12px; background: #5b6674; }
.refmap__holder { position: absolute; inset: 0; }
.refmap__holder svg { display: block; width: 100%; height: 100%; }

/* Stage: Karte + optionale Seitenliste */
.refmap__stage { display: flex; align-items: stretch; gap: 12px; }

.refmap .country-label { font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; text-anchor: middle; pointer-events: none; user-select: none; }
.refmap .city-label { font-weight: 600; text-anchor: start; pointer-events: none; user-select: none; }
.refmap .city-dot, .refmap .country, .refmap .project-marker { cursor: pointer; }

/* Tile-Basemap */
.refmap__tiles image { image-rendering: -webkit-optimize-contrast; }
.refmap__attribution { position: absolute; right: 0; bottom: 0; z-index: 4; font-size: 10px; line-height: 1.4; padding: 2px 6px; color: #2b3440; background: rgba(255,255,255,0.72); border-top-left-radius: 6px; }
.refmap__attribution a { color: #2b3440; }

/* Toolbar */
.refmap__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.refmap__search { flex: 1 1 220px; min-width: 160px; padding: 9px 12px; font-size: 14px; border: 1px solid #d3d8df; border-radius: 8px; background: #fff; color: #2b3440; }
.refmap__search:focus { outline: none; border-color: #e35b52; box-shadow: 0 0 0 3px rgba(227,91,82,0.15); }
.refmap__nearby { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; font-size: 14px; font-weight: 600; border: 1px solid #d3d8df; border-radius: 8px; background: #fff; color: #2b3440; cursor: pointer; }
.refmap__nearby:hover { border-color: #e35b52; color: #e35b52; }
.refmap__nearby[aria-busy="true"] { opacity: 0.6; cursor: progress; }

/* Filter-Chips */
.refmap__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.refmap__chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; font-weight: 600; border: 1px solid #d3d8df; border-radius: 999px; background: #fff; color: #2b3440; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.refmap__chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--chip, #e35b52); }
.refmap__chip[aria-pressed="true"] { background: var(--chip, #e35b52); border-color: var(--chip, #e35b52); color: #fff; }
.refmap__chip[aria-pressed="true"] .dot { background: rgba(255,255,255,0.9); }

/* Seitenliste */
.refmap__list { flex: 0 0 300px; max-width: 42%; overflow-y: auto; border: 1px solid #e3e7ec; border-radius: 12px; background: #fff; }
.refmap__list-empty { padding: 18px; font-size: 13px; color: #8a94a1; }
.refmap__item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid #eef1f4; cursor: pointer; transition: background 0.15s; }
.refmap__item:last-child { border-bottom: none; }
.refmap__item:hover, .refmap__item.active { background: #f5f7f9; }
.refmap__item .bar { flex: 0 0 4px; align-self: stretch; border-radius: 3px; background: var(--cat, #e35b52); }
.refmap__item .txt { min-width: 0; }
.refmap__item .n { display: block; font-size: 14px; font-weight: 600; color: #2b3440; }
.refmap__item .m { display: block; font-size: 12px; color: #7c8794; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.refmap__item .d { font-size: 11px; color: #a2abb6; margin-top: 2px; }

/* Panel (über der Kartenbox) */
.refmap__panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 320px; max-width: 88%;
    background: rgba(28, 35, 45, 0.92);
    backdrop-filter: blur(14px);
    border-left: 1px solid rgba(255,255,255,0.12);
    box-shadow: -16px 0 40px rgba(0,0,0,0.35);
    transform: translateX(105%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 5; color: #eef1f5;
    display: flex; flex-direction: column;
}
.refmap__panel.open { transform: translateX(0); }
.refmap__panel header { padding: 24px 26px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.refmap__panel-logo { max-width: 140px; max-height: 44px; margin-bottom: 10px; }
.refmap__kicker { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #ff8a80; font-weight: 700; margin-bottom: 6px; }
.refmap__title { margin: 0; font-size: 22px; font-weight: 700; color: #fdfcfb; line-height: 1.2; }
.refmap__sub { margin-top: 4px; font-size: 13px; color: #aab3bf; }
.refmap__body { padding: 18px 26px; overflow-y: auto; flex: 1; font-size: 13px; line-height: 1.55; }
.refmap__body .stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.refmap__body .stat .k { color: #aab3bf; flex: 0 0 auto; }
.refmap__body .stat .v { color: #fdfcfb; font-weight: 600; text-align: right; }
.refmap__body .desc { color: #d6dbe1; white-space: pre-wrap; margin-top: 6px; }
.refmap__body .addr { color: #aab3bf; font-size: 12.5px; line-height: 1.5; margin-top: 10px; }
.refmap__body .hours { color: #d6dbe1; white-space: pre-wrap; font-size: 12.5px; }
.refmap__body .list-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #8a94a1; font-weight: 700; margin: 20px 0 8px; }
.refmap__body .city-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px; margin: 0 -10px; border-radius: 8px; cursor: pointer; transition: background 0.15s; }
.refmap__body .city-row:hover { background: rgba(255,255,255,0.07); }
.refmap__body a { color: #ff8a80; }
.refmap__route { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 16px; font-size: 14px; font-weight: 600; text-decoration: none; color: #fff !important; background: #e35b52; border-radius: 8px; transition: background 0.15s; }
.refmap__route:hover { background: #c94a42; }
.refmap__panel-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06); color: #eef1f5;
    font-size: 16px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.refmap__panel-close:hover { background: rgba(255,255,255,0.16); }

.refmap__placing-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; padding: 6px 14px; font-size: 13px; border-radius: 999px; background: rgba(28,35,45,0.9); color: #fff; }

.refmap__loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: inherit; z-index: 10; transition: opacity 0.4s ease; }
.refmap__spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.2); border-top-color: #e35b52; animation: refmap-spin 0.9s linear infinite; }
@keyframes refmap-spin { to { transform: rotate(360deg); } }

.refmap__empty { padding: 20px; color: #8a94a1; }

@media (max-width: 720px) {
    .refmap__stage { flex-direction: column; }
    .refmap__mapwrap { aspect-ratio: auto; height: 64vh; border-radius: 0; }
    .refmap__list { flex-basis: auto; max-width: none; width: 100%; max-height: 40vh; }
    .refmap__panel {
        top: auto; left: 0; right: 0; bottom: 0;
        width: auto; max-width: none; max-height: 62%;
        border-left: none; border-top: 1px solid rgba(255,255,255,0.12);
        border-radius: 18px 18px 0 0;
        transform: translateY(105%);
    }
    .refmap__panel.open { transform: translateY(0); }
}
