html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.map-context-menu {
    position: fixed;
    z-index: 1100;
    min-width: 180px;
    padding: 6px;
    background: #fff;
    border: 1px solid #dce1e7;
    border-radius: 6px;
    box-shadow: 0 4px 18px rgba(24, 36, 51, 0.2);
}

.map-context-menu[hidden] { display: none; }
.map-photo-form { position: fixed; top: 12px; right: 12px; z-index: 1100; width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; font-size: 12px; }
.map-photo-form[hidden] { display: none; }
.map-photo-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.map-photo-form .card-header, .map-photo-form .card-body, .map-photo-form .card-footer { padding: 10px 12px; }
.map-photo-form .card-header { justify-content: space-between; min-height: auto; }
.map-photo-form .card-title { font-size: 14px; margin: 0; }
.map-photo-form .form-label, .map-photo-form .form-control, .map-photo-form .form-select, .map-photo-form .btn { font-size: 12px; }
.map-photo-form .form-label { margin-bottom: 3px; }
.photo-drop-zone { padding: 14px 8px; border: 1px dashed #929dab; border-radius: 4px; text-align: center; cursor: pointer; }
.photo-drop-zone.is-dragging, .photo-drop-zone:focus-visible { border-color: #206bc4; background: #eef3fa; }
.photo-upload-preview { display: block; max-width: 100%; max-height: 120px; margin: 8px auto 0; object-fit: contain; }
.photo-upload-preview[hidden] { display: none; }
.photo-file-name { overflow-wrap: anywhere; }
.photo-drop-zone[hidden], [data-photo-gallery][hidden], .photo-media-fields[hidden] { display: none; }
.photo-gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 250px; overflow-y: auto; }
.photo-gallery-item { position: relative; display: block; padding: 4px; border: 1px solid #dce1e7; border-radius: 4px; cursor: pointer; }
.photo-gallery-item:has(input:checked) { border-color: #206bc4; background: #eef3fa; }
.photo-gallery-item input { position: absolute; top: 8px; left: 8px; }
.photo-gallery-item img { display: block; width: 100%; height: 85px; object-fit: contain; }
.photo-gallery-item span { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.photo-gallery-locations { margin-top: 4px; }
.photo-gallery-locations .badge { display: inline-block; margin-top: 0; max-width: 100%; white-space: normal; text-align: left; }
.photo-location-marker { display: grid; place-items: center; border: 0; background: transparent; box-shadow: none; }
.photo-location-marker > span { display: grid; place-items: center; width: 100%; height: 100%; }
.photo-location-marker img { display: block; width: 50px; height: 50px; object-fit: contain; }
.photo-badge-marker { border: 0; background: transparent; }
.photo-badge { position: absolute; width: 25px; height: 25px; left: 0; z-index: 2; border: 2px solid white; border-radius: 50%; box-sizing: border-box; object-fit: contain; background: white; }
.leaflet-marker-icon.is-details-active { opacity: 1; filter: drop-shadow(0 0 2px crimson) drop-shadow(0 0 3px crimson) drop-shadow(0 0 0.75rem crimson); }
.osm-map-status { padding: 8px 12px; border-radius: 4px; background: white; box-shadow: 0 1px 5px #0003; font: 13px/1.5 system-ui, sans-serif; }
.osm-map-status[hidden] { display: none; }
.osm-feature-tooltip { padding: 3px 6px; color: #182433; border-color: #d63939; }
.osm-map-label { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12px; }
.osm-map-add { display: inline-grid; place-items: center; min-width: 30px; min-height: 30px; border-radius: 4px; background: #206bc4; color: white !important; text-decoration: none; font-size: 22px; font-weight: bold; }
.osm-map-add:hover, .osm-map-add:focus-visible { background: #1854a0; }
.osm-feature-card { padding: 8px; border-bottom: 1px solid #dce1e7; overflow-x: auto; }
.osm-feature-card.is-selected { background: #fff0ef; box-shadow: inset 3px 0 #d63939; }
.osm-feature-row { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.osm-feature-name { flex: 1; min-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.osm-feature-row .btn { flex-shrink: 0; }
.osm-feature-card details { margin-top: 6px; }
.main-map-details {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    z-index: 1050;
    visibility: hidden;
    background: white;
    font: 14px/1.5 system-ui, sans-serif;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.2s ease;
}
.main-map-details.show { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) { .main-map-details { transition: none; } }
.photo-location-data h3, .photo-location-photos h3 { margin: 0 0 16px; font-size: 18px; }
.photo-details-card { padding: 16px 0; border-top: 1px solid #dce1e7; }
.photo-details-card h4 { margin: 0 0 12px; font-size: 16px; overflow-wrap: anywhere; }
.photo-details-card h5 { margin: 16px 0 8px; font-size: 14px; }
.photo-details-preview { display: block; width: 100%; max-height: 65vh; object-fit: contain; margin-bottom: 16px; cursor: pointer; }
.main-map-details a[data-fslightbox], .main-map-details a[data-fslightbox] img { cursor: pointer; }
.main-map-details button[data-fslightbox] { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.photo-details-data { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 2fr); gap: 6px 16px; margin: 0 0 24px; }
.photo-details-data dt { font-weight: 600; }
.photo-details-data dd { margin: 0; overflow-wrap: anywhere; }
.photo-details-related { margin: 0; padding-left: 20px; }
.photo-details-figure { margin: 0 0 16px; }
.photo-details-name { margin: 8px 0 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.photo-details-related-inline { margin: 16px 0 0; }
.photo-details-related-inline h5 { display: inline; margin: 0; }
.map-lightbox-caption { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 5; max-width: calc(100% - 32px); padding: 8px 16px; border-radius: 4px; background: #000b; color: white; font: 16px/1.4 system-ui, sans-serif; text-align: center; overflow-wrap: anywhere; pointer-events: none; }
.main-map-details header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-start; align-items: center; gap: 12px; padding: 12px 16px 12px 0; background: white; }
.main-map-details header h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.main-map-details .place-details-name-pl { display: block; margin-top: 4px; color: #6c757d; font-size: 14px; font-weight: 400; }
.place-details-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; overflow-wrap: anywhere; }
.place-details-address { flex: 1; min-width: 0; }
.place-details-category { flex: 1; min-width: 0; text-align: right; }
.place-details-description { min-width: 0; margin: 0 0 16px; padding: 8px 12px 12px; border: 1px solid #dce1e7; border-radius: 6px; }
.place-details-description legend { float: none; width: auto; margin: 0; padding: 0 6px; font-size: 12px; font-weight: 600; color: #6c757d; }
.place-details-description div { white-space: pre-wrap; overflow-wrap: anywhere; }
.place-details-timestamps { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #dce1e7; color: #6c757d; font-size: 12px; }
.main-map-details .map-details-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0 6px 6px 0; background: #eef3fa; color: #182433; font-size: 30px; line-height: 1; cursor: pointer; }
.main-map-details .map-details-close:hover { background: #dce7f5; }
.main-map-details .map-details-close:focus-visible { outline: 2px solid #206bc4; outline-offset: -2px; }
.main-map-details .offcanvas-body { padding: 16px; }
.main-map-details > header { flex-shrink: 0; }
.main-map-details > .offcanvas-body { flex: 1; min-height: 0; }
.map-details-footer { flex-shrink: 0; padding: 12px 16px; border-top: 1px solid #dce1e7; background: white; text-align: right; }
.map-details-footer[hidden] { display: none; }
.main-map-details .btn { display: inline-block; padding: 8px 12px; border: 1px solid #206bc4; border-radius: 4px; color: #206bc4; text-decoration: none; }

.map-context-menu button {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #182433;
    text-align: left;
}

.map-context-menu button:enabled:hover,
.map-context-menu button:focus-visible {
    background: #eef3fa;
}

.map-context-menu button:disabled {
    color: #929dab;
    cursor: default;
}

#map {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

.place-tooltip {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(35, 46, 60, 0.22);
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(35, 46, 60, 0.28);
    color: #182433;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 5px;
    white-space: nowrap;
}

.place-tooltip::before {
    border-right-color: rgba(35, 46, 60, 0.22);
}

.place-tooltip.leaflet-tooltip-right {
    margin-left: 1px;
}

.place-details-panel {
    left: auto !important;
    right: 0;
    width: 50vw;
    max-width: 50vw;
    height: 100%;
    border-radius: 0;
    box-shadow: -6px 0 24px rgba(24, 36, 51, 0.2);
}

.place-details-panel .offcanvas-body {
    overflow-y: auto;
}

.place-details-heading {
    margin: 1.25rem 0 0.65rem;
    font-size: 1.05rem;
}

.place-details-heading:first-child {
    margin-top: 0;
}

.place-details-table {
    table-layout: fixed;
}

.place-details-table th {
    width: 34%;
    font-weight: 600;
}

.place-details-table td,
.place-details-table th {
    overflow-wrap: anywhere;
    vertical-align: top;
}

.place-details-pre {
    white-space: pre-wrap;
    font-family: var(--tblr-font-monospace);
    font-size: 0.75rem;
}

.place-details-image {
    aspect-ratio: 1 / 1;
    margin: 0;
    overflow: hidden;
    border-radius: 6px;
    background: var(--tblr-bg-surface-secondary);
}

.place-details-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
}

.place-details-image a,
.place-details-image button {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
}

.place-details-image figcaption {
    position: relative;
    margin-top: -2.25rem;
    padding: 0.5rem;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.place-details-link-card {
    margin-bottom: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--tblr-border-color);
    border-radius: 6px;
    background: var(--tblr-bg-surface);
}

.place-details-video-preview {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #111;
    cursor: pointer;
}

.place-details-video-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.place-details-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    color: #fff;
    background: rgba(214, 42, 42, 0.95);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.35rem;
}

.place-details-video-player,
.place-details-video-player iframe,
.place-details-streetview iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}

.place-details-streetview iframe {
    min-height: 260px;
}

.place-details-link-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
}

@media (max-width: 767.98px) {
    .place-details-panel {
        left: 0 !important;
        width: 100vw;
        max-width: 100vw;
        height: 100%;
    }
}

.map-menu-button {
    display: none;
}

.leaflet-control-zoom { position: relative; }
.map-navigation-buttons { position: absolute; top: -2px; left: calc(100% + 8px); display: flex; border: 2px solid rgba(0, 0, 0, 0.2); border-radius: 4px; overflow: hidden; background: white; }
.map-navigation-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 5px; border: 0; background: white; color: #333; cursor: pointer; }
.map-navigation-button + .map-navigation-button { border-left: 1px solid #ccc; }
.map-navigation-button:hover, .map-navigation-button:focus-visible { background: #f4f4f4; }
.map-navigation-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.main-map-menu { position: fixed; inset: 0 auto 0 0; width: min(352px, 100vw); z-index: 1050; background: white; visibility: hidden; overflow-y: auto; box-shadow: 6px 0 24px #18243333; font: 14px/1.5 system-ui, sans-serif; }
.main-map-menu.show { visibility: visible; }
.main-map-menu header { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.main-map-menu h2 { font-size: 18px; }
.main-map-menu header button { font-size: 24px; cursor: pointer; }
.main-map-menu nav a { display: block; padding: 12px 16px; color: #206bc4; text-decoration: none; }
.main-map-menu nav a:hover { background: #eef3fa; }
.map-layer-menu { margin: 16px; padding: 16px 0 0; border: 0; border-top: 1px solid #e6e7e9; }
.map-layer-menu legend { float: none; width: auto; margin-bottom: 12px; font-size: 16px; font-weight: 600; }
.map-layer-menu label { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.map-layer-menu input { width: 16px; height: 16px; accent-color: #206bc4; }
.map-category-menu { --category-color: #4263eb; --category-selected-bg: #edf0fd; }
#photo-category-filters { --category-color: #0ca678; --category-selected-bg: #e6f7f2; }
.map-category-menu input { accent-color: var(--category-color); }
.map-category-menu legend label { padding: 0; }
.map-category-menu legend { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; }
.map-category-actions { display: flex; gap: 6px; margin-left: auto; }
.map-category-menu input[data-map-layer] { appearance: none; position: relative; display: inline-grid; place-items: center; flex-shrink: 0; padding: 0; margin: 0; border: 1px solid var(--category-color); border-radius: 3px; background: transparent; cursor: pointer; }
.map-category-menu input[data-map-layer]:indeterminate::after { content: ''; display: block; width: 8px; height: 8px; background: var(--category-color); }
.map-category-menu input[data-map-layer]:checked:not(:indeterminate)::after { content: ''; display: block; width: 5px; height: 9px; border: solid var(--category-color); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.map-category-menu input[data-map-layer]:focus-visible { outline: 2px solid var(--category-color); outline-offset: 2px; }
.map-category-pill { display: inline-flex; align-items: center; justify-content: center; padding: 2px 8px; border: 1px solid var(--category-color); border-radius: 999px; background: transparent; color: var(--category-color); font: inherit; font-size: 11px; line-height: 1.4; cursor: pointer; }
.map-category-pill:hover { background: transparent; text-decoration: underline; }
.map-category-pill:focus-visible { outline: 2px solid var(--category-color); outline-offset: 2px; }
.map-category-selectgroup { display: flex; flex-wrap: wrap; gap: 6px; }
.map-category-selectgroup .form-selectgroup-item { position: relative; display: block; max-width: 100%; padding: 0; margin: 0; cursor: pointer; }
.map-category-selectgroup .form-selectgroup-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; opacity: 0; }
.map-category-selectgroup .form-selectgroup-label { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 9px; border: 1px solid #dce1e7; border-radius: 5px; color: var(--category-color); background: transparent; }
.map-category-selectgroup .form-selectgroup-input:checked + .form-selectgroup-label { border-color: var(--category-color); background: var(--category-selected-bg); }
.map-category-selectgroup .form-selectgroup-input:focus-visible + .form-selectgroup-label { outline: 2px solid var(--category-color); outline-offset: 2px; }
.map-category-icon { width: 25px; height: 25px; flex-shrink: 0; object-fit: contain; }
.map-category-name { overflow-wrap: anywhere; }
.map-category-count { flex-shrink: 0; padding: 1px 5px; border-radius: 999px; background: var(--category-selected-bg); color: var(--category-color); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
