.uopm {
    --uopm-navy: #001f51;
    --uopm-navy-soft: #e8edf6;
    --uopm-bg: #f5f7fb;
    --uopm-line: #e2e7f0;
    --uopm-text: #151720;
    --uopm-muted: #6b7385;
    --uopm-radius: 16px;

    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    height: clamp(560px, var(--uopm-height, 680px), 820px);
    width: calc(100% - 32px);
    max-width: 1400px;
    margin: 40px auto 56px;
    background: #fff;
    border: 1px solid var(--uopm-line);
    border-radius: var(--uopm-radius);
    box-shadow: 0 12px 40px rgba(0, 31, 81, .08);
    overflow: hidden;
    color: var(--uopm-text);
    font-size: 15px;
    line-height: 1.45;
}

.uopm *,
.uopm *::before,
.uopm *::after {
    box-sizing: border-box;
}

:where(.uopm) button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

:where(.uopm) ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ---------- Панель ---------- */

.uopm-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--uopm-line);
}

.uopm-panel-head {
    padding: 16px;
    border-bottom: 1px solid var(--uopm-line);
}

.uopm-search {
    position: relative;
    display: block;
    margin: 0;
}

.uopm-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--uopm-muted);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.uopm-search input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    border: 1px solid var(--uopm-line);
    border-radius: 12px;
    background: var(--uopm-bg);
    font: inherit;
    color: var(--uopm-text);
    outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.uopm-search input:focus {
    background: #fff;
    border-color: var(--uopm-navy);
    box-shadow: 0 0 0 3px rgba(0, 31, 81, .12);
}

.uopm-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c5cddb transparent;
}

.uopm-summary {
    margin: 0;
    padding: 12px 16px 4px;
    font-size: 13px;
    color: var(--uopm-muted);
}

/* ---------- Список городов ---------- */

.uopm-letter {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 16px 4px;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    color: var(--uopm-muted);
    letter-spacing: .04em;
}

.uopm-city {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    transition: background .15s;
}

.uopm-city:hover,
.uopm-city:focus-visible {
    background: var(--uopm-bg);
    outline: none;
}

.uopm-city-name {
    flex: 1;
    font-weight: 500;
}

.uopm-count {
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--uopm-navy-soft);
    color: var(--uopm-navy);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* ---------- Иконки ---------- */

.uopm-ico {
    display: inline-flex;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.uopm-ico svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.uopm-ico--chevron {
    width: 16px;
    height: 16px;
    color: #a3abbb;
}

/* ---------- Город ---------- */

.uopm-city-head {
    padding: 14px 16px 6px;
}

.uopm-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--uopm-navy);
    transition: background .15s;
}

.uopm-back:hover {
    background: var(--uopm-navy-soft);
}

.uopm-city-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--uopm-navy);
}

.uopm-city-meta {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--uopm-muted);
}

/* ---------- Карточки ---------- */

.uopm-cards {
    padding: 8px 16px 16px;
}

.uopm-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 14px 0 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--uopm-muted);
}

.uopm-group:hover {
    color: var(--uopm-navy);
}

.uopm-card {
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid var(--uopm-line);
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.uopm-card:hover {
    border-color: #c9d2e3;
    box-shadow: 0 4px 16px rgba(0, 31, 81, .06);
}

.uopm-card-title {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--uopm-navy);
}

.uopm-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 4px 0;
    font-size: 14px;
}

.uopm-row .uopm-ico {
    margin-top: 1px;
    color: var(--uopm-navy);
    opacity: .55;
}

.uopm-row a {
    color: var(--uopm-navy);
    font-weight: 600;
    text-decoration: none;
    word-break: break-word;
}

.uopm-row a:hover {
    text-decoration: underline;
}

.uopm-addr {
    flex: 1;
    min-width: 0;
}

.uopm-addr > span {
    margin-right: 8px;
}

.uopm-row .uopm-route {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    color: #2a6fdb;
}

.uopm-empty {
    margin: 0;
    padding: 32px 16px;
    text-align: center;
    color: var(--uopm-muted);
}

/* ---------- Карта ---------- */

.uopm-map {
    position: relative;
    min-width: 0;
    background: var(--uopm-bg);
}

.uopm-map-canvas {
    position: absolute;
    inset: 0;
}

/* ---------- Мобильные: карта сверху, список под ней без вложенной прокрутки ---------- */

@media (max-width: 900px) {
    .uopm {
        grid-template-columns: 1fr;
        height: auto;
        margin: 24px auto 40px;
    }

    .uopm-map {
        order: -1;
        height: clamp(300px, 55vh, 460px);
        border-bottom: 1px solid var(--uopm-line);
    }

    .uopm-panel {
        border-right: 0;
        scroll-margin-top: 16px;
    }

    .uopm-panel-body {
        overflow: visible;
    }

    .uopm-letter {
        position: static;
    }
}
