.osm4j-wrapper {
    width: 100%;
}

.osm4j-map {
    width: 100%;
    min-height: 250px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f2f2f2;
}

.osm4j-filter {
    box-sizing: border-box;
    max-width: 100%;
    --osm4j-filter-surface: rgba(255, 255, 255, 0.86);
    --osm4j-filter-border: rgba(22, 34, 51, 0.10);
    --osm4j-filter-shadow: 0 0.65rem 1.8rem rgba(20, 33, 61, 0.10);
    --osm4j-filter-accent: #2f80ed;
    display: block;
    margin: 0 0 1rem;
    padding: 0.85rem;
    border: 1px solid var(--osm4j-filter-border);
    border-radius: 1rem;
    background:
        radial-gradient(circle at top left, rgba(47, 128, 237, 0.13), transparent 38%),
        radial-gradient(circle at top right, rgba(255, 193, 7, 0.16), transparent 34%),
        var(--osm4j-filter-surface);
    box-shadow: var(--osm4j-filter-shadow);
    backdrop-filter: blur(10px);
}

.osm4j-filter-header {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
    margin: 0 0 0.7rem;
}

.osm4j-filter-kicker {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.osm4j-filter-hint {
    color: #667085;
    font-size: 0.92rem;
}

.osm4j-filter-buttons {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: stretch;
    max-width: 100%;
}

.osm4j-filter-button {
    box-sizing: border-box;
    --osm4j-filter-accent: #2f80ed;
    position: relative;
    display: inline-flex;
    gap: 0.48rem;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    max-width: 100%;
    min-height: 2.45rem;
    border: 1px solid rgba(22, 34, 51, 0.14);
    border-radius: 999px;
    padding: 0.42rem 0.62rem 0.42rem 0.78rem;
    background: rgba(255, 255, 255, 0.78);
    color: #1f2937;
    cursor: pointer;
    line-height: 1.15;
    box-shadow: 0 0.18rem 0.55rem rgba(20, 33, 61, 0.07);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.osm4j-filter-button:hover,
.osm4j-filter-button:focus-visible {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--osm4j-filter-accent) 55%, #ffffff);
    background: #fff;
    box-shadow: 0 0.38rem 1rem rgba(20, 33, 61, 0.13);
}

.osm4j-filter-button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--osm4j-filter-accent) 32%, transparent);
    outline-offset: 2px;
}

.osm4j-filter-button.is-active {
    border-color: color-mix(in srgb, var(--osm4j-filter-accent) 72%, #ffffff);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--osm4j-filter-accent) 14%, #ffffff), #ffffff 70%);
    color: #111827;
    font-weight: 700;
    box-shadow: 0 0.55rem 1.25rem color-mix(in srgb, var(--osm4j-filter-accent) 18%, transparent);
}

.osm4j-filter-button.is-active::after {
    content: "";
    position: absolute;
    right: 0.7rem;
    bottom: -0.42rem;
    left: 0.7rem;
    height: 0.18rem;
    border-radius: 999px;
    background: var(--osm4j-filter-accent);
}

.osm4j-filter-dot {
    width: 0.86rem;
    height: 0.86rem;
    flex: 0 0 auto;
    border-radius: 50%;
    display: inline-block;
    background: var(--osm4j-filter-accent);
    box-shadow: 0 0 0 0.22rem color-mix(in srgb, var(--osm4j-filter-accent) 18%, transparent);
}

.osm4j-filter-dot-all {
    background: linear-gradient(135deg, #2f80ed 0%, #ffd34e 52%, #d92128 100%);
    box-shadow: 0 0 0 0.22rem rgba(47, 128, 237, 0.14);
}

.osm4j-filter-text {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

.osm4j-filter-count {
    min-width: 1.55rem;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.07);
    color: #475467;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.osm4j-filter-button.is-active .osm4j-filter-count {
    background: color-mix(in srgb, var(--osm4j-filter-accent) 16%, #ffffff);
    color: #1f2937;
}

.osm4j-empty {
    margin-top: 0.75rem;
}

.osm4j-popup h3 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.osm4j-popup p {
    margin: 0.35rem 0;
}

.osm4j-popup-category {
    font-weight: 700;
}

.osm4j-map-description {
    margin: 0 0 1rem;
}

.osm4j-filter-level-1 {
    margin-left: 0.25rem;
}

.osm4j-filter-level-2,
.osm4j-filter-level-3,
.osm4j-filter-level-4 {
    margin-left: 0.5rem;
}

.osm4j-filter-level-1 .osm4j-filter-text::before,
.osm4j-filter-level-2 .osm4j-filter-text::before,
.osm4j-filter-level-3 .osm4j-filter-text::before,
.osm4j-filter-level-4 .osm4j-filter-text::before {
    content: "↳ ";
    color: #98a2b3;
    font-weight: 400;
}

.osm4j-popup-image {
    margin: 0 0 0.5rem;
}

.osm4j-popup-image img {
    display: block;
    max-width: 240px;
    max-height: 160px;
    object-fit: cover;
    border-radius: 0.35rem;
}

.osm4j-popup-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.osm4j-popup-image {
    margin: 0;
}

.osm4j-popup-image img {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 0.35rem;
}

.osm4j-popup-image figcaption {
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.osm4j-popup-field {
    margin: 0.35rem 0;
}

.osm4j-popup-field-symbol {
    font-size: 1.1rem;
}

.osm4j-popup-summary .osm4j-popup-image-first img {
    max-width: 240px;
    max-height: 150px;
}

.osm4j-popup-details-row {
    margin-top: 0.65rem;
}

.osm4j-detail-link {
    display: inline-block;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.osm4j-detail-modal[hidden] {
    display: none;
}

.osm4j-detail-modal.is-open {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.osm4j-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.osm4j-detail-dialog {
    position: relative;
    width: min(920px, 100%);
    max-height: min(88vh, 900px);
    overflow: auto;
    border-radius: 0.6rem;
    background: #fff;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
}

.osm4j-detail-close {
    position: sticky;
    top: 0.5rem;
    float: right;
    z-index: 2;
    margin: 0.5rem 0.5rem 0 0;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: #f2f2f2;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.osm4j-detail-body {
    padding: 1.5rem;
}

.osm4j-detail-header h3 {
    margin-top: 0;
}

.osm4j-detail-section {
    margin-top: 1.25rem;
}

.osm4j-detail-section h4,
.osm4j-popup-fields h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.osm4j-detail-content .osm4j-popup-images {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.osm4j-detail-content .osm4j-popup-image img {
    max-height: 260px;
}


.osm4j-detail-images .osm4j-popup-images {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.osm4j-detail-images .osm4j-popup-image {
    position: relative;
    z-index: 1;
}

.osm4j-detail-images .osm4j-popup-image img {
    transform-origin: center center;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.osm4j-detail-images .osm4j-popup-image:hover {
    z-index: 3;
}

.osm4j-detail-images .osm4j-popup-image:hover img,
.osm4j-detail-images .osm4j-popup-image:focus-within img {
    transform: scale(1.12);
    box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.24);
}

@media (prefers-reduced-motion: reduce) {
    .osm4j-detail-images .osm4j-popup-image img {
        transition: none;
    }
}

.osm4j-popup-image-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    text-align: inherit;
}

.osm4j-popup-image-button img {
    display: block;
}

.osm4j-lightbox-modal[hidden] {
    display: none;
}

.osm4j-lightbox-modal.is-open {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.osm4j-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}

.osm4j-lightbox-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(1100px, 100%);
    max-height: 94vh;
}

.osm4j-lightbox-figure {
    margin: 0;
    max-width: 100%;
    text-align: center;
}

.osm4j-lightbox-figure img {
    display: block;
    max-width: 100%;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 0.35rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.45);
}

.osm4j-lightbox-figure figcaption {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
}

.osm4j-lightbox-close,
.osm4j-lightbox-nav {
    position: absolute;
    z-index: 2;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    cursor: pointer;
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.25);
}

.osm4j-lightbox-close {
    top: -0.25rem;
    right: -0.25rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.7rem;
    line-height: 1;
}

.osm4j-lightbox-nav {
    top: 50%;
    width: 2.75rem;
    height: 2.75rem;
    transform: translateY(-50%);
    font-size: 2.1rem;
    line-height: 1;
}

.osm4j-lightbox-prev {
    left: 0.5rem;
}

.osm4j-lightbox-next {
    right: 0.5rem;
}

.osm4j-lightbox-nav[hidden] {
    display: none;
}

@media (max-width: 640px) {
    .osm4j-lightbox-dialog {
        width: 100%;
    }

    .osm4j-lightbox-close {
        top: 0.25rem;
        right: 0.25rem;
    }

    .osm4j-lightbox-prev {
        left: 0.25rem;
    }

    .osm4j-lightbox-next {
        right: 0.25rem;
    }
}

.osm4j-entry-list-wrapper {
    margin-top: 1.25rem;
}

.osm4j-entry-list-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
}

.osm4j-entry-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 1rem;
    align-items: stretch;
}

.osm4j-entry-list-item {
    min-width: 0;
}

.osm4j-entry-card {
    display: flex;
}

.osm4j-entry-card .osm4j-popup {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.6rem;
    padding: 0.85rem;
    background: #fff;
    box-shadow: 0 0.25rem 0.9rem rgba(0, 0, 0, 0.06);
}

.osm4j-entry-card .osm4j-popup h3 {
    margin-bottom: 0.45rem;
    font-size: 1.1rem;
}

.osm4j-entry-card .osm4j-popup-image-first {
    order: -1;
    margin: -0.85rem -0.85rem 0.7rem;
}

.osm4j-entry-card .osm4j-popup-image-first img {
    width: 100%;
    max-width: none;
    height: 155px;
    max-height: none;
    border-radius: 0.6rem 0.6rem 0 0;
    object-fit: cover;
}

.osm4j-entry-card .osm4j-popup-image-first figcaption {
    padding: 0.25rem 0.85rem 0;
}

.osm4j-entry-card .osm4j-popup-details-row {
    margin-top: auto;
    padding-top: 0.5rem;
}

.osm4j-entry-card .osm4j-popup p {
    overflow-wrap: anywhere;
}

.osm4j-entry-list-empty {
    margin-top: 0.75rem;
}


@supports not (backdrop-filter: blur(10px)) {
    .osm4j-filter {
        background: #fff;
    }
}

@media (prefers-reduced-motion: reduce) {
    .osm4j-filter-button {
        transition: none;
    }

    .osm4j-filter-button:hover,
    .osm4j-filter-button:focus-visible {
        transform: none;
    }
}

@media (max-width: 640px) {
    .osm4j-filter {
        padding: 0.75rem;
        border-radius: 0.85rem;
    }

    .osm4j-filter-header {
        display: block;
    }

    .osm4j-filter-hint {
        display: block;
        margin-top: 0.2rem;
    }

    .osm4j-filter-buttons {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
        gap: 0.5rem;
        align-items: stretch;
        overflow: visible;
    }

    .osm4j-filter-button {
        width: 100%;
        padding-right: 0.7rem;
        scroll-snap-align: none;
    }

    .osm4j-filter-button.is-active::after {
        right: 0.7rem;
        left: 0.7rem;
    }

    .osm4j-filter-level-1,
    .osm4j-filter-level-2,
    .osm4j-filter-level-3,
    .osm4j-filter-level-4 {
        margin-left: 0;
    }
}

@media (max-width: 420px) {
    .osm4j-filter-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .osm4j-entry-list {
        grid-template-columns: 1fr;
    }
}
