/* ═══════════════════════════════════════════════════════════
   HVG Art Map — Frontend Viewer Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────── */
:root {
    --hvg-orange:    #E87722;
    --hvg-purple:    #6B2D7B;
    --hvg-gold:      #DAA520;
    --hvg-bg:        #f5f1e8;
    --hvg-text:      #333;
    --hvg-text-light:#666;
    --hvg-border:    #ddd;
    --hvg-radius:    8px;
    --hvg-shadow:    0 4px 20px rgba(0,0,0,0.15);
}

/* ── Wrap ─────────────────────────────────────────────────── */
#hvg-art-map-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--hvg-text);
    line-height: 1.5;
}

#hvg-art-map-wrap *,
#hvg-art-map-wrap *::before,
#hvg-art-map-wrap *::after {
    box-sizing: border-box;
}

/* Both admin and visitor views use flex sidebar + map */
#hvg-art-map-wrap.hvg-has-admin,
#hvg-art-map-wrap.hvg-has-legend {
    display: flex;
    flex-wrap: nowrap;
}

/* Admin: map container corners adjacent to panel */
#hvg-art-map-wrap.hvg-has-admin .hvg-map-container {
    border-radius: 0 var(--hvg-radius) 0 0;
}
#hvg-art-map-wrap.hvg-has-admin .hvg-filter-bar {
    border-radius: 0 0 var(--hvg-radius) 0;
}

/* Legend: map container corners adjacent to legend */
#hvg-art-map-wrap.hvg-has-legend .hvg-map-container {
    border-radius: 0 var(--hvg-radius) 0 0;
}
#hvg-art-map-wrap.hvg-has-legend .hvg-filter-bar {
    border-radius: 0 0 var(--hvg-radius) 0;
}

/* ── Map Area (flex child) ───────────────────────────────── */
.hvg-map-area {
    flex: 1;
    min-width: 0;
}

/* ── Map Container ────────────────────────────────────────── */
.hvg-map-container {
    position: relative;
    width: 100%;
    height: 100vh;
    max-height: none;
    background: #ffffff;
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.hvg-map-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: default;
    /* Hidden until JS finishes the first applyCoverZoom() + updatePositions() pass.
       Prevents the FOUC where the SVG renders at its native 2400x1600 viewBox and the
       overlay markers flash at (0,0) before svg-pan-zoom resizes everything. */
    opacity: 0;
    transition: opacity 0.2s ease-out;
}
#hvg-art-map-wrap.hvg-ready .hvg-map-viewport {
    opacity: 1;
}

/* Pan is enabled — grab cursor on all devices */
.hvg-map-viewport svg,
.hvg-map-viewport .svg-pan-zoom_viewport {
    cursor: grab !important;
}
.hvg-map-viewport:active svg,
.hvg-map-viewport:active .svg-pan-zoom_viewport {
    cursor: grabbing !important;
}

/* Mobile: allow svg-pan-zoom to capture touch for panning */
@media (max-width: 768px) {
    .hvg-map-viewport {
        touch-action: none;
    }
}

/* ── HTML Marker Overlay ─────────────────────────────────── */
#hvg-markers-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;      /* pass mouse through to SVG for panning */
    z-index: 10;
}

.hvg-html-marker {
    position: absolute;
    width: 36px;
    height: 36px;
    margin-left: -18px;        /* center horizontally on the point */
    margin-top: -18px;         /* center vertically on the point */
    pointer-events: auto;      /* markers themselves are clickable */
    cursor: pointer;
    transition: transform 0.15s ease;
    z-index: 1;
}

.hvg-html-marker:hover {
    transform: scale(1.3);
    z-index: 20;
}

.hvg-html-marker.hvg-marker-highlight {
    transform: scale(3);
    z-index: 30;
}

/* Always-visible colored dot — guarantees marker is seen */
.hvg-html-marker-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
    z-index: 1;
}

/* Icon image — sits on top of the dot */
.hvg-html-marker-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
}

.hvg-map-viewport svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Legend Panel (visitor sidebar) ───────────────────────── */
.hvg-legend-panel {
    width: 520px;
    min-width: 520px;
    background: #fff;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    overflow: hidden;
}

.hvg-legend-header {
    background: var(--hvg-purple);
    color: #fff;
    padding: 24px;
}

.hvg-legend-title-wrap {
    /* no flex needed */
}

.hvg-legend-title-line {
    font-size: 46px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
}

span.hvg-legend-logo {
    min-width: 52px;
    min-height: 52px;
    width: 52px;
    height: 52px;
    background: #fff;
    color: var(--hvg-purple);
    border: 3px solid #fff;
    border-radius: 50%;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px !important;
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1.2 !important;
    flex-shrink: 0;
}

.hvg-legend-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 32px 16px 20px;
}

/* Two-column grid layout */
.hvg-legend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}

.hvg-legend-col-left {
    grid-column: 1;
}

.hvg-legend-col-right {
    grid-column: 2;
}

.hvg-legend-col-bottom {
    grid-column: 1 / -1;
    border-top: 1px solid #eee;
    padding-top: 12px;
    margin-top: 8px;
}

.hvg-legend-group-title {
    margin: 0 0 10px;
    padding-left: 46px; /* align with labels: 36px icon + 10px gap */
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hvg-text);
}

.hvg-legend-group-title:not(:first-child) {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.hvg-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 0;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 4px;
}

.hvg-legend-item:hover {
    background: #faf6f0;
}

/* Legend icon image */
.hvg-legend-icon-wrap {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: contain;
}

/* Fallback for <img> icons */
.hvg-legend-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.hvg-legend-label-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 36px;
}

.hvg-legend-label {
    font-size: 13px;
    font-weight: 400;
    color: var(--hvg-text);
    line-height: 1.5;
    text-transform: uppercase;
}

.hvg-legend-note {
    font-size: 9px;
    font-weight: 400;
    color: var(--hvg-text-light);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-style: italic;
}

/* Poster series — single icon + stacked poem titles */
.hvg-legend-poster-group {
    align-items: flex-start;
}

.hvg-legend-poster-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hvg-legend-poster-name {
    font-size: 13px;
    font-weight: 400;
    color: var(--hvg-text);
    line-height: 1.8;
    text-transform: uppercase;
}

/* Left-column-only divider (e.g. between Locations and Moving Installation) */
.hvg-legend-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 28px 0 12px;
}

/* When a group title follows an explicit divider, suppress its own border-top */
.hvg-legend-divider + .hvg-legend-group-title {
    border-top: none;
    margin-top: 0;
    padding-top: 16px;
}

/* ── Legend Toggle / Close / Backdrop (hidden on desktop) ─── */
.hvg-legend-toggle  { display: none; }
.hvg-legend-close   { display: none; }
.hvg-legend-backdrop { display: none; }

/* ── Zoom Controls ────────────────────────────────────────── */
.hvg-zoom-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 9999;
}

.hvg-zoom-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #999;
    background: #fff;
    color: #333;
    font-size: 22px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: background 0.15s, box-shadow 0.15s;
    line-height: 1;
    touch-action: manipulation;    /* prevent browser double-tap-to-zoom */
    padding: 0;
}

.hvg-zoom-btn:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.hvg-zoom-btn:active {
    background: #e0e0e0;
}

.hvg-zoom-reset {
    font-size: 16px;
}

/* ── Filter Bar ───────────────────────────────────────────── */
.hvg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--hvg-border);
    border-top: 0;
    border-radius: 0 0 var(--hvg-radius) var(--hvg-radius);
}

.hvg-filter-btn {
    padding: 6px 16px;
    border: 2px solid var(--hvg-border);
    background: #fff;
    color: var(--hvg-text);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hvg-filter-btn:hover {
    border-color: var(--hvg-orange);
    color: var(--hvg-orange);
}

.hvg-filter-btn.active {
    background: var(--hvg-orange);
    border-color: var(--hvg-orange);
    color: #fff;
}

.hvg-filter-btn[data-filter="set-location"].active    { background: #E87722; border-color: #E87722; }
.hvg-filter-btn[data-filter="poster-series"].active    { background: #DAA520; border-color: #DAA520; }
.hvg-filter-btn[data-filter="no-set-location"].active  { background: #6B2D7B; border-color: #6B2D7B; }
.hvg-filter-btn[data-filter="ephemeral"].active        { background: #E87722; border-color: #E87722; }

/* ── SVG Marker Styles ────────────────────────────────────── */
.hvg-marker-group {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.hvg-marker-group:focus {
    outline: none;
}

.hvg-marker-group:focus-visible .hvg-marker-icon {
    filter: drop-shadow(0 0 3px #000);
}

.hvg-marker-icon {
    overflow: visible;
}

.hvg-marker-hit {
    fill: transparent;
}

.hvg-marker-group.hvg-filtered-out {
    display: none;
}

/* ── Popup Panel (slides up from bottom of map) ──────────── */
.hvg-popup-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85%;
    z-index: 100;
    background: #fff;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.hvg-popup-panel.hvg-popup-panel-open {
    transform: translateY(0);
}

.hvg-popup-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hvg-popup-panel-close:hover {
    background: #fff;
    color: #000;
}

/* Panel grid: two equal columns */
.hvg-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
}

/* ── Panel left column ── */
.hvg-panel-left {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.hvg-panel-decor-top {
    flex-shrink: 0;
    line-height: 0;
}

.hvg-panel-decor-top img {
    width: 100%;
    display: block;
}

.hvg-panel-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 3;
    min-height: 220px;
}

.hvg-panel-photo {
    overflow: hidden;
}

.hvg-panel-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hvg-panel-icon-block {
    position: relative;
    overflow: visible;
}

.hvg-panel-icon {
    position: absolute;
    bottom: -40px;
    right: 10px;
    width: 100px;
    height: 100px;
    object-fit: contain;
    z-index: 5;
}

.hvg-panel-icon svg {
    width: 100%;
    height: 100%;
}

.hvg-panel-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 50px 20px 20px;
    gap: 8px 20px;
    position: relative;
    z-index: 1;
    flex: 2;
}

.hvg-panel-meta-col {
    min-width: 0;
}

.hvg-panel-meta-item {
    margin-bottom: 12px;
}

.hvg-panel-meta-label {
    display: block;
    font-size: 12px;
    color: rgba(0,0,0,0.5);
    margin-bottom: 2px;
}

.hvg-panel-meta-value {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #000;
    text-transform: uppercase;
    line-height: 1.3;
}

.hvg-panel-meta-value a {
    color: var(--hvg-purple);
    text-decoration: underline;
    word-break: break-all;
}

/* ── Panel right column ── */
.hvg-panel-right {
    padding: clamp(16px, 4cqi, 32px) clamp(20px, 5cqi, 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    container-type: inline-size;
    container-name: poempanel;
}

.hvg-panel-title {
    margin: 0 0 4px;
    font-size: clamp(20px, 7.8cqi, 36px);
    font-weight: 900;
    color: #000;
    line-height: 1.1;
}

.hvg-panel-poet {
    margin: 0 0 clamp(10px, 2.4cqi, 20px);
    font-size: clamp(13px, 4.8cqi, 22px);
    font-weight: 400;
    color: #000;
}

.hvg-panel-poem {
    font-size: clamp(8px, 3.5cqi, 16px);
    line-height: 1.65;
    color: #333;
    flex: 1;
}

/* Force any inline font-size from the editor to inherit the responsive clamp() */
#hvg-art-map-wrap .hvg-panel-poem,
#hvg-art-map-wrap .hvg-panel-poem * {
    font-size: inherit !important;
}
#hvg-art-map-wrap .hvg-panel-poem {
    font-size: clamp(8px, 3.5cqi, 16px) !important;
}

#hvg-art-map-wrap .hvg-panel-poem p {
    margin: 0 0 1em !important;
    padding: 0;
    display: block;
    white-space: nowrap;
}
#hvg-art-map-wrap .hvg-panel-poem p:empty {
    margin: 0 0 0.5em !important;
    min-height: 0.5em;
}
#hvg-art-map-wrap .hvg-panel-poem p:last-child {
    margin-bottom: 0 !important;
}
#hvg-art-map-wrap .hvg-panel-poem br {
    display: block;
    content: "";
}

.hvg-panel-decor-btm {
    margin-top: auto;
    margin-left: -40px;
    margin-right: -40px;
    margin-bottom: -32px;
    padding-top: 16px;
    flex-shrink: 0;
    line-height: 0;
}

.hvg-panel-decor-btm img {
    width: 100%;
    display: block;
}

/* ── Tippy.js Theme (kept for compatibility) ─────────────── */
.tippy-box[data-theme~='hvg'] {
    background: #fff;
    color: var(--hvg-text);
    border-radius: var(--hvg-radius);
    box-shadow: var(--hvg-shadow);
    border: 1px solid var(--hvg-border);
    padding: 0;
    overflow: hidden;
}

.tippy-box[data-theme~='hvg'] .tippy-arrow {
    color: #fff;
}

.tippy-box[data-theme~='hvg'] .tippy-arrow::before {
    border-top-color: #fff;
}

/* ── Popup Card ───────────────────────────────────────────── */
.hvg-popup {
    max-width: 340px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.hvg-popup-image {
    width: 100%;
    max-height: 180px;
    overflow: hidden;
}

.hvg-popup-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.hvg-popup-body {
    padding: 14px 16px 16px;
}

.hvg-popup-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: var(--hvg-purple);
    line-height: 1.3;
}

.hvg-popup-location {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--hvg-text-light);
}

.hvg-popup-poem {
    margin: 0 0 10px;
    padding: 10px 12px;
    background: #faf6f0;
    border-left: 3px solid var(--hvg-orange);
    border-radius: 0 4px 4px 0;
}

.hvg-popup-poem-title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    font-style: italic;
    color: var(--hvg-text);
}

.hvg-popup-poet {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--hvg-text-light);
}

.hvg-popup-excerpt {
    margin: 0;
    font-size: 13px;
    color: var(--hvg-text);
    white-space: pre-line;
    line-height: 1.5;
}

.hvg-popup-desc {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--hvg-text-light);
    line-height: 1.5;
}

.hvg-popup-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Toast ────────────────────────────────────────────────── */
.hvg-toast {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
    white-space: nowrap;
}

.hvg-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.hvg-toast-success { background: #4CAF50; }
.hvg-toast-error   { background: #f44336; }
.hvg-toast-info    { background: var(--hvg-purple); }

/* ── Placement Overlay ────────────────────────────────────── */
.hvg-placement-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: rgba(107, 45, 123, 0.9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
    font-size: 14px;
    font-weight: 500;
}

/* ── Mobile Bottom Sheet ──────────────────────────────────── */
.hvg-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hvg-mobile-overlay.hvg-overlay-visible {
    opacity: 1;
}

.hvg-mobile-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.hvg-mobile-sheet.hvg-sheet-open {
    transform: translateY(0);
}

.hvg-sheet-handle {
    display: none;
}

.hvg-sheet-close {
    display: none;
}

.hvg-sheet-content {
    padding: 0;
}

/* ── Mobile title bar ─────────────────────────────────────── */
.hvg-mobile-title-bar {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.hvg-mobile-back {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin-right: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.hvg-mobile-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

/* ── Mobile poem section (stacked below meta) ────────────── */
.hvg-mobile-poem-section {
    padding: 24px 20px;
    background: #fff;
}

.hvg-mobile-poem-section .hvg-panel-decor-btm {
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: -24px;
}

/* ── Mobile overrides for shared panel components ─────────── */
@media (max-width: 768px) {
    .hvg-sheet-content .hvg-panel-visual {
        min-height: 200px;
    }

    .hvg-sheet-content .hvg-panel-meta {
        padding: 40px 16px 16px;
    }

    .hvg-sheet-content .hvg-panel-icon {
        width: 70px;
        height: 70px;
        bottom: -30px;
    }
}

/* ── Buttons (shared) ─────────────────────────────────────── */
.hvg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    text-decoration: none;
    line-height: 1.4;
    gap: 6px;
}

.hvg-btn-primary {
    background: var(--hvg-orange);
    color: #fff;
}

.hvg-btn-primary:hover {
    background: #d06a1a;
}

.hvg-btn-secondary {
    background: #f0f0f0;
    color: var(--hvg-text);
    border: 1px solid var(--hvg-border);
}

.hvg-btn-secondary:hover {
    background: #e0e0e0;
}

.hvg-btn-danger {
    background: #f44336;
    color: #fff;
}

.hvg-btn-danger:hover {
    background: #d32f2f;
}

.hvg-btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* ── Mobile Banner (hidden on desktop) ────────────────────── */
.hvg-mobile-banner {
    display: none;
}

/* ── Mobile Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    #hvg-art-map-wrap.hvg-has-admin,
    #hvg-art-map-wrap.hvg-has-legend {
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .hvg-admin-panel {
        display: none;
    }

    /* Legend panel — slide-in from left instead of hidden */
    .hvg-legend-panel {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 9000;
        width: 85vw;
        max-width: 520px;
        min-width: 0;
        border-right: none;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .hvg-legend-panel.hvg-legend-open {
        transform: translateX(0);
    }

    .hvg-legend-header {
        position: relative;
    }

    .hvg-legend-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
        background: rgba(255,255,255,0.2);
        color: #fff;
        font-size: 20px;
        line-height: 1;
        padding: 0;
        cursor: pointer;
        z-index: 10;
    }

    .hvg-legend-close:hover {
        background: rgba(255,255,255,0.35);
    }

    .hvg-legend-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        bottom: 130px;
        left: 12px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: 2px solid #999;
        background: #fff;
        color: #333;
        cursor: pointer;
        z-index: 9999;
        box-shadow: 0 2px 8px rgba(0,0,0,0.25);
        padding: 0;
        touch-action: manipulation;
    }

    .hvg-legend-toggle:hover {
        background: #f0f0f0;
    }

    .hvg-legend-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 8999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .hvg-legend-backdrop.hvg-legend-backdrop-visible {
        opacity: 1;
        pointer-events: auto;
    }

    .hvg-map-area {
        height: 100%;
    }

    .hvg-map-container {
        height: 100%;
        min-height: 0;
        max-height: none;
        border-radius: 0;
    }

    .hvg-mobile-banner {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px 24px;
        background: var(--hvg-purple);
        color: #fff;
        text-align: center;
        font-size: 20px;
        line-height: 1.3;
        z-index: 50;
    }

    .hvg-filter-bar {
        display: none;
    }

    .hvg-zoom-controls {
        top: 50%;
        bottom: auto;
        right: 12px;
        transform: translateY(-50%);
    }

    .hvg-zoom-btn {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
}
