.osvv-map-stage {
    position: relative;
    isolation: isolate;
    border: 1px solid #d5e0d5;
    border-radius: 14px;
    background: #eaf0e8;
}

.osvv-map-stage :is(.osvv-map-canvas, .osvv-yandex-widget) {
    box-sizing: border-box;
    margin: 0;
    border: 0;
    border-radius: inherit;
}

.osvv-map-stage :is(.osvv-map-canvas, .osvv-yandex-widget iframe) {
    height: clamp(420px, 66vh, 680px);
}

.osvv-map-stage .osvv-map-filter {
    --osvv-filter-ink: #203025;
    --osvv-filter-accent: #31573b;
    --osvv-filter-line: #dae4d9;
    --osvv-filter-fill: #f5f8f4;
    --osvv-filter-gap: 14px;
    --osvv-field-height: 44px;
    --osvv-field-radius: 9px;
    --osvv-toolbar-inset: 10px;
    --osvv-toolbar-gap: 6px;
    position: absolute;
    inset: var(--osvv-toolbar-inset) var(--osvv-toolbar-inset) auto;
    z-index: 2;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--osvv-filter-ink);
    pointer-events: none;
}

.osvv-map-toolbar {
    display: flex;
    align-items: flex-start;
    gap: var(--osvv-toolbar-gap);
}

.osvv-map-criteria {
    display: flex;
    flex: 0 1 auto;
    gap: var(--osvv-toolbar-gap);
    min-width: 0;
    margin: -2px -2px 0;
    padding: 2px 2px 5px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: #31573b70 transparent;
    pointer-events: auto;
}

.osvv-map-menu {
    flex: none;
    margin: 0;
}

.osvv-map-filter :is(.osvv-map-menu > summary, .osvv-map-form-actions button) {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    margin: 0;
    padding: 8px 9px;
    border: 1px solid #52755b35;
    border-radius: 10px;
    background: rgb(255 255 255 / 87%);
    backdrop-filter: blur(10px) saturate(1.15);
    box-shadow: 0 2px 5px #1c37272b;
    color: #213b29;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

.osvv-map-menu > summary { list-style: none; }
.osvv-map-menu > summary::-webkit-details-marker { display: none; }

.osvv-map-menu > summary::after {
    flex: 0 0 6px;
    height: 6px;
    margin: -3px 1px 0 0;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    content: "";
}

.osvv-map-menu[open] > summary::after {
    margin-top: 3px;
    transform: rotate(225deg);
}

.osvv-map-filter :is(.osvv-map-menu > summary:hover, .osvv-map-menu[open] > summary, .osvv-map-reset:hover) {
    background: #fff;
    border-color: #62816a;
}

.osvv-map-filter .osvv-map-menu[data-active] > summary {
    border-color: #62816a;
    background: rgb(230 244 225 / 94%);
    color: #234f31;
}

.osvv-map-menu-panel {
    position: fixed;
    z-index: 1;
    box-sizing: border-box;
    width: min(360px, calc(100vw - 24px));
    max-height: min(440px, calc(100vh - 96px));
    overflow: auto;
    overscroll-behavior: contain;
    padding: 14px;
    border: 1px solid #cad9ca;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px #172a1b26, 0 2px 6px #172a1b12;
}

.osvv-map-menu-panel > .osvv-field + .osvv-field,
.osvv-map-menu-panel .osvv-filter-period > [data-filter-time]:not([hidden]) {
    margin-top: 10px;
}

.osvv-map-filter .osvv-map-menu-panel .osvv-date-note { margin-top: 10px; }

.osvv-map-filter .osvv-map-period-error {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 7px;
    background: #fbeeed;
    color: #792b2b;
    font-size: 13px;
    line-height: 1.4;
}

.osvv-map-form-actions {
    display: flex;
    flex: none;
    gap: var(--osvv-toolbar-gap);
    pointer-events: auto;
}

.osvv-map-filter .osvv-map-form-actions .osvv-map-apply {
    border-color: #254f34;
    background: rgb(38 80 53 / 95%);
    color: #fff;
}

.osvv-map-filter .osvv-map-form-actions .osvv-map-apply:hover { background: #1c402a; }

.osvv-map-filter .osvv-map-form-actions .osvv-map-reset {
    width: 42px;
    padding: 0;
    font-size: 23px;
    font-weight: 500;
}

.osvv-map-fields,
.osvv-map-category-grid,
.osvv-map-category-group:last-child .osvv-map-category-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--osvv-filter-gap);
}

.osvv-map-fields > .osvv-filter-period {
    display: contents;
}

.osvv-map-filter .osvv-field {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.osvv-map-fields [data-filter-time] {
    display: grid;
    min-width: 0;
}

.osvv-map-filter .osvv-field > :is(input, select, .osvv-map-select-trigger) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: var(--osvv-field-height);
    margin: 0;
    padding: 9px 12px;
    border: 1px solid #becdbd;
    border-radius: var(--osvv-field-radius);
    background: var(--osvv-filter-fill);
    color: var(--osvv-filter-ink);
    font: inherit;
    font-weight: 400;
    line-height: 1.45;
}

.osvv-map-filter .osvv-field > input::placeholder {
    color: #617165;
}

.osvv-map-filter .osvv-date-note {
    grid-column: 1 / -1;
    margin: 0;
    color: #546558;
    font-size: 12px;
    line-height: 1.5;
}

.osvv-map-filter .osvv-date-note p {
    margin: 7px 0 0;
}

.osvv-map-filter summary {
    cursor: pointer;
}

.osvv-map-category-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin: -5px 0 5px;
}

.osvv-map-filter .osvv-map-category-actions button {
    min-height: 38px;
    margin: 0;
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--osvv-filter-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.osvv-map-filter .osvv-map-category-actions button:hover {
    background: var(--osvv-filter-fill);
}

.osvv-map-category-group {
    min-width: 0;
}

.osvv-map-category-group:last-child {
    grid-column: 1 / -1;
}

.osvv-map-filter :is(.osvv-map-category-group, .osvv-map-quarantine-fields) h3 {
    margin: 0 0 7px;
    color: #3e5443;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
}

.osvv-map-category-options {
    display: grid;
    gap: 6px;
}

.osvv-map-category {
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr) 8px;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid var(--osvv-filter-line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    line-height: 1.35;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.osvv-map-category:has(input:checked),
.osvv-map-category:hover {
    background: var(--osvv-filter-fill);
}

.osvv-map-category input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--osvv-filter-accent);
    cursor: pointer;
}

.osvv-map-category .osvv-dot {
    width: 8px;
    height: 8px;
    margin: 0;
    border-radius: 50%;
    background: var(--osvv-color, #737373);
}

.osvv-map-filter .osvv-map-disease-help {
    margin: 10px 0 0;
    color: #546558;
    font-size: 12px;
    line-height: 1.5;
}

.osvv-map-filter:has([data-filter-only-quarantine]:not([hidden])) .osvv-map-disease-help {
    display: none;
}

.osvv-map-quarantine-fields {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--osvv-filter-line);
    border-radius: 10px;
    background: var(--osvv-filter-fill);
}

.osvv-map-filter .osvv-map-layers .osvv-statistics-toggle {
    margin: 0 0 14px;
    padding: 10px;
    border-radius: 8px;
    background: var(--osvv-filter-fill);
}

.osvv-map-filter .osvv-map-layers .osvv-region-controls {
    min-width: 0;
    margin: 8px 0 0;
    padding: 10px 12px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr));
}

.osvv-map-filter .osvv-map-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    cursor: pointer;
}

.osvv-map-select-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.osvv-map-select-trigger::after {
    flex: 0 0 7px;
    height: 7px;
    margin: -4px 2px 0 0;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    content: "";
}

.osvv-map-filter .osvv-map-select-trigger:hover,
.osvv-map-filter .osvv-map-select-trigger[aria-expanded="true"] {
    border-color: #5b795e;
    background: #f9fcf8;
}

.osvv-map-select-trigger[aria-expanded="true"]::after {
    margin-top: 4px;
    transform: rotate(225deg);
}

.osvv-map-filter .osvv-map-select-popup {
    position: fixed;
    inset: auto;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0;
    padding: 6px;
    border: 1px solid #c9d6c7;
    border-radius: 12px;
    background: #fff;
    color: #203025;
    box-shadow: 0 12px 32px #172a1b26, 0 2px 6px #172a1b12;
}

.osvv-map-select-popup:popover-open {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.osvv-map-select-choices {
    position: relative;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
}

.osvv-map-filter .osvv-map-select-search {
    flex: 0 0 auto;
    border-color: #c9d6c7;
    border-radius: 7px;
    background: #f5f8f4;
}

.osvv-map-filter .osvv-map-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #203025;
    font: inherit;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}

.osvv-map-filter .osvv-map-select-option:hover {
    background: #f1f5ef;
}

.osvv-map-filter .osvv-map-select-option[aria-pressed="true"] {
    background: #e5efe2;
    color: #234a2c;
    font-weight: 600;
}

.osvv-map-select-option[aria-pressed="true"]::after {
    flex: 0 0 6px;
    height: 11px;
    margin: -3px 4px 0 0;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    content: "";
}

.osvv-map-filter :is(button, input, select, summary):focus-visible {
    outline: 2px solid #386642;
    outline-offset: -2px;
}

.osvv-map-filter .osvv-map-select-empty {
    margin: 0;
    padding: 8px 10px;
    color: #526650;
}

.osvv-map-preview-media {
    width: 100%;
    height: clamp(190px, 25vw, 224px);
    background: #e9f0e6;
}

.osvv-map-preview .osvv-map-preview-media :is(.osvv-map-preview-canvas, iframe) {
    width: 100%;
    height: 100%;
}

.osvv-map-preview-canvas[hidden] {
    display: none;
}

.osvv-map-preview .osvv-map-preview-summary {
    display: grid;
    justify-items: start;
    gap: 3px;
    margin: 0;
    padding: 11px 16px;
    font-size: 13px;
    line-height: 1.45;
}

.osvv-map-preview-summary strong {
    color: #294c32;
}

.osvv-map-outcome-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 4px 16px;
    color: #435647;
    font-size: 13px;
    line-height: 1.45;
}

.osvv-map-app > .osvv-map-outcome-legend {
    margin-top: 10px;
}

.osvv-map-outcome-key {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.osvv-map-outcome-dot {
    flex: 0 0 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--osvv-color);
}

.osvv-map-preview-dot {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px #15281b55;
    transform: translate(-50%, -50%);
    width: 11px;
    height: 11px;
}

@media (max-width: 600px) {
    .osvv-map-stage .osvv-map-filter {
        --osvv-toolbar-inset: 8px;
        --osvv-toolbar-gap: 5px;
    }

    .osvv-map-filter :is(.osvv-map-menu > summary, .osvv-map-form-actions button) {
        min-height: 44px;
        padding-inline: 10px;
        font-size: 13px;
    }

    .osvv-map-filter .osvv-map-form-actions .osvv-map-reset {
        width: 44px;
        padding: 0;
        font-size: 23px;
    }

    .osvv-map-fields,
    .osvv-map-category-grid,
    .osvv-map-category-group:last-child .osvv-map-category-options {
        grid-template-columns: minmax(0, 1fr);
    }

}
