/* Стили конструктора маршрутов (routes/create). */

/* Боковые панели чуть шире дефолтного w-80 (20rem) — чтобы вкладки с иконками помещались.
   id-селектор перебивает Tailwind .w-80; на мобиле правая панель остаётся width:100% !important. */
#filters, #route-panel { width: 22rem; }

/* Скролл-контейнеры поверх карты: явно объявляем, что вертикальный жест — это прокрутка списка,
   иначе браузер отдаёт его OL-карте (её viewport помечен touch-action:none) и карта «едет».
   overscroll-behavior:contain — не пробрасывать прокрутку на карту/страницу на границах. */
#found-list, #pinned-list, #sec-filters, #point-card-mobile {
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Фото в карточке точки (попап на карте): показываем целиком — натуральная высота по ширине,
   без обрезки. Ограничиваем max-height, чтобы очень вытянутые фото не занимали весь экран
   (карточка скроллится). */
.pt-card-photo { display: block; width: 100%; height: auto; max-height: 55vh; object-fit: contain; }

/* ── Навигация по категориям над картой (два ряда + горизонтальный слайдер) ───────
   Ряд родителей прижат к низу карты; ряд детей раскрывается НАД ним (меню вверх).
   Центрируется на всю ширину; боковые поля оставляют место угловым контролам. */
:root { --cats-anchor: 1rem; } /* нижний якорь навигации категорий (мобиль переопределяет) */
.map-cats {
    position: absolute; left: 0; right: 0; bottom: var(--cats-anchor); z-index: 30; /* выше панелей (z-20) */
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    padding: 0 3.5rem; /* поля: справа зум/гео, слева кнопка Я.Карт */
}
/* Горизонтальный слайдер: прокрутка по X, скрытый скроллбар, лёгкий snap. */
/* Слайдер = [стрелка][прокручиваемый ряд][стрелка]. Центрируется в колонке .map-cats. */
.map-cats-slider {
    position: relative; display: flex; align-items: center; gap: .35rem;
    max-width: 100%; min-width: 0;
}
.map-cats-row {
    display: flex; align-items: center; gap: .5rem;
    flex: 1 1 auto; min-width: 0;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: .2rem;
}
.map-cats-row::-webkit-scrollbar { display: none; }
.map-cats-row > * { flex: 0 0 auto; }
.cat-children-group { display: flex; align-items: center; gap: .5rem; }
/* display:flex выше перебивает браузерный [hidden]{display:none} — возвращаем скрытие явно. */
.map-cats-slider[hidden], .cat-children-group[hidden] { display: none !important; }

/* Стрелки прокрутки (десктоп). Скрыты целиком, когда всё влезает (.no-overflow);
   у края — приглушены и некликабельны (.is-disabled). На мобиле — нативный тач-скролл. */
.cats-arrow {
    flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: 9999px;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    background: #fff; color: #374151; border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22); font-size: .78rem;
}
.cats-arrow:hover { background: #f9fafb; }
.cats-arrow.is-disabled { opacity: .35; pointer-events: none; }
.map-cats-slider.no-overflow .cats-arrow { display: none; }

/* Пилюля категории — общий вид (родитель / ребёнок / сервис). */
.cat-pill {
    display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; cursor: pointer;
    background: #fff; color: #1f2937; font-size: .85rem; font-weight: 600;
    padding: .5rem 1rem; border-radius: 9999px; border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}
.cat-pill:active { background: #f9fafb; }
.cat-pill--child { font-weight: 500; font-size: .8rem; padding: .4rem .85rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .16); }
/* Идёт загрузка точек подкатегории — блокируем клики и показываем спиннер. */
.cat-pill.is-loading { pointer-events: none; }
.cat-pill.is-loading::after {
    content: ""; width: .8rem; height: .8rem; margin-left: .1rem; border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, .15); border-top-color: #16a34a;
    animation: fa-spin .7s linear infinite;
}
.cat-pill.active.is-loading::after { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
/* Активна (слой показан) — заливаем цветом категории (--pill-color, из blade);
   сервисы (Зарядки/Еда) без цвета → зелёный фолбэк. */
.cat-pill.active { background: var(--pill-color, #16a34a); color: #fff; border-color: var(--pill-color, #16a34a); }
.cat-pill.active i { color: #fff !important; }
/* Есть выбранные подкатегории (частично) — светлая заливка цветом категории, без обводки. */
.cat-pill.partial { background: color-mix(in srgb, var(--pill-color, #16a34a) 16%, #fff); }
/* Открытый родитель (раскрыт ряд детей) — единственный с обводкой; стрелка вверх → вниз. */
.cat-pill-caret { color: #9ca3af; transition: transform .15s ease; font-size: 10px; }
.cat-pill[aria-expanded="true"] { border-color: var(--pill-color, #16a34a); }
.cat-pill[aria-expanded="true"] .cat-pill-caret { transform: rotate(180deg); }
.cat-pill.active .cat-pill-caret { color: rgba(255, 255, 255, .85); }
/* Бейдж числа активных детей. */
.cat-pill-badge {
    min-width: 1.1rem; height: 1.1rem; padding: 0 .3rem; border-radius: 9999px; line-height: 1;
    background: var(--pill-color, #16a34a); color: #fff; font-size: .68rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.cat-pill.active .cat-pill-badge { background: rgba(255, 255, 255, .25); }

/* «Открыть в Я.Картах» — кнопка внизу секции «Маршрут» (не плавающая). Белая, во всю ширину
   секции, с официальной иконкой Яндекс.Карт (красная булавка). Показ по .show из JS. */
.open-navi {
    display: none; align-items: center; justify-content: center; gap: .4rem; flex-shrink: 0;
    text-decoration: none; text-align: center;
    margin: .5rem .75rem; padding: .55rem .75rem;
    background: #fff; color: #1f2937; font-size: .85rem; font-weight: 600;
    border-radius: .5rem; border: 1px solid #d1d5db;
}
.open-navi:hover { background: #f9fafb; }
.open-navi.show { display: flex; }
.navi-ico { flex-shrink: 0; }
/* 2ГИС / Google / GPX — ряд под «Открыть в Я.Картах» (показ по .show из JS: updateNaviAlt). */
.open-navi-alt { display: none; flex-wrap: wrap; gap: .4rem; margin: -.15rem .75rem .5rem; flex-shrink: 0; }
.open-navi-alt.show { display: flex; }
.open-navi-alt a, .open-navi-alt button {
    flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
    padding: .4rem .5rem; border-radius: .5rem; border: 1px solid #d1d5db; background: #fff;
    color: #1f2937; font-size: .8rem; font-weight: 500; text-decoration: none; cursor: pointer;
}
.open-navi-alt a:hover, .open-navi-alt button:hover { background: #f9fafb; }
.open-navi-note { flex-basis: 100%; margin: 0; font-size: .72rem; line-height: 1.3; color: #6b7280; }
.open-navi-note[hidden] { display: none; }
/* Пока открыта карточка точки/зарядки — прячем плавающую навигацию категорий, чтобы не перекрывала. */
.map-cats.popup-open { display: none !important; }

/* Десктоп: поджимаем навигацию категорий к области между боковыми панелями
   (#filters слева / #route-panel справа, по 20rem). Инсеты --cats-left/right ставит JS
   при открытии/сворачивании панелей. На мобиле панели — нижняя шторка, этот блок не действует. */
@media (min-width: 640px) {
    .map-cats { left: var(--cats-left, 0px); right: var(--cats-right, 0px); }
}

/* Правый столбец контролов (геолокация + зум) — над всей навигацией категорий,
   чтобы 2-й ряд (дети) не перекрывал геолокацию. Формула одна на десктоп и мобиль
   (мобильный якорь --cats-anchor переопределяется в media ниже). */
.map-controls-col { right: 1rem; bottom: calc(var(--cats-anchor) + var(--cats-fixed, 6rem) + 0.3rem); }
.map-controls-col .fa-spin { animation: fa-spin 1s linear infinite; }
/* Десктоп: сдвигаем контролы левее открытой правой панели (--cats-right = 22rem при открытой,
   2.5rem при свёрнутой) — иначе висят поверх правого меню. */
@media (min-width: 640px) {
    .map-controls-col { right: calc(var(--cats-right, 2.5rem) + 0.5rem); }
}

/* Кнопка «Повторить поиск» — оранжевая (класс bg-orange-* отсутствует в tailwind-сабсете). */
#research-btn { background: #f97316; color: #fff; border: 1px solid #f97316; }
#research-btn:hover { background: #ea580c; border-color: #ea580c; }

/* Мини-тост карты (ошибки геолокации и т.п.). */
.map-toast {
    position: absolute; left: 50%; top: 1rem; transform: translateX(-50%);
    max-width: 90%; z-index: 50; pointer-events: none;
    background: rgba(17, 24, 39, .92); color: #fff; font-size: .82rem; line-height: 1.3;
    padding: .5rem .8rem; border-radius: .5rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    opacity: 0; transition: opacity .25s ease; text-align: center;
}
.map-toast.show { opacity: 1; }

/* Мобильная раскладка: правая панель → выезжающая снизу шторка со вкладками. */
.sheet-tabs, .mobile-only, .sheet-handle, .desktop-only { display: none; }
#sec-filters { display: none; } /* на десктопе форма живёт в левой панели */
/* Порядок вкладок (десктоп и мобиль): … Найдено, Маршрут (Найдено левее Маршрута).
   Корзину «Очистить маршрут» уводим вправо от вкладок (order:3); стрелку сворачивания не трогаем. */
.sheet-tabs [data-sheet-tab="found"] { order: 1; }
.sheet-tabs [data-sheet-tab="route"] { order: 2; }
.sheet-tabs #clear-pinned-d { order: 3; }

/* ── Десктоп: правая панель — вкладками «Найдено»/«Маршрут» вместо разделения пополам ──
   Ряд вкладок оформлен зелёной шапкой (как «Параметры» у левой панели), кнопки — внутри. */
@media (min-width: 640px) {
    .sheet-tabs {
        display: flex; align-items: center; gap: .5rem;
        background: #f0fdf4; border-bottom: 1px solid #dcfce7; padding: .6rem .7rem; /* green-50 / green-100 */
    }
    .sheet-tabs [data-sheet-tab="filter"] { display: none; }    /* фильтр — левая панель, не вкладка */
    .desktop-only { display: inline-flex; }
    /* Заголовки секций больше не нужны — их роль выполняет зелёная шапка с вкладками. */
    .pinned-head, .found-head { display: none; }
    /* Секции — на всю высоту; показываем только активную по data-tab (как на мобиле). */
    #sec-pinned { max-height: none; border-bottom: 0; flex: 1 1 auto; }
    #route-panel[data-tab="found"] #sec-pinned,
    #route-panel[data-tab="route"] #sec-found { display: none; }

    /* Левая панель: вкладки AI-помощник / Города — показываем активную панель.
       (На мобиле форма живёт в шторке, панель AI скрыта nlu-mobile-hide — этот блок не действует.) */
    #filters[data-filter-tab="cities"] #filter-ai { display: none; }
    #filters[data-filter-tab="ai"] #filter-cities { display: none; }
}

/* Вкладки левой панели не переносятся (иконок в них нет — текст помещается свободно). */
.filter-tab { white-space: nowrap; }

/* Вкладка «AI-помощник» — фирменный градиент (как у AI-кнопки в мобильном меню).
   Селектор с [data-filter-tab] специфичнее Tailwind-классов, что переключает JS → перебивает их. */
.filter-tab[data-filter-tab="ai"] { background: linear-gradient(135deg, #16a34a, #7c3aed); color: #fff; border-color: transparent; }
.filter-tab[data-filter-tab="ai"] i { color: #fff; }
/* Неактивна — чуть приглушаем; активна — тонкое фиолетовое кольцо. */
#filters:not([data-filter-tab="ai"]) .filter-tab[data-filter-tab="ai"] { opacity: .82; }
#filters[data-filter-tab="ai"] .filter-tab[data-filter-tab="ai"] { box-shadow: 0 0 0 2px rgba(124, 58, 237, .4); }

/* Заготовки фраз (под AI-блоком, на белом фоне) — светлые чипы, клик подставляет текст.
   Иконки идут инлайн перед своим словом, поэтому display:inline (не flex). */
.nlu-preset {
    display: inline-block;
    font-size: .75rem; line-height: 1.35; text-align: left; cursor: pointer;
    background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb;
    border-radius: 9999px; padding: .3rem .7rem;
}
.nlu-preset:hover { background: #ecfdf5; border-color: #86efac; }
.nlu-preset i { font-size: .72rem; margin-right: .12rem; } /* цвет иконок — из категорий (inline в blade) */

/* ── Приоткрытые панели (десктоп): свёрнутая панель не уезжает целиком, а оставляет
   узкую полосу-ручку у края. Клик по полосе — развернуть. Заменяет угловые кнопки. --- */
.panel-peek { display: none; }
@media (min-width: 640px) {
    :root { --peek-w: 2.5rem; }
    #filters.is-peek  { transform: translateX(calc(-100% + var(--peek-w))) !important; }
    #route-panel.is-peek { transform: translateX(calc(100% - var(--peek-w))) !important; }
    #filters.is-peek .panel-peek,
    #route-panel.is-peek .panel-peek { display: flex; }
    .panel-peek {
        position: absolute; top: 0; bottom: 0; width: var(--peek-w); z-index: 30;
        flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
        cursor: pointer; border: 0; background: #f0fdf4; color: #16a34a; font-size: 1rem;
    }
    .panel-peek:hover { background: #dcfce7; }
    /* Подсказка «что за меню» — вертикальная подпись вдоль полосы. */
    .panel-peek-label {
        writing-mode: vertical-rl; transform: rotate(180deg);
        font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; color: #15803d;
    }
    #filters .panel-peek { right: 0; border-left: 1px solid #dcfce7; box-shadow: 2px 0 8px rgba(0, 0, 0, .06); }
    #route-panel .panel-peek { left: 0; border-right: 1px solid #dcfce7; box-shadow: -2px 0 8px rgba(0, 0, 0, .06); }
}

@media (max-width: 639px) {
    /* Фильтр теперь вкладка шторки — левая панель на мобиле скрыта. */
    #filters { display: none !important; }
    #sec-filters { display: flex; }
    /* Показываем только активную вкладку. */
    #route-panel[data-tab="filter"] #sec-pinned,
    #route-panel[data-tab="filter"] #sec-found,
    #route-panel[data-tab="filter"] .sheet-footer { display: none !important; }
    #route-panel[data-tab="found"] #sec-pinned,
    #route-panel[data-tab="found"] #sec-filters { display: none !important; }
    #route-panel[data-tab="route"] #sec-found,
    #route-panel[data-tab="route"] #sec-filters { display: none !important; }
    /* AI-помощник вынесен в нижнее меню — в фильтре на мобиле скрыт. */
    .nlu-mobile-hide { display: none !important; }
    /* AI-блок и разделитель скрыты → убираем лишний воздух над первым видимым полем
       («Города маршрута»): меньше верхнего паддинга + снимаем space-y-отступ. */
    #sec-filters .space-y-4 { padding-top: .35rem; }
    #sec-filters .space-y-4 > .nlu-mobile-hide + * { margin-top: 0 !important; }
    /* Мобиль: якорь навигации над шторкой; сама навигация fixed по центру ширины. */
    :root { --cats-anchor: calc(3.5rem + env(safe-area-inset-bottom) + var(--peek, 4.25rem) + 0.6rem); }
    .map-cats {
        position: fixed; left: 0; right: 0; z-index: 45; padding: 0 .5rem;
        bottom: var(--cats-anchor);
    }
    /* На мобиле стрелки не нужны — прокрутка пальцем. */
    .cats-arrow { display: none !important; }
    /* Контролы (гео/зум) — как и .map-cats, fixed от вьюпорта (иначе absolute считается от дна
       #map-block, которое выше вьюпорта на высоту нижнего меню → гео уезжает вверх). */
    .map-controls-col { position: fixed; right: 1rem; }
    /* Раскрытая шторка занимает экран — прячем плавающую навигацию категорий и контролы,
       чтобы не висели поверх шторки. #route-panel идёт до них → общий сосед. */
    #route-panel.sheet-open ~ .map-cats,
    #route-panel.sheet-open ~ .map-controls-col { display: none; }
    /* Карта — между шапкой (3.5rem) и нижним меню (3.5rem + safe-area). */
    #map-block { height: calc(100dvh - 7rem - env(safe-area-inset-bottom)) !important; min-height: 0 !important; }
    /* Шторка над нижним меню; меняем ВЫСОТУ (не сдвиг) — низ с кнопкой всегда виден.
       Два состояния: пик (var(--peek)) ↔ весь экран (.sheet-open). Тап по ручке переключает. */
    #route-panel {
        position: fixed !important;
        /* Вплотную к меню (без зазора с картой). Приподнятая AI-кнопка (FAB) может слегка наезжать
           на низ шторки — это допустимо. */
        left: 0; right: 0; bottom: calc(3.5rem + env(safe-area-inset-bottom)); top: auto !important;
        width: 100% !important;
        height: var(--peek, 4.25rem) !important; max-height: calc(100dvh - 3.5rem - env(safe-area-inset-bottom));
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, .15);
        transform: none !important;
        overflow: hidden;
        transition: height .3s ease;
        z-index: 35; /* выше кнопок карты (z-30), ниже карточки точки (z-40) и нижнего меню (z-60) */
    }
    /* Раскрытая шторка — до самого верха экрана (перекрывает шапку), над нижним меню.
       В полноэкранном виде убираем скругление верхних углов, чтобы не было щелей у краёв. */
    #route-panel.sheet-open { height: calc(100dvh - 3.5rem - env(safe-area-inset-bottom)) !important; border-radius: 0; }

    /* Ручка: grabber + шеврон (вверх — развернуть, вниз — свернуть). Крупнее для удобного тапа. */
    .sheet-handle { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 1.05rem 0 !important; }
    .sheet-grip { width: 3.5rem; height: 6px; border-radius: 9999px; background: #cbd5e1; }
    .sheet-chevron { font-size: 13px; color: #9ca3af; transition: transform .3s ease; }
    #route-panel.sheet-open .sheet-chevron { transform: rotate(180deg); }
    .sheet-tabs { display: flex !important; }
    .mobile-only { display: inline-flex !important; }
    .pinned-head, .found-head { display: none !important; }
}

/* ── Электрозарядки (belcharge): попап ── */
/* (активная пилюля Зарядки красится из --pill-color, см. .cat-pill.active) */
.charger-popup:empty { display: none; }
.charger-popup {
    width: 16rem; max-width: 82vw; background: #fff; border-radius: .6rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18); border: 1px solid rgba(0, 0, 0, .06);
    padding: .7rem .8rem; font-size: .85rem; color: #1f2937; position: relative;
}
.charger-popup .cp-close {
    position: absolute; top: .3rem; right: .5rem; border: 0; background: none;
    font-size: 1.2rem; line-height: 1; color: #9ca3af; cursor: pointer;
}
.charger-popup .cp-title { font-weight: 700; padding-right: 1rem; line-height: 1.2; }
.charger-popup .cp-sub { color: #6b7280; font-size: .78rem; margin: .15rem 0 .5rem; }
.charger-popup .cp-status { font-size: .8rem; margin-bottom: .5rem; }
.charger-popup .cp-free { color: #16a34a; font-weight: 600; }
.charger-popup .cp-busy { color: #dc2626; font-weight: 600; }
/* Карточки коннекторов — группировка по типу (иконка + мощность диапазоном + статус).
   Всегда 2 колонки: каждая карточка = половина ширины модалки. */
.charger-popup .cp-conns { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .5rem; }
.charger-popup .cp-conn-card {
    min-width: 0; display: flex; flex-direction: column; gap: .35rem;
    padding: .45rem .5rem; background: #f6f8fa; border-radius: .6rem;
}
.charger-popup .cp-conn-head { display: flex; align-items: center; gap: .4rem; }
.charger-popup .cp-conn-meta { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; }
.charger-popup .cp-conn-type { font-weight: 700; font-size: .82rem; line-height: 1.15; color: #111827; }
.charger-popup .cp-conn-power { font-size: .72rem; color: #6b7280; line-height: 1.2; }
.charger-popup .cp-conn-ic {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: 50%; background: #fff; color: #374151;
}
.charger-popup .cp-conn-ic svg { display: block; }
.charger-popup .cp-conn-stat { display: flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; }
.charger-popup .cp-conn-stat .cp-dot { width: .55rem; height: .55rem; border-radius: 50%; flex: 0 0 auto; }
.charger-popup .cp-conn-free { color: #15803d; }
.charger-popup .cp-conn-free .cp-dot { background: #22c55e; }
.charger-popup .cp-conn-busy { color: #9ca3af; }
.charger-popup .cp-conn-busy .cp-dot { background: #d1d5db; }
.charger-popup .cp-conn-plain { color: #6b7280; }
.charger-popup .cp-conn-plain .cp-dot { background: #cbd5e1; }
/* Ссылка «Открыть на Яндекс.Картах» — стиль Яндекса: красный балун + чёрный текст. */
.charger-popup .cp-link {
    display: inline-flex; align-items: center; gap: .35rem; margin-top: .6rem;
    color: #1f2937; font-weight: 600; text-decoration: none; font-size: .82rem;
}
.charger-popup .cp-link .navi-ico { flex-shrink: 0; }
.charger-popup .cp-link:hover { text-decoration: underline; }

/* Мобильный вариант попапа зарядки — заполняет фикс-контейнер #point-card-mobile на всю ширину. */
.charger-popup--mobile { width: 100%; max-width: none; box-shadow: none; border: 0; }
.charger-popup .cp-unknown { color: #b45309; font-weight: 600; } /* «уточняйте у оператора» */
.charger-popup .cp-count { color: #6b7280; }

/* ── Города маршрута: чипсы + автокомплит ── */
#city-list { list-style: none; margin: 0; padding: 0; }
.city-chip {
    display: flex; flex-direction: column; gap: .4rem;
    padding: .5rem .6rem; margin-bottom: .5rem;
    background: #f6f8fa; border: 1px solid #e5e7eb; border-radius: .6rem;
    /* Чип не выделяем при перетаскивании (особенно на тач: не «выделяет текст»). */
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
/* Поля exclude/радиус — обычное поведение (в них можно печатать/выделять). */
.city-chip .city-endopt input { user-select: text; -webkit-user-select: text; }
.city-chip.dragging { opacity: .5; border-color: #16a34a; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.city-chip .city-row { display: flex; align-items: center; gap: .5rem; }
/* Ручка крупнее для удобного захвата; touch-action:none — тач-перетаскивание не скроллит шторку. */
.city-chip .drag-handle {
    flex: 0 0 auto; align-self: stretch; display: flex; align-items: center; justify-content: center;
    color: #9ca3af; cursor: grab; padding: 0 .35rem; font-size: 1.15rem; line-height: 1; touch-action: none;
}
.city-chip .drag-handle:active { cursor: grabbing; }
/* Линия-индикатор места вставки при перетаскивании города. */
.city-drop-line { height: 0; margin: -.25rem 0; border-top: 3px solid #16a34a; border-radius: 3px; box-shadow: 0 0 0 1px rgba(22,163,74,.25); }
.city-chip .city-order {
    flex: 0 0 auto; width: 1.4rem; height: 1.4rem; border-radius: 9999px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: .72rem; font-weight: 700;
}
.city-chip .city-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.city-chip .city-name { font-size: .9rem; font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-chip .city-meta { font-size: .72rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-chip .city-remove {
    flex: 0 0 auto; border: 0; background: none; cursor: pointer;
    color: #9ca3af; font-size: 1.2rem; line-height: 1; padding: 0 .25rem;
}
.city-chip .city-remove:hover { color: #dc2626; }
.city-chip .city-endopt { padding-left: 1.9rem; display: flex; flex-direction: column; gap: .35rem; }
.city-chip .city-excl { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: #374151; cursor: pointer; }
/* Исключение — «красное» действие: активный чекбокс и подпись красные. */
.city-chip .city-excl input { accent-color: #dc2626; }
.city-chip .city-excl:has(input:checked) { color: #dc2626; font-weight: 600; }
.city-chip .city-excl-km { display: flex; align-items: center; gap: .4rem; }
.city-chip .city-excl-km label { font-size: .72rem; color: #6b7280; }
.city-chip .city-excl-km input { width: 5rem; }

/* Автокомплит городов (выпадающий список под инпутом #city-add). */
.city-suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + .25rem); z-index: 50;
    background: #fff; border: 1px solid #e5e7eb; border-radius: .6rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
    max-height: 16rem; overflow-y: auto; overscroll-behavior: contain;
}
.city-suggest .item {
    display: flex; flex-direction: column; gap: .1rem; padding: .5rem .7rem; cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}
.city-suggest .item:last-child { border-bottom: 0; }
.city-suggest .item:hover, .city-suggest .item.active { background: #f0fdf4; }
.city-suggest .s-label { font-size: .88rem; font-weight: 600; color: #111827; }
.city-suggest .s-meta { font-size: .74rem; color: #6b7280; }

/* Атрибуция фото в строке списка «Найдено»/«Маршрут» (как .aic-credit в AI-помощнике). */
.rb-credit { font-size: 11px; line-height: 1.3; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.rb-credit a { color: inherit; text-decoration: underline; }
.rb-credit a:hover { color: #4b5563; }
