/* HotTrip: мобильный режим (до 767px). Тот же HTML и контент, другая раскладка.
   Подключается после tailwind.min.css, поэтому правила идут с !important там, где Tailwind задаёт жёсткую высоту. */

/* Элементы мобильного интерфейса, которые создаёт mobile.js, на широких экранах скрыты */
.m-only { display: none; }
.m-hint { display: none; }

@media (max-width: 767px) {
    html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; overflow-x: clip; }
    body { overflow-x: clip; }
    .m-only { display: revert; }
    .m-hide { display: none !important; }

    /* ---------- Верхняя полоса и шапка ---------- */
    #service-bar { display: none !important; }
    header.sticky { padding-top: env(safe-area-inset-top); }
    header.sticky > div { padding: 10px 16px !important; gap: 12px !important; }
    header.sticky nav { display: none !important; }
    header.sticky > div > button[onclick*="toggleTheme"] { display: none !important; }
    header.sticky a[href="#"] .text-\[1\.25rem\] { font-size: 1.375rem; }
    .m-head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
    .m-icon-btn {
        display: inline-flex; align-items: center; justify-content: center; gap: 8px;
        min-width: 44px; height: 44px; padding: 0 12px; border-radius: 14px; border: 0;
        font-size: 14px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent;
    }
    .m-chat-btn { background: #ff6d00; color: #fff; box-shadow: 0 4px 12px rgba(255,109,0,.35); }
    .m-menu-btn { background: #eef3ff; color: #0066e6; }
    html.dark .m-menu-btn { background: #1b2740; color: #8ab4ff; }

    /* ---------- Меню-бургер ---------- */
    .m-drawer-backdrop {
        position: fixed; inset: 0; z-index: 90; background: rgba(15,23,42,.55);
        opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    .m-drawer {
        position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(86vw, 360px);
        background: #fff; color: #0f172a; display: flex; flex-direction: column;
        transform: translateX(100%); transition: transform .24s cubic-bezier(.16,1,.3,1);
        padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
        box-shadow: -12px 0 40px rgba(15,23,42,.25);
    }
    html.dark .m-drawer { background: #11192e; color: #f1f5f9; }
    html.m-menu-open .m-drawer-backdrop { opacity: 1; pointer-events: auto; }
    html.m-menu-open .m-drawer { transform: none; }
    html.m-menu-open, html.m-chat-open, html.m-city-open { overflow: hidden; }
    .m-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid rgba(148,163,184,.25); }
    .m-drawer-title { font-size: 18px; font-weight: 900; }
    .m-close-btn {
        display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 14px;
        background: #f1f5f9; color: #0f172a; border: 0; font-size: 15px; font-weight: 800; cursor: pointer;
    }
    html.dark .m-close-btn { background: #1e293b; color: #f1f5f9; }
    .m-drawer-list { flex: 1; overflow-y: auto; padding: 8px 12px; }
    .m-drawer-link {
        display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 0 12px; border: 0;
        background: transparent; color: inherit; font-size: 17px; font-weight: 700; text-align: left; text-decoration: none;
        border-radius: 14px; cursor: pointer;
    }
    .m-drawer-link:active { background: rgba(0,102,230,.08); }
    .m-drawer-link i { width: 24px; text-align: center; color: #0066e6; font-size: 18px; }
    .m-drawer-sep { height: 1px; margin: 8px 12px; background: rgba(148,163,184,.25); }
    .m-drawer-foot { padding: 12px 16px 16px; font-size: 13px; color: #64748b; }

    /* ---------- Главная: основной экран с поиском ---------- */
    main { padding-top: 12px !important; padding-bottom: 24px !important; row-gap: 0; }
    main > * + * { margin-top: 28px !important; }
    main > #search-hero { margin-top: 0 !important; }
    #search-hero { border-radius: 24px !important; padding: 16px !important; }

    #search-hero #route-grid {
        display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px;
        height: auto !important; background: transparent !important; box-shadow: none !important;
        overflow: visible !important; border: 0 !important; width: 100%; min-width: 0;
    }
    #search-hero #route-grid > * {
        min-width: 0; box-sizing: border-box;
        background: #fff; color: #0f172a; border: 0 !important; border-radius: 16px;
        min-height: 60px; height: auto !important; padding: 0 16px !important;
        box-shadow: 0 2px 10px rgba(0,40,120,.18);
    }
    #search-hero #cell-flight-from, #search-hero #cell-flight-to, #search-hero #cell-passengers-simple { grid-column: 1 / -1; }
    #search-hero #simple-route-container, #search-hero #simple-route-container > div { min-width: 0; max-width: 100%; }
    #search-hero #route-grid input { width: 100%; max-width: 100%; }
    #search-hero #route-grid input[type="text"] {
        font-size: 18px !important; font-weight: 700 !important; height: 60px; min-width: 0; color: #0f172a;
    }
    #search-hero #route-grid input[type="text"]::placeholder { font-weight: 600; color: #94a3b8; }
    #search-hero #route-grid input[type="date"] {
        font-size: 16px !important; font-weight: 700; height: 60px; min-width: 0; text-align: left;
        -webkit-appearance: none; appearance: none; color: #0f172a;
    }
    #search-hero #cell-passengers-simple { min-height: 56px; }
    #search-hero #passengers-display-simple { font-size: 16px !important; font-weight: 700; }
    #search-hero #class-display-simple { font-size: 12px !important; }
    #search-hero #date-back-disabled-placeholder { border-radius: 16px; font-size: 15px; }

    /* Кнопка поиска */
    #search-hero #simple-route-container > div:first-child { gap: 12px !important; }
    #search-hero button[type="submit"] {
        width: 100%; height: 60px !important; font-size: 19px !important; font-weight: 900 !important;
        border-radius: 16px !important; padding: 0 16px !important;
    }

    /* Под кнопкой: чипсы направлений, «Фильтры», сложный маршрут */
    #search-extras { display: flex !important; flex-direction: column; align-items: stretch !important; gap: 12px !important; padding: 6px 0 0 !important; }
    #search-extras > div { display: contents !important; }
    #search-extras { min-width: 0; }
    #search-extras .m-chips {
        order: 1; display: flex !important; flex-wrap: nowrap !important; gap: 8px !important;
        overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; width: calc(100% + 32px); min-width: 0; max-width: none; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    #search-extras .m-chips::-webkit-scrollbar { display: none; }
    #search-extras .m-chips > span { display: none; }
    #search-extras .m-chips > button {
        flex: 0 0 auto; min-height: 44px; padding: 0 18px; border-radius: 999px; text-decoration: none !important;
        background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); color: #fff; font-size: 15px; font-weight: 700;
        margin-left: 0 !important;
    }
    #search-extras .m-chips > button:active { background: rgba(255,255,255,.32); }
    #search-extras > div > span.text-white\/30 { display: none; }
    .m-filters-btn {
        order: 2; display: flex !important; align-items: center; justify-content: space-between; width: 100%;
        min-height: 48px; padding: 0 4px; background: transparent; border: 0; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
    }
    .m-filters-btn i { transition: transform .2s; }
    #search-hero.m-filters-open .m-filters-btn i { transform: rotate(180deg); }
    #search-extras .m-filter { order: 3; display: none !important; min-height: 48px; font-size: 16px; justify-content: flex-start; gap: 12px; }
    #search-extras .m-complex { order: 4; display: none !important; }
    #search-hero.m-filters-open .m-filter { display: flex !important; }
    .m-hint { display: block; font-size: 12px; font-weight: 500; opacity: .85; margin-top: 2px; }
    .m-hint::before { content: none; }
    #search-hero.m-filters-open .m-complex { display: flex !important; min-height: 48px; font-size: 16px; }

    /* Сложный маршрут: сегменты друг под другом */
    #complex-route-container .complex-leg > div { display: grid !important; grid-template-columns: 1fr 1fr; height: auto !important; gap: 8px; background: transparent !important; box-shadow: none !important; overflow: visible !important; }
    #complex-route-container .complex-leg > div > div { background: #fff; border-radius: 14px; min-height: 56px; height: auto !important; border: 0 !important; }
    #complex-route-container .complex-leg > div > div:first-child, #complex-route-container .complex-leg > div > div:nth-child(2) { grid-column: 1 / -1; }
    #complex-route-container input { font-size: 17px !important; height: 56px; }
    #complex-route-container button { min-height: 52px; height: auto !important; }

    /* Пассажиры: нижний лист */
    #passengers-dropdown {
        position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important;
        width: 100% !important; max-width: none !important; border-radius: 24px 24px 0 0 !important; z-index: 95 !important;
        padding: 20px 20px calc(20px + env(safe-area-inset-bottom)) !important; max-height: 88vh; overflow-y: auto;
        box-shadow: 0 -12px 40px rgba(15,23,42,.35) !important;
    }
    #passengers-dropdown .text-sm { font-size: 17px; }
    #passengers-dropdown button[id^="btn-"] { width: 44px; height: 44px; }
    #passengers-dropdown #class-economy-btn, #passengers-dropdown #class-business-btn { min-height: 48px; font-size: 15px; }
    #passengers-dropdown > div > button:last-child { min-height: 52px; font-size: 16px; border-radius: 14px; }
    #passengers-dropdown .text-sm.font-extrabold, #passengers-dropdown span[id$="-count"] { font-size: 18px; width: 28px; }
    .m-sheet-backdrop { position: fixed; inset: 0; z-index: 94; background: rgba(15,23,42,.5); }

    /* ---------- Рекомендованные направления: карусель ---------- */
    #home-deals { padding: 16px !important; border-radius: 24px !important; }
    #home-deals > div:first-child { margin-bottom: 14px !important; }
    #home-deals > div:first-child > div:last-child { display: none; }
    #home-deals h2 { font-size: 1.375rem !important; line-height: 1.2; }
    #destinations-track {
        scroll-snap-type: x mandatory; gap: 12px; margin: 0 -16px; padding: 0 16px 8px !important;
        -webkit-overflow-scrolling: touch; scroll-padding-left: 16px;
    }
    #destinations-track > * { scroll-snap-align: start; width: 72vw !important; max-width: 300px; flex: 0 0 auto; margin-left: 0 !important; }
    #destinations-track > * a, #destinations-track > * button { min-height: 44px; }
    .recommended-skeleton { width: 72vw !important; max-width: 300px; }

    /* ---------- Журнал ---------- */
    #news h2 { font-size: 1.375rem !important; }
    #news > .grid { gap: 16px !important; }
    #news-side > :nth-child(n+4) { display: none; }
    #news-more, #news-actions button { display: none !important; }
    #news-tabs { margin: 0 -16px; padding: 0 16px 4px; }
    #news-tabs > * { min-height: 44px; flex: 0 0 auto; }

    /* ---------- Разделы портала, направления, гайды ---------- */
    #portal-sections { flex-wrap: nowrap !important; overflow-x: auto; margin-left: -16px !important; margin-right: -16px !important; padding: 0 16px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    #portal-sections::-webkit-scrollbar { display: none; }
    #portal-sections > * { flex: 0 0 auto; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
    #portal-sections > span { display: none; }
    #home-destinations h2, #home-guides h2 { font-size: 1.375rem !important; }
    #home-destinations > div:last-child, #home-guides > div:last-child {
        display: flex !important; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; scroll-padding-left: 16px;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    #home-destinations > div:last-child::-webkit-scrollbar, #home-guides > div:last-child::-webkit-scrollbar { display: none; }
    #home-destinations > div:last-child > a { flex: 0 0 62%; max-width: 260px; height: 140px !important; scroll-snap-align: start; }
    #home-guides > div:last-child > a { flex: 0 0 78%; max-width: 320px; scroll-snap-align: start; min-height: 88px; }

    /* ---------- Результаты поиска: билеты первыми, справка о направлении ниже ---------- */
    #telegram-feed { display: flex !important; flex-direction: column; gap: 14px; margin-top: 20px !important; }
    #telegram-feed.hidden { display: none !important; }
    #telegram-feed > * { margin: 0 !important; min-width: 0; }
    #telegram-feed > div:nth-child(2) { order: 1; align-items: flex-start; }
    #telegram-feed > div:nth-child(2) > div:last-child { display: none; }
    #telegram-feed #search-results-title { font-size: 1.375rem; line-height: 1.2; }
    #telegram-feed #search-results-subtitle { font-size: 14px; margin-top: 4px; }
    #telegram-feed #tickets-container { order: 2; }
    #telegram-feed #dest-info { order: 3; overflow-anchor: none; }
    #telegram-feed #dest-info * { overflow-anchor: none; }

    /* ---------- Карточки билетов: крупный шрифт, цена и кнопка заметны ---------- */
    #tickets-cards-list { display: flex; flex-direction: column; gap: 12px !important; }
    #tickets-cards-list > * { margin: 0 !important; }
    #tickets-cards-list > [data-dest] { padding: 16px !important; border-radius: 20px !important; gap: 14px !important; box-shadow: 0 2px 12px rgba(15,23,42,.08); }
    #tickets-cards-list [class*="text-[0.5rem]"] { font-size: 11px !important; }
    #tickets-cards-list [class*="text-[0.5625rem]"], #tickets-cards-list [class*="text-[0.625rem]"] { font-size: 12px !important; }
    #tickets-cards-list [class*="text-[0.6875rem]"] { font-size: 13px !important; }
    #tickets-cards-list [class*="truncate"] { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
    #tickets-cards-list [class*="max-w-[85px]"] { max-width: none !important; }
    #tickets-cards-list > [data-dest] > div:nth-child(1) { gap: 12px; align-items: center; }
    #tickets-cards-list > [data-dest] > div:nth-child(1) > div:first-child { width: 40px !important; height: 40px !important; border-radius: 12px !important; font-size: 15px !important; }
    #tickets-cards-list > [data-dest] > div:nth-child(1) .font-bold { font-size: 16px !important; line-height: 1.25 !important; }
    #tickets-cards-list > [data-dest] > div:nth-child(1) > div:last-child > div:last-child { flex-wrap: wrap; row-gap: 2px; margin-top: 3px; }
    #tickets-cards-list > [data-dest] > div:nth-child(2) { padding: 12px 14px !important; max-width: none !important; margin: 0 !important; border-radius: 16px !important; }
    #tickets-cards-list > [data-dest] > div:nth-child(2) .font-black { font-size: 22px !important; line-height: 1.1 !important; }
    #tickets-cards-list > [data-dest] > div:nth-child(2) .font-black + div { font-size: 13px !important; font-weight: 700; margin-top: 2px; }
    #tickets-cards-list > [data-dest] > div:nth-child(2) .min-w-\[75px\] { min-width: 90px; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) { padding-top: 14px !important; gap: 12px !important; align-items: center; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:first-child { flex: 0 0 auto; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:first-child .font-black { font-size: 24px !important; line-height: 1.05 !important; white-space: nowrap; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:last-child { flex: 1 1 auto; min-width: 0; gap: 8px; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:last-child > button { width: 46px; height: 48px; flex: 0 0 46px; padding: 0 !important; border-radius: 14px; background: #f1f5f9; }
    html.dark #tickets-cards-list > [data-dest] > div:nth-child(3) > div:last-child > button { background: #1e293b; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:last-child > button i { font-size: 17px !important; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:last-child > a {
        flex: 1 1 auto; min-width: 0; min-height: 48px; font-size: 16px !important; font-weight: 900 !important; border-radius: 14px !important; padding: 0 12px !important;
    }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:last-child > a i { display: none; }
    /* Строка цены и покупки: слева цена, справа кнопки, плашка «по зарубежной карте» отдельной строкой ниже на всю ширину */
    #tickets-cards-list > [data-dest] > div:nth-child(3) {
        display: grid !important; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center; justify-content: stretch;
    }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:first-child { display: contents; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:first-child > * { grid-column: 1; min-width: 0; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:last-child { display: contents; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:last-child > button { grid-column: 2; grid-row: 1 / span 3; align-self: center; justify-self: end; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:last-child > a { grid-column: 1 / -1; grid-row: 5; margin-top: 12px; min-height: 52px; }
    #tickets-cards-list > [data-dest] > div:nth-child(3) > div:first-child > :nth-child(n+4) {
        grid-column: 1 / -1; grid-row: 4; justify-self: start; margin-top: 10px !important; padding: 6px 10px !important;
        font-size: 12px !important; line-height: 1.3 !important; white-space: normal !important; border-radius: 10px !important; max-width: 100%;
    }
    #tickets-progress-banner { padding: 16px !important; border-radius: 18px !important; }
    #neighbor-dates-strip { border-radius: 16px; padding: 8px !important; }
    #neighbor-dates-strip > button { width: 40px !important; height: 44px !important; }
    #neighbor-dates-list > * { min-height: 44px; flex: 0 0 auto; }

    /* Панель маршрута и сортировка: прилипает под шапкой при прокрутке результатов */
    .m-route-bar {
        order: 0; position: sticky; top: var(--m-head-h, 61px); z-index: 35; margin: 0 -16px !important; padding: 10px 16px 8px !important;
        background: rgba(245,247,251,.96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
        border-bottom: 1px solid rgba(148,163,184,.3);
    }
    html.dark .m-route-bar { background: rgba(11,17,32,.96); }
    .m-route-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .m-route-text { min-width: 0; }
    .m-route-text b { display: block; font-size: 16px; font-weight: 900; line-height: 1.25; }
    .m-route-text span { display: block; font-size: 13px; color: #64748b; margin-top: 1px; }
    .m-route-edit { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 14px; border: 0; background: #0066e6; color: #fff; font-size: 15px; font-weight: 800; cursor: pointer; }
    .m-sort { display: flex; gap: 8px; overflow-x: auto; margin: 8px -16px 0; padding: 0 16px; scrollbar-width: none; }
    .m-sort::-webkit-scrollbar { display: none; }
    .m-sort button { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff; color: #0f172a; font-size: 14px; font-weight: 800; cursor: pointer; }
    .m-sort button[aria-pressed="true"] { background: #0066e6; border-color: #0066e6; color: #fff; }
    html.dark .m-sort button { background: #131b2e; color: #e2e8f0; border-color: #334155; }
    html.dark .m-sort button[aria-pressed="true"] { background: #0066e6; color: #fff; border-color: #0066e6; }

    /* ---------- Внутренние страницы: карточки статей списком с миниатюрой ---------- */
    main a[data-card] { flex-direction: row !important; border-radius: 18px !important; min-height: 104px; }
    main a[data-card] > div:first-child { width: 116px; flex: 0 0 116px; height: auto !important; min-height: 104px; }
    main a[data-card] > div:first-child > span { display: none; }
    main a[data-card] > div:last-child { padding: 12px 14px !important; min-width: 0; justify-content: center; }
    main a[data-card] h3 { font-size: 15px !important; line-height: 1.3 !important; }
    main a[data-card] p { display: none !important; }
    main a[data-card] > div:last-child > div { margin-top: 8px !important; font-size: 12px !important; }
    main .grid.grid-cols-1 { gap: 12px !important; }
    main section.mb-12 { margin-bottom: 32px !important; }
    main h1 { font-size: 1.75rem !important; line-height: 1.15 !important; }
    main section h2, main article h2 { text-wrap: balance; }

    main table, article table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    main pre, article pre { max-width: 100%; overflow-x: auto; }
    main img, article img { max-width: 100%; height: auto; }
    [data-filter], [data-filter2] { min-height: 44px; }
    #p-search { font-size: 16px !important; min-height: 48px; }
    .m-toc { position: relative; max-height: 168px; overflow: hidden; }
    .m-toc.m-toc-open { max-height: none; }
    .m-toc:not(.m-toc-open)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 72px; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 85%); pointer-events: none; border-radius: 0 0 16px 16px; }
    html.dark .m-toc:not(.m-toc-open)::after { background: linear-gradient(to bottom, rgba(19,27,46,0), #131b2e 85%); }
    .m-toc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 8px; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; color: #0066e6; font-size: 15px; font-weight: 800; cursor: pointer; }
    html.dark .m-toc-btn { background: #131b2e; border-color: #334155; color: #8ab4ff; }

    /* ---------- Мелкие блоки ---------- */
    main section h2 { text-wrap: balance; }
    main a, main button { -webkit-tap-highlight-color: rgba(0,102,230,.12); }
    footer { margin-top: 32px !important; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

    /* ---------- Cookie-плашка: узкая полоса под меню и чатом ---------- */
    #cookie-banner {
        left: 8px !important; right: 8px !important; bottom: calc(8px + env(safe-area-inset-bottom)) !important;
        z-index: 85 !important; flex-wrap: nowrap !important; gap: 10px !important; padding: 10px 12px !important;
        border-radius: 14px !important; font-size: 12px !important; line-height: 1.35 !important;
    }
    #cookie-banner p { flex: 1 1 auto !important; }
    #cookie-banner button { flex: 0 0 auto; min-height: 44px; padding: 0 14px !important; font-size: 14px !important; }

    /* Даты: чуть компактнее, чтобы формат дд.мм.гггг и крестик помещались */
    #search-hero #route-grid #cell-flight-date-there, #search-hero #route-grid #cell-date-back { padding: 0 12px !important; }
    #search-hero #route-grid input[type="date"] { font-size: 15px !important; }
    #search-hero #cell-date-back input[type="date"] { font-size: 13.5px !important; letter-spacing: -.2px; }
    #search-hero #back-clear-btn { margin-left: 4px !important; width: 26px !important; height: 26px !important; }

    /* ---------- Ассистент: на весь экран ---------- */
    #bot-welcome-bubble, #bot-fab { display: none !important; }
    #bot-popup {
        position: fixed !important; inset: 0 !important; width: 100% !important; max-width: none !important;
        height: var(--m-vh, 100dvh) !important; max-height: none !important; border-radius: 0 !important; border: 0 !important;
        z-index: 100 !important; animation: none !important; bottom: 0 !important; right: 0 !important;
    }
    #bot-popup > div:first-child { padding: calc(10px + env(safe-area-inset-top)) 12px 10px 16px !important; }
    #bot-popup #bot-close-btn {
        display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px !important; border-radius: 14px;
        background: rgba(255,255,255,.14); color: #fff; font-size: 15px; font-weight: 800;
    }
    #bot-popup #bot-close-btn .m-close-label { display: inline; }
    #bot-popup #bot-chat-box { font-size: 15px; padding: 16px !important; }
    #bot-popup #bot-input-field { font-size: 16px !important; min-height: 48px; }
    #bot-popup button { min-height: 44px; }
    #bot-popup > div:last-child { padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important; }

    /* ---------- Полноэкранный выбор города ---------- */
    .m-city {
        position: fixed; inset: 0; z-index: 110; display: none; flex-direction: column; background: #fff; color: #0f172a;
        height: var(--m-vh, 100dvh);
    }
    html.dark .m-city { background: #0b1120; color: #f1f5f9; }
    html.m-city-open .m-city { display: flex; }
    .m-city-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; border-bottom: 1px solid rgba(148,163,184,.3); }
    .m-city-top input {
        flex: 1; min-width: 0; height: 52px; border-radius: 14px; border: 2px solid #0066e6; padding: 0 14px; font-size: 18px; font-weight: 700;
        background: transparent; color: inherit; outline: none;
    }
    .m-city-label { padding: 14px 16px 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
    .m-city-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }
    .m-city-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 58px; padding: 8px 16px; border: 0; background: transparent; color: inherit; text-align: left; font-size: 17px; font-weight: 700; cursor: pointer; border-bottom: 1px solid rgba(148,163,184,.18); }
    .m-city-item:active { background: rgba(0,102,230,.08); }
    .m-city-item small { display: block; font-size: 13px; font-weight: 500; color: #64748b; }
    .m-city-code { font-size: 14px; font-weight: 800; color: #0066e6; flex: 0 0 auto; }
    .m-city-empty { padding: 24px 16px; color: #64748b; font-size: 15px; }
}
