/*
 * Мобильная раскладка CRM (ширина экрана меньше 1100px).
 * Класс html.ag-mobile ставит скрипт в layout/master.blade.php — там же ниже 1100px отключается сжатие html.zoom.
 * Здесь — каркас (шапка, нижняя панель, окно «Меню») и общие правила для «кирпичей» интерфейса.
 * Правила конкретных страниц добавляются ниже отдельными блоками, по мере адаптации разделов.
 */

/* ── на компьютере мобильных элементов нет ── */
.agm-bar, .agm-sheet, .agm-sheet-bg, .agm-title, .agm-add { display: none; }

/* ── каркас ── */
html.ag-mobile body { -webkit-text-size-adjust: 100%; }
html.ag-mobile #kt_app_sidebar,
html.ag-mobile #kt_app_sidebar_mobile_toggle,
html.ag-mobile #kt_app_header_container > .d-lg-none,
html.ag-mobile #kt_app_header_container > .flex-grow-1:not(#kt_app_header_wrapper),
html.ag-mobile .app-header-menu,
html.ag-mobile .hdr-home-link,
html.ag-mobile #hdrFx, html.ag-mobile #hdrNew,
html.ag-mobile #ag-drawer, html.ag-mobile #ag-drawer-overlay,
html.ag-mobile .app-navbar > .d-flex.align-items-center { display: none !important; } /* последний — переключатель языка: он в «Меню» */

html.ag-mobile #kt_app_header {
    position: fixed !important; top: 0; left: 0 !important; right: 0; height: 52px !important; z-index: 600;
    background: #fff; border-bottom: 0.5px solid #f0f0f5;
}
html.ag-mobile #kt_app_header_container { padding: 0 12px !important; height: 52px; align-items: center !important; }
html.ag-mobile #kt_app_header_wrapper { flex: 1 1 auto; min-width: 0; align-items: center !important; }
html.ag-mobile #kt_app_header_tools { padding: 0 !important; min-width: 0; }
html.ag-mobile .agm-title { display: block; flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 600; color: #181c32; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* синий «мазок кисти» под шапкой — оформление компьютерной версии (top: 69px), на телефоне он пересекал ленту отборов */
html.ag-mobile #kt_app_page::after { display: none !important; }

/* справа в шапке: поиск, «+», профиль — значками 40px под палец */
html.ag-mobile .app-navbar { gap: 2px; align-items: center; }
html.ag-mobile .ag-qs-btn { width: 40px !important; height: 40px !important; padding: 0 !important; border: none !important; background: none !important; justify-content: center; }
html.ag-mobile .ag-qs-btn span, html.ag-mobile .ag-qs-btn kbd { display: none !important; }
html.ag-mobile .ag-qs-btn i { font-size: 22px !important; color: #5e6278; }
html.ag-mobile .agm-add { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; color: #185fa5; font-size: 24px; text-decoration: none; }
html.ag-mobile #kt_header_user_menu_toggle { margin: 0 !important; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }

/* лента быстрых отборов под шапкой: листается пальцем вбок */
html.ag-mobile .hdr-seg-nav {
    position: fixed !important; top: 52px !important; left: 0 !important; right: 0; z-index: 590;
    display: flex; gap: 6px; padding: 7px 12px; background: #fff; border-bottom: 0.5px solid #f0f0f5;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
html.ag-mobile .hdr-seg-nav::-webkit-scrollbar { display: none; }
html.ag-mobile .hdr-seg-link { flex: 0 0 auto; font-size: 13px; padding: 6px 12px; border-radius: 16px; background: #f5f6f8; color: #5e6278; }
html.ag-mobile .hdr-seg-link.active { background: #E6F1FB; color: #185fa5; box-shadow: none; border-radius: 16px; }

/* контент: без отступа под док, с местом под шапку, ленту и нижнюю панель */
html.ag-mobile #kt_app_wrapper { margin-left: 0 !important; margin-top: 0 !important; padding-top: 96px; }
html.ag-mobile body.agm-no-seg #kt_app_wrapper { padding-top: 56px; }
html.ag-mobile .app-container { padding-left: 12px !important; padding-right: 12px !important; max-width: 100% !important; }
html.ag-mobile #kt_app_content { padding-top: 8px !important; padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
html.ag-mobile #kt_app_toolbar { display: none !important; }
/* страница не шире экрана: ещё не адаптированный широкий блок прокручивается внутри контента, а шапка и нижняя панель остаются на месте */
/* overflow-x: hidden только у html: если задать его и body, прокручиваться начинает body, а не окно (ломаются sticky и сворачивание адресной строки) */
html.ag-mobile { max-width: 100%; overflow-x: hidden; }
html.ag-mobile body { max-width: 100%; overflow-x: clip; }
html.ag-mobile #kt_app_root, html.ag-mobile #kt_app_page, html.ag-mobile #kt_app_wrapper { max-width: 100vw; min-width: 0; }
/* overflow-x: clip, а не auto: auto делает блок отдельной областью прокрутки — страница «белеет» при прокрутке вниз.
   clip только обрезает по горизонтали, вертикальная прокрутка остаётся у окна */
html.ag-mobile #kt_app_main { min-width: 0; max-width: 100vw; overflow-x: clip; }

/* ── нижняя панель ── */
html.ag-mobile .agm-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 650;
    background: #fff; border-top: 0.5px solid #e9e9e9; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.agm-bar-item {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 4px 2px; border: none; background: none; text-decoration: none !important;
    font-family: inherit; font-size: 11px; font-weight: 500; color: #a1a5b7; cursor: pointer;
}
.agm-bar-item i { font-size: 23px; line-height: 1; }
.agm-bar-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.agm-bar-item.is-on { color: #185fa5; }
/* счётчик своих задач (Срочные + Текущие): на кнопке «Меню» и у пункта Workspace в окне меню */
.agm-bar-item { position: relative; }
.agm-badge { position: absolute; top: 0; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #E24B4A; color: #fff;
             font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.agm-badge-mi { position: static; margin-left: auto; }

/* ── окно «Меню» (выезжает снизу) ── */
html.ag-mobile .agm-sheet-bg { display: block; position: fixed; inset: 0; z-index: 640; background: rgba(24,28,50,.35); opacity: 0; pointer-events: none; transition: opacity .18s; }
html.ag-mobile .agm-sheet-bg.is-open { opacity: 1; pointer-events: auto; }
html.ag-mobile .agm-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 645;
    background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 16px rgba(24,28,50,.12);
    padding: 8px 12px calc(76px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto;
    transform: translateY(105%); transition: transform .2s ease;
}
html.ag-mobile .agm-sheet.is-open { transform: translateY(0); }
.agm-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: #e1e3ea; margin: 2px auto 8px; }
.agm-mi { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 10px; border-radius: 10px; font-size: 15px; color: #181c32; text-decoration: none !important; }
.agm-mi i { font-size: 21px; color: #5e6278; width: 24px; text-align: center; }
.agm-mi.is-on { background: #E6F1FB; color: #185fa5; }
.agm-mi.is-on i { color: #185fa5; }
.agm-sep { height: 0.5px; background: #f0f0f5; margin: 6px 0; }
.agm-fx { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 10px; font-size: 13px; color: #181c32; font-variant-numeric: tabular-nums; }
.agm-fx:empty { display: none; }
.agm-fx .fx-up { color: #50cd89; } .agm-fx .fx-down { color: #f1416c; } .agm-fx .fx-flat { color: #c9ccd4; }
.agm-langs { display: flex; align-items: center; gap: 6px; padding: 4px 10px 0; }
.agm-lang { min-width: 44px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 0.5px solid #e1e3ea; font-size: 13px; font-weight: 600; color: #5e6278; text-decoration: none !important; }
.agm-lang.is-on { background: #E6F1FB; border-color: #b5d4f4; color: #185fa5; }
.agm-logout { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 9px; font-size: 14px; color: #f1416c; text-decoration: none !important; }
.agm-logout i { font-size: 18px; }

/* ── общие «кирпичи» ── */
/* поля и кнопки — под палец, шрифт 16px (иначе iPhone приближает страницу при вводе) */
html.ag-mobile input.form-control, html.ag-mobile select.form-select, html.ag-mobile textarea.form-control { font-size: 16px !important; min-height: 42px; }
/* окна — почти на весь экран */
html.ag-mobile .modal-dialog { margin: 8px !important; max-width: calc(100vw - 16px) !important; }
html.ag-mobile .modal .modal-body .form-control { max-width: 100% !important; }

/* ════════ Список авто (Авто, Продажи, Архив): панель поиска, окно «Фильтры», карточка ════════ */
.otb-filters-btn, .otbf-sheet-bg, .otbf-sheet-done { display: none; }

/* панель поиска — обычный блок в потоке страницы (не закреплена: под шапкой и лентой и так мало места) */
html.ag-mobile .orders-pad { padding-top: 0 !important; }
html.ag-mobile #orders-curtain { display: none !important; }
html.ag-mobile .orders-topbar {
    position: static !important; left: auto !important; right: auto !important; width: auto !important;
    flex-wrap: wrap; gap: 8px; padding: 0 !important; margin: 0 0 10px; border: none; box-shadow: none; background: transparent; border-radius: 0;
}
html.ag-mobile .orders-topbar .otb-skel { display: none !important; }
html.ag-mobile .orders-topbar.is-loading > :not(.otb-skel) { visibility: visible; }
html.ag-mobile .orders-topbar-search { flex: 1 1 0 !important; min-width: 0 !important; margin: 0 !important; }
html.ag-mobile .orders-topbar-search input { height: 42px; font-size: 16px; border-radius: 10px; border: 0.5px solid #e1e3ea; }
html.ag-mobile .otb-filters-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; flex: 0 0 auto;
    border: 0.5px solid #e1e3ea; border-radius: 10px; background: #fff; font-family: inherit; font-size: 14px; font-weight: 500; color: #181c32;
}
html.ag-mobile .otb-filters-btn i { font-size: 18px; color: #5e6278; }
.otb-filters-cnt { display: none; min-width: 18px; height: 18px; border-radius: 9px; background: #185fa5; color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; padding: 0 5px; }
.otb-filters-cnt.is-on { display: inline-block; }
/* «Экспорт / Польша» — отдельной строкой под поиском */
html.ag-mobile .orders-topbar > .osf-sec-wrap { flex: 0 0 100%; display: flex; gap: 6px; }
html.ag-mobile .orders-topbar > .osf-sec-wrap .osf-sec-chip { height: 34px; border-radius: 17px; padding: 0 14px; }

/* окно «Фильтры»: те же выпадающие группы, развёрнутые списком; выбор применяется сразу */
html.ag-mobile #otbFilters { display: none; }
html.ag-mobile #otbFilters.is-sheet {
    display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 700; max-height: 82vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 16px rgba(24,28,50,.12);
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
}
html.ag-mobile .otbf-sheet-bg.is-open { display: block; position: fixed; inset: 0; z-index: 699; background: rgba(24,28,50,.35); }
html.ag-mobile #otbFilters.is-sheet .otbf { position: static; margin: 0 !important; padding: 10px 0; border-bottom: 0.5px solid #f0f0f5; }
html.ag-mobile #otbFilters.is-sheet .otbf[style*="display:none"], html.ag-mobile #otbFilters.is-sheet .otbf[style*="display: none"] { display: none; }
html.ag-mobile #otbFilters.is-sheet .otbf-btn { border: none; background: none; padding: 0; height: auto; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #a1a5b7; pointer-events: none; }
html.ag-mobile #otbFilters.is-sheet .otbf-btn .ti-chevron-down { display: none; }
html.ag-mobile #otbFilters.is-sheet .otbf-panel { display: block; position: static; border: none; box-shadow: none; padding: 8px 0 0; min-width: 0; max-width: none; }
html.ag-mobile #otbFilters.is-sheet .osf-reset-btn { margin: 12px 0 0; height: 42px; justify-content: center; }
html.ag-mobile #otbFilters.is-sheet .otbf-sheet-done {
    display: block; position: sticky; bottom: 0; margin-top: 12px; height: 46px; width: 100%; flex: 0 0 auto;
    border: none; border-radius: 12px; background: #185fa5; color: #fff; font-family: inherit; font-size: 15px; font-weight: 600;
}

/* карточка списка: миниатюра слева, данные справа, трекер — строкой под ними */
html.ag-mobile #orders-page-layout { display: block; }
html.ag-mobile #orders-page-layout > .card, html.ag-mobile #orders-page-layout > .card > .card-body { background: transparent; box-shadow: none; border: none; padding: 0 !important; margin: 0 !important; max-width: none; }
html.ag-mobile .ocard-wrap { width: 100% !important; max-width: none !important; margin-bottom: 10px; }
html.ag-mobile .ocard-wrap > :not(.ocard) { display: none !important; } /* замок правки статусов: на телефоне трекер только показывает */
html.ag-mobile #orders-card-grid { padding: 0 !important; gap: 0; }
html.ag-mobile .ocard { width: 100% !important; height: auto !important; flex-direction: row !important; flex-wrap: wrap; border-radius: 12px; }
html.ag-mobile .ocard:hover { box-shadow: 0 4px 16px rgba(24,28,50,.12); }
html.ag-mobile .ocard-arch-btn, html.ag-mobile .ocard-lock, html.ag-mobile .ocard-skel { display: none !important; }
html.ag-mobile .ocard-img { width: 96px !important; height: auto !important; min-height: 96px; border-radius: 12px 0 0 0; }
html.ag-mobile .ocard-img-cap { padding: 18px 6px 5px; }
html.ag-mobile .ocard-img-brand { display: none; }
html.ag-mobile .ocard-img-cap .ocard-id { font-size: 11px; padding: 1px 5px; }
html.ag-mobile .ocard-img-placeholder { font-size: 26px; }
html.ag-mobile .ocard-center { flex: 1 1 0 !important; min-width: 0; padding: 8px 10px 8px; border-right: none; overflow: visible; }
html.ag-mobile a.ocard-brand, html.ag-mobile .ocard-brand { font-size: 16px; line-height: 1.25; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ag-mobile .ocard-vin-row { margin-top: 4px; min-height: 0; flex-wrap: wrap; gap: 4px 6px; }
html.ag-mobile .ocard-vin-pill { font-size: 13px; letter-spacing: .03em; padding: 0; }
html.ag-mobile .ocard-vin-copy { padding: 6px; margin: -6px 0; font-size: 17px; }
html.ag-mobile .ocard-badges { margin-left: 0; padding-left: 0; flex: 0 0 100%; }
html.ag-mobile .ocard-badges .ocard-nds-badge, html.ag-mobile .ocard-sec-badge { font-size: 11px; padding: 3px 8px; }
/* участники — одной мелкой строкой: поставщик · страна · дилер */
html.ag-mobile .ocard-meta { margin-top: 5px; gap: 2px 10px; flex-wrap: wrap; }
html.ag-mobile .ocard-meta-item .m-l { display: none; }
html.ag-mobile .ocard-meta-item .m-v { font-size: 12px; color: #5e6278; }
html.ag-mobile .ocard-center .ocard-dealer-bottom { position: static; display: inline-block; margin: 2px 0 0; }
html.ag-mobile .ocard-dealer-bottom .m-l { display: none; }
html.ag-mobile .ocard-dealer-bottom .m-v { font-size: 12px; color: #5e6278; }
html.ag-mobile .ocard-meta-item.is-empty, html.ag-mobile .ocard-meta:not(:has(.ocard-meta-item:not(.is-empty))) { display: none !important; }
html.ag-mobile .ocard-date { display: none; } /* дата создания: на телефоне хватает колонки «Прогресс» */

/* трекер: 5 групп + «Прогресс» равными колонками */
html.ag-mobile .ocard-right { flex: 0 0 100%; width: 100%; box-sizing: border-box; display: block; padding: 6px 8px 8px 4px; border-top: 0.5px solid #f0f0f5; overflow: hidden; }
html.ag-mobile .ocard-flowhost, html.ag-mobile .ocard-flow { display: block; width: 100%; padding: 0; }
html.ag-mobile .ocard-flowhost .ocard-editgrid { display: none !important; }
html.ag-mobile .ocard-editing .ocard-flowhost .ocard-flow { display: block; }
html.ag-mobile .ocard-gview { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
html.ag-mobile .cards-logistics .ocard-gview { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; }
html.ag-mobile .ocard-gview > .ocard-g, html.ag-mobile .ocard-g.ocard-lastmove { width: auto !important; min-width: 0 !important; min-height: 0; flex: none; gap: 0; }
html.ag-mobile .ocard-g-name { font-size: 10px !important; letter-spacing: -.2px; line-height: 1.2; color: #a1a5b7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; height: auto !important; min-height: 0 !important; }
html.ag-mobile .ocard-g-name br { display: none; }
html.ag-mobile .ocard-g-state { font-size: 10px !important; letter-spacing: -.3px; white-space: nowrap; line-height: 1.2; min-height: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: block; flex: none; }
html.ag-mobile .ocard-g-step { margin: 4px 0 0; width: 100%; }
html.ag-mobile .ocard-lastmove-rel { font-size: 11px !important; line-height: 1.2; white-space: nowrap; padding: 1px 4px !important; min-height: 14px; flex: none; display: block; }
html.ag-mobile .ocard-lastmove-date { font-size: 10px !important; color: #a1a5b7; }
html.ag-mobile #ordersPager { margin: 8px 0 16px !important; }
html.ag-mobile #ordersPager .row { margin: 0; gap: 8px; flex-wrap: wrap !important; }
html.ag-mobile #ordersPager .row > [class*="col-"] { width: 100%; max-width: 100%; flex: 0 0 100%; padding: 0; justify-content: center !important; }
html.ag-mobile #ordersPager .pagination { flex-wrap: wrap; justify-content: center; }
/* Логистика: плитки разделов — лентой под поиском, листаются вбок (сам раздел адаптируется отдельным этапом) */
html.ag-mobile .lg-secs { flex: 0 0 100%; margin: 0 !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
html.ag-mobile .lg-secs::-webkit-scrollbar { display: none; }
html.ag-mobile .lg-secs .lg-sec { flex: 0 0 auto; }

/* ════════ Карточка авто: общий верх (фото, марка, трекер) + лента вкладок, на экране один раздел ════════ */
.ocv-mtabs, .agm-back { display: none; }
html.ag-mobile .agm-back { display: inline-flex; width: 36px; height: 40px; margin-left: -8px; align-items: center; justify-content: center; color: #181c32; font-size: 22px; text-decoration: none; flex: 0 0 auto; }

html.ag-mobile .ocv-row { display: block !important; padding-top: 0 !important; }
html.ag-mobile #order-show-content { display: block !important; max-width: none !important; width: 100% !important; }
html.ag-mobile #order-show-content > .card { border-radius: 12px !important; box-shadow: none !important; background: transparent !important; }
html.ag-mobile #order-show-content > .card > .card-body { padding: 0 !important; }
/* колонки «фото+документы» и «данные» растворяются: блоки встают в одну колонку в нужном порядке */
html.ag-mobile .ocv-main { display: flex !important; flex-direction: column; gap: 10px; }
html.ag-mobile .ocv-left, html.ag-mobile .ocv-info { display: contents !important; }
html.ag-mobile .ocv-left > div:first-child { order: 1; }
html.ag-mobile .ocv-top { order: 2; margin: 0 !important; padding: 12px !important; background: #fff; border-radius: 12px; box-shadow: 0 4px 16px rgba(24,28,50,.12); }
html.ag-mobile .ocv-mtabs { order: 3; }
html.ag-mobile .ocv-left > [id^="orderReportsBlock_"], html.ag-mobile .ocv-left > [id^="orderDocsBlock_"], html.ag-mobile .of-fields-host { order: 4; }
html.ag-mobile .ocv-head { min-height: 0 !important; gap: 10px !important; }
html.ag-mobile .ocv-track { margin-top: 4px !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }

/* лента вкладок: закреплена под шапкой и лентой отборов, листается вбок */
html.ag-mobile .ocv-mtabs {
    display: flex; gap: 6px; position: sticky; top: 98px; z-index: 400; margin: 0 -12px; padding: 8px 12px;
    background: #fafafa; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
html.ag-mobile .ocv-mtabs::-webkit-scrollbar { display: none; }
.ocv-mtab { flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 10px; border: 0.5px solid #e9e9e9; background: #fff; font-family: inherit; font-size: 14px; font-weight: 500; color: #5e6278; white-space: nowrap; }
.ocv-mtab.is-on { background: #185fa5; border-color: #185fa5; color: #fff; }

/* на экране один раздел */
html.ag-mobile .ocv-row .of-fields-host,
html.ag-mobile .ocv-row .ocv-left > [id^="orderReportsBlock_"],
html.ag-mobile .ocv-row .ocv-left > [id^="orderDocsBlock_"],
html.ag-mobile .ocv-row .ocv-side,
html.ag-mobile .ocv-row .otabs-wrap,
html.ag-mobile .ocv-row [id^="edBlockInfo_"],
html.ag-mobile .ocv-row [id^="orderAcceptanceBlock_"] { display: none !important; }
html.ag-mobile .ocv-row[data-mtab="data"] .of-fields-host, html.ag-mobile .ocv-row[data-mtab="acceptance"] .of-fields-host { display: block !important; }
html.ag-mobile .ocv-row[data-mtab="data"] [id^="edBlockInfo_"] { display: block !important; }
html.ag-mobile .ocv-row[data-mtab="acceptance"] [id^="orderAcceptanceBlock_"] { display: block !important; }
html.ag-mobile .ocv-row[data-mtab="docs"] .ocv-left > [id^="orderReportsBlock_"], html.ag-mobile .ocv-row[data-mtab="docs"] .ocv-left > [id^="orderDocsBlock_"] { display: block !important; }
html.ag-mobile .ocv-row[data-mtab="tasks"] .ocv-side { display: flex !important; }
html.ag-mobile .ocv-row[data-mtab="otab"] .otabs-wrap { display: block !important; }

html.ag-mobile .ocv-side { position: static !important; width: 100% !important; margin-top: 10px; }
html.ag-mobile .of-fields-host > .row { margin: 0 !important; }
html.ag-mobile .of-fields-host > .row > [class*="col-"] { padding: 0 !important; }
html.ag-mobile .of-fields-host > .row > [class*="col-"] > div { display: block !important; }
/* «папки»: корешки не нужны — их заменяет лента вкладок */
html.ag-mobile .otabs-strip { display: none !important; }
html.ag-mobile .otabs-wrap { margin-top: 10px; padding-bottom: 0 !important; }
html.ag-mobile .otabs-body { min-height: 0 !important; border-radius: 12px !important; padding: 12px !important; }

/* верх карточки: марка отдельной строкой, VIN и дата под ней, участники — сеткой в 2 колонки */
html.ag-mobile .ocv-head > div:first-child { gap: 6px 10px !important; min-height: 0 !important; }
html.ag-mobile .ocv-head > div:first-child > div:first-child { flex-wrap: wrap !important; gap: 4px 10px !important; flex: 1 1 100% !important; }
html.ag-mobile .ocv-head > div:first-child > div:first-child > div:first-child { flex: 0 0 100%; min-width: 0; }
html.ag-mobile [id^="hdrBrand_"] { font-size: 18px !important; white-space: normal !important; line-height: 1.25 !important; }
html.ag-mobile [id^="hdrVin_"] { font-size: 14px !important; letter-spacing: .04em !important; }
html.ag-mobile .ocv-head [id^="hdrLine"] { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px !important; width: 100%; }
html.ag-mobile .hdr-mi { min-width: 0; }
html.ag-mobile .hdr-mi-l { font-size: 12px !important; white-space: nowrap; }
html.ag-mobile .hdr-mi-v { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* трекер статусов: 5 равных колонок, подписи мельче — помещается без прокрутки */
html.ag-mobile .scpg-segrow { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 !important; }
html.ag-mobile .scpg-segrow > .scp2-g { width: auto !important; min-width: 0 !important; flex: none !important; min-height: 0 !important; overflow: hidden; }
html.ag-mobile .scp2-name { font-size: 10px !important; letter-spacing: -.2px; width: auto !important; max-width: 100%; height: auto !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ag-mobile .scp2-state { width: auto !important; max-width: 100%; height: auto !important; min-height: 18px; }
html.ag-mobile .scp2-state .ocard-seg-cur, html.ag-mobile .scp2-state .ocard-seg-cur em { font-size: 11px !important; letter-spacing: -.3px; white-space: nowrap; }
html.ag-mobile .scp2-when { width: auto !important; max-width: 100%; flex-wrap: wrap; justify-content: center; gap: 0 3px !important; font-size: 10px !important; }
html.ag-mobile .scp2-when .scp2-at, html.ag-mobile .scp2-when .scp2-days { font-size: 10px !important; }
html.ag-mobile .scp2-step { width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; }
/* колонки одной высоты, линия с точками — по низу: иначе колонка с датой в две строки («19.08 / 33 дн») опускает свой отрезок */
html.ag-mobile .scpg-segrow { align-items: stretch !important; }
html.ag-mobile .scpg-segrow > .scp2-g > .scp2-step { margin-top: auto !important; }

/* плитки процесса (Проформа → Оформление → Заявление → Выдача): лента, листается вбок */
html.ag-mobile .dt-row { display: flex !important; gap: 8px !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-top: 8px !important; padding-bottom: 2px; }
html.ag-mobile .dt-row::-webkit-scrollbar { display: none; }
html.ag-mobile .dt-row > .dt-tile { flex: 0 0 150px !important; min-width: 150px; width: 150px !important; }
html.ag-mobile .scp2-when { min-height: 30px; align-content: flex-start; }
html.ag-mobile .hdr-mi-nds { margin-left: 0 !important; padding-left: 0 !important; border-left: none !important; }
html.ag-mobile .hdr-mi-nds .hdr-mi-l { position: static !important; }


/* вкладка «Данные»: поля авто в 2 колонки, блок — белой карточкой */
html.ag-mobile [id^="edBlockInfo_"] { border-radius: 12px !important; padding: 12px !important; margin-top: 0 !important; box-shadow: 0 4px 16px rgba(24,28,50,.12); }
html.ag-mobile .inf-list { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px 10px !important; }
html.ag-mobile .inf-row { min-width: 0; }
html.ag-mobile .inf-ico { width: 34px !important; height: 34px !important; flex: 0 0 34px; }
html.ag-mobile .inf-txt { min-width: 0; }

/* вкладка «Приёмка»: плитки по две в ряд, «На борту» и «Комментарий» — друг под другом */
html.ag-mobile [id^="accCard_"] { border-radius: 12px !important; box-shadow: 0 4px 16px rgba(24,28,50,.12) !important; background: #fff !important; }
html.ag-mobile [id^="accCard_"] > .card-body { padding: 12px !important; }
html.ag-mobile .acc-tiles { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px !important; }
html.ag-mobile .acc-tiles > .acc-tile, html.ag-mobile .acc-tiles > .acc-tile-lkp { width: auto !important; min-width: 0 !important; height: 84px; }
html.ag-mobile .acc-tiles-sep { display: none !important; }
html.ag-mobile .acc-tiles-meta { grid-column: 1 / -1; margin: 0 !important; flex-wrap: wrap; gap: 6px 14px !important; justify-content: flex-start !important; }
html.ag-mobile .acc-bottom-row { display: block !important; margin-top: 12px; }
html.ag-mobile .acc-bottom-row > * { width: auto !important; min-width: 0 !important; max-width: none !important; margin: 0 0 14px !important; min-height: 0 !important; }

/* вкладки-«папки» (Доставка, Баланс, Оплата, Журнал): колонки — друг под другом */
html.ag-mobile .otab-panel > .card { border: none !important; }
html.ag-mobile .otab-panel > .card > .card-body { padding: 0 !important; }
html.ag-mobile [id^="dlvWrap_"], html.ag-mobile [id^="balWrap_"],
html.ag-mobile .otab-panel[data-otab-panel="invoice"] > .card > .card-body > div { flex-direction: column !important; flex-wrap: nowrap !important; gap: 16px !important; align-items: stretch !important; }
html.ag-mobile [id^="dlvWrap_"] > *, html.ag-mobile [id^="balWrap_"] > *,
html.ag-mobile .otab-panel[data-otab-panel="invoice"] > .card > .card-body > div > * { width: auto !important; max-width: none !important; min-width: 0 !important; flex: 0 0 auto !important; min-height: 0 !important; margin-left: 0 !important; margin-right: 0 !important; border-left: none !important; border-right: none !important; padding-left: 0 !important; padding-right: 0 !important; }
/* поле комментария: текст + кнопка «Добавить» */
html.ag-mobile .chat-cmt { grid-template-columns: minmax(0, 1fr) auto !important; }
html.ag-mobile .leaflet-container { max-width: 100% !important; overflow: hidden !important; }
html.ag-mobile .otab-panel [id^="dlvMap"], html.ag-mobile .otab-panel .dlv-map { width: 100% !important; max-width: 100% !important; }

/* комментарий во вкладках Доставка и Баланс: на компьютере height:0 + flex-grow тянет блок по высоте колонки,
   в одной колонке телефона это схлопывало его в ноль и текст налезал на соседний блок */
html.ag-mobile .chat-cmt { height: auto !important; flex: 0 0 auto !important; }
html.ag-mobile .chat-cmt > .comment-history { max-height: 260px; }

/* Баланс: строка валют переносится, суммы не вылезают за край */
html.ag-mobile .balance-box > div:first-child { flex-wrap: wrap; gap: 8px 10px !important; }
html.ag-mobile [id^="balNbp_"] { margin-left: 0 !important; }
html.ag-mobile .balance-box .row { margin-left: 0 !important; margin-right: 0 !important; }
html.ag-mobile .balance-box .row > [class*="col-"] { padding-left: 0 !important; padding-right: 0 !important; }
html.ag-mobile .bl-amount { flex-wrap: wrap; justify-content: flex-end; gap: 0 6px !important; }
/* PLN и EUR — друг под другом: в две колонки на 375px суммы не помещаются */
html.ag-mobile .bal-income-cols { grid-template-columns: minmax(0, 1fr) !important; gap: 10px 0 !important; }
html.ag-mobile .balance-line { flex-wrap: wrap; gap: 2px 10px !important; }
html.ag-mobile .balance-line .bl-label { min-width: 0; }
/* правая часть вкладки (заявка клиента, комментарий) — под таблицей баланса, а не над ней */
html.ag-mobile [id^="balWrap_"] > div:first-child { order: -1 !important; }

/* длинные статусы в трекере списка и карточки — в две строки вместо обрезки («Отправитель», «Распределён») */
html.ag-mobile .ocard-g-state, html.ag-mobile .scp2-state .ocard-seg-cur, html.ag-mobile .scp2-state .ocard-seg-cur em {
    white-space: normal !important; line-height: 1.1 !important; overflow-wrap: anywhere;
}
html.ag-mobile .ocard-g-state { min-height: 24px; }
html.ag-mobile .scp2-state { min-height: 26px; }

/* Журнал: время и автор в одну строку, действие — под ними (иначе колонка действия ужимается до пары букв) */
html.ag-mobile .olog-row { flex-wrap: wrap; gap: 2px 10px !important; align-items: baseline !important; }
html.ag-mobile .olog-when { width: auto !important; }
html.ag-mobile .olog-who { min-width: 0 !important; }
html.ag-mobile .olog-text { flex: 0 0 100%; }
html.ag-mobile .olog-list { max-height: none !important; }
html.ag-mobile .olog-filters input, html.ag-mobile .olog-filters select { min-height: 40px; }

/* ════════ Окна карточки авто ════════ */
html.ag-mobile .modal-dialog { margin: 8px auto !important; }
html.ag-mobile .modal-content { border-radius: 14px; }
html.ag-mobile .modal-body { padding: 14px !important; max-height: calc(100vh - 150px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
html.ag-mobile .modal-header { padding: 12px 14px !important; }
html.ag-mobile .modal-footer { padding: 10px 14px !important; flex-wrap: wrap; gap: 8px; }
html.ag-mobile .modal-footer > .btn { flex: 1 1 auto; min-height: 42px; }
/* окно документов: ссылка и файл — друг под другом, колонки формы в одну */
html.ag-mobile .ag-doc-modal .rep-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; }
html.ag-mobile .ag-doc-modal .rep-grid > [style*="grid-column: 2"] { grid-column: 1 !important; justify-content: flex-start !important; }
html.ag-mobile .ag-doc-modal .doc-add-layout { flex-direction: column; gap: 12px; }
html.ag-mobile .ag-doc-modal .doc-add-layout > .rep-box { flex: 0 0 auto; width: 100%; }
html.ag-mobile .ag-doc-modal .modal-body .row > [class*="col-"] { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
html.ag-mobile .ag-doc-modal .nav-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
html.ag-mobile .ag-doc-modal .nav-tabs::-webkit-scrollbar { display: none; }
/* конструктор полей и комплектации: название и значения — друг под другом */
html.ag-mobile [id^="infoFieldsModal_"] .fc-row, html.ag-mobile [id^="cmpFieldsModal_"] .fc-row { flex-wrap: wrap; gap: 8px !important; }
html.ag-mobile [id^="infoFieldsModal_"] .fc-namecell, html.ag-mobile [id^="cmpFieldsModal_"] .fc-namecell { flex: 0 0 100% !important; padding-top: 0 !important; }
html.ag-mobile [id^="infoFieldsModal_"] .fc-list, html.ag-mobile [id^="cmpFieldsModal_"] .fc-list { max-height: none !important; }
html.ag-mobile [id^="infoFieldsModal_"] .fc-name, html.ag-mobile [id^="cmpFieldsModal_"] .fc-name { white-space: normal !important; }
/* фото в карточке ниже: на телефоне верх карточки виден всегда, и большое фото отодвигало ленту вкладок за экран */
html.ag-mobile .ocv-left .ov-main, html.ag-mobile .ocv-left .block-images-view img { max-height: 200px !important; }
html.ag-mobile .ocv-left > div:first-child .card-images-view { margin-bottom: 0 !important; }

/* ════════ Стол заказов: список карточками, заявка — отдельным экраном ════════ */
/* панель поиска: поиск на всю ширину, разделы лентой под ним, «+» — плавающей кнопкой */
html.ag-mobile #cot-topbar {
    position: static !important; margin: 0 0 10px !important; padding: 0 !important;
    background: transparent; border: none; box-shadow: none; border-radius: 0;
    flex-wrap: wrap; gap: 8px;
}
html.ag-mobile #cot-topbar::before { display: none; }
html.ag-mobile .cot-topbar-search { flex: 1 1 100% !important; }
html.ag-mobile .cot-topbar-search input { height: 42px; font-size: 16px; border-radius: 10px; border: 0.5px solid #e1e3ea; }
html.ag-mobile .cot-sec-toggle {
    flex: 1 1 100%; display: flex !important; height: auto; gap: 6px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
html.ag-mobile .cot-sec-toggle::-webkit-scrollbar { display: none; }
html.ag-mobile .cot-sec { flex: 0 0 auto; height: 34px; border-radius: 17px; background: #f5f6f8; }
html.ag-mobile .cot-sec.active { background: #185fa5; border-color: #185fa5; color: #fff; }
html.ag-mobile .cot-sec.active .cot-sec-count { color: #fff; }
html.ag-mobile #cot-add-btn {
    position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 620;
    width: 52px; height: 52px; border-radius: 50%; margin: 0 !important;
    background: #185fa5; border-color: #185fa5; color: #fff; box-shadow: 0 4px 12px rgba(24,95,165,.35);
}
html.ag-mobile #cot-add-btn i { font-size: 24px; }

/* список: карточки на всю ширину, внутренние колонки — друг под другом */
html.ag-mobile #cot-list-card, html.ag-mobile #cot-list-card > .card-body { padding: 0 !important; background: transparent; box-shadow: none; }
html.ag-mobile #cot-list-card > .card-body > div:first-child { display: block !important; }
html.ag-mobile #cot-cards { max-width: none !important; }
html.ag-mobile .cot-card { padding: 12px !important; border-radius: 12px; margin-bottom: 10px; }
html.ag-mobile .cot-d-row { flex-wrap: wrap; gap: 10px !important; }
html.ag-mobile .cot-d-client { flex: 1 1 0 !important; }
html.ag-mobile .cot-d-side { flex: 0 0 auto; font-size: 12px; }
html.ag-mobile .cot-d-main { flex: 1 1 100% !important; border-left: none !important; padding-left: 0 !important; border-top: 0.5px solid #f0f0f5; padding-top: 10px !important; }
html.ag-mobile .cot-d-main .cot-brand { font-size: 15px; }
html.ag-mobile .cot-d-params, html.ag-mobile .cot-d-meta-text { font-size: 13px; white-space: normal !important; }
html.ag-mobile .cot-d-car { flex-wrap: wrap; gap: 4px 10px !important; }
html.ag-mobile .cot-d-right { flex: 0 0 auto; margin-left: auto; }

/* заявка: отдельный экран поверх списка (класс на <html> ставит скрипт страницы) */
html.ag-mobile #cot-edit-panel {
    position: fixed !important; inset: 52px 0 calc(62px + env(safe-area-inset-bottom)) 0;
    width: auto !important; max-height: none !important; top: 52px !important;
    z-index: 660; margin: 0; border: none; border-radius: 0; padding: 12px 12px 24px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}
html.ag-mobile.cot-panel-open .hdr-seg-nav { display: none !important; }
/* шапка панели прилипает к верху, крестик — крупнее под палец */
html.ag-mobile .cot-ep-head { position: sticky; top: -8px; z-index: 2; background: #fff; padding: 6px 0 8px; margin: 0 0 6px !important; }
html.ag-mobile .cot-ep-close { width: 40px; height: 40px; font-size: 22px; }
/* формы заявки: поля в одну колонку */
html.ag-mobile #cot-edit-panel .row > [class*="col-"] { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
html.ag-mobile #cot-edit-panel input, html.ag-mobile #cot-edit-panel select, html.ag-mobile #cot-edit-panel textarea { font-size: 16px !important; min-height: 42px; }
/* сетки формы и просмотра заявки — в одну колонку; режим «две колонки» включается по числу авто, а не по ширине экрана */
html.ag-mobile #cot-edit-panel .cot-ep-grid,
html.ag-mobile #cot-edit-panel .cot-vp-grid,
html.ag-mobile #cot-edit-panel .cot-2col,
html.ag-mobile #cotEpCars.two,
html.ag-mobile #cot-edit-panel .cot-vp-cars.two,
html.ag-mobile #cot-edit-panel .cot-vp-cars.two .cot-vp-grid { grid-template-columns: minmax(0, 1fr) !important; }
/* ячейки блока авто: ширина стоит инлайном на безымянных div — перебиваем через !important */
html.ag-mobile #cotEpCars .cot-car-row { flex-wrap: wrap !important; gap: 10px !important; }
html.ag-mobile #cotEpCars .cot-car-row > div { flex: 1 1 100% !important; min-width: 0 !important; }
/* ряды форм с жёсткими px (залог, валюта, лизинг, бюджет) */
html.ag-mobile #cot-edit-panel .cot-ep-grid > div, html.ag-mobile #cot-edit-panel .full { min-width: 0; }
html.ag-mobile #cot-edit-panel .cot-ep-grid [style*="flex:0 0"], html.ag-mobile #cot-edit-panel .full [style*="flex:0 0"] { flex: 1 1 auto !important; }
html.ag-mobile #cot-edit-panel .full > div[style*="display:flex"] { flex-wrap: wrap; gap: 8px; }
/* кнопки действий панели: в ряд с переносом, под палец */
html.ag-mobile .cot-ep-actions { flex-wrap: wrap; gap: 8px; }
html.ag-mobile .cot-ep-actions .btn, html.ag-mobile .cot-ep-actions button { min-height: 42px; }
/* мелкие кнопки карточки и блока авто — под палец */
html.ag-mobile .cot-d-expand, html.ag-mobile .cot-edit-btn, html.ag-mobile .cot-del-btn, html.ag-mobile .cot-ep-car-remove { width: 36px !important; height: 36px !important; }
html.ag-mobile .cot-d-expand i, html.ag-mobile .cot-edit-btn i, html.ag-mobile .cot-del-btn i { font-size: 18px; }
/* скелетон списка: инлайновые ширины рядов */
html.ag-mobile .cot-skel { padding: 12px !important; }
html.ag-mobile .cot-skel > span[style*="flex:0 0"] { flex: 1 1 auto !important; }
/* полоса пагинации DataTables (ширина считается от десктопной панели 560px) */
html.ag-mobile :is(#client_order_table_wrapper, #cotPager) > .row:last-child { max-width: none !important; flex-wrap: wrap !important; gap: 8px; margin: 0; }
html.ag-mobile :is(#client_order_table_wrapper, #cotPager) > .row:last-child > [class*="col-"] { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; padding: 0; justify-content: center !important; }
html.ag-mobile :is(#client_order_table_wrapper, #cotPager) .pagination { flex-wrap: wrap; justify-content: center; }
/* стрелка «назад» — слева от заголовка панели */
html.ag-mobile .cot-ep-head { justify-content: flex-start !important; gap: 4px; }
html.ag-mobile .cot-ep-head .cot-ep-close { order: -1; margin-left: -8px; }
/* ряды формы заявки: собраны из безымянных div с инлайновыми flex:none и width в px — переносим и растягиваем по месту */
html.ag-mobile #cot-edit-panel [style*="display:flex"] { flex-wrap: wrap !important; }
html.ag-mobile #cot-edit-panel .cot-ep-grid div[style*="flex:none"],
html.ag-mobile #cot-edit-panel .cot-ep-grid div[style*="flex:1"],
html.ag-mobile #cot-edit-panel .cot-leasing-fields > div[style*="flex:none"] { flex: 1 1 140px !important; min-width: 0; }
html.ag-mobile #cot-edit-panel .cot-ep-grid input[style*="width:"],
html.ag-mobile #cot-edit-panel .cot-ep-grid select[style*="width:"],
html.ag-mobile #cot-edit-panel .cot-ep-grid input:not([type=radio]):not([type=checkbox]),
html.ag-mobile #cot-edit-panel .cot-ep-grid select,
html.ag-mobile #cot-edit-panel .cot-leasing-fields input[style*="width:"] { width: 100% !important; }
html.ag-mobile #cot-edit-panel .cot-ep-label { white-space: nowrap; }
html.ag-mobile #cot-edit-panel .cot-type-toggle, html.ag-mobile #cot-edit-panel .cot-leasing-btn { width: 100%; justify-content: center; }

/* ════════ Логистика: на телефоне только список заказов ════════ */
/* Локации и Бухгалтерия автовозов свёрстаны под компьютер — плитки скрыты, разделы не открываются.
   Автовозы — адаптированы, вход по ссылке «Автовозы» в ленте шапки (?sec=autovoz) */
html.ag-mobile #lgSecs .lg-sec:not([data-lgsec="list"]) { display: none !important; }
html.ag-mobile #lgSecs .lg-sec[data-lgsec="list"] { display: none !important; } /* одна плитка без выбора не нужна */
html.ag-mobile #lgLocSection, html.ag-mobile #lgDlSection, html.ag-mobile #lgAccSection { display: none !important; }
.lg-desktop-only { display: none; }
html.ag-mobile .lg-desktop-only {
    align-items: center; gap: 8px; margin: 0 0 10px; padding: 10px 12px;
    background: #FAEEDA; border-radius: 10px; font-size: 13px; color: #633806;
}
html.ag-mobile .lg-desktop-only.is-on { display: flex; }
html.ag-mobile .lg-desktop-only i { font-size: 18px; }

/* ════════ Автовозы (Логистика ?sec=autovoz) ════════ */
html.ag-mobile #lgAvSection { padding-left: 0 !important; }
html.ag-mobile .avz-wrap { max-width: none; }
html.ag-mobile .avz-tab { min-height: 36px; }
/* шапка автовоза: дата и «Собран» сверху, перевозчик / номера / водитель — столбиком под ними */
html.ag-mobile .avz-wrap .avz-load-head { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
html.ag-mobile .avz-done-date { font-size: 16px; }
html.ag-mobile .avz-head-fields { order: 5; flex: 0 0 100%; flex-direction: column; margin-left: 0; }
html.ag-mobile .avz-head-fields .avz-field-in, html.ag-mobile .avz-head-fields select.avz-field-in { width: 100%; max-width: none; height: 44px; font-size: 16px; }
html.ag-mobile .avz-actions .avz-btn { min-height: 40px; }
html.ag-mobile .avz-done-meta { order: 5; flex: 0 0 100%; white-space: normal; }
html.ag-mobile .avz-done-del { margin-left: auto; width: 36px; height: 36px; }
/* карточка авто: фото + данные, ниже лентой документы и CMR, ещё ниже ZIP */
html.ag-mobile .avz-wrap .avz-row { height: auto; flex-wrap: wrap; align-items: stretch; padding: 0; }
html.ag-mobile .avz-wrap .avz-photo { width: 110px; height: auto; min-height: 110px; border-radius: 10px 0 0 0; }
html.ag-mobile .avz-wrap .avz-main { flex: 1 1 0; min-width: 0; padding: 10px 44px 10px 12px; }
html.ag-mobile .avz-brand-line { flex-wrap: wrap; row-gap: 4px; }
html.ag-mobile .avz-wrap .avz-tags { flex-wrap: wrap; }
html.ag-mobile .avz-wrap .avz-docs { order: 3; flex: 0 0 100%; align-self: auto; padding: 8px 10px; border-top: 0.5px solid #f0f0f5; -webkit-overflow-scrolling: touch; }
html.ag-mobile .avz-wrap .avz-cmr-btn { width: 36px; height: 36px; }
html.ag-mobile .avz-wrap .avz-row-actions { order: 4; flex: 0 0 100%; margin: 0; padding: 0 10px 10px; }
html.ag-mobile .avz-wrap .avz-row-actions .avz-btn { min-height: 40px; }
html.ag-mobile .avz-wrap .avz-del { width: 36px; height: 36px; top: 4px; right: 4px; font-size: 18px; }
html.ag-mobile .avz-addline { display: flex; flex-wrap: wrap; gap: 4px 16px; }
html.ag-mobile .avz-addline button { min-height: 44px; }
/* окна раздела: CMR — на весь экран, одна колонка; выбор авто и загрузка — по ширине экрана */
html.ag-mobile #avzCmrModal .fn-modal-card { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; padding: 12px; }
html.ag-mobile #avzPickModal .fn-modal-card, html.ag-mobile #avzUpModal .fn-modal-card { width: calc(100vw - 24px) !important; max-width: none; max-height: 88dvh; padding: 14px; }
html.ag-mobile .avc-cols { grid-template-columns: minmax(0, 1fr); }
html.ag-mobile .avc-row2 { grid-template-columns: minmax(0, 1fr); }
html.ag-mobile .avc-f input, html.ag-mobile .avc-f select, html.ag-mobile .avc-f textarea, html.ag-mobile .avc-car input { font-size: 16px; min-height: 44px; }
html.ag-mobile .avc-car-r1 { grid-template-columns: minmax(0, 1fr) 36px; }
html.ag-mobile .avc-car-r1 > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
html.ag-mobile .avc-car-r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.ag-mobile .avc-car-r2 > span { display: none; }
html.ag-mobile .avc-actions { flex-wrap: wrap; }
html.ag-mobile .avc-actions .avc-btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
html.ag-mobile .avc-scan { margin-top: 16px; }

/* ════════ Распределение: карточка в одну колонку, действия под ней ════════ */
html.ag-mobile .dst-wrap { max-width: none !important; }
html.ag-mobile .dst-ocard { width: auto !important; max-width: none !important; height: auto !important; flex-wrap: wrap; border-radius: 12px; }
html.ag-mobile .dst-img { width: 96px !important; min-height: 96px !important; border-radius: 12px 0 0 0; }
html.ag-mobile .dst-center { flex: 1 1 0 !important; padding: 10px 12px !important; border-right: none !important; }
html.ag-mobile .dst-brand { font-size: 16px; white-space: normal !important; }
html.ag-mobile .dst-vin { white-space: normal !important; overflow-wrap: anywhere; }
html.ag-mobile .dst-tags { flex-wrap: wrap !important; max-height: none !important; gap: 4px 6px !important; }
/* кнопки Принять / Польша / Дилер — ниже фото, отделены линией (01.10.2026) */
html.ag-mobile .dst-right { flex: 0 0 100%; flex-wrap: wrap; gap: 8px !important; padding: 12px 12px 12px !important; margin-top: 12px; border-top: 0.5px solid #f0f0f5; }
html.ag-mobile .dst-assign { width: 100% !important; min-height: 42px; }
html.ag-mobile .dst-accept, html.ag-mobile .dst-poland { flex: 1 1 140px; min-height: 42px; }

/* ════════ Ayvens: вставка письма и карточки лотов ════════ */
html.ag-mobile .ayv-wrap { max-width: none !important; }
/* телефон: только разобранные результаты — вставка письма с компьютера */
html.ag-mobile .ayv-paste { display: none !important; }
html.ag-mobile .ayv-lot { flex-wrap: wrap; gap: 0 12px !important; }
html.ag-mobile .ayv-lot-photo { width: 96px !important; min-height: 84px !important; }
html.ag-mobile .ayv-lot-main { flex: 1 1 0 !important; padding: 10px 12px 10px 0 !important; }
html.ag-mobile .ayv-lot-brand, html.ag-mobile .ayv-lot-spec { white-space: normal !important; }
/* место, цена и дата — одной строкой под карточкой, а не тремя строками без отступов */
html.ag-mobile .ayv-lot-right { flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; text-align: left !important; padding: 0 12px 10px !important; }
/* зона вставки письма не должна занимать весь первый экран */
html.ag-mobile .ayv-title { font-size: 16px !important; margin-bottom: 8px !important; }
html.ag-mobile .ayv-meta-line { flex-wrap: wrap; gap: 6px 8px !important; }

/* ════════ Workspace: полоса разделов лентой, доска воронки — в колонку ════════ */
html.ag-mobile .ws-wrap { min-width: 0; }
html.ag-mobile .ws-sec-card { width: auto !important; max-width: none !important; margin-bottom: 10px !important; }
html.ag-mobile .ws-sec-row { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
html.ag-mobile .ws-sec-row::-webkit-scrollbar { display: none; }
html.ag-mobile .ws-sec { padding: 12px 14px 10px !important; }
html.ag-mobile .ws-sec span { font-size: 14px; }
/* конструкторы Workspace — только с компьютера */
html.ag-mobile .fn-cfg-btn { display: none !important; }
/* карточки блоков */
html.ag-mobile .ws-card { padding: 12px !important; border-radius: 12px; }
html.ag-mobile .ws-card-title { font-size: 16px; }
/* доска воронки: колонки этапов друг под другом */
html.ag-mobile .fn-board { flex-direction: column; gap: 12px !important; }
html.ag-mobile .fn-col-wrap { flex: 0 0 auto !important; width: 100%; }
html.ag-mobile .fn-col { min-height: 0 !important; }
/* старая двухколоночная сетка (если где-то осталась) */
html.ag-mobile .ws-grid { flex-direction: column; }
html.ag-mobile .ws-main, html.ag-mobile .ws-side { flex: 0 0 auto !important; width: 100%; min-width: 0 !important; }
/* Задачи: колонка напоминаний 300px — под список, а не рядом */
html.ag-mobile .ws-task-layout { flex-direction: column; }
html.ag-mobile .ws-task-left, html.ag-mobile .ws-rem-col { flex: 0 0 auto !important; width: 100%; }
/* Калькуляторы: форма и результат друг под другом, ширина результата фиксирована в px */
html.ag-mobile .ws-funnel-card.ws-calc-mode { width: auto !important; margin: 0 !important; }
html.ag-mobile .calc-native { flex-direction: column; gap: 12px !important; }
html.ag-mobile .calc-nform, html.ag-mobile .calc-nresult, html.ag-mobile #calcBy .calc-nresult { flex: 0 0 auto !important; width: 100% !important; }
html.ag-mobile .calc-actions { margin-left: 0 !important; flex-wrap: wrap; }
html.ag-mobile .calc-tabs { overflow-x: auto; scrollbar-width: none; }
html.ag-mobile .calc-tabs::-webkit-scrollbar { display: none; }
html.ag-mobile .ws-funnel-card.ws-calc-mode .calc-tabs { flex-wrap: nowrap; }
html.ag-mobile .calc-tab { flex: 0 0 auto; }
/* «Авто в работе» и «Оплаты»: строка авто переносится */
html.ag-mobile .vic-car, html.ag-mobile .vic-pick { flex-wrap: wrap; max-width: none !important; }
html.ag-mobile .vic-car-photo { width: 84px !important; height: 64px !important; }
html.ag-mobile .vic-car-main { flex: 1 1 0 !important; max-width: none !important; }
html.ag-mobile .vic-car-brand, html.ag-mobile .vic-car-vin { white-space: normal !important; overflow-wrap: anywhere; }
html.ag-mobile .vic-car-date-r { flex: 0 0 auto; margin-left: auto; font-size: 12px; }
html.ag-mobile .vic-car-del { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; }
/* Задачи: колонки «Мои» / «Команда» — друг под другом */
html.ag-mobile .ws-task-cols { flex-direction: column; }
html.ag-mobile .ws-task-cols > .ws-col { flex: 0 0 auto !important; width: 100%; }
/* задачи на телефоне: наведения нет — кнопки видны всегда и под палец; «Переместить» вместо перетаскивания */
html.ag-mobile .ws-task-row { align-items: center; padding: 8px 9px !important; }
html.ag-mobile .ws-check { font-size: 24px; min-width: 36px; min-height: 36px; justify-content: center; margin: 0; }
html.ag-mobile .ws-row-tools { position: static; display: flex !important; gap: 6px; padding: 0; flex-shrink: 0; align-self: flex-end; }
html.ag-mobile .ws-tool, html.ag-mobile .ws-move { width: 36px; height: 36px; border-radius: 9px; }
html.ag-mobile .ws-tool i, html.ag-mobile .ws-move i { font-size: 17px; }
html.ag-mobile .ws-move { flex-shrink: 0; align-self: flex-end; border: 0.5px solid #e1e3ea; background: #fff; color: #185fa5; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
html.ag-mobile .ws-zone[data-zone="done"] .ws-move, html.ag-mobile .ws-zone[data-zone="given"] .ws-move, html.ag-mobile .ws-task-row.done .ws-move { display: none; }
html.ag-mobile .ws-row-title { padding-right: 34px; }
/* воронка: крестик и «Переместить» видны всегда */
html.ag-mobile .fn-del, html.ag-mobile .fn-move { width: 34px; height: 34px; font-size: 17px; color: #a1a5b7; margin: -6px -4px -6px 0; }
html.ag-mobile .fn-move { border: none; background: transparent; color: #185fa5; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
html.ag-mobile .fn-card-client { align-items: center; }
/* окно выбора agmPick */
.agm-pick-title { font-size: 13px; color: #a1a5b7; padding: 0 10px 6px; }
html.ag-mobile .agm-pick .agm-mi { width: 100%; border: none; background: transparent; text-align: left; font-family: inherit; }
/* тосты — ниже мобильной шапки */
html.ag-mobile #toast-container.toast-top-right, html.ag-mobile #toast-container.toast-top-center { top: 60px !important; right: 8px !important; left: 8px !important; }
html.ag-mobile #toast-container > div { width: auto !important; max-width: none; }
/* «Авто в работе»: трекер и метки переносятся, дата под фото */
html.ag-mobile .vic-track { flex: 0 0 100%; flex-wrap: wrap; gap: 8px 12px !important; padding: 8px 0 0 !important; }
html.ag-mobile .vic-tags { width: 100%; }
html.ag-mobile .vic-tag { white-space: normal !important; }
/* «Авто в работе»: боковое меню 240px — лентой над содержимым */
html.ag-mobile .vic-layout { flex-direction: column; gap: 10px !important; }
html.ag-mobile .vic-nav { flex: 0 0 auto !important; width: 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 6px !important; }
html.ag-mobile .vic-nav::-webkit-scrollbar { display: none; }
html.ag-mobile .vic-nav-item { flex: 0 0 auto; }
html.ag-mobile .vic-nav.vic-nav-top { display: flex !important; } /* плитки разделов на телефоне — прежняя лента */
html.ag-mobile .vic-nav-top .vic-nav-item { height: auto; padding: 10px 14px; font-size: 14px; }
html.ag-mobile .vic-nav-top .vic-nav-item i { font-size: 16px; }
html.ag-mobile .vic-content { width: 100%; }

/* ════════ Добавить авто: источники над формой, поля в одну колонку ════════ */
html.ag-mobile .oc-layout { flex-direction: column; gap: 10px !important; max-width: none !important; }
html.ag-mobile .oc-src { position: static !important; flex: 0 0 auto !important; width: 100%; }
html.ag-mobile .oc-src textarea.oc-input { min-height: 90px !important; }
html.ag-mobile .oc-layout > form, html.ag-mobile .oc-layout > .oc-card { width: 100%; min-width: 0; }
html.ag-mobile .oc-card { padding: 12px !important; border-radius: 12px; }
/* сетки полей 2 и 3 колонки — в одну */
html.ag-mobile .oc-grid, html.ag-mobile .oc-grid-3 { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
/* поля под палец, 16px — иначе iPhone приближает страницу при вводе */
html.ag-mobile .oc-input, html.ag-mobile .oc-field select.form-select, html.ag-mobile .oc-field .form-control { font-size: 16px !important; min-height: 44px; }
html.ag-mobile .oc-src .oc-src-box .oc-input { font-size: 16px !important; }
html.ag-mobile .oc-src-file { min-height: 64px; }
/* кнопки внизу — на всю ширину, «Добавить» первой */
html.ag-mobile .oc-footer { flex-wrap: wrap; gap: 8px !important; }
html.ag-mobile .oc-footer .oc-btn { flex: 1 1 140px; min-height: 46px; justify-content: center; }
html.ag-mobile .oc-footer .oc-btn-primary { order: -1; flex: 1 1 100%; }
/* ссылка для клиента: поле и кнопка «Копировать» друг под другом */
html.ag-mobile #ocClientLinkCopy { width: 100%; min-height: 44px; justify-content: center; }
html.ag-mobile .oc-modal-card { width: auto !important; max-width: calc(100vw - 24px) !important; max-height: 85vh; overflow-y: auto; }

/* ════════ Справочники: Дилеры, Сотрудники, Контрагенты, Профиль ════════ */
/* Дилеры: панель поиска в столбик, вкладки лентой, карточка в одну колонку */
html.ag-mobile .dealers-topbar { flex-wrap: wrap; gap: 8px; margin-right: 0 !important; padding: 0 !important; background: transparent; border: none; box-shadow: none; }
html.ag-mobile .dealers-topbar > * { min-width: 0; }
html.ag-mobile .dealers-topbar input { height: 42px; font-size: 16px; }
html.ag-mobile .dealer-tabs { flex: 1 1 100%; margin-left: 0 !important; overflow-x: auto; scrollbar-width: none; }
html.ag-mobile .dealer-tabs::-webkit-scrollbar { display: none; }
html.ag-mobile .dealer-tab { flex: 0 0 auto; min-height: 38px; }
/* «Добавить дилера» на телефоне — квадратная кнопка «+» справа от поиска, вкладки — строкой ниже */
html.ag-mobile .dealers-topbar .search-wrap { flex: 1 1 0 !important; }
html.ag-mobile .dealers-add-btn { order: 1; width: 42px; height: 42px; padding: 0; justify-content: center; margin-left: 0; }
html.ag-mobile .dealers-add-btn span { display: none; }
html.ag-mobile .dealers-add-btn i { font-size: 20px; }
html.ag-mobile .dealer-tabs { order: 2; }
/* дилеры — на компьютере таблица строк; на телефоне каждая строка снова карточка: шапка колонок скрыта, ячейки переносятся */
html.ag-mobile .dealer-thead { display: none; }
html.ag-mobile #dealers-grid { border: none; background: transparent; border-radius: 0; gap: 8px; overflow: visible; }
html.ag-mobile .dealer-tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px !important; background: #fff; border: 0.5px solid #e9e9e9; border-radius: 12px; }
html.ag-mobile .dealer-tr .dealer-main { flex: 1 1 0; }
html.ag-mobile .dealer-tr .dealer-contacts { flex: 0 0 100%; }
html.ag-mobile .dealer-tr .dealer-cell { flex: 0 0 auto; white-space: normal; }
html.ag-mobile .dealer-tr .dealer-num::before { content: attr(data-l) ' '; color: #a1a5b7; font-weight: 400; }
html.ag-mobile .dealer-tr .dealer-updated { flex: 0 0 100%; }
html.ag-mobile .dealer-tr .dealer-lock-btn { width: 36px; height: 36px; }
html.ag-mobile .dealer-pass { flex-wrap: wrap; }
html.ag-mobile .dealer-pass .dealer-pass-val { overflow-wrap: anywhere; }
html.ag-mobile .dealer-pass .ti { font-size: 18px; padding: 6px; }

/* Сотрудники: сетка карточек в одну колонку, вкладки лентой */
html.ag-mobile #emp-grid, html.ag-mobile #emp-skeleton { grid-template-columns: minmax(0, 1fr) !important; max-width: none !important; }
html.ag-mobile .emp-tabs { flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; }
html.ag-mobile .emp-tabs::-webkit-scrollbar { display: none; }
html.ag-mobile .emp-tabs > * { flex: 0 0 auto; }
html.ag-mobile .emp-photo { height: 150px !important; }
html.ag-mobile .ec-grid { grid-template-columns: minmax(0, 1fr) !important; }
/* панель поиска сотрудников: закреплённая строка с margin-right 308px под десктопную панель */
html.ag-mobile .employees-topbar { position: static !important; flex-wrap: wrap; margin-right: 0 !important; padding: 0 !important; background: transparent; border: none; box-shadow: none; gap: 8px !important; }
html.ag-mobile .employees-topbar > * { min-width: 0; }
html.ag-mobile .employees-topbar input { height: 42px; font-size: 16px; }
html.ag-mobile #empAddOpen { flex: 1 1 100%; width: 100%; min-height: 44px; }

/* Контрагенты: блок и таблицы прокручиваются вбок внутри себя, а не рвут страницу */
html.ag-mobile .partners-block { min-width: 0 !important; width: auto !important; }
/* таблица шире экрана прокручивается внутри себя; flex:0 0 auto держал её по ширине содержимого (1600px) и рвал страницу */
html.ag-mobile .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
html.ag-mobile .ctab-card-wrapper { min-width: 0; }

/* Профиль и вход */
html.ag-mobile #ag-profile .row > [class*="col-"] { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
html.ag-mobile #ag-profile .form-control, html.ag-mobile #ag-profile .form-select { font-size: 16px !important; min-height: 42px; }
html.ag-mobile #kt_sign_in_form input { font-size: 16px !important; min-height: 46px; }

/* общее: вкладки Metronic (nav-tabs) лентой, таблицы не рвут страницу */
html.ag-mobile .nav-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
html.ag-mobile .nav-tabs::-webkit-scrollbar { display: none; }
html.ag-mobile .nav-tabs .nav-item { flex: 0 0 auto; }
html.ag-mobile table { max-width: 100%; }
/* Контрагенты: панель поиска в столбик, вкладки лентой, «Добавить» на всю ширину */
html.ag-mobile .partners-topbar { position: static !important; flex-wrap: wrap; gap: 8px; padding: 10px 0 !important; border-radius: 0; }
html.ag-mobile .partners-topbar::before { display: none; }
html.ag-mobile .partners-topbar .search-wrap { flex: 1 1 100% !important; }
html.ag-mobile .partners-topbar input#partners-search { height: 42px; font-size: 16px; }
html.ag-mobile #partners-tabs { flex: 1 1 100%; margin: 0 !important; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
html.ag-mobile #partners-tabs::-webkit-scrollbar { display: none; }
html.ag-mobile .partners-add-btn { flex: 1 1 100%; margin-left: 0 !important; height: 44px; justify-content: center; }

/* ════════ Планшет (от 700px): там, где одна колонка тратит место впустую ════════ */
@media (min-width: 700px) {
    /* поля и сетки — в две колонки */
    html.ag-mobile .inf-list { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    html.ag-mobile .oc-grid, html.ag-mobile .oc-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    html.ag-mobile #cot-edit-panel .cot-ep-grid, html.ag-mobile #cot-edit-panel .cot-vp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    html.ag-mobile #cotEpCars .cot-car-row > div { flex: 1 1 200px !important; }
    /* списки карточек */
    html.ag-mobile #emp-grid, html.ag-mobile #emp-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    /* доски: по две колонки вместо одной */
    html.ag-mobile .fn-board { flex-direction: row !important; flex-wrap: wrap; }
    html.ag-mobile .fn-col-wrap { flex: 1 1 300px !important; width: auto; }
    html.ag-mobile .ws-task-cols { flex-direction: row !important; flex-wrap: wrap; }
    html.ag-mobile .ws-task-cols > .ws-col { flex: 1 1 300px !important; width: auto; }
    /* баланс: PLN и EUR рядом */
    html.ag-mobile .bal-income-cols { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    /* карточка авто: фото крупнее, участники в три колонки */
    html.ag-mobile .ocv-left .ov-main, html.ag-mobile .ocv-left .block-images-view img { max-height: 320px !important; }
    html.ag-mobile .ocv-head [id^="hdrLine"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    /* карточка в списке: миниатюра крупнее */
    html.ag-mobile .ocard-img { width: 150px !important; }
}

/* заставка загрузки на телефоне — просто белый экран, без синего крутящегося кольца (.lds-dual-ring) */
html.ag-mobile .preloader_custom .lds-dual-ring { display: none; }

/* Приёмка на телефоне (01.10.2026): пустая плитка фото — крупный «+» по центру (было 13px в углу, не видно);
   горизонтально (шире 600px) плитки в один ряд по 4, а не 2 растянутые */
html.ag-mobile .acc-tile:not(.has-cover) .acc-tile-n:empty::before {
    content: '+'; position: absolute; left: 50%; top: calc(50% - 13px); transform: translate(-50%, -50%);
    width: 38px; height: 38px; border-radius: 50%; background: #E6F1FB; color: #185fa5;
    display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 400; line-height: 1;
}
@media (min-width: 600px) {
    html.ag-mobile .acc-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* замки на телефоне крупнее (01.10.2026): 40px — под палец, значок 20px */
html.ag-mobile .scp-lock, html.ag-mobile .acc-lock-btn, html.ag-mobile .bal-lock, html.ag-mobile .avacc-lock,
html.ag-mobile .emp-lock-btn, html.ag-mobile .dealer-lock-btn, html.ag-mobile .dealer-tr .dealer-lock-btn {
    width: 40px; height: 40px; min-width: 40px; border-radius: 10px;
}
html.ag-mobile .scp-lock i, html.ag-mobile .acc-lock-btn i, html.ag-mobile .bal-lock i, html.ag-mobile .avacc-lock i,
html.ag-mobile .emp-lock-btn i, html.ag-mobile .dealer-lock-btn i { font-size: 20px; }
/* ряд «приёмщик · дата · замок» — одной строкой, замок справа; не влезает — сжимается имя */
html.ag-mobile .acc-tiles-meta { flex-wrap: nowrap !important; gap: 6px 10px !important; }
html.ag-mobile .acc-tiles-meta > .acc-lock-btn { align-self: center; margin: 0 0 0 auto; }
/* замок блока «Данные»: стоял вплотную к правому краю (right: 0) — внутрь, на отступ блока (кнопка конструктора 40px — в show-fields, там #id) */
html.ag-mobile [id^="edBlockInfo_"] .ed-controls { top: 12px; right: 12px; }

/* Окно карточки «Воронки продаж» на телефоне (09.10.2026): на весь экран, подпись поля — над значением, цели нажатия под палец.
   Правила строки-свойства (.fn-prop) общие: такие же строки в других окнах Workspace встанут так же. Шрифт полей 16px — iOS не увеличивает страницу при вводе */
html.ag-mobile #fnModal { padding: 0; align-items: stretch; }
html.ag-mobile #fnModal .fn-modal-card { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; padding: 12px 14px 28px; box-shadow: none; }
html.ag-mobile #fnModal .fn-modal-head { position: sticky; top: -12px; z-index: 5; background: #fff; margin: -12px -14px 8px; padding: 10px 14px 8px; border-bottom: 0.5px solid #f0f0f5; align-items: center; }
html.ag-mobile #fnModal .fn-modal-head input { font-size: 21px; min-width: 0; }
html.ag-mobile #fnModal .fn-close { width: 40px; height: 40px; font-size: 20px; margin-top: 0; }
html.ag-mobile .fn-prop { flex-wrap: wrap; gap: 0 8px; min-height: 0; padding: 5px 6px; }
html.ag-mobile .fn-prop:hover { background: transparent; }
html.ag-mobile .fn-prop-label { flex: 0 0 100%; font-size: 13px; }
html.ag-mobile .fn-prop-label i { font-size: 14px; }
html.ag-mobile .fn-prop input, html.ag-mobile .fn-prop select, html.ag-mobile .fn-prop textarea { font-size: 16px; min-height: 38px; }
html.ag-mobile .fn-prop .fn-dd-value { min-height: 38px; }
html.ag-mobile .fn-prop .fn-dd-chip, html.ag-mobile .fn-prop .fn-dd-ph, html.ag-mobile .fn-prop .fn-dd-tag { font-size: 16px; }
html.ag-mobile .fn-dd-item { padding: 10px 8px; }
html.ag-mobile .fn-dd-menu { max-height: 46dvh; }
html.ag-mobile .fn-prop-check { flex-wrap: nowrap; min-height: 44px; align-items: center; }
html.ag-mobile .fn-prop-check input { width: 22px; height: 22px; min-height: 0; }
html.ag-mobile .fn-prop-check span { font-size: 16px; }
html.ag-mobile .fn-src-tags { flex-wrap: wrap; }
html.ag-mobile .fn-src-tag { padding: 8px 12px; font-size: 15px; }
html.ag-mobile .fn-copy { width: 40px; height: 40px; font-size: 18px; }
html.ag-mobile .fn-copy-car { width: auto; height: 36px; font-size: 14px; }
html.ag-mobile .fn-sec-title { font-size: 14px; margin-top: 16px; }
html.ag-mobile .fn-prop:has(textarea) .fn-prop-label { padding-top: 0; }
