/* =====================================================================
 * БЛОК «СПИСОК + КАРТА» - КАРТА (п.1101, п.1103, п.1105), вид. Поведение - map-list.js рядом.
 * Метки - маленький блок map-pin.css (подключается до этого файла); здесь - кнопки, панель областей, обводка и замер.
 * Значения - как у карты /search-split/ сайта (map-markers-kit.css, search-split/index.php .ymss-*);
 * правка вида карты - здесь, своих копий в местах вызова не держать.
 * ===================================================================== */
.ymb-ml { position: absolute; inset: 0; overflow: hidden; isolation: isolate; font-family: inherit; }
.ymb-ml__map { position: absolute; inset: 0; }

/* ---------- инструменты справа сверху ---------- */
.ymb-ml__tools { position: absolute; z-index: 5; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 2px; padding: 4px; border-radius: 14px; background: #fff; box-shadow: 0 4px 16px rgba(7,24,63,.16); }
.ymb-ml__tools button { position: relative; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #07183f; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ymb-ml__tools button:hover { background: #f3f5f9; }
.ymb-ml__tools button[aria-pressed="true"] { background: #07183f; color: #fff; }
.ymb-ml__tools svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ymb-ml__sep { height: 1px; margin: 3px 6px; background: #e3e8ef; }
.ymb-ml__tools button[data-tip]::after { content: attr(data-tip); position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); padding: 5px 9px; border-radius: 8px; background: #07183f; color: #fff; font-weight: 500; font-size: 12px; line-height: 1.2; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
.ymb-ml__tools button[data-tip]:hover::after { opacity: 1; }
.ymb-ml__rwrap { position: relative; }
.ymb-ml__rmenu { position: absolute; top: -4px; right: calc(100% + 8px); display: none; flex-direction: column; gap: 2px; width: 236px; padding: 6px; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(7,24,63,.2); }
.ymb-ml__rmenu::after { content: ""; position: absolute; top: 0; bottom: 0; right: -10px; width: 10px; }
.ymb-ml__rwrap:hover .ymb-ml__rmenu, .ymb-ml__rwrap:focus-within .ymb-ml__rmenu, .ymb-ml__rwrap.is-open .ymb-ml__rmenu { display: flex; }
.ymb-ml__tools .ymb-ml__rmenu button { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; height: auto; padding: 8px 10px; text-align: left; font-weight: 500; font-size: 12px; line-height: 1.3; color: #6b7893; }
.ymb-ml__tools .ymb-ml__rmenu button b { display: block; font-size: 13.5px; font-weight: 600; color: #07183f; }
.ymb-ml__tools .ymb-ml__rmenu button small { font-size: 12px; }
.ymb-ml__tools .ymb-ml__rmenu button[aria-pressed="true"] { background: #07183f; color: #c9d3e6; }
.ymb-ml__tools .ymb-ml__rmenu button[aria-pressed="true"] b { color: #fff; }
/* сенсорный экран: подсказок по наведению нет, меню линейки - по нажатию */
@media (hover: none) {
    .ymb-ml__tools button[data-tip]::after { content: none; }
    .ymb-ml__tools button:hover { background: transparent; }
    .ymb-ml__tools button[aria-pressed="true"]:hover { background: #07183f; }
    .ymb-ml__rwrap:hover .ymb-ml__rmenu, .ymb-ml__rwrap:focus-within .ymb-ml__rmenu { display: none; }
    .ymb-ml__rwrap.is-open .ymb-ml__rmenu { display: flex; }
}

/* ---------- панель областей слева сверху ---------- */
.ymb-ml__area { position: absolute; z-index: 5; top: 16px; left: 16px; display: block; max-width: min(420px, calc(100% - 100px)); padding: 6px 6px 6px 12px; border-radius: 12px 12px 12px 0; background: #fff; box-shadow: 0 4px 16px rgba(7,24,63,.16); color: #07183f; font-weight: 600; font-size: 13px; line-height: 1.2; }
.ymb-ml__area[hidden], .ymb-ml__hint[hidden], .ymb-ml__draw[hidden], .ymb-ml__meas[hidden], .ymb-ml__alabel[hidden] { display: none !important; }
.ymb-ml__area i { width: 12px; height: 12px; flex: none; box-sizing: border-box; border: 2px solid #e7182c; border-radius: 3px; background: rgba(231,24,44,.12); }
.ymb-ml__area button { height: 30px; padding: 0 10px; border: 1px solid #dce2ea; border-radius: 9px; background: #fff; color: #07183f; font-weight: 600; font-size: 12px; line-height: 1; cursor: pointer; }
.ymb-ml__area button:hover { border-color: #e7182c; color: #e7182c; }
.ymb-ml__area .ymb-ml__area-x { width: 30px; padding: 0; font-size: 18px; }
.ymb-ml__area-head { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; align-items: center; column-gap: 8px; min-height: 32px; }
.ymb-ml__area-head span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ymb-ml__area.is-many .ymb-ml__area-head { grid-template-columns: 12px minmax(0, 1fr) auto; }
.ymb-ml__area-list { margin: 6px 0 0 -12px; padding: 6px 0 0 12px; border-top: 1px solid #edf0f5; list-style: none; max-height: 122px; overflow-y: auto; overscroll-behavior: contain; }
.ymb-ml__area-list::-webkit-scrollbar { width: 6px; } .ymb-ml__area-list::-webkit-scrollbar-thumb { border-radius: 3px; background: #c3ccda; }
.ymb-ml__area-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 30px; align-items: center; column-gap: 6px; min-height: 36px; margin: 0; padding: 0; }
.ymb-ml__area-row + .ymb-ml__area-row { margin-top: 2px; }
.ymb-ml__area .ymb-ml__area-name { display: grid; grid-template-columns: 12px auto minmax(0, 1fr); align-items: center; column-gap: 8px; height: 32px; min-width: 0; margin-left: -6px; padding: 0 8px 0 6px; border-color: transparent; background: transparent; text-align: left; font-weight: 600; white-space: nowrap; }
.ymb-ml__area .ymb-ml__area-name small { overflow: hidden; text-overflow: ellipsis; font-weight: 500; font-size: 12px; color: #6b7893; }
.ymb-ml__area .ymb-ml__area-name small em { display: inline-block; margin: 0 5px 0 0; font-style: normal; font-weight: 700; }
.ymb-ml__area .ymb-ml__area-name:hover { border-color: #dce2ea; color: #07183f; background: #f6f8fb; }
.ymb-ml__area-row.is-sel .ymb-ml__area-name { border-color: #e7182c; background: #fff1f2; color: #e7182c; }
.ymb-ml__area-row.is-sel .ymb-ml__area-name small { color: #e7182c; }
.ymb-ml__area-row.is-sel .ymb-ml__area-name i { background: #e7182c; }
.ymb-ml__area .ymb-ml__area-add { position: absolute; left: 0; top: 100%; width: 38px; height: 26px; padding: 0 0 2px; border: 0; border-radius: 0 0 10px 10px; background: #fff; color: #9aa6b8; font-size: 20px; font-weight: 500; line-height: 1; box-shadow: 0 8px 14px rgba(7,24,63,.14); clip-path: inset(0 -20px -20px -20px); }
.ymb-ml__area .ymb-ml__area-add:hover, .ymb-ml__area .ymb-ml__area-add[aria-pressed="true"] { color: #fff; background: #e7182c; }

/* ---------- обвести ---------- */
.ymb-ml__draw { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.ymb-ml__draw:not([hidden]) { background: rgba(7,24,63,.10); box-shadow: inset 0 0 0 3px rgba(231,24,44,.75); border-radius: inherit; animation: ymbMlDrawIn .18s ease-out; }
@keyframes ymbMlDrawIn { from { background: rgba(7,24,63,0); box-shadow: inset 0 0 0 0 rgba(231,24,44,0); } }
.ymb-ml__draw polyline { fill: rgba(231,24,44,.08); stroke: #e7182c; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ymb-ml__hint { position: absolute; z-index: 6; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 9px 16px; border-radius: 12px; background: #07183f; color: #fff; font-weight: 500; font-size: 13px; line-height: 1.3; box-shadow: 0 6px 18px rgba(7,24,63,.24); white-space: nowrap; }
.ymb-ml__hint.is-draw { top: 50%; bottom: auto; transform: translate(-50%, -50%); padding: 14px 20px; font-size: 15px; font-weight: 600; pointer-events: none; text-align: center; white-space: normal; max-width: min(320px, calc(100% - 40px)); }

/* ---------- замер площади ---------- */
.ymb-ml__meas { position: absolute; z-index: 6; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 40px); padding: 8px 8px 8px 16px; border-radius: 12px; background: #07183f; color: #fff; font-weight: 500; font-size: 13px; line-height: 1.35; box-shadow: 0 6px 18px rgba(7,24,63,.24); box-sizing: border-box; }
.ymb-ml__meas b { font-weight: 700; }
.ymb-ml__meas button { flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.ymb-ml__meas button:hover { background: #e7182c; }
.ymb-ml__alabel { position: absolute; z-index: 6; left: 0; top: 0; padding: 7px 14px 7px 12px; border-radius: 10px; background: #fff; color: #07183f; font-weight: 700; font-size: 13px; line-height: 1.25; white-space: nowrap; box-shadow: 0 3px 12px rgba(7,24,63,.22); border: 1px solid #e7182c; text-align: left; }
.ymb-ml__alabel small { display: block; font-weight: 500; font-size: 11.5px; color: #6b7893; }
.ymb-ml__alabel-x { position: absolute; top: -9px; right: -9px; width: 20px; height: 20px; padding: 0; border: 1px solid #dfe5ef; border-radius: 50%; background: #fff; color: #07183f; font-weight: 400; font-size: 14px; line-height: 18px; text-align: center; cursor: pointer; box-shadow: 0 1px 4px rgba(7,24,63,.18); }
.ymb-ml__alabel-x:hover { border-color: #e7182c; background: #e7182c; color: #fff; }

@media (max-width: 767px) {
    .ymb-ml__tools { top: 10px; right: 10px; }
    .ymb-ml__area { top: 10px; left: 10px; max-width: calc(100% - 80px); }
    .ymb-ml__hint, .ymb-ml__meas { bottom: 12px; }
}
