        /* ===== ГЛОБАЛЬНЫЕ ===== */
        /* Фирменная палитра MapWay — тёмный чирок (морская волна) + чёрный,
           вместо прежнего фиолетового градиента */
        :root {
            --brand: #0f6f6c;
            --brand-rgb: 15, 111, 108;
            --brand-dark: #0b5451;
            --brand-darker: #072e2c;
            --ink: #0a0f0e;
            --ink-rgb: 10, 15, 14;

            /* Шрифт — Onest вместо системного Segoe UI. Геометричный гротеск с
               кириллицей как родной системой письма (не поздняя докладка к
               латинице) — важно для русскоязычного интерфейса, и не входит в
               список "примелькавшихся" AI-шрифтов (Inter/Roboto/Plus Jakarta
               Sans/Space Grotesk). */
            --font-sans: 'Onest', 'Segoe UI', system-ui, sans-serif;

            /* Радиусы — единая шкала вместо разбросанных 6/7/8/10/12/14/16px */
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --radius-pill: 999px;

            /* Тени тонированы в тон чернил, а не чистый чёрный — глубже и мягче */
            --shadow-sm: 0 1px 2px rgba(var(--ink-rgb), 0.05), 0 1px 1px rgba(var(--ink-rgb), 0.04);
            --shadow-md: 0 6px 20px rgba(var(--ink-rgb), 0.10);
            --shadow-lg: 0 16px 40px rgba(var(--ink-rgb), 0.16);
            --shadow-brand: 0 8px 22px rgba(var(--brand-rgb), 0.24);

            /* Easing по стандартам Emil Kowalski — встроенные CSS-кривые слишком
               слабые, у этих есть выраженный характер */
            --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
            --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
            --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

            --dur-fast: 140ms;
            --dur-base: 200ms;
            --dur-slow: 320ms;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: var(--font-sans);
            background: #f5f5f5;
            overflow: hidden;
            -webkit-font-smoothing: antialiased;
        }

        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.001ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.001ms !important;
                scroll-behavior: auto !important;
            }
        }

        .app-container {
            display: none;
            width: 100%;
            /* 100vh в мобильном Safari считается по "максимальной" высоте экрана
               (как если бы нижняя панель браузера была скрыта) — когда она реально
               показана, нижняя часть страницы (в т.ч. нижняя шторка на карте)
               уезжала под неё. 100dvh учитывает фактически видимую область;
               100vh оставлен раньше как fallback для браузеров без поддержки dvh. */
            height: 100vh;
            height: 100dvh;
            /* overflow:hidden всё равно разрешает менять scrollTop программно (например,
               браузерный scrollIntoView на фокусе внутри абсолютно спозиционированной
               панели) — из-за этого на мобильных шапка/карта иногда уезжали вверх.
               overflow:clip запрещает скролл контейнера вообще (fallback на hidden
               в браузерах, которые clip ещё не понимают). */
            overflow: hidden;
            overflow: clip;
        }

        .app-container.active {
            display: flex;
            flex-direction: column;
        }

        /* Лендинг — единственный экран без внутреннего скролл-контейнера (не грид/флекс
           панель, а обычная длинная страница), поэтому именно ему нужен собственный
           вертикальный скролл поверх общего overflow:hidden — иначе доп. блоки контента
           (картинки/видео), из-за которых страница стала выше 100vh, обрезаются снизу. */
        #landingScreen {
            overflow-y: auto;
        }

        /* ===== ЛЕНДИНГ ===== */
        .landing {
            /* Сплошной тёмный фон на всю (теперь прокручиваемую) страницу — так под
               дополнительными блоками контента никогда не проглянет белый фон body,
               даже когда общая высота страницы больше одного экрана. Само фото —
               только в первом экране, см. .landing-hero-section ниже. */
            background: var(--ink);
            color: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding-bottom: 60px;
        }

        .landing-hero-section {
            /* Фоновое фото + тёмный чирок/чёрный оверлей поверх — для контраста текста.
               Само фото — CSS-переменная --hero-image, чтобы админка могла подменить
               его на своё через настройки, не трогая градиент-оверлей инлайн-стилем.
               Ограничено высотой первого экрана — раньше фото растягивалось на
               background-attachment:fixed для всей страницы, что переставало работать,
               как только страница стала выше одного экрана (Хиро-редизайн, п.12/13). */
            width: 100%;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 24px 20px 40px;
            background: linear-gradient(160deg, rgba(var(--ink-rgb), 0.78) 0%, rgba(7, 46, 44, 0.82) 55%, rgba(11, 84, 81, 0.75) 100%), var(--hero-image, url('../img/hero.jpg'));
            background-size: cover;
            background-position: center;
            transition: background 0.5s;
        }

        .landing-nav {
            width: 100%;
            max-width: 1100px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 4px;
            margin-bottom: 10vh;
        }

        .landing-logo {
            font-size: 1.3rem;
            font-weight: 800;
            letter-spacing: 0.3px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .landing-logo i {
            color: var(--brand);
        }

        .landing-nav-actions {
            display: flex;
            gap: 10px;
        }

        .landing-hero {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            max-width: 720px;
            margin: 0 auto;
        }

        .landing h1 {
            font-size: 2.8rem;
            font-weight: 800;
            line-height: 1.15;
            margin-bottom: 16px;
        }

        .landing p {
            font-size: 1.1rem;
            max-width: 600px;
            margin-bottom: 28px;
            opacity: 0.85;
        }

        .landing .btn {
            padding: 12px 32px;
            border: none;
            border-radius: 50px;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            transition: 0.3s;
            background: var(--brand);
            color: white;
            margin: 6px;
        }

        .landing .btn:hover {
            transform: scale(1.05);
            background: var(--brand-dark);
        }

        .landing .btn-outline {
            background: transparent;
            border: 2px solid rgba(255, 255, 255, 0.6);
            color: white;
        }

        .landing .btn-outline:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: white;
        }

        .landing .btn-sm {
            padding: 8px 20px;
            font-size: 0.85rem;
            margin: 0;
        }

        .landing .btn-cta {
            background: var(--brand);
            font-size: 1.05rem;
            padding: 14px 40px;
            box-shadow: 0 8px 24px rgba(var(--brand-rgb), 0.4);
        }

        .landing .btn-cta:hover {
            background: var(--brand-dark);
        }

        .landing .features {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            margin-top: 40px;
            justify-content: center;
        }

        .landing .feature {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(4px);
            padding: 16px 24px;
            border-radius: 14px;
            max-width: 180px;
        }

        .landing .feature i {
            font-size: 2rem;
            margin-bottom: 6px;
            color: var(--brand);
        }

        .landing-about {
            width: 100%;
            /* Расширено с 640px под картинки в тексте (решение пользователя:
               "картинки шире текста", затем "сделать ещё больше") — сам текст
               остаётся узкой читаемой колонкой (см.
               .landing-about-text > :not(.mw-rich-image) ниже), а вставленные
               фото могут занимать всю эту более широкую площадку. 1100px — та
               же ширина, что и у .landing-nav (эталон "широкого" контента на
               этом лендинге, единообразно с остальной страницей). */
            max-width: 1100px;
            margin-top: 50px;
            padding: 30px 20px 0;
            border-top: 1px solid rgba(255, 255, 255, 0.15);
            text-align: center;
            box-sizing: border-box;
        }

        .landing-about h2 {
            font-size: 1.4rem;
            margin-bottom: 10px;
        }

        .landing-about-text {
            font-size: 0.95rem;
            line-height: 1.6;
            opacity: 0.8;
        }

        /* Текстовые абзацы/заголовки/списки внутри "О нас" — узкая читаемая
           колонка (640px, как раньше был весь блок), центрированная в более
           широком родителе. Картинки (.mw-rich-image) исключены — им доступна
           вся ширина .landing-about-text. */
        .landing-about-text > :not(.mw-rich-image) {
            max-width: 640px;
            margin-left: auto;
            margin-right: auto;
        }

        /* Дополнительные блоки лендинга, настраиваемые из админки */
        .landing-blocks {
            width: 100%;
            /* Расширено с 640px под картинки в тексте блока — тот же приём, что
               и у .landing-about (см. её комментарий): текст в теле блока
               остаётся узкой читаемой колонкой (.landing-block-body >
               :not(.mw-rich-image) ниже), картинки — во всю ширину. 1100px —
               та же "широкая" ширина, что у .landing-nav/.landing-about. */
            max-width: 1100px;
            margin-top: 10px;
            padding: 0 20px;
            display: flex;
            flex-direction: column;
            gap: 30px;
            box-sizing: border-box;
        }

        /* Текст в теле доп. блока — узкая колонка, центрированная в более
           широком блоке; картинки (.mw-rich-image) — во всю ширину блока. */
        .landing-block-body > :not(.mw-rich-image) {
            max-width: 640px;
            margin-left: auto;
            margin-right: auto;
        }

        .landing-block {
            text-align: center;
        }

        .landing-block h2 {
            font-size: 1.3rem;
            margin-bottom: 10px;
        }

        .landing-block p {
            font-size: 0.95rem;
            line-height: 1.6;
            opacity: 0.85;
        }

        .landing-block img {
            max-width: 100%;
            border-radius: 14px;
            display: block;
            margin: 0 auto;
        }

        .landing-block video,
        .landing-block iframe {
            max-width: 100%;
            width: 100%;
            aspect-ratio: 16 / 9;
            border-radius: 14px;
            border: none;
            display: block;
        }

        .landing-block-caption {
            font-size: 0.8rem;
            opacity: 0.65;
            margin-top: 8px;
        }

        /* ===== ФУТЕР (лендинг + страница "Тарифы") =====
           Разметка продублирована в обоих местах (см. index.html) — здесь общие
           стили по классам, без привязки к id/родителю. Оба родителя (.landing,
           .pricing-page) уже тёмные (var(--ink) + white), поэтому свой фон футеру
           не нужен — только верхняя граница-разделитель, как у .landing-about. */
        .site-footer {
            width: 100%;
            max-width: 1100px;
            margin-top: 50px;
            padding: 36px 20px 0;
            border-top: 1px solid rgba(255, 255, 255, 0.15);
            box-sizing: border-box;
        }

        .site-footer-top {
            display: flex;
            flex-wrap: wrap;
            gap: 40px;
            justify-content: space-between;
        }

        .site-footer-brand {
            max-width: 260px;
        }

        .site-footer-logo {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 1.2rem;
            font-weight: 700;
            color: white;
        }

        .site-footer-logo i {
            color: var(--brand);
        }

        .site-footer-tagline {
            margin-top: 10px;
            font-size: 0.85rem;
            line-height: 1.55;
            opacity: 0.65;
        }

        .site-footer-col {
            display: flex;
            flex-direction: column;
            gap: 10px;
            min-width: 160px;
        }

        .site-footer-col-title {
            font-size: 0.78rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            opacity: 0.5;
            margin-bottom: 2px;
        }

        .site-footer-col a {
            color: rgba(255, 255, 255, 0.75);
            text-decoration: none;
            font-size: 0.9rem;
            transition: color var(--dur-fast) var(--ease-out);
        }

        .site-footer-col a:hover {
            color: white;
        }

        .site-footer-email-value,
        .site-footer-requisites-value {
            font-size: 0.85rem;
            opacity: 0.7;
            line-height: 1.5;
        }

        .site-footer-email-value a {
            color: rgba(255, 255, 255, 0.75);
            text-decoration: none;
        }

        .site-footer-email-value a:hover {
            color: white;
        }

        .site-footer-bottom {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            flex-wrap: wrap;
            margin-top: 36px;
            padding: 18px 0;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            font-size: 0.8rem;
            opacity: 0.55;
        }

        .site-footer-social {
            display: flex;
            gap: 10px;
        }

        .site-footer-social .social-icon-btn {
            width: 34px;
            height: 34px;
            font-size: 15px;
        }

        @media (max-width: 640px) {
            .site-footer-top {
                gap: 28px;
            }

            .site-footer-bottom {
                justify-content: center;
                text-align: center;
            }
        }

        /* Приписка про акцепт оферты под кнопкой "Оформить Pro" на /?view=pricing */
        .pricing-consent-note {
            margin-top: 12px;
            font-size: 0.78rem;
            text-align: center;
            opacity: 0.6;
        }

        .pricing-consent-note a {
            color: rgba(255, 255, 255, 0.85);
            text-decoration: underline;
        }

        /* ===== ВЕРХНЯЯ ПАНЕЛЬ (полноширинный тёмный хедер) ===== */
        .app-header {
            flex-shrink: 0;
            height: 34px;
            /* На iPhone с "чёлкой"/статус-баром (напр. iPhone 11) без этого отступа
               содержимое хедера (лого, кнопки) рисовалось в одном ряду со статус-баром
               ОС и перекрывалось им — viewport-fit=cover в <meta viewport> (index.html)
               делает страницу на весь экран и включает env(safe-area-inset-*).
               На устройствах без выреза env() возвращает 0 — блок не меняется. */
            padding-top: env(safe-area-inset-top, 0px);
            box-sizing: content-box;
            background: rgba(var(--ink-rgb), 0.82);
            backdrop-filter: blur(14px) saturate(140%);
            -webkit-backdrop-filter: blur(14px) saturate(140%);
            color: rgba(255, 255, 255, 0.9);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding-left: 14px;
            padding-right: 14px;
            z-index: 1001;
            box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 2px 14px rgba(0, 0, 0, 0.22);
        }

        .app-header-logo {
            font-size: 0.95rem;
            font-weight: 800;
            letter-spacing: -0.01em;
            color: white;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .app-header-logo i {
            color: var(--brand);
        }

        .app-header-actions {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .app-header .tool-btn {
            width: 26px;
            height: 26px;
            font-size: 12px;
            border-radius: var(--radius-sm);
            border: none;
            background: transparent;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255, 255, 255, 0.8);
        }

        .app-header .tool-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

        .app-header .tool-btn:active {
            transform: scale(0.94);
        }

        .app-header .tool-btn.end-edit {
            width: auto;
            padding: 0 10px;
            height: 24px;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.01em;
            border-radius: var(--radius-sm);
            background: rgba(255, 255, 255, 0.08);
            /* Иконка и подпись раньше держались только на пробеле между ними в
               разметке (~3-4px) — на десктопе, где подпись видна, смотрелось
               слишком плотно. Явный gap не зависит от пробела в HTML. */
            gap: 6px;
        }

        /* Единый акцентный стиль шапки (Войти/Донат/Кабинет) — вместо разномастных
           инлайн-цветов (зелёный/оранжевый/красный) на разных кнопках. Один акцент
           на всю страницу — фирменный чирок, см. COLOR_CONSISTENCY_LOCK. */
        .app-header .tool-btn.tool-btn-accent {
            background: var(--brand);
            color: white;
        }

        .app-header .tool-btn.tool-btn-accent:hover {
            background: var(--brand-dark);
            color: white;
        }

        /* Выход — редкое, потенциально "прощальное" действие: нейтральная
           призрачная кнопка, текст краснеет только при наведении, без сплошной
           заливки на весь день. */
        .app-header .tool-btn.tool-btn-ghost:hover {
            background: rgba(220, 90, 90, 0.16);
            color: #ffb4b4;
        }

        /* Админ-бейдж — тонкая обводка вместо заливки оранжевым, тише и уместнее
           рядом с остальными нейтральными кнопками шапки. */
        .app-header .tool-btn.tool-btn-outline {
            border: 1px solid rgba(255, 255, 255, 0.25);
            background: rgba(255, 255, 255, 0.04);
        }

        .app-header .tool-btn.tool-btn-outline:hover {
            border-color: var(--brand);
            color: white;
            background: rgba(var(--brand-rgb), 0.18);
        }

        /* Звёздочка "Тарифы" — золотая, тот же оттенок, что и у пилюли PRO
           (единственные два золотых элемента в интерфейсе, оба про Pro-тему). */
        #pricingHeaderBtn i {
            color: #f0c14a;
        }

        .app-header .tool-divider {
            width: 1px;
            height: 18px;
            background: rgba(255, 255, 255, 0.15);
            margin: 0 2px;
        }

        /* ===== Выпадающее меню выбора формата скачивания (шапка карты + кабинет) ===== */
        .download-menu-wrap {
            position: relative;
            display: inline-flex;
        }

        .download-menu {
            /* position:fixed + координаты через JS (см. toggleDownloadMenu), а не
               absolute относительно обёртки — иначе меню зажимается overflow:hidden
               у .route-card в кабинете, когда карточка выше (длинное описание) и под
               кнопкой остаётся меньше места до нижнего края карточки.
               display больше не швейцарский нож видимости — держим в DOM и скрываем
               через opacity/scale, чтобы открытие/закрытие можно было анимировать
               (переключается только класс .open, см. track-export.js). */
            position: fixed;
            background: #fff;
            border-radius: var(--radius-sm);
            box-shadow: var(--shadow-lg);
            z-index: 1500;
            min-width: 130px;
            overflow: hidden;
            transform-origin: top right;
            opacity: 0;
            transform: scale(0.95);
            pointer-events: none;
            transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
        }

        .download-menu.open {
            opacity: 1;
            transform: scale(1);
            pointer-events: auto;
        }

        .download-menu button {
            display: block;
            width: 100%;
            text-align: left;
            padding: 9px 14px;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 13px;
            color: var(--ink);
            transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
        }

        .download-menu button:hover {
            background: rgba(var(--brand-rgb), 0.1);
            color: var(--brand);
        }

        #userInfo {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: rgba(255, 255, 255, 0.85);
        }

        #userInfo #userAvatar {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            display: none;
            object-fit: cover;
        }

        #userNameWrap {
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        /* Единственное место во всём приложении с золотым цветом (не чирок-акцент) —
           намеренно: это "премиальная" пилюля, ей и положено выделяться, а не
           сливаться с обычными брендовыми элементами. Мягкое тёплое свечение
           (тонированная тень, не неон) + периодический блик, который пробегает
           по пилюле — как у "золотых" бейджей в других сервисах. */
        .user-pro-badge {
            position: relative;
            overflow: hidden;
            font-size: 9px;
            font-weight: 800;
            letter-spacing: 0.04em;
            color: #4a3200;
            background: linear-gradient(135deg, #fff3c4 0%, #f0c14a 50%, #d89a1f 100%);
            border-radius: var(--radius-pill);
            padding: 1px 7px;
            line-height: 1.5;
            box-shadow: 0 0 7px rgba(230, 170, 30, 0.55), 0 1px 2px rgba(0, 0, 0, 0.18);
        }

        @media (prefers-reduced-motion: no-preference) {
            .user-pro-badge::after {
                content: '';
                position: absolute;
                top: 0;
                left: -60%;
                width: 40%;
                height: 100%;
                background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.9), transparent);
                animation: proBadgeShine 3.4s ease-in-out infinite;
            }
        }

        @keyframes proBadgeShine {
            0% { left: -60%; }
            35% { left: 130%; }
            100% { left: 130%; }
        }

        /* ===== ЛЕВАЯ ПАНЕЛЬ ===== */
        /* Обёртка держит абсолютное позиционирование (вертикально по центру карты),
           сама панель инструментов и ручка выезжающей панели соцсетей — просто
           flex-элементы внутри неё, друг под другом. */
        .left-toolbar-group {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            z-index: 1001;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .left-toolbar {
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
            display: flex;
            flex-direction: column;
            padding: 6px 4px;
            gap: 2px;
        }

        .left-toolbar .tool-btn {
            width: 34px;
            height: 34px;
            font-size: 15px;
            border-radius: var(--radius-sm);
            border: none;
            background: transparent;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #555;
        }

        .left-toolbar .tool-btn:hover {
            background: rgba(0, 0, 0, 0.06);
        }

        .left-toolbar .tool-btn:active:not(:disabled) {
            transform: scale(0.92);
        }

        .left-toolbar .tool-btn:disabled {
            opacity: 0.3;
            cursor: default;
            pointer-events: none;
        }

        .left-toolbar .tool-btn.active {
            background: var(--brand);
            color: white;
            box-shadow: var(--shadow-brand);
        }

        .left-toolbar .tool-divider-vertical {
            width: 80%;
            height: 1px;
            background: rgba(0, 0, 0, 0.08);
            margin: 2px auto;
        }

        /* Пока выбран сегмент для редактирования — на карте курсор-прицел вместо
           руки, чтобы режим "я сейчас рисую/редактирую" был виден сразу. */
        #map.segment-editing,
        #map.segment-editing .leaflet-grab,
        #map.segment-editing .leaflet-interactive {
            cursor: crosshair;
        }

        /* Перетаскиваемые вершины активного сегмента остаются "перемещаемыми" */
        #map.segment-editing .leaflet-marker-draggable {
            cursor: move;
        }

        /* ---- Мини-меню клика по линии редактируемого сегмента ---- */
        .line-menu-popup .leaflet-popup-content-wrapper {
            padding: 4px;
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-md);
        }

        .line-menu-popup .leaflet-popup-content {
            margin: 0;
        }

        .line-menu {
            display: flex;
            flex-direction: column;
            min-width: 170px;
        }

        .line-menu button {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border: none;
            background: none;
            text-align: left;
            font: inherit;
            font-size: 13px;
            color: var(--ink);
            cursor: pointer;
            border-radius: var(--radius-sm);
            transition: background-color var(--dur-fast) var(--ease-out);
        }

        .line-menu button:hover {
            background: rgba(var(--brand-rgb), 0.08);
            color: var(--brand-dark);
        }

        .line-menu button i {
            width: 15px;
            text-align: center;
            color: var(--brand);
        }

        /* ---- Ручка + выезжающая панель соцсетей (под панелью инструментов) ---- */
        .social-flyout-wrap {
            position: relative;
        }

        /* Фирменный цвет вместо нейтрального белого — иначе ручка теряется под
           панелью инструментов и незаметна. */
        .social-flyout-toggle {
            width: 30px;
            height: 20px;
            border: none;
            border-radius: var(--radius-sm);
            background: var(--brand);
            box-shadow: var(--shadow-brand);
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .social-flyout-toggle:hover {
            background: var(--brand-dark);
        }

        .social-flyout-toggle:active {
            transform: scale(0.92);
        }

        .social-flyout-toggle.active {
            background: var(--brand-darker);
        }

        /* Выезжает ВБОК (вправо от ручки) — не толкая и не перекрывая панель
           инструментов над собой; отдельный слой (position:absolute), карта под
           ним по-прежнему кликабельна за пределами узкой карточки.
           transform-origin слева (у ручки) — панель растёт от источника, а не
           из центра/из ниоткуда. */
        .social-flyout {
            position: absolute;
            left: 100%;
            top: 50%;
            margin-left: 8px;
            transform-origin: left center;
            transform: translateY(-50%) scale(0.95);
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
            padding: 10px;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: center;
            gap: 10px;
            max-width: 220px;
            opacity: 0;
            pointer-events: none;
            transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
            z-index: 1001;
        }

        .social-flyout.open {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(-50%) scale(1);
        }

        .map-social-links {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 10px;
        }

        .map-social-links .social-icon-btn {
            width: 40px;
            height: 40px;
            font-size: 18px;
        }

        /* ===== ПРАВАЯ ПАНЕЛЬ ===== */
        .side-panel {
            /* Ширина настраивается в админке (вкладка "Контент сайта" → "Интерфейс
               карты"), а не перетаскиванием мышкой, как раньше — см. applySettings()
               в admin-content.js. 452px — запасное значение по умолчанию. */
            position: absolute;
            top: 16px;
            right: 16px;
            width: var(--side-panel-width, 452px);
            max-height: calc(100% - 32px);
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            z-index: 1000;
            padding: 12px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        /* Ручка сворачивания правой панели в "шторку" снизу — значима только на
           мобильных (см. @media ниже), на десктопе панель всегда полностью открыта. */
        .side-panel-mobile-handle {
            display: none;
            border: none;
            background: none;
            padding: 0;
        }

        .side-panel .panel-tabs {
            display: flex;
            gap: 2px;
            margin-bottom: 10px;
            background: #eef1f1;
            border-radius: var(--radius-sm);
            padding: 3px;
            flex-shrink: 0;
        }

        .side-panel .panel-tab {
            padding: 7px 4px;
            font-size: 10px;
            letter-spacing: 0.01em;
            border-radius: 7px;
            border: none;
            background: transparent;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
            flex: 1;
            text-align: center;
            color: #666;
            font-weight: 600;
        }

        .side-panel .panel-tab:hover {
            color: var(--brand);
        }

        .side-panel .panel-tab.active {
            background: var(--brand);
            color: white;
            box-shadow: var(--shadow-brand);
        }

        .side-panel .panel-content {
            display: none;
            flex: 1;
            overflow-y: auto;
            padding-right: 2px;
        }

        .side-panel .panel-content.active {
            display: block;
        }

        .side-panel .panel-title {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #999;
            margin-bottom: 6px;
        }

        .panel-btn {
            width: 100%;
            padding: 8px;
            margin-bottom: 4px;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            background: #f0f2f2;
            color: #333;
        }

        .panel-btn:hover {
            background: #e4e7e7;
            transform: translateY(-1px);
        }

        .panel-btn:active:not(:disabled) {
            transform: scale(0.97);
        }

        /* Режим "только просмотр" восстановленного маршрута (isRouteReadOnly, см.
           updateEditModeUI в ui.js) — кнопки, требующие разрешения на правку,
           затемняются и не реагируют на клик, пока не нажата "Редактировать". */
        .panel-btn:disabled {
            opacity: 0.4;
            cursor: default;
            pointer-events: none;
            transform: none;
        }

        /* Только нейтральный серый и цвет темы — без красных/зелёных/оранжевых
           плашек. Акцент темой (чирок) — только у "Новый маршрут" (начало
           работы), остальные кнопки нейтральные (порядок и подтверждения через
           confirm() и так предупреждают о необратимых действиях). */
        .panel-btn.secondary,
        .panel-btn.success,
        .panel-btn.danger {
            background: #f0f2f2;
            color: #333;
        }

        .panel-btn.secondary:hover,
        .panel-btn.success:hover,
        .panel-btn.danger:hover {
            background: #e4e7e7;
        }

        .panel-btn.primary {
            background: var(--brand);
            color: white;
            box-shadow: var(--shadow-brand);
        }

        .panel-btn.primary:hover {
            background: var(--brand-dark);
        }

        .side-panel .panel-stats {
            font-size: 10px;
            font-weight: 600;
            color: #777;
            text-align: center;
            padding: 6px 0;
            background: #f5f6f6;
            border-radius: var(--radius-sm);
            margin-top: 6px;
            font-variant-numeric: tabular-nums;
        }

        /* ===== ОПИСАНИЕ МАРШРУТА (панель "Упр.") ===== */
        .route-description-view {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .route-name-text {
            font-size: 13px;
            font-weight: 700;
            color: #222;
        }

        .route-description-text {
            font-size: 12px;
            color: #555;
            line-height: 1.4;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .route-name-input {
            width: 100%;
            padding: 7px 9px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            font-family: inherit;
            margin-bottom: 6px;
        }

        .route-description-edit-link {
            align-self: flex-start;
            border: none;
            background: none;
            color: var(--brand);
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            padding: 0;
        }

        .route-description-edit-link:hover {
            text-decoration: underline;
        }

        .route-description-edit textarea {
            width: 100%;
            min-height: 60px;
            padding: 8px 9px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 12px;
            font-family: inherit;
            resize: vertical;
        }

        .route-description-edit-actions {
            display: flex;
            gap: 8px;
            margin-top: 6px;
        }

        /* ===== ПОДСКАЗКА ПО ЦЕНТРУ (замена системного alert()) ===== */
        .hint-toast {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.95);
            z-index: 3000;
            background: rgba(var(--ink-rgb), 0.92);
            color: white;
            padding: 14px 22px;
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 600;
            text-align: center;
            box-shadow: var(--shadow-lg);
            pointer-events: none;
            opacity: 0;
            transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
            max-width: 320px;
        }

        .hint-toast.active {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }

        /* ===== СЕГМЕНТЫ ===== */
        .segment-list {
            margin-top: 4px;
        }

        .segment-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 5px 6px;
            background: #f7f8f8;
            border-radius: var(--radius-sm);
            margin-bottom: 4px;
            font-size: 10px;
            transition: background-color var(--dur-base) var(--ease-out);
        }

        .segment-item:hover {
            background: #eef1f1;
        }

        .segment-item .seg-left {
            display: flex;
            align-items: center;
            flex: 1;
            min-width: 0;
        }

        .segment-item .seg-color {
            width: 10px;
            height: 10px;
            border-radius: 3px;
            margin-right: 4px;
            flex-shrink: 0;
        }

        .segment-item .seg-info {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .segment-item .seg-name {
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 10px;
        }

        .segment-item .seg-distance {
            font-size: 8px;
            color: #666;
        }

        .segment-item .seg-actions {
            display: flex;
            gap: 2px;
        }

        .segment-item .seg-actions button {
            background: none;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 10px;
            color: #888;
            padding: 3px 4px;
        }

        .segment-item .seg-actions button:hover {
            color: var(--brand);
            background: rgba(var(--brand-rgb), 0.1);
        }

        .segment-item .seg-actions button:disabled {
            opacity: 0.35;
            cursor: default;
            pointer-events: none;
        }

        /* Активный (редактируемый) сегмент — карточка выбирается кликом
           (onSegmentItemClick в segments.js), выбранная подсвечена брендом,
           как у MapMagic: рамка + лёгкий фон. */
        .segment-item {
            cursor: pointer;
        }

        .segment-item.seg-active {
            border: 1px solid var(--brand);
            background: rgba(var(--brand-rgb), 0.07);
            border-radius: var(--radius-sm);
        }

        .segments-total {
            font-size: 10px;
            font-weight: 600;
            color: #333;
            margin-top: 4px;
            padding: 4px 0;
            border-top: 1px solid rgba(0, 0, 0, 0.06);
            text-align: right;
        }

        .segment-item.highlighted {
            background: rgba(var(--brand-rgb), 0.12);
            border-left: 2px solid var(--brand);
        }

        .segment-item.seg-excluded {
            opacity: 0.5;
        }

        /* ===== ИНФОРМАЦИЯ О МАРШРУТЕ (ВНИЗУ ПО ЦЕНТРУ) ===== */
        .track-info {
            /* left/top подобраны так, чтобы панель стояла правее поля поиска
               (.search-box, left:56px + width:300px) и не перекрывалась им и
               выпадающим списком результатов поиска, даже когда он открыт. */
            position: absolute;
            top: 8px;
            left: 372px;
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
            z-index: 999;
            padding: 8px 12px;
            min-width: 220px;
            font-size: 13px;
        }

        /* Список меток — переиспользуется и в панели инфо о треке (метки трека),
           и в панели "Упр." (обычные метки маршрута), поэтому классы общие. */
        .mini-list {
            margin-top: 6px;
            max-height: 220px;
            overflow-y: auto;
            border-top: 1px solid rgba(0, 0, 0, 0.08);
        }

        .mini-list-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 4px;
            font-size: 12px;
            color: #333;
            cursor: pointer;
            border-bottom: 1px solid rgba(0, 0, 0, 0.06);
            transition: background-color var(--dur-fast) var(--ease-out);
        }

        .mini-list-item:last-child {
            border-bottom: none;
        }

        .mini-list-item:hover {
            background: rgba(var(--brand-rgb), 0.08);
        }

        .mini-list-item i {
            color: var(--brand);
            font-size: 12px;
        }

        .track-info-name {
            font-size: 12px;
            font-weight: 600;
            color: #333;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .track-info .stats-row {
            display: flex;
            justify-content: space-around;
            gap: 8px;
        }

        .track-info .stat-item .value {
            font-size: 15px;
            font-weight: 700;
            color: #333;
            font-variant-numeric: tabular-nums;
        }

        .track-info .stat-item .label {
            font-size: 9px;
            color: #666;
        }

        .track-info .stat-item .icon {
            color: var(--brand);
            margin-right: 2px;
        }

        .route-info {
            position: absolute;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            z-index: 999;
            padding: 14px 28px;
            min-width: 360px;
            text-align: center;
            font-size: 14px;
            /* visibility вместо display:none — позволяет анимировать появление
               (display не участвует в transition). transform тут не трогаем —
               на мобильном это же свойство используется для сдвига в шторку
               (см. @media ниже), пересекать смыслы в одном свойстве рискованно. */
            visibility: hidden;
            opacity: 0;
            transition: opacity var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow);
        }

        .route-info.active {
            visibility: visible;
            opacity: 1;
            transition: opacity var(--dur-slow) var(--ease-out);
        }

        .route-info .stats-row {
            display: flex;
            justify-content: space-around;
            align-items: center;
            gap: 18px;
            margin-bottom: 8px;
        }

        .route-info .stat-item .value {
            font-size: 20px;
            font-weight: 700;
            color: #333;
            font-variant-numeric: tabular-nums;
        }

        .route-info .stat-item .label {
            font-size: 11px;
            color: #666;
        }

        .route-info .stat-item .icon {
            color: var(--brand);
            margin-right: 2px;
        }

        .route-info .stat-item.time-stat .value {
            font-size: 30px;
            font-weight: 800;
            color: var(--ink);
            letter-spacing: -0.01em;
        }

        .route-info .stat-item.time-stat .label {
            font-size: 12px;
        }

        .route-info .activity-row {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 12px;
            font-size: 13px;
            color: #555;
            border-top: 1px solid rgba(0, 0, 0, 0.06);
            padding-top: 8px;
            margin-top: 2px;
        }

        .route-info .activity-row span i {
            margin-right: 4px;
            color: var(--brand);
        }

        .route-info .speed-control {
            display: inline-flex;
            align-items: center;
            gap: 3px;
        }

        .route-info .speed-control input {
            width: 60px;
            font-size: 15px;
            font-weight: 600;
            font-variant-numeric: tabular-nums;
            border: 1px solid rgba(0, 0, 0, 0.2);
            border-radius: var(--radius-sm);
            padding: 3px 6px;
            text-align: center;
            transition: border-color var(--dur-base) var(--ease-out);
        }

        .route-info .speed-control input:focus {
            outline: none;
            border-color: var(--brand);
        }

        /* Ручка сворачивания в боковую шторку — значима только на мобильном (см.
           @media ниже), на десктопе панель всегда полностью открыта. */
        .route-info-mobile-handle {
            display: none;
        }

        /* ===== МОДАЛКИ ===== */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
            /* visibility вместо display:none — чтобы можно было анимировать
               появление/скрытие модалки (display не участвует в transition). */
            visibility: hidden;
            opacity: 0;
            transition: opacity var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
        }

        .modal-overlay.active {
            visibility: visible;
            opacity: 1;
            transition: opacity var(--dur-base) var(--ease-out);
        }

        .modal {
            background: white;
            border-radius: var(--radius-lg);
            padding: 16px;
            width: 380px;
            max-width: 90vw;
            max-height: 80vh;
            overflow: auto;
            box-shadow: var(--shadow-lg);
            /* Модалка не привязана к конкретному триггеру на экране — в отличие
               от флаутов/поповеров остаётся center-anchored. Начинаем не с
               scale(0), а с 0.95 — ничего в реальном мире не появляется из точки. */
            transform: scale(0.95);
            transition: transform var(--dur-base) var(--ease-out);
        }

        .modal-overlay.active .modal {
            transform: scale(1);
        }

        /* Модалки с более объёмным содержимым (например, "Поделиться" с полем
           ссылки, тумблерами и кодом виджета) — шире и вручную растягиваемая
           (resize за нижний правый угол), чтобы было удобнее работать с текстом. */
        .modal.modal-wide {
            width: 520px;
            resize: both;
        }

        .modal-title {
            font-size: 16px;
            font-weight: 700;
            letter-spacing: -0.01em;
            margin-bottom: 12px;
            text-align: center;
        }

        .modal input,
        .modal select,
        .modal textarea {
            width: 100%;
            padding: 7px 10px;
            margin-bottom: 8px;
            border: 1px solid #ddd;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-family: inherit;
            transition: border-color var(--dur-base) var(--ease-out);
        }

        .modal input:focus,
        .modal select:focus,
        .modal textarea:focus {
            outline: none;
            border-color: var(--brand);
        }

        /* Тумблеры (.seg-include-checkbox) внутри модалок иначе наследуют правило
           выше (.modal input) и растягиваются на всю ширину модалки вместо своих
           26x15px — сбрасываем инпутные стили обратно на стили тумблера. */
        .modal input.seg-include-checkbox {
            width: 26px;
            height: 15px;
            padding: 0;
            margin-bottom: 0;
            border: none;
            border-radius: 999px;
        }

        .modal .btn-row {
            display: flex;
            gap: 8px;
            margin-top: 10px;
        }

        .password-field-wrap {
            position: relative;
            margin-bottom: 8px;
        }

        .password-field-wrap input {
            margin-bottom: 0;
            padding-right: 32px;
        }

        .password-toggle-icon {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: #999;
            cursor: pointer;
            font-size: 14px;
            user-select: none;
            transition: color var(--dur-fast) var(--ease-out);
        }

        .password-toggle-icon:hover {
            color: var(--brand);
        }

        .modal .btn-row .btn {
            flex: 1;
            padding: 9px 8px;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .modal .btn-row .btn:active {
            transform: scale(0.97);
        }

        .modal .btn-row .btn-primary {
            background: var(--brand);
            color: white;
        }

        .modal .btn-row .btn-primary:hover {
            background: var(--brand-dark);
        }

        .modal .btn-row .btn-secondary {
            background: #f0f0f0;
            color: #333;
        }

        .modal .btn-row .btn-secondary:hover {
            background: #e4e4e4;
        }

        .help-guide-wrapper {
            display: none;
        }

        /* Крестик закрытия гайда — position:sticky, а не в конце содержимого:
           текст гайда длинный и .modal сам скроллится (overflow:auto), раньше
           единственная кнопка "Закрыть" была внизу под всем текстом — приходилось
           долистывать до конца, чтобы закрыть модалку. */
        .modal-close-x {
            position: sticky;
            top: 0;
            float: right;
            margin: -16px -16px 0 0;
            background: #fff;
            border: none;
            border-radius: 0 var(--radius-lg) 0 var(--radius-sm);
            font-size: 22px;
            line-height: 1;
            width: 36px;
            height: 32px;
            cursor: pointer;
            color: #888;
            z-index: 2;
            transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
        }

        .modal-close-x:hover {
            color: #333;
            background: #f0f0f0;
        }

        .modal-close-x:active {
            transform: scale(0.92);
        }

        /* ---- Окно помощи ----
           Крупная модалка с шапкой, поиском, оглавлением (из заголовков гайда,
           строится в ui.js) и своей типографикой для Quill-контента. */
        .modal.modal-help {
            width: 780px;
            max-width: 94vw;
            height: 82vh;
            padding: 0;
            display: flex;
            flex-direction: column;
            /* Скроллятся внутренние области (оглавление/текст), не вся модалка */
            overflow: hidden;
        }

        .help-modal-header {
            display: flex;
            align-items: center;
            gap: 11px;
            padding: 14px 16px 11px;
        }

        .help-modal-icon {
            width: 36px;
            height: 36px;
            flex-shrink: 0;
            border-radius: 50%;
            background: rgba(var(--brand-rgb), 0.12);
            color: var(--brand);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
        }

        .help-modal-title {
            flex: 1;
            font-size: 17px;
            font-weight: 700;
            letter-spacing: -0.01em;
            display: flex;
            flex-direction: column;
            line-height: 1.25;
        }

        .help-modal-subtitle {
            font-size: 11.5px;
            font-weight: 400;
            color: #888;
        }

        .help-modal-close {
            flex-shrink: 0;
            background: none;
            border: none;
            border-radius: var(--radius-sm);
            width: 32px;
            height: 32px;
            font-size: 22px;
            line-height: 1;
            color: #888;
            cursor: pointer;
            transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
        }

        .help-modal-close:hover {
            color: #333;
            background: #f0f0f0;
        }

        .help-search-row {
            position: relative;
            padding: 0 16px 12px;
            border-bottom: 1px solid #eee;
        }

        .help-search-row>i {
            position: absolute;
            left: 29px;
            top: 9px;
            color: #999;
            font-size: 12px;
            pointer-events: none;
        }

        .modal .help-search-row input {
            width: 100%;
            margin: 0;
            padding: 7px 32px 7px 34px;
            border: 1px solid #ddd;
            border-radius: var(--radius-pill);
            font-size: 13px;
        }

        .help-search-clear {
            position: absolute;
            right: 24px;
            top: 4px;
            width: 26px;
            height: 26px;
            border: none;
            border-radius: 50%;
            background: none;
            color: #999;
            font-size: 17px;
            line-height: 1;
            cursor: pointer;
            transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
        }

        .help-search-clear:hover {
            color: #333;
            background: #f0f0f0;
        }

        .help-modal-body {
            flex: 1;
            display: flex;
            min-height: 0;
        }

        .help-toc {
            width: 216px;
            flex-shrink: 0;
            overflow-y: auto;
            padding: 12px 8px;
            border-right: 1px solid #eee;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .help-toc-item {
            text-align: left;
            background: none;
            border: none;
            cursor: pointer;
            padding: 6px 10px;
            border-radius: var(--radius-sm);
            font-size: 12.5px;
            line-height: 1.35;
            color: #444;
            transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
        }

        .help-toc-item:hover {
            background: #f2f2f2;
        }

        .help-toc-item.active {
            background: rgba(var(--brand-rgb), 0.1);
            color: var(--brand);
            font-weight: 600;
        }

        .help-toc-lvl3 {
            padding-left: 22px;
            font-size: 12px;
            color: #666;
        }

        .help-toc-dimmed {
            opacity: 0.35;
        }

        .help-modal-content {
            flex: 1;
            overflow-y: auto;
            padding: 16px 22px 22px;
        }

        /* Типографика Quill-контента справки. Классы help-h-top/help-h-sub
           проставляет buildHelpToc (ui.js): уровень заголовка относительный —
           реальный гайд написан одними h3, и они должны выглядеть верхним
           уровнем. Селекторы по тегам — фолбэк, пока оглавление не строилось. */
        .help-modal-content h1,
        .help-modal-content h2,
        .help-modal-content .help-h-top {
            position: relative;
            font-size: 16.5px;
            font-weight: 700;
            letter-spacing: -0.01em;
            margin: 22px 0 8px;
            padding-left: 12px;
        }

        .help-modal-content h1::before,
        .help-modal-content h2::before,
        .help-modal-content .help-h-top::before {
            content: '';
            position: absolute;
            left: 0;
            top: 3px;
            bottom: 3px;
            width: 4px;
            border-radius: 2px;
            background: var(--brand);
        }

        .help-modal-content h3,
        .help-modal-content .help-h-sub {
            font-size: 14px;
            font-weight: 700;
            margin: 16px 0 6px;
        }

        .help-modal-content .help-h-sub {
            padding-left: 0;
        }

        .help-modal-content .help-h-sub::before {
            display: none;
        }

        .help-modal-content p {
            font-size: 13.5px;
            line-height: 1.6;
            margin: 0 0 9px;
            color: #333;
        }

        .help-modal-content ul,
        .help-modal-content ol {
            padding-left: 22px;
            margin: 0 0 10px;
            font-size: 13.5px;
            line-height: 1.6;
            color: #333;
        }

        .help-modal-content img {
            max-width: 100%;
            border-radius: var(--radius-md);
        }

        .help-modal-content a {
            color: var(--brand);
        }

        #helpTextContent> :first-child,
        #helpGuideContent> :first-child {
            margin-top: 0;
        }

        #helpGuideContent {
            margin-top: 14px;
        }

        mark.help-mark {
            background: #ffe08a;
            border-radius: 3px;
            padding: 0 1px;
        }

        .help-no-results {
            text-align: center;
            color: #888;
            font-size: 13px;
            line-height: 1.8;
            padding: 34px 0;
        }

        .help-no-results i {
            font-size: 20px;
            color: #ccc;
        }

        .contact-links {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-top: 14px;
            padding-top: 12px;
            border-top: 1px solid #eee;
        }

        .contact-link {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            border-radius: 8px;
            background: #f5f6f7;
            color: #333;
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
        }

        .contact-link i {
            color: var(--brand);
        }

        .contact-link:hover {
            background: rgba(var(--brand-rgb), 0.1);
        }

        .donate-links {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 14px;
        }

        .donate-method-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 14px;
            border-radius: 10px;
            border: 1px solid var(--brand);
            background: rgba(var(--brand-rgb), 0.06);
            color: var(--ink);
            text-decoration: none;
            font-size: 14px;
            font-weight: 600;
            transition: background 0.15s;
        }

        .donate-method-btn i {
            color: var(--brand);
            font-size: 18px;
            width: 22px;
            text-align: center;
        }

        .donate-method-btn:hover {
            background: rgba(var(--brand-rgb), 0.15);
        }

        .donate-qr-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 14px;
            border-radius: 10px;
            border: 1px solid var(--brand);
            background: rgba(var(--brand-rgb), 0.06);
            text-decoration: none;
            color: var(--ink);
            transition: background 0.15s;
        }

        .donate-qr-card img {
            width: 160px;
            height: 160px;
            border-radius: 6px;
            background: #fff;
        }

        .donate-qr-card span {
            font-size: 13px;
            font-weight: 600;
            text-align: center;
        }

        .donate-qr-card span i {
            color: var(--brand);
        }

        .donate-qr-card:hover {
            background: rgba(var(--brand-rgb), 0.15);
        }

        .modal-message {
            font-size: 13px;
            color: #555;
            text-align: center;
        }

        .modal .auth-toggle {
            margin-top: 8px;
            text-align: center;
            font-size: 13px;
            color: #666;
        }

        .modal .auth-toggle a {
            color: var(--brand);
            cursor: pointer;
        }

        .auth-divider {
            display: flex;
            align-items: center;
            text-align: center;
            font-size: 12px;
            color: #aaa;
            margin: 14px 0 2px;
        }

        .auth-divider::before,
        .auth-divider::after {
            content: '';
            flex: 1;
            border-bottom: 1px solid #eee;
        }

        .auth-divider::before {
            margin-right: 8px;
        }

        .auth-divider::after {
            margin-left: 8px;
        }

        .auth-forgot-link {
            text-align: right;
            font-size: 12px;
            margin: -4px 0 8px;
        }

        .auth-forgot-link a {
            color: var(--brand);
            cursor: pointer;
        }

        .auth-legal-notice {
            margin-top: 12px;
            padding-top: 10px;
            border-top: 1px solid #eee;
            font-size: 11px;
            line-height: 1.5;
            color: #666;
            text-align: center;
        }

        .auth-legal-notice a {
            color: var(--brand);
            cursor: pointer;
        }

        .legal-doc-content {
            font-size: 13px;
            line-height: 1.6;
            color: #333;
            max-height: 60vh;
            overflow-y: auto;
        }

        .legal-doc-content h1,
        .legal-doc-content h2,
        .legal-doc-content h3 {
            margin: 14px 0 6px;
        }

        /* ===== КНОПКА ПОМОЩИ ===== */
        /* Соцсети переехали в выезжающую панель под левой панелью инструментов
           (см. .social-flyout выше) — освободившееся место снизу отдано кнопке
           помощи. Раньше — отдельный position:absolute с магическим "bottom",
           который считал, что панель инструментов всегда одной и той же высоты;
           на деле состав кнопок в .left-toolbar менялся (см. историю), и на
           экранах другой высоты (или в чужом in-app браузере с обрезанным
           viewport) кнопка то отставала от панели, то залезала на неё. Теперь
           это flex-элемент той же колонки .left-toolbar-group — позиция сама
           следует за реальной высотой панели. */
        .help-btn {
            flex-shrink: 0;
            background: var(--brand);
            color: white;
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            font-size: 18px;
            cursor: pointer;
            box-shadow: var(--shadow-brand);
            transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
            /* Раньше pulse infinite — экран карты открывают десятки раз за сессию,
               бесконечная пульсация быстро становится шумом. Проигрывается дважды
               при заходе на экран и останавливается (Emil: анимация, которую видят
               часто, должна быть сведена к минимуму, а не длиться вечно). */
            animation: pulse 1.8s var(--ease-out) 2;
        }

        .help-btn:hover {
            transform: scale(1.1);
        }

        .help-btn:active {
            transform: scale(0.95);
        }

        /* Та же иконка, но на лендинге — position:fixed, т.к. #landingScreen
           сам скроллится (единственный экран без внутреннего flex-контейнера),
           поэтому кнопка должна быть закреплена относительно окна, а не карты. */
        .landing-social-links {
            position: fixed;
            bottom: 24px;
            left: 24px;
            z-index: 999;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .landing-social-links .social-icon-btn {
            width: 44px;
            height: 44px;
            font-size: 20px;
        }

        .social-icon-btn {
            border-radius: 50%;
            background: var(--brand);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            box-shadow: var(--shadow-brand);
            transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
        }

        .social-icon-btn:hover {
            transform: scale(1.1);
            background: var(--brand-dark);
        }

        .social-icon-btn:active {
            transform: scale(0.95);
        }

        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0.5);
            }

            70% {
                box-shadow: 0 0 0 12px rgba(var(--brand-rgb), 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0);
            }
        }

        /* ===== НИЖНЯЯ ПАНЕЛЬ ПРОФИЛЯ ВЫСОТ ===== */
        .elevation-toggle-btn {
            position: absolute;
            bottom: 20px;
            right: 20px;
            z-index: 999;
            background: var(--brand);
            color: white;
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            font-size: 16px;
            cursor: pointer;
            box-shadow: var(--shadow-brand);
            transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
        }

        .elevation-toggle-btn:hover {
            transform: scale(1.1);
        }

        .elevation-toggle-btn:active {
            transform: scale(0.95);
        }

        .elevation-toggle-btn.active {
            background: #4CAF50;
        }

        .elevation-drawer {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.96);
            backdrop-filter: blur(8px);
            box-shadow: 0 -8px 28px rgba(var(--ink-rgb), 0.14);
            z-index: 1000;
            transform: translateY(100%);
            transition: transform var(--dur-slow) var(--ease-drawer);
            max-height: min(300px, 60vh);
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            padding: 10px 16px;
        }

        .elevation-drawer.open {
            transform: translateY(0);
        }

        .elevation-drawer-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 600;
            font-size: 13px;
            color: #333;
            margin-bottom: 6px;
            flex-shrink: 0;
        }

        .elevation-drawer-close {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 14px;
            color: #888;
            padding: 4px;
        }

        .elevation-drawer-close:hover {
            color: #333;
        }

        .elevation-drawer-body {
            flex: 1;
            min-height: 120px;
            position: relative;
        }

        .elevation-drawer-body canvas {
            width: 100% !important;
            height: 100% !important;
        }

        .elevation-drawer .profile-stats {
            flex-shrink: 0;
        }

        /* В нижней панели места по ширине хватает — держим все 5 плашек в один ряд,
           чтобы они не переносились и не съезжали за пределы экрана */
        .elevation-drawer .profile-stats .profile-stat {
            flex: 1 1 0;
            min-width: 0;
        }

        .elevation-drawer .profile-stat-label,
        .elevation-drawer .profile-stat-value {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .elevation-drawer-body {
            min-height: 90px;
        }

        /* Строка из графиков в режиме "Оба" (маршрут + сегменты) — два столбца
           50/50 вместо друг-под-другом, чтобы под графиками оставалось место для
           статистики без прокрутки. Когда виден только один столбец (обычный режим
           "Маршрут"/"Сегменты" — второй скрыт display:none), flex сам растягивает
           единственный видимый столбец на всю ширину — отдельный CSS-класс на
           "одиночный" режим не нужен. */
        .profile-charts-row {
            display: flex;
            gap: 8px;
            min-width: 0;
        }

        .profile-chart-col {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
        }

        .elevation-drawer .profile-charts-row {
            flex: 1;
            min-height: 0;
        }

        .profile-charts-row .profile-chart-label {
            margin-top: 0;
        }

        /* ===== КМ-МЕТКИ (сегменты и маршрут) ===== */
        /* Полупрозрачные, без цветной (брендовой) заливки — чтобы не перекрывать
           карту и не спорить по цвету с линией маршрута, только тонкая обводка. */
        .km-label {
            background: rgba(255, 255, 255, 0.45);
            color: var(--ink);
            border-radius: 50%;
            width: 24px;
            height: 24px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 7px;
            font-weight: 700;
            border: 1px solid rgba(255, 255, 255, 0.7);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
            line-height: 1;
            opacity: 0.8;
        }

        .km-label .num {
            font-size: 10px;
            margin-top: -1px;
        }

        .km-label .unit {
            font-size: 5px;
            opacity: 0.8;
            margin-top: -2px;
        }

        /* ===== АДМИНКА ===== */
        .cabinet-nav-divider {
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            margin: 8px 4px;
        }

        .admin-tab-content {
            display: none;
        }

        .admin-tab-content.active {
            display: block;
        }

        .admin-panel {
            background: white;
            border-radius: var(--radius-md);
            padding: 20px 24px;
            box-shadow: var(--shadow-sm);
            margin-bottom: 20px;
        }

        .setting-item {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 14px;
        }

        .setting-item:last-child {
            margin-bottom: 0;
        }

        .setting-item label,
        .setting-item-label {
            width: 140px;
            flex-shrink: 0;
            font-weight: 600;
            font-size: 13px;
            color: #333;
        }

        .setting-item.column {
            flex-direction: column;
            align-items: stretch;
        }

        .setting-item.column label,
        .setting-item.column .setting-item-label {
            width: auto;
        }

        .setting-item input[type="text"],
        .setting-item textarea {
            flex: 1;
            padding: 8px 10px;
            border: 1px solid #ddd;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-family: inherit;
            transition: border-color var(--dur-base) var(--ease-out);
        }

        .setting-item input[type="text"]:focus,
        .setting-item textarea:focus {
            outline: none;
            border-color: var(--brand);
        }

        /* Textarea, растягиваемые по высоте контента через autoGrowTextarea() —
           без ручного изменения размера и внутренней прокрутки, чтобы весь текст
           было видно сразу, а не листать ползунком в маленьком окне.
           flex:none обязателен: унаследованный flex:1 (flex-basis:0%) во флекс-колонке
           .setting-item.column иначе пересчитывает высоту заново при каждом layout,
           перебивая высоту, выставленную через style.height в JS. */
        .setting-item textarea,
        .admin-block-card-fields textarea {
            flex: none;
            resize: none;
            overflow: hidden;
            min-height: 2.4em;
        }

        .admin-pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
            margin-top: 16px;
            font-size: 13px;
            color: #666;
        }

        .admin-pagination button:disabled {
            opacity: 0.5;
            cursor: default;
        }

        .admin-empty-state {
            color: #888;
            text-align: center;
            padding: 40px 0;
            font-size: 14px;
        }

        .admin-btn {
            padding: 8px 20px;
            border: none;
            border-radius: var(--radius-sm);
            background: var(--brand);
            color: white;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .admin-btn:hover {
            background: var(--brand-dark);
        }

        .admin-btn:active {
            transform: scale(0.97);
        }

        .admin-btn.secondary {
            background: #f0f0f0;
            color: #333;
        }

        .admin-btn-file {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .admin-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 14px;
        }

        .admin-panel-header h3 {
            font-size: 15px;
            color: #333;
        }

        .admin-panel-hint {
            font-size: 12px;
            color: #888;
            margin: -6px 0 14px;
        }

        .admin-block-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 14px;
        }

        .admin-block-card {
            border: 1px solid #e5e5e5;
            border-radius: 10px;
            padding: 12px 14px;
            display: flex;
            gap: 10px;
            align-items: flex-start;
        }

        .admin-block-card-fields {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 8px;
            min-width: 0;
        }

        .admin-block-card-fields input[type="text"],
        .admin-block-card-fields textarea,
        .admin-block-card-fields select {
            width: 100%;
            padding: 6px 8px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 13px;
            font-family: inherit;
        }

        .admin-block-card-controls {
            display: flex;
            flex-direction: column;
            gap: 4px;
            flex-shrink: 0;
        }

        .admin-block-card-controls button {
            width: 28px;
            height: 28px;
            border: none;
            border-radius: 6px;
            background: #f0f0f0;
            color: #555;
            cursor: pointer;
            font-size: 12px;
        }

        .admin-block-card-controls button:hover {
            background: #e0e0e0;
        }

        .admin-block-card-controls button:disabled {
            opacity: 0.35;
            cursor: default;
        }

        .admin-block-card-controls button.remove {
            color: #f44336;
        }

        .admin-icon-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .admin-icon-row input[type="text"] {
            flex: 1;
        }

        .admin-icon-row select {
            width: auto;
            flex-shrink: 0;
        }

        .admin-icon-preview {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 30px;
            height: 30px;
            border-radius: 8px;
            background: rgba(var(--brand-rgb), 0.1);
            color: var(--brand);
            font-size: 14px;
            flex-shrink: 0;
        }

        .admin-upload-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .admin-upload-row input[type="text"] {
            flex: 1;
            min-width: 120px;
        }

        .admin-media-preview {
            max-width: 160px;
            max-height: 90px;
            border-radius: 6px;
            display: block;
            margin-top: 4px;
            object-fit: cover;
        }

        .admin-hero-preview-row {
            display: flex;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
        }

        /* ---- Дашборд ---- */
        .dash-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 14px;
            margin-bottom: 20px;
        }

        .admin-stat-card {
            background: white;
            border-radius: 12px;
            padding: 16px 18px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }

        .dash-stat-value {
            font-size: 1.7rem;
            font-weight: 800;
            color: var(--ink);
        }

        .dash-stat-label {
            font-size: 12px;
            color: #888;
            margin-top: 2px;
        }

        .dash-stat-sub {
            font-size: 11px;
            color: var(--brand);
            font-weight: 700;
            margin-top: 6px;
        }

        .dash-charts-row {
            display: grid;
            grid-template-columns: 1.4fr 1fr;
            gap: 16px;
            margin-bottom: 20px;
        }

        .dash-chart-panel {
            min-width: 0;
        }

        .dash-period-toggle {
            display: flex;
            gap: 4px;
            flex-shrink: 0;
        }

        .dash-period-btn {
            padding: 4px 10px;
            border: 1px solid #ddd;
            border-radius: 8px;
            background: white;
            font-size: 12px;
            font-weight: 600;
            color: #666;
            cursor: pointer;
            transition: 0.15s;
        }

        .dash-period-btn:hover {
            border-color: var(--brand);
        }

        .dash-period-btn.active {
            border-color: var(--brand);
            background: rgba(var(--brand-rgb), 0.08);
            color: var(--brand);
        }

        .dash-custom-range-form {
            display: none;
            align-items: center;
            gap: 10px;
            margin-top: 12px;
            flex-wrap: wrap;
        }

        .dash-custom-range-form.open {
            display: flex;
        }

        .dash-custom-range-form .setting-item {
            margin-bottom: 0;
        }

        .dash-custom-range-form input[type="date"] {
            padding: 6px 8px;
            border: 1px solid #ddd;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-family: inherit;
        }

        /* Отдельный контейнер строго под сам canvas (не считая заголовка панели) —
           иначе высота, выставленная на всю .admin-panel, включала заголовок и
           смещала диаграмму вниз/обрезала её. */
        .dash-chart-canvas-wrap {
            position: relative;
            width: 100%;
            height: 220px;
        }

        .dash-usage-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 14px;
        }

        .dash-usage-item {
            text-align: center;
            padding: 10px;
            background: #f7f8f8;
            border-radius: 10px;
        }

        .dash-usage-value {
            font-size: 1.3rem;
            font-weight: 800;
            color: var(--brand);
        }

        .dash-usage-label {
            font-size: 11px;
            color: #777;
            margin-top: 2px;
        }

        .dash-lists-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 16px;
            margin-bottom: 20px;
        }

        .dash-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .dash-list li {
            display: flex;
            justify-content: space-between;
            gap: 8px;
            font-size: 13px;
            padding-bottom: 8px;
            border-bottom: 1px solid #f0f0f0;
        }

        .dash-list li:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .dash-list .dash-list-name {
            color: #333;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .dash-list .dash-list-value {
            color: var(--brand);
            font-weight: 700;
            flex-shrink: 0;
        }

        .admin-hero-preview-row img {
            width: 160px;
            height: 90px;
            object-fit: cover;
            border-radius: 8px;
            border: 1px solid #eee;
        }

        /* ---- Редактор форматированного текста (Quill) ---- */
        .rich-editor {
            background: white;
            margin-bottom: 4px;
        }

        .rich-editor .ql-editor {
            min-height: 90px;
            font-size: 13px;
        }

        .admin-block-card-fields .rich-editor {
            width: 100%;
        }

        /* ---- Картинка с шириной и подписью (кастомный Quill-блот .mw-rich-image) ---- */
        /* В самой админке превью пропорционально выбранной ширине, но со своим
           куда более скромным потолком (90-320px, не проценты) — иначе крупное
           фото раздувало бы редактор (жалоба пользователя). Ступени РАЗНЫЕ по
           размеру специально: если 25% и 100% выглядели бы в редакторе
           одинаково (как было раньше, единый потолок 160×120 для всех) —
           непонятно, применилась ли вообще выбранная ширина (второй фидбек
           пользователя). Специфичность этих правил (3 класса + атрибут) выше
           паблик-правил с [data-width] ниже (1 класс + атрибут), так что в
           админке побеждают именно они, а не реальные проценты.*/
        .rich-editor .ql-editor .mw-rich-image {
            margin: 8px 0;
            text-align: center;
        }

        .rich-editor .ql-editor .mw-rich-image img {
            width: auto;
            height: auto;
            object-fit: contain;
            border-radius: 4px;
            cursor: pointer;
            max-width: 160px;
            max-height: 130px;
        }

        .rich-editor .ql-editor .mw-rich-image[data-width="25"] img { max-width: 90px; max-height: 90px; }
        .rich-editor .ql-editor .mw-rich-image[data-width="50"] img { max-width: 160px; max-height: 130px; }
        .rich-editor .ql-editor .mw-rich-image[data-width="75"] img { max-width: 240px; max-height: 170px; }
        .rich-editor .ql-editor .mw-rich-image[data-width="100"] img { max-width: 320px; max-height: 220px; }

        .rich-editor .ql-editor .mw-rich-image figcaption {
            font-size: 11px;
            opacity: 0.65;
            margin: 2px 0;
        }

        .rich-editor .ql-editor .mw-rich-image::after {
            content: 'Двойной клик — изменить ширину/подпись';
            display: block;
            font-size: 10.5px;
            opacity: 0.45;
        }

        /* Публичный показ (лендинг/кабинет/модалки) — реальная выбранная ширина */
        .mw-rich-image {
            margin: 16px auto;
            text-align: center;
        }

        .mw-rich-image img {
            max-width: 100%;
            height: auto;
            border-radius: 8px;
            display: block;
            margin: 0 auto;
        }

        .mw-rich-image[data-width="25"] img { width: 25%; }
        .mw-rich-image[data-width="50"] img { width: 50%; }
        .mw-rich-image[data-width="75"] img { width: 75%; }
        .mw-rich-image[data-width="100"] img { width: 100%; }

        .mw-rich-image figcaption {
            font-size: 0.85em;
            opacity: 0.7;
        }

        .mw-rich-image figcaption:first-child { margin: 0 0 6px; }
        .mw-rich-image figcaption:last-child { margin: 6px 0 0; }

        /* Подстраховка для старых картинок, вставленных ДО появления этого
           блота (голый <img> без обёртки) — просто не должны переполнять контейнер. */
        .ql-editor img:not(.mw-rich-image img) {
            max-width: 100%;
            height: auto;
        }
        .landing-about-text img:not(.mw-rich-image img),
        .landing-block-body img:not(.mw-rich-image img) {
            max-width: 100%;
            height: auto;
            border-radius: 8px;
        }

        /* ---- Модалка "Параметры картинки" ---- */
        .rich-image-options-preview {
            display: block;
            max-width: 100%;
            max-height: 160px;
            width: auto;
            margin: 4px auto 14px;
            border-radius: 8px;
            object-fit: contain;
        }

        .rich-image-option-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 7px;
        }

        .rich-image-option-pill {
            padding: 7px 15px;
            border-radius: var(--radius-pill, 999px);
            border: 1px solid #ddd;
            background: #f5f5f5;
            color: #444;
            font-family: inherit;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }

        .rich-image-option-pill:hover {
            background: #eee;
        }

        .rich-image-option-pill.active {
            background: var(--brand);
            border-color: var(--brand);
            color: white;
        }

        /* Quill не знает форматы "upper"/"lower" — свои кнопки регистра букв,
           подписываем текстом вместо иконки (которой для них нет). */
        .ql-toolbar .ql-upper,
        .ql-toolbar .ql-lower {
            width: auto !important;
            padding: 0 6px !important;
            font-size: 11px;
            font-weight: 700;
        }

        .ql-toolbar .ql-upper::before {
            content: "ABC";
        }

        .ql-toolbar .ql-lower::before {
            content: "abc";
        }

        .admin-user-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }

        .admin-user-table th,
        .admin-user-table td {
            padding: 6px 10px;
            border-bottom: 1px solid #eee;
            text-align: left;
        }

        .admin-user-table th {
            background: #f5f5f5;
        }

        /* Строка фичи без единого события — приглушена, чтобы «живые» фичи
           выделялись, но новые всё равно были видны в списке. */
        .admin-user-table tr.feature-row-zero td {
            color: #999;
        }

        .admin-user-table .btn-sm {
            padding: 4px 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
        }

        .admin-user-table .btn-sm.danger {
            background: #f44336;
            color: white;
        }

        .admin-user-table .btn-sm.danger:hover {
            background: #d32f2f;
        }

        .admin-user-table .btn-sm.primary {
            background: var(--brand);
            color: white;
        }

        .admin-user-table .btn-sm.primary:hover {
            background: var(--brand-dark);
        }

        .admin-user-table .role-select {
            padding: 2px 4px;
            border-radius: 4px;
            border: 1px solid #ddd;
        }

        /* ===== ЛИЧНЫЙ КАБИНЕТ ===== */
        .cabinet-layout {
            display: flex;
            height: 100vh;
            height: 100dvh;
            background: #f5f6f7;
        }

        .cabinet-sidebar {
            width: 220px;
            flex-shrink: 0;
            background: var(--ink);
            color: rgba(255, 255, 255, 0.85);
            display: flex;
            flex-direction: column;
            padding: 20px 14px;
        }

        /* Кнопка-гамбургер и подложка для мобильного off-canvas меню — значимы
           только на мобильных (см. @media ниже), на десктопе сайдбар всегда открыт. */
        .cabinet-mobile-toggle {
            display: none;
            position: fixed;
            top: 10px;
            left: 10px;
            width: 38px;
            height: 38px;
            border-radius: 8px;
            border: none;
            background: var(--ink);
            color: white;
            font-size: 16px;
            cursor: pointer;
            z-index: 2600;
            align-items: center;
            justify-content: center;
        }

        .cabinet-sidebar-backdrop {
            display: none;
        }

        .cabinet-logo {
            font-size: 1.15rem;
            font-weight: 800;
            letter-spacing: -0.01em;
            color: white;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0 8px;
            margin-bottom: 24px;
        }

        .cabinet-logo i {
            color: var(--brand);
        }

        .cabinet-nav {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .cabinet-nav-item {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 10px 12px;
            border: none;
            border-radius: var(--radius-sm);
            background: transparent;
            color: rgba(255, 255, 255, 0.75);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
            text-align: left;
        }

        .cabinet-nav-item i {
            width: 16px;
            text-align: center;
        }

        .cabinet-nav-item:hover {
            background: rgba(255, 255, 255, 0.08);
            color: white;
        }

        .cabinet-nav-item:active {
            transform: scale(0.98);
        }

        .cabinet-nav-item.active {
            background: var(--brand);
            color: white;
        }

        .cabinet-nav-count {
            margin-left: auto;
            background: rgba(255, 255, 255, 0.15);
            border-radius: var(--radius-pill);
            padding: 1px 7px;
            font-size: 11px;
            font-variant-numeric: tabular-nums;
        }

        .cabinet-nav-item.active .cabinet-nav-count {
            background: rgba(0, 0, 0, 0.2);
        }

        /* ===== ПАПКИ МАРШРУТОВ (КАБИНЕТ) ===== */
        .cabinet-nav-section-label {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: rgba(255, 255, 255, 0.4);
            padding: 4px 12px;
            margin-top: 2px;
        }

        .folder-item {
            padding-right: 6px;
        }

        .folder-item-name {
            display: flex;
            align-items: center;
            gap: 10px;
            flex: 1;
            min-width: 0;
            cursor: pointer;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .folder-icon-btn {
            background: transparent;
            border: none;
            color: inherit;
            opacity: 0.5;
            cursor: pointer;
            padding: 2px 4px;
            font-size: 11px;
            border-radius: var(--radius-sm);
            transition: opacity var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
        }

        .folder-icon-btn:hover {
            opacity: 1;
        }

        .route-folder-select {
            width: 100%;
            margin-top: 8px;
            padding: 5px 8px;
            border: 1px solid #ddd;
            border-radius: var(--radius-sm);
            font-size: 11px;
            color: #666;
            background: #fafafa;
            transition: border-color var(--dur-base) var(--ease-out);
        }

        .route-folder-select:hover {
            border-color: var(--brand);
        }

        .cabinet-main {
            flex: 1;
            overflow-y: auto;
            padding: 28px 32px;
        }

        .cabinet-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
        }

        .cabinet-header h1 {
            font-size: 1.7rem;
            font-weight: 800;
            letter-spacing: -0.015em;
            color: #1a1a1a;
        }

        .cabinet-header-controls {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* Переключатель "Сетка / Список" над списком маршрутов — см.
           setCabinetRouteViewMode() в js/routes.js. */
        .cabinet-view-toggle {
            display: flex;
            gap: 2px;
            padding: 3px;
            border-radius: var(--radius-sm);
            background: #eef0f0;
        }

        .cabinet-view-toggle-btn {
            width: 30px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            border-radius: calc(var(--radius-sm) - 2px);
            background: none;
            color: #888;
            cursor: pointer;
            font-size: 13px;
            transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
        }

        .cabinet-view-toggle-btn:hover {
            color: var(--brand);
        }

        .cabinet-view-toggle-btn.active {
            background: white;
            color: var(--brand);
            box-shadow: var(--shadow-sm);
        }

        .cabinet-sort {
            padding: 8px 14px;
            border: 1px solid #ddd;
            border-radius: var(--radius-sm);
            background: white;
            font-size: 13px;
            font-weight: 600;
            color: #333;
            cursor: pointer;
            transition: border-color var(--dur-base) var(--ease-out);
        }

        .cabinet-sort:hover {
            border-color: var(--brand);
        }

        .route-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 18px;
        }

        /* Лёгкий stagger при первом рендере списка — карточки не должны просто
           "выпрыгивать" все разом (Emil: появление без перехода выглядит
           сломанным). До 10 карточек получают нарастающую задержку, дальше все
           стартуют вместе с последней задержкой — не растягиваем ожидание. */
        @media (prefers-reduced-motion: no-preference) {
            .route-list .route-card {
                /* fill-mode: backwards (не both/forwards) — после завершения
                   анимации transform должен полностью вернуться под контроль
                   обычного каскада, иначе held-эффект keyframe перебивает
                   transition на :hover (анимации имеют приоритет над
                   transition для одного и того же свойства). */
                animation: routeCardIn 0.42s var(--ease-out) backwards;
            }

            .route-list .route-card:nth-child(1) { animation-delay: 0ms; }
            .route-list .route-card:nth-child(2) { animation-delay: 40ms; }
            .route-list .route-card:nth-child(3) { animation-delay: 80ms; }
            .route-list .route-card:nth-child(4) { animation-delay: 120ms; }
            .route-list .route-card:nth-child(5) { animation-delay: 160ms; }
            .route-list .route-card:nth-child(6) { animation-delay: 200ms; }
            .route-list .route-card:nth-child(7) { animation-delay: 240ms; }
            .route-list .route-card:nth-child(8) { animation-delay: 280ms; }
            .route-list .route-card:nth-child(n+9) { animation-delay: 320ms; }
        }

        @keyframes routeCardIn {
            from {
                opacity: 0;
                transform: translateY(10px) scale(0.98);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* Пояснение про автоудаление в корзине — растягивается на всю ширину
           грида .route-list (карточки маршрутов — grid-элементы, эта плашка нет). */
        .cabinet-trash-notice {
            grid-column: 1 / -1;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            background: #f0f2f2;
            border-radius: var(--radius-sm);
            font-size: 12px;
            color: #666;
        }

        .route-card {
            background: white;
            border-radius: var(--radius-md);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
        }

        .route-card:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-md);
        }

        /* transform на .route-card создаёт containing block для position:fixed
           потомков (.download-menu) — пока меню открыто, оно вместо viewport
           позиционируется от карточки и обрезается её overflow:hidden. Убираем
           transform на время открытого меню. */
        .route-card.menu-open,
        .route-card.menu-open:hover {
            transform: none;
        }

        .route-thumb {
            height: 120px;
            /* Заливка-заглушка на случай пустой геометрии/пока грузится картинка карты */
            background: linear-gradient(135deg, var(--brand) 0%, var(--brand-darker) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .route-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .route-thumb i {
            font-size: 2.4rem;
            color: rgba(255, 255, 255, 0.5);
        }

        .route-card-body {
            padding: 10px 12px;
        }

        .route-card .route-name {
            font-weight: 700;
            font-size: 14.5px;
            letter-spacing: -0.005em;
            color: #1a1a1a;
        }

        .route-card .route-description {
            font-size: 12px;
            color: #666;
            margin: 3px 0;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        .route-card .route-meta {
            display: flex;
            gap: 12px;
            font-size: 11px;
            color: #666;
            flex-wrap: wrap;
            margin: 4px 0;
        }

        /* Тумблер публичного доступа прямо на карточке в кабинете — переиспользует
           .seg-include-checkbox (та же тумблерная стилистика, что и у сегментов). */
        .route-public-toggle {
            display: flex;
            align-items: center;
            font-size: 11px;
            color: #666;
            cursor: pointer;
            margin: 2px 0;
        }

        .route-card .route-actions {
            display: flex;
            /* Кнопки переносятся на следующий ряд целиком, если не помещаются в
               ширину карточки (например, "Восстановить" + "Удалить навсегда" в
               корзине на узкой карточке) — раньше текст просто обрезался. */
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 6px;
            justify-content: flex-end;
        }

        .route-card .route-actions button {
            background: none;
            border: none;
            color: #888;
            cursor: pointer;
            font-size: 13px;
            padding: 4px 7px;
            border-radius: var(--radius-sm);
            /* Надпись кнопки не ломается посреди слова — переносится кнопка целиком */
            white-space: nowrap;
            transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .route-card .route-actions button:active {
            transform: scale(0.9);
        }

        .route-card .route-actions .restore-btn {
            color: var(--brand);
        }

        .route-card .route-actions .restore-btn:hover {
            background: rgba(var(--brand-rgb), 0.1);
        }

        .route-card .route-actions .delete-btn {
            color: #c05050;
        }

        .route-card .route-actions .delete-btn:hover {
            background: rgba(192, 80, 80, 0.1);
        }

        .route-card .route-actions .share-btn {
            color: var(--brand);
        }

        .route-card .route-actions .share-btn:hover {
            background: rgba(var(--brand-rgb), 0.1);
        }

        .route-card .route-actions .edit-btn {
            color: #8a6d3b;
        }

        .route-card .route-actions .edit-btn:hover {
            background: rgba(138, 109, 59, 0.1);
        }

        .route-card .route-actions .download-btn {
            color: var(--brand);
        }

        .route-card .route-actions .download-btn:hover {
            background: rgba(var(--brand-rgb), 0.1);
        }

        /* ==================================================================
           Компактный вид списка маршрутов (.route-list.view-list) — та же
           разметка .route-card, что и в сетке, CSS просто перекладывает её в
           горизонтальную строку: маленькая миниатюра слева, остальное — гибкая
           строка справа, которая сама переносится на второй ряд на узких
           экранах (см. setCabinetRouteViewMode() в js/routes.js).
           ================================================================== */
        .route-list.view-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .route-list.view-list .route-card {
            display: flex;
            align-items: center;
        }

        .route-list.view-list .route-card:hover {
            transform: none;
        }

        .route-list.view-list .route-thumb {
            width: 64px;
            height: 64px;
            flex-shrink: 0;
        }

        .route-list.view-list .route-thumb i {
            font-size: 1.4rem;
        }

        .route-list.view-list .route-card-body {
            flex: 1;
            min-width: 0;
            padding: 8px 14px;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 4px 18px;
        }

        .route-list.view-list .route-name {
            flex-shrink: 0;
            max-width: 240px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .route-list.view-list .route-description {
            display: none;
        }

        .route-list.view-list .route-meta {
            margin: 0;
            flex-shrink: 0;
        }

        .route-list.view-list .route-public-toggle {
            margin: 0;
            flex-shrink: 0;
        }

        .route-list.view-list .route-actions {
            margin: 0;
            margin-left: auto;
        }

        .route-list.view-list .route-folder-select {
            width: auto;
            max-width: 150px;
            margin: 0;
        }

        @media (max-width: 768px) {
            .route-list.view-list .route-card-body {
                gap: 4px 12px;
            }

            .route-list.view-list .route-actions {
                margin-left: 0;
            }
        }

        /* ===== ТОЧКА МАРШРУТА (маленький кружок с точкой внутри, без редактирования) ===== */
        .route-point-icon {
            background: none !important;
            border: none !important;
        }

        .route-point-dot {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #fff;
            border: 2px solid var(--brand);
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
            position: relative;
        }

        .route-point-dot::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: var(--brand);
            transform: translate(-50%, -50%);
        }

        /* ===== МАРКЕР МЕТКИ (убраны квадратики) ===== */
        .custom-marker .leaflet-marker-icon {
            background: none !important;
            border: none !important;
            box-shadow: none !important;
        }

        .custom-marker {
            background: none !important;
            border: none !important;
        }

        /* ===== ПОПАП МЕТКИ (редизайн) ===== */
        .mark-popup {
            display: flex;
            flex-direction: column;
            gap: 10px;
            min-width: 230px;
        }

        .mark-color-row {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        .mark-color-swatch {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 10px;
            padding: 0;
            box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6);
            transition: transform 0.15s;
        }

        .mark-color-swatch:hover {
            transform: scale(1.1);
        }

        .mark-color-swatch.selected {
            box-shadow: 0 0 0 2px white, 0 0 0 3.5px var(--ink);
        }

        .mark-type-select {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            border: 1px solid #ddd;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            color: #333;
        }

        .mark-type-select i.fas:first-child {
            color: var(--brand);
            width: 16px;
            text-align: center;
        }

        .mark-type-chevron {
            margin-left: auto;
            font-size: 10px;
            color: #999;
        }

        .mark-icon-picker {
            max-height: 180px;
            overflow-y: auto;
            border: 1px solid #eee;
            border-radius: 8px;
            padding: 8px;
            background: #fafafa;
        }

        .mark-icon-group-label {
            font-size: 11px;
            font-weight: 700;
            color: #666;
            margin: 6px 0 4px;
            text-transform: uppercase;
        }

        .mark-icon-group-label:first-child {
            margin-top: 0;
        }

        .mark-icon-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 4px;
        }

        .mark-icon-option {
            width: 30px;
            height: 30px;
            border: none;
            border-radius: 6px;
            background: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #444;
            font-size: 13px;
            transition: background 0.15s;
        }

        .mark-icon-option:hover {
            background: rgba(var(--brand-rgb), 0.12);
            color: var(--brand);
        }

        .mark-popup input[type="text"],
        .mark-popup textarea {
            width: 100%;
            padding: 7px 9px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 13px;
            font-family: inherit;
        }

        .mark-popup textarea {
            min-height: 50px;
            resize: vertical;
        }

        .mark-coords {
            font-size: 11px;
            color: #999;
        }

        /* Попап метки в режиме "только просмотр" (createMarkPopup(id, true), см.
           js/marks.js) — текст названия/заметки вместо редактируемых полей. */
        .mark-popup-note {
            font-size: 12px;
            color: #444;
            white-space: pre-wrap;
        }

        .mark-popup-actions {
            display: flex;
            gap: 8px;
        }

        .mark-btn-primary,
        .mark-btn-secondary {
            flex: 1;
            padding: 8px;
            border: none;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
        }

        .mark-btn-primary {
            background: var(--brand);
            color: white;
        }

        .mark-btn-primary:hover {
            background: var(--brand-dark);
        }

        .mark-btn-secondary {
            background: #f5f5f5;
            color: #c62828;
        }

        .mark-btn-secondary:hover {
            background: #ffebee;
        }

        /* ===== КАРТА ===== */
        #map {
            height: 100%;
            width: 100%;
        }

        /* ===== ОСТАЛЬНОЕ (профиль, карта) ===== */
        .profile-container {
            width: 100%;
            max-height: 140px;
            margin-top: 4px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 8px;
            padding: 4px;
            overflow: hidden;
        }

        .profile-container canvas {
            width: 100% !important;
            height: 100px !important;
        }

        .profile-placeholder {
            color: #999;
            font-size: 11px;
            text-align: center;
            padding: 20px 0;
        }

        /* Подпись над графиком в режиме "Оба" (маршрут + сегменты) — видна только
           когда на экране два графика подряд, иначе не нужна (заголовок панели уже
           говорит, что именно показано). */
        .profile-chart-label {
            font-size: 10px;
            font-weight: 700;
            color: #777;
            margin: 6px 0 2px;
        }

        .profile-stats {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 6px;
        }

        .profile-stat {
            flex: 1 1 40%;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 6px;
            padding: 4px 6px;
            text-align: center;
            color: #333;
        }

        .profile-stat-label {
            font-size: 9px;
            color: #666;
            white-space: nowrap;
        }

        .profile-stat-value {
            font-size: 13px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }

        .profile-stat i {
            color: var(--brand);
            margin-right: 3px;
        }

        .profile-source-switch {
            display: flex;
            gap: 4px;
            margin: 4px 0;
        }

        .profile-switch-btn {
            flex: 1;
            padding: 4px 8px;
            font-size: 10px;
            font-weight: 600;
            border: none;
            border-radius: 6px;
            background: var(--brand);
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 3px;
            white-space: nowrap;
            transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .profile-switch-btn:hover {
            background: var(--brand-dark);
        }

        .profile-switch-btn:active {
            transform: scale(0.96);
        }

        .elevation-drawer-header .profile-source-switch {
            margin: 0 10px;
            flex: 1;
            max-width: 260px;
        }

        .profile-seg-toggles {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin: 2px 0 6px;
            max-height: 60px;
            overflow-y: auto;
            flex-shrink: 0;
        }

        /* В правой панели (вкладка "Профиль") места по вертикали больше, чем в
           нижней шторке — при многих сегментах даём блоку чипов расти выше,
           чтобы не приходилось скроллить его в три строки. */
        #panel-profile .profile-seg-toggles {
            max-height: 180px;
        }

        /* Чип сегмента в профиле — фон целиком в цвет сегмента (раньше был лишь
           тонкий цветной кантик слева, его было плохо видно). Выключенный из
           статистики чип приглушается. */
        .profile-seg-toggle {
            display: flex;
            align-items: center;
            gap: 3px;
            font-size: 10px;
            background: var(--seg-color, var(--brand));
            color: #fff;
            font-weight: 600;
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
            border-radius: 10px;
            padding: 2px 8px 2px 4px;
            cursor: pointer;
            white-space: nowrap;
        }

        .profile-seg-toggle:has(input:not(:checked)) {
            opacity: 0.5;
        }

        /* Переключатели-тумблеры в цвет темы (вместо стандартных чекбоксов
           браузера) — включение сегмента в общую статистику и в профиль высот */
        .seg-include-checkbox,
        .profile-seg-toggle input {
            appearance: none;
            -webkit-appearance: none;
            width: 26px;
            height: 15px;
            background: #dcdfdf;
            border-radius: 999px;
            position: relative;
            cursor: pointer;
            flex-shrink: 0;
            margin-right: 5px;
            transition: background 0.2s;
        }

        .seg-include-checkbox::before,
        .profile-seg-toggle input::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 11px;
            height: 11px;
            background: white;
            border-radius: 50%;
            transition: transform 0.2s;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        }

        .seg-include-checkbox:checked,
        .profile-seg-toggle input:checked {
            background: var(--brand);
        }

        .seg-include-checkbox:checked::before,
        .profile-seg-toggle input:checked::before {
            transform: translateX(11px);
        }

        .map-selector {
            display: flex;
            gap: 4px;
        }

        /* ===== ВИДЖЕТ ДЛЯ ВСТРАИВАНИЯ (?widget=shareId) ===== */
        #widgetScreen {
            position: relative;
        }

        .widget-stats-overlay {
            /* left:56px, а не 12px — иначе карточка перекрывается зум-контролами
               Leaflet (те стоят в стандартной позиции top-left). То же смещение
               уже используется для .search-box на основной карте по той же причине. */
            position: absolute;
            top: 8px;
            left: 56px;
            z-index: 999;
            background: rgba(255, 255, 255, 0.92);
            border-radius: 10px;
            padding: 10px 14px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            font-size: 12px;
            color: #333;
            max-width: 220px;
        }

        .widget-stat-name {
            font-weight: 700;
            margin-bottom: 4px;
        }

        .widget-stat-row {
            display: flex;
            gap: 12px;
            color: #666;
        }

        .widget-branding {
            position: absolute;
            bottom: 8px;
            right: 8px;
            z-index: 999;
            background: rgba(255, 255, 255, 0.85);
            color: var(--brand-dark);
            font-size: 11px;
            font-weight: 700;
            padding: 3px 8px;
            border-radius: 6px;
            text-decoration: none;
        }

        .widget-error {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: #888;
            font-size: 14px;
        }

        /* ===== ТОЧКИ ИНТЕРЕСА (вода/перевалы/транспорт) ===== */
        .poi-marker-icon {
            background: none !important;
            border: none !important;
        }

        .poi-marker-dot {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 11px;
            border: 2px solid white;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        }

        /* Кластеры Leaflet.markercluster (см. createPoiClusterGroup, js/poi.js) —
           переопределяем дефолтную жёлто-оранжевую раскраску плагина в цвет бренда. */
        .poi-cluster-icon {
            background: none !important;
            border: none !important;
        }

        .poi-cluster-dot {
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 13px;
            background: rgba(var(--brand-rgb), 0.9);
            border: 2px solid white;
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
        }

        .spring-add-report-link {
            display: block;
            margin-top: 8px;
            padding: 6px 10px;
            border-radius: 6px;
            background: rgba(var(--brand-rgb), 0.1);
            color: var(--brand-dark);
            text-decoration: none;
            font-size: 12px;
            font-weight: 600;
            text-align: center;
        }

        .spring-add-report-link:hover {
            background: rgba(var(--brand-rgb), 0.2);
        }

        /* SVG-иконка в местах, где обычно рисуется <i class="fas">, — см.
           markIconMarkup()/MARK_ICON_SVGS в js/map-core.js. em-размеры вместо
           фиксированных px, чтобы подстраивалась под font-size контекста, как и FA. */
        .mark-icon-svg {
            display: inline-flex;
            width: 1em;
            height: 0.85em;
            vertical-align: -0.1em;
        }

        .mark-icon-svg svg {
            width: 100%;
            height: 100%;
        }

        /* Та же геометрия, что у .report-pass-marker (report.js) — см. комментарий
           в createWestraPassIcon (js/poi.js). Цвет border/иконки задаётся инлайн
           по категории сложности, здесь только форма. */
        .westra-pass-marker {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: #fff;
            border-width: 2px;
            border-style: solid;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
        }

        .westra-pass-marker svg {
            width: 15px;
            height: 13px;
        }

        .westra-pass-badge {
            display: inline-block;
            margin-top: 4px;
            padding: 2px 8px;
            border-radius: 10px;
            color: #fff;
            font-size: 12px;
            font-weight: 700;
        }

        .spring-photo-wrap {
            position: relative;
            width: 100%;
            height: 140px;
            border-radius: 6px;
            overflow: hidden;
            margin: 6px 0;
            background: #eee;
        }

        .spring-photo-placeholder {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #bbb;
            font-size: 28px;
        }

        .spring-nav-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 26px;
            height: 26px;
            border-radius: 50%;
            border: none;
            background: rgba(0, 0, 0, 0.45);
            color: white;
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2;
        }

        .spring-nav-btn:hover {
            background: rgba(0, 0, 0, 0.65);
        }

        .spring-nav-prev {
            left: 6px;
        }

        .spring-nav-next {
            right: 6px;
        }

        /* ===== ВКЛАДКА "НАСТРОЙКИ" (отображение меток/км-отметок на карте) ===== */
        .settings-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 12px;
            color: #333;
            padding: 6px 0;
        }

        .settings-radio-row {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: #333;
            padding: 4px 0;
            cursor: pointer;
        }

        .settings-number-input {
            width: 60px;
            padding: 4px 8px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 12px;
            text-align: center;
        }

        /* ===== ПОИСК МЕСТ И АДРЕСОВ ===== */
        .search-box {
            position: absolute;
            top: 8px;
            left: 56px;
            width: 300px;
            z-index: 1001;
        }

        .search-input-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
            padding: 0 12px;
            height: 42px;
            transition: box-shadow var(--dur-base) var(--ease-out);
        }

        .search-input-wrap:focus-within {
            box-shadow: var(--shadow-md), 0 0 0 2px rgba(var(--brand-rgb), 0.35);
        }

        .search-input-wrap i.fa-search {
            color: #888;
            font-size: 13px;
        }

        .search-input-wrap input {
            flex: 1;
            border: none;
            outline: none;
            background: transparent;
            font-size: 13px;
            height: 100%;
            font-family: inherit;
        }

        .search-clear-btn {
            border: none;
            background: transparent;
            color: #999;
            cursor: pointer;
            font-size: 13px;
            padding: 4px;
            display: flex;
            align-items: center;
        }

        .search-clear-btn:hover {
            color: #555;
        }

        .search-results {
            margin-top: 6px;
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            max-height: 320px;
            overflow-y: auto;
        }

        .search-result-item {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 10px 12px;
            cursor: pointer;
            border-bottom: 1px solid rgba(0, 0, 0, 0.06);
            transition: background-color var(--dur-fast) var(--ease-out);
        }

        .search-result-item:last-child {
            border-bottom: none;
        }

        .search-result-item:hover {
            background: rgba(var(--brand-rgb), 0.08);
        }

        .search-result-item i {
            color: var(--brand);
            margin-top: 3px;
            font-size: 13px;
        }

        .search-result-name {
            font-size: 13px;
            font-weight: 600;
            color: #333;
        }

        .search-result-address {
            font-size: 11px;
            color: #666;
        }

        .search-result-empty {
            padding: 12px;
            font-size: 12px;
            color: #999;
            text-align: center;
        }

        .map-btn {
            flex: 1;
            padding: 4px;
            border: 2px solid #ddd;
            border-radius: var(--radius-sm);
            background: white;
            cursor: pointer;
            font-size: 10px;
            font-weight: 600;
            transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
            text-align: center;
        }

        .map-btn:hover {
            border-color: var(--brand);
        }

        .map-btn.active {
            border-color: var(--brand);
            background: rgba(var(--brand-rgb), 0.08);
            color: var(--brand);
        }

        .map-layer-group-label {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.4px;
            color: #999;
            margin: 10px 0 4px;
        }

        /* ===== КНОПКИ-ТРИГГЕРЫ ФЛАУТ-ПАНЕЛЕЙ "СЛОИ"/"МЕСТА" ===== */
        .map-layer-menu-btn {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 11px 12px;
            border: 1px solid #eee;
            border-radius: var(--radius-sm);
            background: white;
            font-size: 13px;
            font-weight: 600;
            color: #333;
            cursor: pointer;
            margin-bottom: 8px;
            transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .map-layer-menu-btn:active {
            transform: scale(0.98);
        }

        .map-layer-menu-btn i:first-child {
            color: var(--brand);
            width: 16px;
            text-align: center;
        }

        .map-layer-menu-btn:hover {
            border-color: var(--brand);
        }

        .map-layer-menu-btn.active {
            border-color: var(--brand);
            background: rgba(var(--brand-rgb), 0.08);
            color: var(--brand);
        }

        .map-layer-menu-chevron {
            margin-left: auto;
            font-size: 11px;
            color: #bbb;
        }

        /* ===== ФЛАУТ-ПАНЕЛИ "СЛОИ"/"МЕСТА" (выезжают слева от правой панели) ===== */
        .map-flyout {
            /* display больше не переключается через display:none/flex — держим
               панель в DOM и скрываем через opacity/scale, чтобы появление можно
               было анимировать (JS только переключает класс .open, см. map-core.js). */
            display: flex;
            position: absolute;
            width: 340px;
            min-width: 280px;
            /* Высота НЕ фиксируется — панель растёт под содержимое (см.
               positionMapFlyout в map-core.js, там задаётся только max-height,
               а не height), у совсем пустых панелей вроде "Инфо" (одна строка)
               раньше был неоправданно большой пустой блок. */
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            z-index: 1001;
            flex-direction: column;
            overflow: hidden;
            /* Ручка растягивания в правом нижнем углу — панель маленькая по
               умолчанию не влезала под длинные списки слоёв/категорий. */
            resize: both;
            /* Выезжает СЛЕВА от правой панели — растёт из точки у правого края,
               откуда физически появляется (transform-origin), а не из центра. */
            transform-origin: right center;
            opacity: 0;
            transform: scale(0.96);
            visibility: hidden;
            pointer-events: none;
            transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
        }

        .map-flyout.open {
            opacity: 1;
            transform: scale(1);
            visibility: visible;
            pointer-events: auto;
            transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
        }

        .flyout-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            font-size: 14px;
            font-weight: 700;
            border-bottom: 1px solid #eee;
            flex-shrink: 0;
        }

        .flyout-close-btn {
            border: none;
            background: none;
            color: #999;
            cursor: pointer;
            font-size: 14px;
            padding: 4px;
        }

        .flyout-close-btn:hover {
            color: #333;
        }

        .flyout-search {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 10px 14px 0;
            padding: 8px 10px;
            border: 1px solid #ddd;
            border-radius: var(--radius-sm);
            color: #999;
            font-size: 12px;
            flex-shrink: 0;
            transition: border-color var(--dur-base) var(--ease-out);
        }

        .flyout-search:focus-within {
            border-color: var(--brand);
        }

        .flyout-search input {
            border: none;
            outline: none;
            flex: 1;
            font-size: 13px;
            font-family: inherit;
            color: #333;
        }

        .flyout-filter-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            padding: 10px 14px 0;
            flex-shrink: 0;
        }

        .flyout-pill {
            border: 1px solid #ddd;
            background: white;
            border-radius: var(--radius-pill);
            padding: 5px 11px;
            font-size: 11px;
            font-weight: 600;
            color: #555;
            cursor: pointer;
            white-space: nowrap;
            transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .flyout-pill:hover {
            border-color: var(--brand);
        }

        .flyout-pill:active {
            transform: scale(0.95);
        }

        .flyout-pill.active {
            background: var(--brand);
            border-color: var(--brand);
            color: white;
        }

        .flyout-sort-row {
            padding: 8px 14px 0;
            flex-shrink: 0;
        }

        .flyout-sort-btn {
            border: none;
            background: none;
            color: var(--brand);
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            padding: 2px 0;
        }

        .flyout-body {
            padding: 10px 14px 14px;
            overflow-y: auto;
            flex: 1;
            /* min-height:0 — без него flex-элемент с overflow:auto не может
               сжаться ниже размера своего контента, из-за чего max-height на
               родителе (.map-flyout) не давал бы включиться внутреннему скроллу
               и панель просто вылезала бы за отведённое место. */
            min-height: 0;
        }

        .map-flyout .admin-panel-hint {
            padding: 0 14px 12px;
            margin: 0;
            flex-shrink: 0;
        }

        .poi-loading-indicator {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 10px 14px 0;
            font-size: 12px;
            color: var(--brand);
        }

        /* ---- Флаут "Места рядом" (js/nearby.js) ---- */
        .nearby-radius-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px 0;
            font-size: 12.5px;
            color: #777;
            flex-shrink: 0;
        }

        .nearby-radius-input {
            width: 64px;
            padding: 5px 8px;
            border: 1px solid #ddd;
            border-radius: var(--radius-sm);
            background: white;
            color: #333;
            font-family: inherit;
            font-size: 13px;
            font-weight: 600;
            text-align: center;
        }

        .nearby-radius-input:focus {
            outline: none;
            border-color: var(--brand);
        }

        .nearby-placeholder {
            font-size: 12.5px;
            color: #888;
            padding: 10px 2px;
            line-height: 1.5;
        }

        .nearby-placeholder.nearby-error {
            color: #c0392b;
        }

        .nearby-card {
            display: flex;
            gap: 10px;
            padding: 10px 0;
            border-bottom: 1px solid #f0f0f0;
        }

        .nearby-card:last-child {
            border-bottom: none;
        }

        .nearby-card-icon {
            flex-shrink: 0;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: rgba(var(--brand-rgb), 0.1);
            color: var(--brand);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
        }

        .nearby-card-body {
            flex: 1;
            min-width: 0;
        }

        .nearby-card-head {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 8px;
        }

        .nearby-card-name {
            font-size: 13px;
            font-weight: 700;
            color: #222;
        }

        .nearby-card-dist {
            flex-shrink: 0;
            font-size: 11.5px;
            font-weight: 600;
            color: var(--brand);
        }

        .nearby-card-category {
            font-size: 11px;
            color: #999;
            margin-top: 1px;
        }

        .nearby-card-thumb {
            display: block;
            width: 100%;
            max-height: 110px;
            object-fit: cover;
            border-radius: var(--radius-sm);
            margin-top: 6px;
        }

        .nearby-card-extract {
            font-size: 12px;
            color: #666;
            line-height: 1.45;
            margin: 6px 0 0;
        }

        .nearby-card-add {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 8px;
            padding: 5px 10px;
            border: 1px solid #ddd;
            border-radius: var(--radius-sm);
            background: white;
            color: #555;
            font-family: inherit;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
        }

        .nearby-card-add:hover {
            background: rgba(var(--brand-rgb), 0.08);
            border-color: var(--brand);
            color: var(--brand);
        }

        /* ---- "Улучшить маршрут" — карточки вариантов пути (js/improve.js) ----
           Панель и плейсхолдеры переиспользуют классы "Мест рядом" (.nearby-*),
           здесь — только своё: шапка карточки со свотчем цвета линии, строка
           статистики, ярлыки-чипы и пояснения к ним. */
        .improve-card {
            padding: 10px 0;
            border-bottom: 1px solid #f0f0f0;
            transition: background var(--dur-fast, 0.15s);
        }

        .improve-card:last-child {
            border-bottom: none;
        }

        .improve-card-focus {
            background: rgba(var(--brand-rgb), 0.07);
            border-radius: var(--radius-sm);
        }

        .improve-card-head {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .improve-card-name {
            flex: 1;
            font-size: 13px;
            font-weight: 700;
            color: #222;
        }

        .improve-card-dist {
            flex-shrink: 0;
            font-size: 12px;
            font-weight: 700;
            color: var(--brand);
        }

        .improve-card-stats {
            display: flex;
            flex-wrap: wrap;
            gap: 4px 14px;
            margin-top: 5px;
            font-size: 12px;
            color: #666;
        }

        .improve-card-stats i {
            color: var(--brand);
            margin-right: 3px;
        }

        .improve-card-compare {
            margin-top: 4px;
            font-size: 11.5px;
            color: #888;
        }

        .improve-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            margin-top: 7px;
        }

        .improve-chip {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 9px;
            border-radius: var(--radius-pill, 999px);
            background: rgba(var(--brand-rgb), 0.1);
            color: var(--brand);
            font-size: 11px;
            font-weight: 600;
        }

        /* Единственный "тревожный" чип — пересечение реки без моста. Оранжевый
           (не красный) — это предупреждение "проверьте", а не запрет. */
        .improve-chip-warn {
            background: rgba(224, 122, 63, 0.14);
            color: #b35c22;
        }

        .improve-explain {
            margin-top: 5px;
            font-size: 11.5px;
            line-height: 1.45;
            color: #777;
        }

        .improve-explain b {
            color: #555;
            font-weight: 600;
        }

        /* Чип тропяного варианта — зелёный, в цвет его линии на карте */
        .improve-chip-trail {
            background: rgba(46, 125, 50, 0.12);
            color: #2e7d32;
        }

        /* ---- Секция "Путь по тропам (MapWay)" во флауте "Улучшить маршрут" ---- */
        .improve-trail-section {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #e8e8e8;
        }

        .improve-trail-head {
            font-size: 12.5px;
            font-weight: 700;
            color: #333;
            display: flex;
            align-items: center;
            gap: 7px;
        }

        .improve-trail-head i {
            color: #2e7d32;
        }

        .improve-trail-desc {
            margin: 5px 0 8px;
            font-size: 11.5px;
            line-height: 1.45;
            color: #777;
        }

        .improve-trail-opt {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            font-size: 12px;
            color: #444;
            margin-bottom: 6px;
            cursor: pointer;
        }

        .improve-trail-opt .seg-include-checkbox {
            flex-shrink: 0;
            margin-top: 1px;
        }

        .improve-trail-opt-hint {
            color: #888;
            font-weight: 400;
        }

        .improve-trail-btn {
            width: 100%;
            margin-top: 2px;
        }

        .improve-trail-btn:disabled {
            opacity: 0.6;
            cursor: default;
        }

        .improve-trail-status {
            margin-top: 7px;
            font-size: 11.5px;
            line-height: 1.45;
            color: #666;
        }

        .improve-trail-error {
            color: #b35c22;
        }

        .improve-trail-warn {
            color: #8a7420;
        }

        /* ========================================================================
           МОБИЛЬНАЯ АДАПТАЦИЯ (п.8 в статусе CLAUDE.md)
           ======================================================================== */
        @media (max-width: 768px) {

            /* ---- Окно помощи: оглавление превращается в горизонтальные чипы ---- */
            .modal.modal-help {
                width: 96vw;
                height: 88vh;
            }

            .help-modal-body {
                flex-direction: column;
            }

            .help-toc {
                width: 100%;
                flex-direction: row;
                overflow-x: auto;
                overflow-y: hidden;
                border-right: none;
                border-bottom: 1px solid #eee;
                padding: 8px 10px;
                gap: 4px;
            }

            .help-toc-item {
                white-space: nowrap;
                flex-shrink: 0;
                background: #f4f4f4;
                border-radius: var(--radius-pill);
            }

            .help-toc-lvl3 {
                padding-left: 10px;
            }

            .help-modal-content {
                padding: 14px 14px 18px;
            }

            /* ---- Лендинг ---- */
            .landing h1 {
                font-size: 2rem;
            }

            .landing p {
                font-size: 1rem;
            }

            .landing-nav {
                margin-bottom: 6vh;
            }

            .landing-hero-section {
                padding: 16px 14px 30px;
            }

            .landing .feature {
                max-width: 140px;
                padding: 12px 16px;
            }

            /* ---- Верхняя панель на карте ---- */
            .app-header {
                padding: 0 8px;
            }

            .app-header-actions {
                gap: 3px;
            }

            .app-header .tool-btn.end-edit {
                padding: 0 7px;
            }

            /* ---- Левая панель инструментов ---- */
            .left-toolbar-group {
                left: 8px;
                /* Правая (боковая) панель управления на мобильном превращается в
                   нижнюю шторку и может выезжать на 72vh (см. .side-panel ниже) —
                   без z-index выше, чем у неё, эта вертикально центрированная
                   колонка инструментов оказывалась НАД развёрнутой шторкой и
                   перекрывала её кнопки. z-index у шторки/нижней панели профиля
                   выше (см. ниже) — они сами перекрывают эту панель, когда выезжают. */
                z-index: 999;
            }

            .left-toolbar .tool-btn {
                width: 30px;
                height: 30px;
                font-size: 13px;
            }

            /* ---- Развёрнутая нижняя шторка (правая панель) и нижняя панель
               профиля высот должны перекрывать левую панель инструментов, а не
               наоборот — иначе колонка инструментов "наезжает" на выехавшую снизу
               панель (см. .left-toolbar выше). ---- */
            .side-panel,
            .elevation-drawer {
                z-index: 1002;
            }

            /* ---- Кнопка "Помощь" и иконки соцсетей на карте — на мобильном
               компактнее (были рассчитаны на десктоп, 40px), чтобы не выглядели
               громоздким продолжением левой панели инструментов над ними. ---- */
            .help-btn {
                width: 32px;
                height: 32px;
                font-size: 15px;
            }

            .social-flyout-toggle {
                width: 26px;
                height: 18px;
                font-size: 11px;
            }

            .map-social-links .social-icon-btn {
                width: 32px;
                height: 32px;
                font-size: 15px;
            }

            /* ---- Поиск мест — уже позиционтрован правее левой панели, просто
               уменьшаем ширину, чтобы не вылезать за экран ---- */
            .search-box {
                left: 48px;
                width: min(260px, calc(100vw - 64px));
            }

            /* ---- Инфо о загруженном треке — на десктопе стоит правее поиска,
               на мобильном места рядом уже нет, переносим под поиск ---- */
            .track-info {
                left: 48px;
                top: 58px;
                min-width: 0;
                width: min(260px, calc(100vw - 64px));
            }

            /* ---- Правая (боковая) панель управления — превращается в нижнюю
               "шторку" на всю ширину экрана вместо плавающего окна 452px ---- */
            .side-panel {
                top: auto;
                /* Флаш к нижнему краю (с поправкой только на реальную безопасную зону
                   iPhone, env=0 на большинстве устройств) — раньше был ещё +10px
                   зазор для приподнятой свёрнутой шторки, но он же оставлял щель
                   с картой (видна атрибуция Leaflet) и под РАЗВёрнутым окном. Подъём
                   свёрнутого состояния сделан отдельно — см. .mobile-collapsed ниже. */
                bottom: env(safe-area-inset-bottom, 0px);
                left: 0;
                right: 0;
                width: 100%;
                max-height: 72vh;
                border-radius: var(--radius-lg) var(--radius-lg) 0 0;
                transition: transform var(--dur-slow) var(--ease-drawer);
                padding-top: 6px;
            }

            /* Реальная область нажатия шире видимой полоски (5px не попасть пальцем) —
               полоска рисуется псевдоэлементом по центру настоящей высоты кнопки. */
            .side-panel-mobile-handle {
                display: block;
                width: 100%;
                height: 22px;
                background: none;
                cursor: pointer;
                flex-shrink: 0;
                position: relative;
            }

            .side-panel-mobile-handle::after {
                content: '';
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                width: 40px;
                height: 5px;
                border-radius: 999px;
                background: #ddd;
            }

            /* Свёрнутое состояние по умолчанию — видны только ручка и вкладки,
               карта остаётся доступной под ней. Разворачивается тапом по ручке
               (toggleSidePanelMobile() в js/ui.js). */
            .side-panel.mobile-collapsed {
                transform: translateY(calc(100% - 64px));
            }

            /* ---- Нижняя информационная панель маршрута (дистанция/время) — на
               мобильном не помещалась целиком (обрезалась) и заслоняла обзор карты
               по центру снизу. Теперь боковая выезжающая шторка справа: по умолчанию
               видна только узкая ручка с иконкой часов, полностью выезжает по тапу
               на неё же (toggleRouteInfoMobile() в js/ui.js), сворачивается обратно
               повторным тапом. ---- */
            .route-info {
                left: auto;
                right: 0;
                bottom: 90px;
                transform: translateX(calc(100% - 34px));
                transition: transform var(--dur-slow) var(--ease-drawer);
                min-width: 0;
                width: min(260px, calc(100vw - 20px));
                max-width: none;
                border-radius: var(--radius-md) 0 0 var(--radius-md);
                padding: 10px 14px 10px 40px;
                text-align: left;
            }

            .route-info.mobile-open {
                transform: translateX(0);
            }

            .route-info-mobile-handle {
                display: flex;
                align-items: center;
                justify-content: center;
                position: absolute;
                left: 0;
                top: 0;
                bottom: 0;
                width: 34px;
                border: none;
                background: var(--brand);
                color: white;
                border-radius: 14px 0 0 14px;
                font-size: 15px;
                cursor: pointer;
            }

            .route-info .stats-row {
                justify-content: space-between;
                gap: 10px;
            }

            .route-info .stat-item.time-stat .value {
                font-size: 24px;
            }

            /* ---- Флаут-панели "Слои"/"Места"/"Инфо" ---- на мобильном правая
               панель, от которой десктоп считает позицию через JS, превращается
               в нижнюю шторку — расчёт "справа от неё" уводил флаут за экран
               (баг: панели не открывались). На мобильном позиция фиксированная
               через CSS, JS (positionMapFlyout) только сбрасывает инлайн-стили. */
            .map-flyout {
                position: fixed;
                top: 44px;
                left: 8px;
                right: 8px;
                bottom: 12px;
                width: auto;
                max-width: none;
                height: auto;
                max-height: none;
                resize: none;
                /* Открывается кнопкой ВНУТРИ развёрнутой нижней шторки (.side-panel,
                   z-index 1002 на мобильном — см. выше), поэтому сам флаут должен
                   быть ещё выше неё, иначе шторка перекрывает его и чекбоксы внутри
                   становятся некликабельными (баг: "панель на заднем фоне"). */
                z-index: 1003;
            }

            /* iOS Safari масштабирует всю страницу при фокусе на поле ввода с
               font-size < 16px и не даёт удобного способа вернуть масштаб назад
               (баг: "экран приблизился после входа и не отдаляется"). Единый
               размер 16px на мобильном убирает авто-зум у всех текстовых полей
               сайта (логин, попапы, админка, настройки и т.п.). !important —
               осознанно, чтобы перебить более специфичные существующие правила
               font-size у полей в разных местах проекта. */
            input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
            select,
            textarea {
                font-size: 16px !important;
            }

            /* ---- Личный кабинет / Админка — боковое меню становится
               выезжающим off-canvas вместо постоянной колонки 220px ---- */
            .cabinet-mobile-toggle {
                display: flex;
            }

            .cabinet-sidebar {
                position: fixed;
                top: 0;
                left: 0;
                bottom: 0;
                width: 240px;
                transform: translateX(-100%);
                transition: transform var(--dur-slow) var(--ease-drawer);
                z-index: 2500;
            }

            .cabinet-layout.sidebar-open .cabinet-sidebar {
                transform: translateX(0);
            }

            .cabinet-layout.sidebar-open .cabinet-sidebar-backdrop {
                display: block;
                position: fixed;
                inset: 0;
                background: rgba(0, 0, 0, 0.4);
                z-index: 2400;
            }

            .cabinet-main {
                padding: 60px 16px 24px;
            }

            .cabinet-header {
                flex-wrap: wrap;
                gap: 10px;
            }

            .route-list {
                grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            }
        }

        @media (max-width: 480px) {

            /* Подписи текстом у кнопок шапки карты (Скачать/Поделиться/Кабинет) —
               на совсем узких экранах остаются только иконки. */
            .btn-label {
                display: none;
            }

            /* Подписи вкладок правой панели ("Настройки" — самая длинная, 9 букв —
               не помещалась в 1/5 ширины экрана и обрезалась за пределы шторки).
               На узких экранах остаются только иконки, как и у кнопок шапки выше. */
            .side-panel .tab-label {
                display: none;
            }

            .side-panel .panel-tab {
                font-size: 15px;
            }

            .app-header .tool-btn.end-edit {
                padding: 0 8px;
            }

            /* Имя скрываем (не помещается рядом с иконками-кнопками), но бейдж
               "PRO" внутри той же обёртки оставляем видимым — иначе Pro-статус
               вообще не был бы виден на мобильном (см. #userProBadge в js/pro.js). */
            #userNameWrap #userName {
                display: none;
            }

            .landing h1 {
                font-size: 1.6rem;
            }

            .route-info {
                padding: 8px 10px 8px 36px;
            }

            .route-info .stats-row {
                gap: 8px;
            }

            .map-flyout {
                left: 4px;
                right: 4px;
            }

            .side-panel {
                max-height: 78vh;
            }
        }

        /* ==================================================================
           MapWay Pro — замочки на платных фичах, модалка подписки, админ-вкладка
           "Тарифы". Ничего из этого не видно, пока монетизация выключена в
           админке (см. js/pro.js, updateProUI). Палитра — как везде: только
           нейтральный серый и --brand, без новых цветов.
           ================================================================== */
        .pro-locked {
            position: relative;
            opacity: 0.75;
        }

        .pro-lock-badge {
            font-size: 9px;
            color: var(--brand);
            margin-left: 6px;
            vertical-align: middle;
            pointer-events: none;
        }

        /* В строке-настройке (например, "без логотипа" в окне "Поделиться")
           замочек прижимается к тексту, не улетая за тумблер */
        label.pro-locked .pro-lock-badge {
            order: -1;
            margin-left: 0;
            margin-right: 6px;
        }

        .pro-modal-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 6px;
        }

        .pro-modal-header .modal-title {
            margin-bottom: 0;
        }

        .pro-modal-feature-icon {
            font-size: 22px;
            color: var(--brand);
            flex-shrink: 0;
        }

        .pro-modal-plans {
            display: flex;
            gap: 10px;
            margin-top: 14px;
        }

        .pro-plan-btn {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            padding: 12px 8px;
            border: 1px solid rgba(var(--ink-rgb), 0.15);
            border-radius: 10px;
            background: none;
            cursor: pointer;
            transition: border-color 0.15s, background 0.15s;
        }

        .pro-plan-btn:hover {
            border-color: var(--brand);
            background: rgba(var(--brand-rgb), 0.06);
        }

        .pro-plan-btn.pro-plan-year {
            border-color: var(--brand);
            background: rgba(var(--brand-rgb), 0.08);
        }

        .pro-plan-price {
            font-size: 20px;
            font-weight: 700;
            color: var(--ink);
        }

        .pro-plan-period {
            font-size: 12px;
            color: #777;
        }

        .pro-plan-savings {
            color: var(--brand);
            font-weight: 600;
        }

        .pro-badge {
            display: inline-block;
            padding: 1px 8px;
            border-radius: 10px;
            background: var(--brand);
            color: white;
            font-size: 11px;
            font-weight: 600;
        }

        .admin-pro-actions {
            white-space: nowrap;
        }

        .admin-pro-actions .btn-sm {
            margin-right: 4px;
        }

        /* ==================================================================
           Раздел "Профиль" в личном кабинете (вкладки Аккаунт/Тариф) —
           см. js/account.js. Стили в духе админ-панелей (.admin-panel).
           ================================================================== */
        .profile-subtabs {
            display: flex;
            gap: 8px;
            margin-bottom: 18px;
        }

        .profile-subtab-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 18px;
            border: none;
            border-radius: var(--radius-sm);
            background: white;
            color: #555;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            box-shadow: var(--shadow-sm);
            transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
        }

        .profile-subtab-btn.active {
            background: var(--brand);
            color: white;
            box-shadow: var(--shadow-brand);
        }

        .profile-pro-features {
            list-style: none;
            margin: 0 0 16px;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 8px;
            font-size: 13px;
            color: #333;
        }

        .profile-pro-features i {
            color: var(--brand);
            width: 18px;
            text-align: center;
            margin-right: 6px;
        }

        /* ==================================================================
           Экран "Тарифы" (js/pricing.js) — тёмная страница в духе хиро лендинга
           (тот же var(--ink) фон + белый текст + чирок-акцент), с собственным
           внутренним скроллом (.pricing-page), как у .cabinet-main, а не как у
           лендинга (там скроллится сам экран — здесь экран фиксированной высоты).
           ================================================================== */
        .pricing-page {
            width: 100%;
            height: 100%;
            overflow-y: auto;
            background: var(--ink);
            color: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px 20px 60px;
        }

        .pricing-nav {
            width: 100%;
            max-width: 1100px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 4px;
            margin-bottom: 6vh;
        }

        .pricing-back-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 8px 16px;
            border: 1px solid rgba(255, 255, 255, 0.25);
            border-radius: var(--radius-pill);
            background: rgba(255, 255, 255, 0.06);
            color: white;
            font-family: inherit;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .pricing-back-btn:hover {
            background: rgba(255, 255, 255, 0.13);
            border-color: rgba(255, 255, 255, 0.5);
        }

        .pricing-back-btn:active {
            transform: scale(0.97);
        }

        .pricing-hero {
            max-width: 620px;
            text-align: center;
            margin-bottom: 40px;
        }

        .pricing-hero h1 {
            font-size: 2.2rem;
            font-weight: 800;
            line-height: 1.15;
            margin-bottom: 12px;
        }

        .pricing-hero p {
            font-size: 1rem;
            opacity: 0.8;
            margin-bottom: 24px;
        }

        .pricing-period-toggle {
            display: inline-flex;
            gap: 2px;
            padding: 3px;
            border-radius: var(--radius-pill);
            background: rgba(255, 255, 255, 0.08);
        }

        .pricing-period-btn {
            padding: 8px 18px;
            border: none;
            border-radius: var(--radius-pill);
            background: none;
            color: rgba(255, 255, 255, 0.7);
            font-family: inherit;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
        }

        .pricing-period-btn.active {
            background: var(--brand);
            color: white;
        }

        .pricing-period-save {
            color: rgba(255, 255, 255, 0.85);
            font-weight: 600;
        }

        .pricing-cards {
            width: 100%;
            max-width: 760px;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 50px;
        }

        .pricing-card {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-lg);
            padding: 28px 26px;
            display: flex;
            flex-direction: column;
        }

        .pricing-card-pro {
            border-color: var(--brand);
            background: rgba(var(--brand-rgb), 0.1);
            box-shadow: var(--shadow-brand);
            position: relative;
        }

        .pricing-card-badge {
            position: absolute;
            top: -12px;
            left: 26px;
            background: var(--brand);
            color: white;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.03em;
            padding: 3px 12px;
            border-radius: var(--radius-pill);
        }

        .pricing-card-name {
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            opacity: 0.7;
            margin-bottom: 10px;
        }

        .pricing-card-price {
            font-size: 2.4rem;
            font-weight: 800;
            line-height: 1;
        }

        .pricing-card-price-period {
            font-size: 13px;
            opacity: 0.65;
            margin-top: 4px;
            margin-bottom: 20px;
        }

        .pricing-card-features {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 10px;
            font-size: 13.5px;
            margin-bottom: 24px;
            flex: 1;
        }

        .pricing-card-features i {
            color: var(--brand);
            width: 16px;
            margin-right: 6px;
        }

        .pricing-card-cta {
            border: none;
            border-radius: var(--radius-sm);
            padding: 12px 20px;
            font-family: inherit;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            background: var(--brand);
            color: white;
            transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .pricing-card-cta:hover {
            background: var(--brand-dark);
        }

        .pricing-card-cta:active {
            transform: scale(0.97);
        }

        .pricing-card-cta-ghost {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        .pricing-card-cta-ghost:hover {
            background: rgba(255, 255, 255, 0.08);
        }

        .pricing-compare {
            width: 100%;
            max-width: 620px;
        }

        .pricing-compare h2 {
            font-size: 1.2rem;
            font-weight: 800;
            text-align: center;
            margin-bottom: 18px;
        }

        .pricing-compare-row {
            display: grid;
            grid-template-columns: 1fr 90px 90px;
            align-items: center;
            gap: 8px;
            padding: 12px 4px;
            font-size: 13.5px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }

        .pricing-compare-row:last-child {
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .pricing-compare-col-free,
        .pricing-compare-col-pro {
            text-align: center;
            opacity: 0.85;
        }

        .pricing-compare-col-pro {
            color: var(--brand);
            font-weight: 700;
        }

        .pricing-compare-head {
            display: grid;
            grid-template-columns: 1fr 90px 90px;
            gap: 8px;
            padding: 0 4px 8px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            opacity: 0.55;
        }

        .pricing-compare-head span {
            text-align: center;
        }

        .pricing-compare-head span:first-child {
            text-align: left;
        }

        @media (max-width: 768px) {
            .pricing-cards {
                grid-template-columns: 1fr;
            }

            .pricing-hero h1 {
                font-size: 1.7rem;
            }
        }

        /* ==================================================================
           Раздел "О проекте" в кабинете (см. account.js showCabinetAbout()) —
           тот же текст/ссылки, что раньше показывала модалка showAboutContacts()
           в шапке карты, но оформлено как отдельный "about"-момент, а не форма
           настроек: круглая иконка-бейдж, читаемый текст, ссылки-пилюли, список
           правовых документов со стрелочками вместо серых кнопок.
           ================================================================== */
        .about-card {
            max-width: 640px;
            margin: 0 auto 20px;
            padding: 40px 36px 30px;
            background: linear-gradient(180deg, rgba(var(--brand-rgb), 0.05) 0%, white 160px);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-sm);
            text-align: center;
        }

        .about-card-icon {
            width: 56px;
            height: 56px;
            margin: 0 auto 20px;
            border-radius: 50%;
            background: var(--brand);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            box-shadow: var(--shadow-brand);
        }

        .about-card-text {
            text-align: left;
            font-size: 15px;
            line-height: 1.75;
            color: #333;
        }

        .about-card-text p {
            margin-bottom: 12px;
        }

        .about-card-text p:last-child {
            margin-bottom: 0;
        }

        .about-contact-row {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 26px;
            padding-top: 22px;
            border-top: 1px solid #eee;
        }

        .about-contact-row .contact-link {
            background: rgba(var(--brand-rgb), 0.07);
        }

        .legal-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .legal-list-item {
            display: flex;
            align-items: center;
            gap: 12px;
            width: 100%;
            padding: 13px 14px;
            border: none;
            border-radius: var(--radius-sm);
            background: #f7f8f8;
            color: #333;
            font-size: 13.5px;
            font-weight: 600;
            text-align: left;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out);
        }

        .legal-list-item:hover {
            background: rgba(var(--brand-rgb), 0.08);
        }

        .legal-list-item i:first-child {
            color: var(--brand);
            width: 16px;
            text-align: center;
        }

        .legal-list-item span {
            flex: 1;
        }

        .legal-list-chevron {
            color: #bbb;
            font-size: 11px;
        }

        /* Опасная зона (удаление аккаунта) — единственное место в кабинете,
           где уместен красный: действие необратимое */
        .admin-panel.danger-zone {
            border: 1px solid rgba(244, 67, 54, 0.35);
        }

        .btn-outline-danger {
            padding: 8px 20px;
            border: 1px solid #c0392b;
            border-radius: var(--radius-sm);
            background: transparent;
            color: #c0392b;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .btn-outline-danger:hover {
            background: #c0392b;
            color: white;
        }

        .btn-outline-danger:active {
            transform: scale(0.97);
        }

        .modal .btn-row .btn-danger {
            background: #f44336;
            color: white;
        }

        /* Подсказка "сохранено X из Y" над списком маршрутов в кабинете — видна
           только при включённой монетизации и только у Free (см. updateCabinetRoutesLimitHint
           в routes.js). */
        .cabinet-routes-limit-hint {
            font-size: 12px;
            color: #666;
            margin: -6px 0 14px;
        }

        /* ==================================================================
           ЭКРАН "АНАЛИЗ МАРШРУТА" (routeReportScreen, js/report.js) — та же
           тёмная стилистика, что и страница "Тарифы" (переиспользует
           .pricing-nav/.pricing-back-btn). Страница-отчёт: погода по дням,
           позже — сложность/броды/перевалы.
           ================================================================== */
        .report-page {
            width: 100%;
            height: 100%;
            overflow-y: auto;
            background: var(--ink);
            color: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px 20px 60px;
        }

        .report-page .pricing-nav {
            margin-bottom: 24px;
        }

        .report-header {
            width: 100%;
            max-width: 860px;
            margin-bottom: 26px;
        }

        .report-header-label {
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--brand-light, #4db6ac);
            opacity: 0.9;
            margin-bottom: 6px;
        }

        .report-header h1 {
            font-size: 1.9rem;
            font-weight: 800;
            line-height: 1.15;
            margin-bottom: 10px;
            overflow-wrap: anywhere;
        }

        .report-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            font-size: 13.5px;
            opacity: 0.75;
        }

        .report-meta i {
            margin-right: 5px;
        }

        .report-section {
            width: 100%;
            max-width: 860px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-lg);
            padding: 22px 24px;
            margin-bottom: 18px;
        }

        .report-section-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }

        .report-section-header i {
            color: var(--brand-light, #4db6ac);
            font-size: 18px;
        }

        .report-section-header h2 {
            font-size: 1.15rem;
            font-weight: 700;
        }

        .report-section-hint {
            font-size: 13px;
            line-height: 1.5;
            opacity: 0.7;
            margin-bottom: 16px;
        }

        .report-weather-controls {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-end;
            gap: 14px;
            margin-bottom: 18px;
        }

        .report-weather-source-row {
            margin-bottom: 18px;
        }

        .report-weather-source-row label {
            display: block;
            font-size: 11.5px;
            font-weight: 600;
            opacity: 0.7;
            margin-bottom: 6px;
        }

        .report-weather-source-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .report-weather-source-pill {
            border: 1px solid rgba(255, 255, 255, 0.2);
            background: rgba(255, 255, 255, 0.07);
            border-radius: var(--radius-pill);
            padding: 6px 14px;
            font-size: 12.5px;
            font-weight: 600;
            font-family: inherit;
            color: white;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .report-weather-source-pill:hover {
            border-color: var(--brand);
        }

        .report-weather-source-pill:active {
            transform: scale(0.96);
        }

        .report-weather-source-pill.active {
            background: var(--brand);
            border-color: var(--brand);
        }

        .report-weather-source-blurb {
            margin: 8px 0 0;
            font-size: 12px;
            line-height: 1.5;
            opacity: 0.65;
        }

        .report-field {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .report-field label {
            font-size: 11.5px;
            font-weight: 600;
            opacity: 0.7;
        }

        .report-field input {
            padding: 8px 10px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: var(--radius-sm);
            background: rgba(255, 255, 255, 0.07);
            color: white;
            font-family: inherit;
            font-size: 13.5px;
        }

        .report-field input[type="number"] {
            width: 90px;
        }

        /* Нативная иконка календаря на тёмном фоне почти не видна — осветляем */
        .report-field input::-webkit-calendar-picker-indicator {
            filter: invert(1);
            opacity: 0.7;
            cursor: pointer;
        }

        .report-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 9px 18px;
            border: none;
            border-radius: var(--radius-pill);
            background: var(--brand);
            color: white;
            font-family: inherit;
            font-size: 13.5px;
            font-weight: 700;
            cursor: pointer;
            transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .report-btn:hover {
            background: var(--brand-dark);
        }

        .report-btn:active {
            transform: scale(0.97);
        }

        .report-placeholder {
            font-size: 13.5px;
            opacity: 0.65;
            padding: 8px 0;
            line-height: 1.5;
        }

        .report-placeholder.report-error {
            color: #ef9a9a;
            opacity: 1;
        }

        .report-attribution {
            margin-top: 14px;
            font-size: 11.5px;
            opacity: 0.5;
        }

        .report-attribution a {
            color: inherit;
        }

        /* ---- Секция "Сложность и рельеф" ---- */
        .report-difficulty-row {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            align-items: stretch;
        }

        .report-difficulty-badge {
            flex: 0 0 auto;
            width: 190px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 4px;
            padding: 16px 18px;
            border-radius: var(--radius-md);
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(255, 255, 255, 0.04);
        }

        .report-difficulty-label {
            font-size: 22px;
            font-weight: 800;
            line-height: 1.1;
        }

        .report-difficulty-sub {
            font-size: 11.5px;
            opacity: 0.7;
            line-height: 1.35;
        }

        .report-difficulty-badge.tier-easy {
            background: rgba(76, 175, 125, 0.14);
            border-color: rgba(76, 175, 125, 0.5);
        }

        .report-difficulty-badge.tier-easy .report-difficulty-label {
            color: #6fce9c;
        }

        .report-difficulty-badge.tier-moderate {
            background: rgba(215, 166, 59, 0.14);
            border-color: rgba(215, 166, 59, 0.5);
        }

        .report-difficulty-badge.tier-moderate .report-difficulty-label {
            color: #e6bd5c;
        }

        .report-difficulty-badge.tier-hard {
            background: rgba(224, 122, 63, 0.16);
            border-color: rgba(224, 122, 63, 0.55);
        }

        .report-difficulty-badge.tier-hard .report-difficulty-label {
            color: #ef9a6e;
        }

        .report-difficulty-badge.tier-extreme {
            background: rgba(217, 83, 79, 0.16);
            border-color: rgba(217, 83, 79, 0.55);
        }

        .report-difficulty-badge.tier-extreme .report-difficulty-label {
            color: #f08a86;
        }

        .report-difficulty-badge.tier-na .report-difficulty-label {
            font-size: 18px;
            opacity: 0.75;
        }

        .report-analysis-grid {
            flex: 1 1 320px;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
            gap: 8px;
        }

        .report-stat-tile {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: var(--radius-sm);
            padding: 10px 8px;
            text-align: center;
        }

        .report-stat-tile i {
            color: var(--brand-light, #4db6ac);
            font-size: 13px;
            margin-bottom: 4px;
        }

        .report-stat-value {
            font-size: 16px;
            font-weight: 700;
            line-height: 1.15;
        }

        .report-stat-label {
            font-size: 10.5px;
            opacity: 0.6;
            margin-top: 2px;
        }

        .report-difficulty-why {
            margin-top: 14px;
            font-size: 13.5px;
            line-height: 1.55;
        }

        .report-elev-chart-wrap {
            position: relative;
            height: 180px;
            margin-top: 14px;
        }

        .report-elev-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 14px;
            margin-top: 8px;
            font-size: 11.5px;
            opacity: 0.7;
        }

        .report-elev-legend i {
            font-size: 10px;
            margin-right: 3px;
        }

        .report-subhead {
            font-size: 14px;
            font-weight: 700;
            margin: 18px 0 8px;
            display: flex;
            align-items: center;
            gap: 7px;
        }

        .report-subhead i {
            color: var(--brand-light, #4db6ac);
        }

        /* ---- Разбивка сложности по сегментам ---- */
        .report-segments-breakdown {
            margin-top: 4px;
        }

        .report-segment-rows {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .report-segment-row {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: var(--radius-sm);
            padding: 8px 12px;
            font-size: 13px;
            width: 100%;
            text-align: left;
            font-family: inherit;
            color: inherit;
            cursor: pointer;
            transition: background var(--dur-fast, 0.12s) var(--ease-out, ease), border-color var(--dur-fast, 0.12s) var(--ease-out, ease);
        }

        .report-segment-row:hover {
            background: rgba(255, 255, 255, 0.07);
        }

        .report-segment-row.active {
            background: rgba(15, 111, 108, 0.16);
            border-color: rgba(15, 111, 108, 0.55);
        }

        /* ---- "Итого по маршруту" (только факты, без оценки — многодневный маршрут) ---- */
        .report-totals-row {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            font-size: 13px;
            opacity: 0.8;
            margin-bottom: 14px;
            padding-bottom: 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .report-totals-row i {
            color: var(--brand-light, #4db6ac);
            margin-right: 4px;
        }

        /* ---- Поле "за сколько дней проходите" (маршрут одним куском) ---- */
        .report-days-input-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 10px;
            margin-bottom: 16px;
            font-size: 13px;
        }

        .report-days-input-row label {
            font-weight: 600;
        }

        .report-days-input-row input[type="number"] {
            width: 64px;
            padding: 5px 8px;
            border-radius: var(--radius-sm);
            border: 1px solid rgba(255, 255, 255, 0.15);
            background: rgba(255, 255, 255, 0.05);
            color: inherit;
            font-size: 13px;
        }

        .report-days-input-hint {
            opacity: 0.6;
            font-size: 12px;
        }

        .report-segment-swatch {
            width: 11px;
            height: 11px;
            border-radius: 3px;
            flex: 0 0 auto;
        }

        .report-segment-name {
            font-weight: 700;
            margin-right: auto;
        }

        .report-segment-tier {
            font-size: 11px;
            font-weight: 700;
            padding: 2px 9px;
            border-radius: var(--radius-pill, 999px);
            background: rgba(255, 255, 255, 0.08);
        }

        .report-segment-tier.tier-easy {
            color: #6fce9c;
            background: rgba(76, 175, 125, 0.16);
        }

        .report-segment-tier.tier-moderate {
            color: #e6bd5c;
            background: rgba(215, 166, 59, 0.16);
        }

        .report-segment-tier.tier-hard {
            color: #ef9a6e;
            background: rgba(224, 122, 63, 0.18);
        }

        .report-segment-tier.tier-extreme {
            color: #f08a86;
            background: rgba(217, 83, 79, 0.18);
        }

        .report-segment-stat {
            opacity: 0.75;
            white-space: nowrap;
        }

        .report-segment-stat i {
            color: var(--brand-light, #4db6ac);
            margin-right: 3px;
        }

        .report-steep-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
            gap: 6px;
        }

        .report-steep-list li {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: var(--radius-sm);
            padding: 8px 11px;
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 7px;
        }

        .report-steep-list li i.steep-up {
            color: #ef9a6e;
        }

        .report-steep-list li i.steep-down {
            color: #b18fd4;
        }

        .report-steep-list li b {
            font-weight: 800;
        }

        .report-steep-meta {
            margin-left: auto;
            font-size: 11px;
            opacity: 0.6;
            text-align: right;
        }

        .report-steep-none {
            margin-top: 14px;
            font-size: 13px;
            opacity: 0.8;
        }

        .report-steep-none i {
            color: #6fce9c;
        }

        .report-speed-note {
            display: flex;
            gap: 9px;
            align-items: flex-start;
            margin-top: 16px;
            padding: 11px 13px;
            border-radius: var(--radius-sm);
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            font-size: 13px;
            line-height: 1.5;
        }

        .report-speed-note i {
            color: var(--brand-light, #4db6ac);
            margin-top: 2px;
        }

        .report-speed-note.report-speed-warn {
            background: rgba(215, 166, 59, 0.12);
            border-color: rgba(215, 166, 59, 0.4);
        }

        .report-speed-note.report-speed-warn i {
            color: #e6bd5c;
        }

        .report-difficulty-disclaimer {
            margin-top: 14px;
            font-size: 11.5px;
            opacity: 0.55;
            line-height: 1.5;
        }

        .report-difficulty-disclaimer i {
            margin-right: 4px;
        }

        /* ---- Вкладки экрана "Анализ маршрута" ---- */
        .report-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 18px;
        }

        .report-tab-btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 9px 16px;
            border-radius: var(--radius-pill, 999px);
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(255, 255, 255, 0.05);
            color: inherit;
            font-family: inherit;
            font-size: 13.5px;
            font-weight: 600;
            cursor: pointer;
            transition: background var(--dur-fast, 0.12s) var(--ease-out, ease), border-color var(--dur-fast, 0.12s) var(--ease-out, ease);
        }

        .report-tab-btn:hover {
            background: rgba(255, 255, 255, 0.09);
        }

        .report-tab-btn.active {
            background: rgba(15, 111, 108, 0.28);
            border-color: rgba(77, 182, 172, 0.6);
        }

        .report-tab-btn i {
            color: var(--brand-light, #4db6ac);
        }

        .report-tab-panel {
            display: none;
        }

        .report-tab-panel.active {
            display: block;
        }

        /* ---- Тумблеры "что подсвечивать" над картой ---- */
        .report-pois-toggles {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            margin-bottom: 10px;
        }

        .report-pois-toggle {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            font-size: 13px;
            cursor: pointer;
        }

        .report-pois-toggle i {
            color: var(--brand-light, #4db6ac);
        }

        /* ---- Итого по маршруту (низ секции) ---- */
        .report-pois-totals {
            margin-top: 16px;
            padding-top: 12px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            font-size: 13.5px;
            font-weight: 600;
        }

        .report-pois-totals i {
            color: var(--brand-light, #4db6ac);
            margin-right: 6px;
        }

        /* ---- Мини-карта во вкладке "Вода и перевалы" ---- */
        .report-pois-map {
            height: 420px;
            border-radius: var(--radius-md);
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.12);
            margin-bottom: 16px;
            /* Тёмная тема отчёта, карта светлая — лёгкое приглушение, чтобы не слепила */
            background: #202325;
        }

        @media (max-width: 768px) {
            .report-pois-map {
                height: 300px;
            }
        }

        .report-pass-marker {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: #fff;
            border: 2px solid #0f6f6c;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
            color: #0f6f6c;
            transition: box-shadow 0.2s, transform 0.2s;
        }

        .report-pass-marker svg {
            width: 15px;
            height: 13px;
        }

        /* Временная подсветка при клике по перевалу в списке */
        @keyframes reportPassPulse {
            0%, 100% { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(15, 111, 108, 0.6); }
            50% { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35), 0 0 0 9px rgba(15, 111, 108, 0); }
        }

        .report-pass-marker-pulse {
            animation: reportPassPulse 0.5s ease-out 3;
            transform: scale(1.15);
        }

        /* Иконка перевала (SVG) в тексте — подзаголовок/тумблер/список */
        .report-pass-icon {
            display: inline-flex;
            align-items: center;
            color: var(--brand-light, #4db6ac);
        }

        .report-pass-icon svg {
            width: 15px;
            height: 13px;
        }

        /* Чипы выбора сегмента над сводкой */
        .report-pois-scopes {
            display: flex;
            flex-wrap: wrap;
            gap: 7px;
            margin-bottom: 10px;
        }

        .report-pois-scope-pill {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 6px 13px;
            border-radius: var(--radius-pill, 999px);
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(255, 255, 255, 0.05);
            color: inherit;
            font-family: inherit;
            font-size: 12.5px;
            font-weight: 600;
            cursor: pointer;
            transition: background var(--dur-fast, 0.12s) var(--ease-out, ease);
        }

        .report-pois-scope-pill:hover {
            background: rgba(255, 255, 255, 0.09);
        }

        .report-pois-scope-pill.active {
            background: rgba(15, 111, 108, 0.28);
            border-color: rgba(77, 182, 172, 0.6);
        }

        .report-pois-scope-title {
            font-size: 12.5px;
            opacity: 0.7;
            margin-bottom: 8px;
        }

        .report-pois-cross-summary {
            margin-top: 12px;
            font-size: 13px;
            line-height: 2;
            opacity: 0.9;
        }

        .report-pois-cross-summary .report-crossing-badge {
            margin-left: 0;
        }

        /* ---- Секция "Вода и перевалы" (данные OSM) ---- */
        .report-pois-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 6px;
        }

        .report-pois-list li {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: var(--radius-sm);
            padding: 8px 11px;
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 7px;
            flex-wrap: wrap;
            cursor: pointer;
            transition: background var(--dur-fast, 0.12s) var(--ease-out, ease), border-color var(--dur-fast, 0.12s) var(--ease-out, ease);
        }

        .report-pois-list li:hover {
            background: rgba(15, 111, 108, 0.14);
            border-color: rgba(77, 182, 172, 0.4);
        }

        .report-pois-focus-hint {
            margin-left: auto;
            color: var(--brand-light, #4db6ac);
            opacity: 0.5;
            font-size: 12px;
        }

        .report-pois-list li:hover .report-pois-focus-hint {
            opacity: 1;
        }

        .report-pois-icon {
            color: var(--brand-light, #4db6ac);
        }

        /* Пересечения рек — во всю ширину, статус-бейдж справа */
        .report-crossings-list {
            grid-template-columns: 1fr;
        }

        .report-crossing-name {
            opacity: 0.85;
        }

        .report-crossing-badge {
            margin-left: auto;
            font-size: 11px;
            font-weight: 700;
            padding: 2px 9px;
            border-radius: var(--radius-pill, 999px);
            background: rgba(255, 255, 255, 0.08);
            white-space: nowrap;
        }

        .report-crossing-badge.cross-bridge {
            color: #6fce9c;
            background: rgba(76, 175, 125, 0.14);
        }

        .report-crossing-badge.cross-ford {
            color: #e6bd5c;
            background: rgba(215, 166, 59, 0.14);
        }

        .report-crossing-badge.cross-possible {
            color: #ef9a6e;
            background: rgba(224, 122, 63, 0.16);
        }

        .report-crossing-badge.cross-stream {
            color: #8fbce4;
            background: rgba(91, 155, 213, 0.14);
        }

        .report-pois-icon.cross-possible {
            color: #ef9a6e;
        }

        .report-pois-icon.cross-ford {
            color: #e6bd5c;
        }

        .report-pois-sac {
            margin-top: 10px;
            font-size: 13px;
            opacity: 0.85;
        }

        .report-pois-sac i {
            color: var(--brand-light, #4db6ac);
            margin-right: 4px;
        }

        .report-pois-water-summary {
            font-size: 13px;
            margin-bottom: 10px;
            opacity: 0.85;
        }

        /* ---- Карточка одного дня прогноза ---- */
        .report-day-card {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.09);
            border-radius: var(--radius-md);
            padding: 16px 18px;
            margin-bottom: 12px;
        }

        .report-day-head {
            display: flex;
            flex-wrap: wrap;
            align-items: baseline;
            gap: 10px;
            margin-bottom: 10px;
        }

        .report-day-num {
            font-size: 14px;
            font-weight: 800;
            color: var(--brand-light, #4db6ac);
        }

        .report-day-date {
            font-size: 13.5px;
            font-weight: 600;
        }

        .report-day-place {
            font-size: 12px;
            opacity: 0.6;
            margin-left: auto;
        }

        .report-day-summary {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 12px;
        }

        .report-day-icon {
            font-size: 30px;
            color: var(--brand-light, #4db6ac);
            width: 38px;
            text-align: center;
        }

        .report-day-temp-cols {
            display: flex;
            gap: 16px;
            align-items: baseline;
        }

        .report-day-temp {
            font-size: 24px;
            font-weight: 800;
            display: flex;
            flex-direction: column;
            align-items: center;
            line-height: 1.1;
        }

        .report-day-temp span {
            font-size: 10.5px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            opacity: 0.55;
            margin-top: 2px;
        }

        .report-day-temp-night {
            font-size: 19px;
            opacity: 0.85;
        }

        .report-day-summary-text {
            font-size: 13px;
            opacity: 0.75;
            line-height: 1.4;
        }

        /* Автоописание дня — сгенерированный из данных текст */
        .report-day-narrative {
            font-size: 13px;
            line-height: 1.6;
            opacity: 0.85;
            margin-bottom: 12px;
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.03);
            border-left: 3px solid rgba(var(--brand-rgb), 0.6);
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        }

        .report-wind-arrow {
            display: inline-block;
            font-size: 10px;
        }

        .report-sun-tz {
            opacity: 0.55;
            font-style: italic;
        }

        .report-alerts {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 12px;
        }

        .report-alert {
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            background: rgba(255, 167, 38, 0.13);
            border: 1px solid rgba(255, 167, 38, 0.35);
            color: #ffcc80;
            font-size: 12.5px;
            font-weight: 600;
        }

        .report-day-parts {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
            gap: 8px;
            margin-bottom: 12px;
        }

        .report-day-part {
            background: rgba(255, 255, 255, 0.04);
            border-radius: var(--radius-sm);
            padding: 10px 8px;
            text-align: center;
        }

        .report-part-label {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            opacity: 0.55;
            margin-bottom: 6px;
        }

        .report-part-icon {
            font-size: 17px;
            color: var(--brand-light, #4db6ac);
            margin-bottom: 6px;
        }

        .report-part-temp {
            font-size: 15px;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .report-part-detail {
            font-size: 11px;
            opacity: 0.65;
            margin-top: 2px;
        }

        .report-day-sun {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            font-size: 12.5px;
            opacity: 0.7;
            margin-bottom: 8px;
        }

        .report-notes {
            margin: 8px 0 0;
            padding-left: 18px;
            font-size: 12.5px;
            line-height: 1.55;
            opacity: 0.8;
        }

        .report-notes li {
            margin-bottom: 4px;
        }

        /* Переключатель "Части суток / По часам" на карточке дня (js/report.js,
           toggleReportDayHourly) */
        .report-parts-toggle {
            display: inline-flex;
            gap: 2px;
            padding: 2px;
            margin-bottom: 10px;
            border-radius: var(--radius-pill);
            background: rgba(255, 255, 255, 0.06);
        }

        .report-parts-toggle-btn {
            padding: 5px 12px;
            border: none;
            border-radius: var(--radius-pill);
            background: transparent;
            color: rgba(255, 255, 255, 0.65);
            font-family: inherit;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
        }

        .report-parts-toggle-btn.active {
            background: var(--brand);
            color: white;
        }

        /* Почасовая лента — горизонтальный скролл, т.к. в ближних днях бывает
           до ~24 столбцов (MET Norway отдаёт час в час только на первые ~48ч). */
        .report-hours-scroll {
            overflow-x: auto;
            margin: 0 -4px 4px;
            padding: 0 4px;
        }

        .report-hours-row {
            display: flex;
            gap: 6px;
        }

        .report-hour-col {
            flex: 0 0 62px;
            background: rgba(255, 255, 255, 0.04);
            border-radius: var(--radius-sm);
            padding: 8px 4px;
            text-align: center;
        }

        .report-hour-time {
            font-size: 10.5px;
            font-weight: 700;
            opacity: 0.6;
            margin-bottom: 4px;
        }

        .report-hour-icon {
            font-size: 15px;
            color: var(--brand-light, #4db6ac);
            margin-bottom: 4px;
        }

        .report-hour-temp {
            font-size: 13px;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .report-hour-detail {
            font-size: 10px;
            opacity: 0.65;
            margin-top: 2px;
        }

        .report-hours-sparse-hint {
            font-size: 11px;
            opacity: 0.55;
            font-style: italic;
        }

        @media (max-width: 600px) {
            .report-section {
                padding: 16px 14px;
            }

            .report-day-place {
                margin-left: 0;
                width: 100%;
            }

            .report-weather-controls {
                gap: 10px;
            }

            .report-btn {
                width: 100%;
                justify-content: center;
            }
        }

        /* ==================================================================
           Печать / PDF отчёта "Анализ маршрута" (шаг 6 плана Pro-фич):
           кнопка "Печать / PDF" сразу СОХРАНЯЕТ файл (html2canvas + jsPDF,
           js/report.js printRouteReport()) — без системного диалога печати
           (пользователь просил не открывать окно печати, а сразу отдавать PDF).
           .pdf-export-mode навешивается на #routeReportScreen на время захвата
           html2canvas — те же правила, что раньше жили в @media print, здесь
           работают через класс, т.к. html2canvas не эмулирует print-медиа.
           ================================================================== */

        /* Кнопки в шапке отчёта (Печать + Назад) — рядом друг с другом */
        .report-nav-actions {
            display: inline-flex;
            gap: 8px;
        }

        /* Колонтитул PDF-версии — на экране не показывается вовсе */
        .report-print-footer {
            display: none;
        }

        /* .report-page сам скроллится (overflow-y:auto, см. базовое правило выше) —
           html2canvas снимает элемент таким, какой он есть, включая обрезку по
           overflow, поэтому без сброса в PDF попадала бы только первая видимая
           "страница" контента (offsetHeight), а не весь отчёт (scrollHeight).
           height:auto возвращает элементу его настоящую полную высоту. */
        #routeReportScreen.pdf-export-mode .report-page {
            max-width: 100%;
            height: auto;
            overflow: visible;
            padding: 0;
        }

        #routeReportScreen.pdf-export-mode {
            height: auto !important;
            overflow: visible !important;
        }

        /* Экран отчёта тёмный — в PDF принудительно светлый (чернила!). Тотальный
           сброс фона/цвета, НО с исключениями, где цвет — это смысл: инлайновые
           свотчи сегментов (style="background:...") и бейдж сложности с его
           цветом тира. :not() исключает их из селектора — иначе !important
           здесь перебил бы даже инлайн-стиль. */
        #routeReportScreen.pdf-export-mode :not([style*="background"]):not(.report-difficulty-badge):not(.report-difficulty-badge *) {
            background-color: transparent !important;
            color: #111 !important;
            box-shadow: none !important;
            text-shadow: none !important;
        }

        /* Все вкладки раскладываются подряд (на экране видна только активная);
           секции без данных помечены print-skip из printRouteReport() */
        #routeReportScreen.pdf-export-mode .report-tab-panel {
            display: block !important;
            margin-bottom: 18px;
            border-bottom: 1px solid #ccc;
            padding-bottom: 14px;
        }

        #routeReportScreen.pdf-export-mode .report-tab-panel.print-skip {
            display: none !important;
        }

        /* Интерактив в PDF не нужен: навигация, вкладки, все кнопки, поля
           даты/дней, селектор источника погоды, тумблеры слоёв карты */
        #routeReportScreen.pdf-export-mode .pricing-nav,
        #routeReportScreen.pdf-export-mode .report-tabs,
        #routeReportScreen.pdf-export-mode button,
        #routeReportScreen.pdf-export-mode .report-weather-controls,
        #routeReportScreen.pdf-export-mode .report-weather-source-row,
        #routeReportScreen.pdf-export-mode .report-pois-toggles {
            display: none !important;
        }

        /* Мини-карта "Бродов и перевалов" в PDF не участвует — её тайлы почти
           всегда придут БЕЗ CORS-заголовка (публичные OSM-зеркала это иногда
           отдают, но наш собственный кэширующий nginx-прокси на проде — нет),
           html2canvas в этом случае либо не сможет их встроить, либо "испачкает"
           canvas и сорвёт весь экспорт SecurityError на toDataURL. Вся полезная
           информация (перевалы/броды/сухие участки) и так уже текстом рядом —
           карта на экране интерактивна для этого, PDF её просто пропускает. */
        #routeReportScreen.pdf-export-mode #reportPoisMap {
            display: none !important;
        }

        #routeReportScreen.pdf-export-mode canvas {
            max-width: 100% !important;
            height: auto !important;
        }

        #routeReportScreen.pdf-export-mode a {
            text-decoration: none;
        }

        #routeReportScreen.pdf-export-mode .report-print-footer {
            display: block !important;
            margin-top: 16px;
            font-size: 11px;
            color: #666 !important;
            text-align: center;
        }

        /* ==================================================================
           Печать / PDF списка "Снаряги" (js/gear.js downloadGearScreenPdf) —
           тот же приём, что и у отчёта выше: перед съёмкой владелец временно
           переключается в read-only-превью (см. gearScreenReadOnlyPreview), так
           что полей ввода в canvas почти нет — здесь только светлая тема и
           скрытие оставшегося интерактива (вкладки графика, баннер фильтра,
           кнопки шапки/вкладок). Легенда графика — тоже <button>, но НЕ скрыта:
           в ней сама статистика (подпись+вес), которая должна попасть в PDF.
           ================================================================== */
        #gearScreen.gear-pdf-mode .report-page {
            max-width: 100%;
            height: auto;
            overflow: visible;
            padding: 0;
        }

        #gearScreen.gear-pdf-mode {
            height: auto !important;
            overflow: visible !important;
        }

        #gearScreen.gear-pdf-mode :not([style*="background"]) {
            background-color: transparent !important;
            color: #111 !important;
            box-shadow: none !important;
            text-shadow: none !important;
        }

        #gearScreen.gear-pdf-mode .pricing-nav,
        #gearScreen.gear-pdf-mode .gear-screen-header-actions,
        #gearScreen.gear-pdf-mode .report-tabs,
        #gearScreen.gear-pdf-mode .gear-chart-view-tabs,
        #gearScreen.gear-pdf-mode .gear-filter-banner,
        #gearScreen.gear-pdf-mode .gear-item-note-btn {
            display: none !important;
        }

        #gearScreen.gear-pdf-mode canvas {
            max-width: 100% !important;
            height: auto !important;
        }

        /* ==================================================================
           Печать куска карты в PDF (js/map-print.js, по образцу nakarte.me).
           Своя floating-пара кнопка+панель в левом нижнем углу карты (НЕ общий
           .map-flyout — тот на мобильном разворачивается на весь экран, закрывая
           карту, а тут пользователю нужно ВИДЕТЬ и двигать карту под рамкой
           прямо во время настройки, см. фидбек пользователя). Одинаковое
           поведение на десктопе и мобильном — разница только в размере панели
           (мобильный override в самом конце этого блока).
           ================================================================== */

        .map-print-btn {
            position: absolute;
            left: 10px;
            bottom: 28px;
            z-index: 900;
            width: 34px;
            height: 34px;
            border: none;
            border-radius: var(--radius-sm);
            background: white;
            color: #444;
            font-size: 14px;
            cursor: pointer;
            box-shadow: var(--shadow-sm);
            transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
        }

        .map-print-btn:hover {
            color: var(--brand);
        }

        .map-print-btn:active {
            transform: scale(0.94);
        }

        .map-print-btn.active {
            background: var(--brand);
            color: white;
        }

        /* Панель настроек — раскрывается НАД кнопкой. max-height+overflow вместо
           full-screen: карта под ней остаётся видна и доступна для панорамирования
           (весь смысл фичи — двигать карту, глядя на рамку, не закрывая панель). */
        .map-print-panel {
            position: absolute;
            left: 10px;
            bottom: 70px;
            z-index: 1001;
            width: 280px;
            max-width: calc(100vw - 20px);
            max-height: min(420px, 60vh);
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            opacity: 0;
            transform: scale(0.96);
            visibility: hidden;
            pointer-events: none;
            transform-origin: left bottom;
            transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
        }

        .map-print-panel.open {
            opacity: 1;
            transform: scale(1);
            visibility: visible;
            pointer-events: auto;
            transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
        }

        .map-print-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            font-size: 14px;
            font-weight: 700;
            border-bottom: 1px solid #eee;
            flex-shrink: 0;
        }

        .map-print-body {
            padding: 10px 14px 14px;
            overflow-y: auto;
        }

        .map-print-hint {
            font-size: 11.5px;
            color: #888;
            line-height: 1.45;
            margin: 4px 0 8px;
        }

        .map-print-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
            font-size: 12.5px;
            color: #555;
        }

        .map-print-row label {
            flex-shrink: 0;
            width: 64px;
            font-weight: 600;
        }

        .map-print-row select {
            flex: 1;
            min-width: 0;
            padding: 5px 6px;
            border: 1px solid #ddd;
            border-radius: var(--radius-sm);
            background: white;
            color: #333;
            font-family: inherit;
            font-size: 12.5px;
        }

        .map-print-info {
            font-size: 11.5px;
            font-weight: 600;
            color: var(--brand);
            min-height: 16px;
            margin-bottom: 8px;
        }

        .map-print-go {
            width: 100%;
            justify-content: center;
        }

        .map-print-progress {
            font-size: 11.5px;
            color: #666;
            min-height: 16px;
            margin-top: 6px;
        }

        /* Обёртка рамки-видоискателя — overflow:hidden на весь размер карты, чтобы
           гигантская box-shadow "прожектора" самой рамки (см. ниже) не заливала
           затемнением шапку/панели ЗА пределами карты, а обрезалась её границей. */
        .map-print-frame-clip {
            position: absolute;
            inset: 0;
            overflow: hidden;
            pointer-events: none;
            z-index: 850;
        }

        /* Рамка-видоискатель: показывает будущую область листа; всё вокруг
           слегка затемняется гигантской box-shadow (приём "прожектора"),
           обрезанной по границе карты обёрткой .map-print-frame-clip выше.
           left/top/width/height проставляет JS (updateMapPrintFrame). */
        .map-print-frame {
            position: absolute;
            pointer-events: none;
            border: 2px solid var(--brand);
            border-radius: 2px;
            box-shadow: 0 0 0 9999px rgba(20, 30, 30, 0.18);
        }

        /* Мобильный — панель заметно ниже (жалоба пользователя: full-screen версия
           не оставляла видимой карты, чтобы её подвинуть под рамку). ~40% высоты
           экрана — достаточно для формы настроек, большая часть карты остаётся
           видна и доступна для панорамирования прямо во время настройки.
           Кнопка и панель ещё и подняты выше своего десктопного места — на
           мобильном снизу карты всегда видна свёрнутая нижняя шторка правой
           панели (ручка + вкладки "Упр./Карта/Профиль/Настройки", ровно 64px,
           см. .side-panel.mobile-collapsed) поверх карты с БОЛЬШИМ z-index —
           на исходной высоте (bottom:28px) кнопка целиком пряталась под ней
           (баг, найден пользователем по скриншоту). Поднимаем на высоту этой
           полосы + запас на "выемку" безопасной зоны у смартфонов с чёлкой. */
        @media (max-width: 768px) {
            .map-print-btn {
                bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 12px);
            }

            /* Заметно компактнее десктопной версии (жалоба пользователя: панель
               была слишком большой) — уже сама по себе значимая часть узкого
               экрана, тут в разы важнее плотность, чем на широкой десктопной
               панели. Подсказка-хинт (не критичная, разово прочитанная) убрана
               совсем, отступы/шрифты полей уменьшены. */
            .map-print-panel {
                bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 54px);
                width: calc(100vw - 32px);
                max-width: 260px;
                max-height: 30vh;
            }

            .map-print-header {
                padding: 9px 12px;
                font-size: 13px;
            }

            .map-print-body {
                padding: 8px 12px 10px;
            }

            .map-print-row {
                margin-bottom: 6px;
                font-size: 11px;
            }

            .map-print-row label {
                width: 48px;
            }

            .map-print-row select {
                padding: 4px 5px;
                font-size: 11px;
            }

            .map-print-hint {
                display: none;
            }

            .map-print-info {
                font-size: 10.5px;
                margin-bottom: 6px;
            }
        }

        /* ========================================================================
           «Снаряга» — списки снаряжения/раскладки (#gearScreen, см. js/gear.js)
           Экран использует тот же тёмный .report-page/.report-header/.report-tabs,
           что и «Анализ маршрута» — здесь только то, что специфично для снаряги.
           ======================================================================== */
        .gear-screen-thumb {
            margin-top: 14px;
            max-width: 280px;
            border-radius: var(--radius-md);
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }

        .gear-screen-thumb img {
            width: 100%;
            display: block;
        }

        /* Описание маршрута (п.10 фидбека) — видно, когда снаряга открыта
           прикреплённой к конкретному маршруту и у него есть описание. */
        .gear-screen-route-description {
            max-width: 860px;
            margin-top: 12px;
            font-size: 13.5px;
            line-height: 1.5;
            opacity: 0.8;
            white-space: pre-wrap;
        }

        .gear-screen-header-actions {
            display: flex;
            gap: 8px;
            margin-top: 14px;
            flex-wrap: wrap;
        }

        .gear-list-header-row {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px;
        }

        .gear-list-name-input {
            flex: 1;
            min-width: 0;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: var(--radius-sm);
            color: white;
            font-size: 16px;
            font-weight: 700;
            padding: 8px 12px;
        }

        .gear-list-name-input:focus {
            outline: none;
            border-color: var(--brand-light, #4db6ac);
        }

        .gear-header-btn {
            white-space: nowrap;
        }

        .gear-list-actions-row {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-bottom: 16px;
        }

        /* Кнопки действий над списком ("Обновить из шаблона"/"Сохранить как
           шаблон"/"Поделиться") — по фидбоку сделаны компактнее (мельче отступы
           и шрифт), чтобы не занимали половину экрана над самим списком вещей. */
        .gear-list-actions-row .admin-btn {
            padding: 5px 10px;
            font-size: 0.8rem;
        }
        .gear-list-actions-row .admin-btn i {
            font-size: 0.85em;
        }

        /* Выпадающий список выбора шаблона для замены прикреплённого */
        .gear-swap-select {
            max-width: 200px;
            padding: 5px 8px;
            font-size: 0.8rem;
            border-radius: var(--radius-sm, 6px);
        }

        .gear-list-readonly-title {
            font-size: 1.3rem;
            font-weight: 800;
            margin-bottom: 14px;
        }

        /* Подсказка-апселл, когда Free открывает прикреплённый к маршруту список
           (правка под маршрут — Pro). Экран «Снаряга» тёмный (var(--ink), белый
           текст) — поэтому подсказка светлая: полупрозрачный светлый фон и
           светлый текст, иначе не читалась бы. */
        .gear-pro-notice {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.22);
            border-radius: var(--radius-md, 10px);
            padding: 10px 14px;
            margin-bottom: 14px;
            font-size: 0.88rem;
            line-height: 1.5;
            color: rgba(255, 255, 255, 0.92);
        }
        .gear-pro-notice > i {
            color: #ffd966;
            margin-top: 2px;
        }
        .gear-pro-notice-link {
            background: none;
            border: none;
            padding: 0;
            color: #ffd966;
            font-weight: 700;
            cursor: pointer;
            text-decoration: underline;
            font-size: inherit;
        }

        /* ---- Статистика веса ---- */
        .gear-stats-row {
            display: flex;
            justify-content: space-around;
            gap: 12px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-md);
            padding: 14px 10px;
            margin-bottom: 16px;
        }

        .gear-stat-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .gear-stat-item .value {
            font-size: 18px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }

        .gear-stat-item.total .value {
            color: var(--brand-light, #4db6ac);
            font-size: 21px;
        }

        .gear-stat-item .label {
            font-size: 11px;
            opacity: 0.7;
            margin-top: 2px;
        }

        /* ---- Раскладка: без персонажа, просто итог + дни похода ---- */
        .gear-food-summary {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            gap: 24px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-md);
            padding: 16px;
            margin-bottom: 16px;
        }

        .gear-food-days {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .gear-food-days label {
            font-size: 11px;
            opacity: 0.7;
        }

        .gear-food-days input {
            width: 64px;
            text-align: center;
            padding: 6px;
            border-radius: var(--radius-sm);
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(255, 255, 255, 0.06);
            color: white;
        }

        /* ---- Статистика: упрощённая строка (когда есть участники, п.6 фидбека) ---- */
        .gear-stats-row-simple {
            justify-content: center;
        }

        /* ---- Круговой график статистики (Chart.js), заменил фигурку персонажа
           (п.5 фидбека) — тот же тёмный стиль карточки, что и у других блоков экрана. ---- */
        .gear-stats-chart-block {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-md);
            padding: 16px;
            margin-bottom: 16px;
        }

        .gear-chart-view-tabs {
            display: flex;
            gap: 6px;
            margin-bottom: 14px;
            flex-wrap: wrap;
        }

        .gear-chart-view-tab {
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.75);
            border-radius: var(--radius-pill);
            padding: 5px 14px;
            font-size: 12.5px;
            cursor: pointer;
            transition: background var(--dur-fast, 0.14s) var(--ease-out, ease);
        }

        .gear-chart-view-tab:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .gear-chart-view-tab.active {
            background: var(--brand);
            border-color: var(--brand);
            color: white;
            font-weight: 700;
        }

        .gear-stats-chart-row {
            display: flex;
            align-items: center;
            gap: 22px;
            flex-wrap: wrap;
        }

        .gear-stats-chart-canvas-wrap {
            position: relative;
            width: 140px;
            height: 140px;
            flex-shrink: 0;
        }

        .gear-stats-chart-legend {
            flex: 1;
            min-width: 160px;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .gear-chart-legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            border: 1px solid transparent;
            background: none;
            border-radius: var(--radius-sm);
            padding: 4px 8px;
            cursor: pointer;
            font-size: 12.5px;
            color: white;
            text-align: left;
            transition: background var(--dur-fast, 0.14s) var(--ease-out, ease);
        }

        .gear-chart-legend-item:hover {
            background: rgba(255, 255, 255, 0.06);
        }

        .gear-chart-legend-item.active {
            background: rgba(var(--brand-rgb), 0.18);
            border-color: rgba(var(--brand-rgb), 0.4);
        }

        .gear-chart-legend-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .gear-chart-legend-label {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .gear-chart-legend-value {
            opacity: 0.7;
            font-variant-numeric: tabular-nums;
            flex-shrink: 0;
        }

        .gear-chart-legend-reset {
            align-self: flex-start;
            margin-top: 4px;
            border: none;
            background: none;
            color: var(--brand-light, #4db6ac);
            cursor: pointer;
            font-size: 12px;
            padding: 4px 8px;
        }

        .gear-chart-legend-reset:hover {
            text-decoration: underline;
        }

        /* ---- Баннер активного фильтра списка вещей (п.2 фидбека) ---- */
        .gear-filter-banner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            background: rgba(var(--brand-rgb), 0.14);
            border: 1px solid rgba(var(--brand-rgb), 0.3);
            border-radius: var(--radius-sm);
            padding: 8px 12px;
            margin-bottom: 10px;
            font-size: 13px;
        }

        .gear-filter-banner button {
            border: none;
            background: none;
            color: white;
            cursor: pointer;
            font-size: 12.5px;
            opacity: 0.85;
        }

        .gear-filter-banner button:hover {
            opacity: 1;
        }

        .gear-category-name-clickable,
        .gear-member-name-clickable {
            cursor: pointer;
        }

        .gear-category-name-clickable:hover,
        .gear-member-name-clickable:hover {
            text-decoration: underline;
        }

        .gear-member-chip.active {
            background: rgba(var(--brand-rgb), 0.22);
            border-color: rgba(var(--brand-rgb), 0.5);
        }

        /* ---- Список предметов ---- */
        .gear-items-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 14px;
        }

        .gear-item-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: var(--radius-sm);
            padding: 8px 10px;
            transition: opacity var(--dur-fast, 0.14s) var(--ease-out, ease);
        }

        .gear-item-row.packed {
            opacity: 0.55;
        }

        .gear-item-row.gear-item-readonly {
            padding: 7px 10px;
        }

        .gear-item-icon-btn,
        .gear-item-more-btn,
        .gear-item-delete-btn {
            width: 30px;
            height: 30px;
            flex-shrink: 0;
            border: none;
            border-radius: var(--radius-sm);
            background: rgba(255, 255, 255, 0.08);
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background var(--dur-fast, 0.14s) var(--ease-out, ease);
        }

        .gear-item-icon-btn:hover,
        .gear-item-more-btn:hover {
            background: rgba(255, 255, 255, 0.16);
        }

        .gear-item-delete-btn:hover {
            background: rgba(229, 57, 53, 0.35);
        }

        /* Пикер иконок вещи — переиспользует разметку .mark-icon-picker (попапы
           меток на карте), но та стилизована под светлый попап; здесь тёмный экран
           "Снаряги" — переопределяем компактнее и под тёмную тему (пункт 1 фидбека:
           "окошко иконок" было плохо видно и занимало много места на маленьких иконках). */
        .gear-icon-picker {
            flex-basis: 100%;
            max-width: 380px;
            max-height: 190px;
            overflow-y: auto;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-sm);
            padding: 8px;
        }

        .gear-icon-picker .mark-icon-group-label {
            color: rgba(255, 255, 255, 0.55);
        }

        /* Было repeat(8, 1fr) — на широкой строке колонки растягивались куда шире
           самих иконок, между ними образовывались большие пустые промежутки, и
           панель выглядела громоздкой (пункт 2 фидбека). flex-wrap пакует иконки
           плотно друг к другу без искусственного растяжения колонок. */
        .gear-icon-picker .mark-icon-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
        }

        .gear-icon-picker .mark-icon-option {
            width: 26px;
            height: 26px;
            flex-shrink: 0;
            background: rgba(255, 255, 255, 0.06);
            color: rgba(255, 255, 255, 0.8);
            font-size: 11px;
        }

        .gear-icon-picker .mark-icon-option:hover {
            background: rgba(var(--brand-rgb), 0.25);
            color: white;
        }

        .gear-icon-picker .mark-icon-option.selected {
            background: var(--brand);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .gear-item-name-input {
            flex: 1 1 160px;
            min-width: 100px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: var(--radius-sm);
            color: white;
            padding: 6px 10px;
            font-size: 13.5px;
        }

        .gear-item-weight-input {
            width: 68px;
        }

        .gear-item-qty-input {
            width: 52px;
        }

        .gear-item-weight-input,
        .gear-item-qty-input {
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: var(--radius-sm);
            color: white;
            padding: 6px 8px;
            font-size: 13px;
            text-align: center;
        }

        .gear-item-name-input:focus,
        .gear-item-weight-input:focus,
        .gear-item-qty-input:focus {
            outline: none;
            border-color: var(--brand-light, #4db6ac);
        }

        .gear-item-check {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 12px;
            opacity: 0.85;
        }

        .gear-item-check-worn i,
        .gear-item-check-consumable i {
            font-size: 11px;
        }

        .gear-item-check-consumable i {
            color: #ffb74d;
        }

        /* ---- Ссылка/цена/заметка (разворачивается по кнопке "..."), пункт 2 фидбека:
           заметка — полноразмерная растущая textarea, а не тесная однострочная
           строка вперемешку со ссылкой/ценой. ---- */
        .gear-item-details {
            display: none;
            flex-direction: column;
            flex-basis: 100%;
            gap: 8px;
            margin-top: 4px;
        }

        .gear-item-details-row {
            display: flex;
            gap: 8px;
        }

        .gear-item-details-row input {
            flex: 1;
            min-width: 100px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: var(--radius-sm);
            color: white;
            padding: 6px 10px;
            font-size: 13px;
        }

        .gear-item-note-input {
            width: 100%;
            min-height: 46px;
            resize: vertical;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: var(--radius-sm);
            color: white;
            padding: 8px 10px;
            font-size: 13px;
            font-family: inherit;
            line-height: 1.4;
        }

        .gear-item-note-input:focus,
        .gear-item-details-row input:focus {
            outline: none;
            border-color: var(--brand-light, #4db6ac);
        }

        /* Вкладка "Заметки" — произвольный текст на весь маршрут (расходы,
           логистика и т.п.), не список вещей — своя, гораздо более простая
           разметка тела экрана (см. renderGearListEditor, list.type === 'notes'). */
        .gear-notes-textarea {
            width: 100%;
            min-height: 320px;
            resize: vertical;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: var(--radius-sm);
            color: white;
            padding: 14px 16px;
            font-size: 14px;
            font-family: inherit;
            line-height: 1.6;
        }

        .gear-notes-textarea:focus {
            outline: none;
            border-color: var(--brand-light, #4db6ac);
        }

        .gear-notes-readonly {
            white-space: pre-wrap;
            word-break: break-word;
            color: white;
            font-size: 14px;
            line-height: 1.6;
            background: rgba(255, 255, 255, 0.06);
            border-radius: var(--radius-sm);
            padding: 14px 16px;
            min-height: 80px;
        }

        /* Точка-индикатор на кнопке "..." — видно, что у вещи уже есть заметка,
           не открывая её. */
        .gear-item-more-btn {
            position: relative;
        }

        .gear-item-more-btn.has-note::after {
            content: '';
            position: absolute;
            top: 5px;
            right: 5px;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--brand-light, #4db6ac);
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
        }

        /* ---- Read-only-строка (публичная ссылка) ---- */
        .gear-item-readonly-wrap {
            position: relative;
            display: flex;
            flex-direction: column;
        }

        /* Кнопка-иконка заметки в read-only-строке (пункт 1 фидбека) — открывает
           всплывающее окошко .gear-item-note-popover рядом, не разворачивает
           заметку прямо в строке (неудобно для длинных заметок). */
        .gear-item-note-btn {
            border: none;
            background: none;
            color: var(--brand-light, #4db6ac);
            opacity: 0.8;
            cursor: pointer;
            padding: 2px 4px;
            font-size: 13px;
        }

        .gear-item-note-btn:hover {
            opacity: 1;
        }

        .gear-item-note-popover {
            position: absolute;
            top: 0;
            left: 100%;
            margin-left: 8px;
            width: 240px;
            max-width: calc(100vw - 40px);
            background: rgba(20, 30, 30, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: var(--radius-md);
            padding: 10px 30px 10px 12px;
            box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.4));
            z-index: 20;
        }

        .gear-item-note-popover-text {
            font-size: 12.5px;
            line-height: 1.4;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .gear-item-note-popover-close {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 20px;
            height: 20px;
            border: none;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.08);
            color: white;
            cursor: pointer;
            font-size: 11px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .gear-item-note-popover-close:hover {
            background: rgba(255, 255, 255, 0.18);
        }

        @media (max-width: 560px) {
            .gear-item-note-popover {
                left: 0;
                top: 100%;
                margin-left: 0;
                margin-top: 6px;
                width: 100%;
                max-width: 100%;
            }
        }

        .gear-item-icon {
            width: 26px;
            text-align: center;
            color: var(--brand-light, #4db6ac);
        }

        .gear-item-name {
            flex: 1;
            min-width: 100px;
        }

        .gear-item-weight {
            font-variant-numeric: tabular-nums;
            opacity: 0.85;
        }

        .gear-item-qty {
            opacity: 0.6;
            font-size: 12px;
        }

        .gear-item-flag {
            color: var(--brand-light, #4db6ac);
            font-size: 12px;
        }

        .gear-item-link {
            color: inherit;
            opacity: 0.7;
        }

        .gear-item-link:hover {
            opacity: 1;
        }

        /* ---- Пустые состояния и прикрепление шаблона ---- */
        .gear-empty-hint {
            text-align: center;
            opacity: 0.6;
            padding: 20px 0;
        }

        .gear-attach-prompt {
            text-align: center;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-md);
            padding: 26px 20px;
        }

        .gear-attach-row {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin: 14px 0;
            flex-wrap: wrap;
        }

        .gear-attach-row select {
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            border: 1px solid rgba(255, 255, 255, 0.2);
            background: white;
            color: var(--ink);
        }

        .gear-add-item-btn {
            width: 100%;
        }

        /* ---- Категории (пункт 4 фидбека) ---- */
        .gear-list-footer-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .gear-category-block {
            margin-bottom: 18px;
        }

        .gear-category-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 6px 2px 8px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.12);
            margin-bottom: 8px;
        }

        .gear-category-name {
            flex: 1;
            min-width: 0;
            font-weight: 700;
            font-size: 14px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .gear-category-block-uncat .gear-category-name {
            font-weight: 600;
            font-style: italic;
            opacity: 0.65;
        }

        .gear-category-meta {
            font-size: 12px;
            opacity: 0.6;
            white-space: nowrap;
        }

        .gear-category-actions {
            display: flex;
            gap: 2px;
            flex-shrink: 0;
        }

        .gear-category-actions button {
            width: 26px;
            height: 26px;
            border: none;
            border-radius: var(--radius-sm);
            background: none;
            color: rgba(255, 255, 255, 0.55);
            cursor: pointer;
            font-size: 12px;
        }

        .gear-category-actions button:hover {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

        .gear-empty-hint-sm {
            text-align: center;
            opacity: 0.5;
            font-size: 12px;
            padding: 6px 0 10px;
        }

        .gear-add-item-btn-sm {
            width: 100%;
            font-size: 12.5px;
            padding: 6px 10px;
            margin-bottom: 14px;
        }

        .gear-add-category-btn {
            width: 100%;
            margin-top: 4px;
        }

        .gear-item-category-select {
            width: 100%;
            margin-bottom: 8px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: var(--radius-sm);
            color: white;
            padding: 6px 10px;
            font-size: 13px;
        }

        .gear-item-category-select option {
            color: var(--ink);
        }

        /* ---- Участники похода / "кто что несёт" (пункт 5 фидбека) ---- */
        .gear-members-panel {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-md);
            padding: 14px 16px;
            margin-bottom: 16px;
        }

        .gear-members-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 10px;
        }

        .gear-members-title {
            font-size: 13px;
            font-weight: 700;
            opacity: 0.85;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .gear-members-add-btn {
            border: none;
            background: rgba(var(--brand-rgb), 0.25);
            color: white;
            border-radius: var(--radius-pill);
            padding: 4px 12px;
            font-size: 12px;
            cursor: pointer;
        }

        .gear-members-add-btn:hover {
            background: rgba(var(--brand-rgb), 0.4);
        }

        .gear-members-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .gear-member-chip {
            display: flex;
            align-items: center;
            gap: 6px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: var(--radius-pill);
            padding: 5px 6px 5px 12px;
            font-size: 12.5px;
        }

        .gear-member-chip-unassigned {
            opacity: 0.6;
            font-style: italic;
        }

        .gear-member-name {
            font-weight: 600;
        }

        .gear-member-weight {
            opacity: 0.7;
            font-variant-numeric: tabular-nums;
        }

        .gear-member-chip button {
            width: 20px;
            height: 20px;
            border: none;
            border-radius: 50%;
            background: none;
            color: rgba(255, 255, 255, 0.55);
            cursor: pointer;
            font-size: 10px;
        }

        .gear-member-chip button:hover {
            background: rgba(255, 255, 255, 0.12);
            color: white;
        }

        .gear-item-assignee-tag {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 11.5px;
            color: var(--brand-light, #4db6ac);
            opacity: 0.9;
            white-space: nowrap;
        }

        .gear-item-assignee-select {
            width: 100%;
            margin-bottom: 8px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: var(--radius-sm);
            color: white;
            padding: 6px 10px;
            font-size: 13px;
        }

        .gear-item-assignee-select option {
            color: var(--ink);
        }

        /* ---- Библиотека шаблонов (личный кабинет) ---- */
        .gear-library-group {
            margin-bottom: 28px;
        }

        .gear-library-group-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .gear-library-group-header h3 {
            font-size: 15px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .gear-template-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 14px;
        }

        .gear-template-card {
            background: white;
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-sm);
            padding: 14px 16px;
            transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
        }

        .gear-template-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        .gear-template-card-name {
            font-weight: 700;
            font-size: 14.5px;
            margin-bottom: 4px;
        }

        .gear-template-card-meta {
            font-size: 12px;
            color: #777;
            margin-bottom: 10px;
        }

        .gear-template-card-actions {
            display: flex;
            gap: 6px;
        }

        /* .edit-btn/.delete-btn обычно стилизуются только внутри .route-card
           .route-actions (см. выше) — здесь та же геометрия и цвета своим
           селектором, карточка шаблона не является .route-card. */
        .gear-template-card-actions button {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 13px;
            padding: 4px 7px;
            border-radius: var(--radius-sm);
            transition: background-color var(--dur-base) var(--ease-out);
        }

        .gear-template-card-actions .edit-btn {
            color: #8a6d3b;
        }

        .gear-template-card-actions .edit-btn:hover {
            background: rgba(138, 109, 59, 0.1);
        }

        .gear-template-card-actions .delete-btn {
            color: #c05050;
        }

        .gear-template-card-actions .delete-btn:hover {
            background: rgba(192, 80, 80, 0.1);
        }

        /* Легенда чекбоксов "упаковано/надето/расходник" — на десктопе их поясняет
           title-подсказка при наведении, поэтому строка скрыта; включается только
           на мобильном (ниже), где наведения нет. Экран "Снаряги" тёмный
           (.report-page { background: var(--ink); color: white }) — раньше тут
           стоял светлый набор (тёмный текст на светлой подложке), из-за чего
           легенда была практически не видна на тёмном фоне; цвет/фон — как у
           остальных приглушённых надписей на этом экране (белый с opacity, см.
           .gear-category-meta/.gear-empty-hint), а не отдельный серый оттенок. */
        .gear-items-legend {
            display: none;
            gap: 14px;
            flex-wrap: wrap;
            padding: 6px 10px;
            margin-bottom: 6px;
            background: rgba(255, 255, 255, 0.06);
            border-radius: var(--radius-sm, 6px);
            font-size: 11px;
            color: white;
            opacity: 0.7;
        }

        .gear-items-legend span {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .gear-items-legend i {
            font-size: 11px;
            width: 14px;
            text-align: center;
        }

        @media (max-width: 768px) {
            .gear-stats-chart-row {
                flex-direction: column;
                align-items: stretch;
            }

            .gear-stats-row {
                flex-wrap: wrap;
            }

            .gear-items-legend {
                display: flex;
                /* Список вещей может быть длинным и разбит на категории — легенда
                   стоит один раз в самом верху, до всех категорий, и её легко
                   проскроллить мимо. "Прилипает" к верху скролл-контейнера
                   (.report-page, см. общее правило выше — overflow-y:auto),
                   поэтому остаётся на виду. Фон непрозрачный (не 0.06 как в
                   покое), чтобы скроллящийся контент не просвечивал под ней. */
                position: sticky;
                top: 0;
                z-index: 3;
                background: var(--ink);
                opacity: 1;
            }

            /* Разворачиваемые доп.поля вещи (ссылка/цена) — раньше стояли в ряд
               (flex, min-width:100px каждое) и не помещались на узком экране,
               "Цена, ₽" обрезалась за край экрана (баг с реального скриншота).
               На мобильном — друг под другом, каждое на всю ширину. */
            .gear-item-details-row {
                flex-direction: column;
            }

            .gear-item-details-row input {
                min-width: 0;
            }
        }
