/* ============================================================================
   mobile-ux.css — мобільна ревізія 11.2026 (телефон ≤768px). ІЗОЛЬОВАНО.
   Підключається ОСТАННІМ у index.html: mobile.css стоїть рано, і пізніші шари
   (apple-ui, navy-pages, company.css…) перебивали його правила на телефоні.
   Усе всередині @media (max-width:768px) — на десктопі не діє нічого.
   ============================================================================ */

/* m-only: елементи лише для телефона (напр. сортування для карток замість шапки таблиці) */
@media (min-width: 769px) { .m-only, .m-filt-btn { display: none !important; } }

@media (max-width: 768px) {

  /* ---- Топбар: один рядок. Курси й статус 1С — інформаційні, на телефоні ховаємо;
     🔔 сповіщення мав клас .topbar-nav-btn і ховався разом із дублями меню — повертаємо ---- */
  .topbar { flex-wrap: nowrap; min-height: 52px; padding-top: calc(6px + env(safe-area-inset-top, 0px)) !important; padding-bottom: 6px !important; }
  .topbar-actions { flex-wrap: nowrap !important; margin-left: auto !important; }
  #onecSyncBadge, #currencyWidget { display: none !important; }
  .topbar-actions #leadNotifBtn { display: flex !important; min-width: 44px; min-height: 40px; justify-content: center; }
  .topbar-meet-btn { min-height: 40px; }
  .mobile-menu-btn { min-width: 44px; min-height: 44px; justify-content: center; align-items: center; }

  /* ---- Плаваюча кнопка асистента: менша, у safe-area, і не накриває кінець сторінки ---- */
  .ai-assistant-btn { width: 48px !important; height: 48px !important; font-size: 21px !important; right: 14px !important; bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important; }
  .page-container { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }

  /* ---- Таб-бари (Кабінет, картка компанії, сегменти) — ОДИН рядок зі скролом, не 7 рядків переносу ---- */
  .cck-tabs, .comp-tabs, #pageCompanyDetail .comp-tabs {
    display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-snap-type: x proximity;
  }
  .cck-tabs::-webkit-scrollbar, .comp-tabs::-webkit-scrollbar { display: none; }
  .cck-tab, .comp-tab-btn { flex: 0 0 auto !important; white-space: nowrap; min-height: 40px; scroll-snap-align: start; }

  /* ---- Будь-яка таблиця, що НЕ стала карткою, гортається всередині себе, а не розпирає сторінку ---- */
  .page.active { max-width: 100vw; }
  .page-content, .page-container { min-width: 0; }

  /* ---- Таблиці → картки v2: клас m-card-tbl ставить js/mobile.js (data-table, mdash-table, admin-table,
     contract-table, report-table, cs-table, .m-cards; лише з <thead>). Комірка — block: підпис float ліворуч,
     значення праворуч (flex розкладав багатовузлові комірки в колонки). ---- */
  table.m-card-tbl { border: 0 !important; width: 100% !important; min-width: 0 !important; table-layout: auto !important; background: transparent !important; }
  table.m-card-tbl colgroup { display: none; }
  table.m-card-tbl thead { position: absolute !important; left: -9999px !important; top: -9999px !important; }
  table.m-card-tbl tbody, table.m-card-tbl tfoot, table.m-card-tbl tr, table.m-card-tbl td { display: block; width: auto !important; max-width: none !important; }
  table.m-card-tbl tr {
    border: 1px solid var(--border-color) !important; border-radius: 14px; margin: 0 0 10px; padding: 10px 14px;
    background: var(--bg-secondary, #fff); box-shadow: 0 1px 2px rgba(15,23,42,.05);
  }
  table.m-card-tbl tr[hidden], table.m-card-tbl tr[style*="display: none"], table.m-card-tbl tr[style*="display:none"] { display: none !important; }
  table.m-card-tbl td {
    border: 0 !important; padding: 5px 0 !important; text-align: right !important; min-height: 0 !important;
    white-space: normal !important; word-break: normal !important; overflow-wrap: anywhere; position: static !important;
    background: transparent !important; height: auto !important;
  }
  table.m-card-tbl td::after { content: ""; display: table; clear: both; }
  table.m-card-tbl td::before {
    content: attr(data-label); float: left; max-width: 45%; margin-right: 12px; text-align: left;
    font: 600 13px/1.35 system-ui, -apple-system, sans-serif; color: var(--text-muted); letter-spacing: 0; text-transform: none;
  }
  /* заголовок картки: перша комірка або td[data-m-title] */
  table.m-card-tbl td:first-child, table.m-card-tbl td[data-m-title] { text-align: left !important; font-weight: 700; font-size: 15px; padding-top: 0 !important; }
  table.m-card-tbl td:first-child::before, table.m-card-tbl td[data-m-title]::before,
  table.m-card-tbl td[colspan]::before, table.m-card-tbl td.m-nolabel::before, table.m-card-tbl td:not([data-label])::before,
  table.m-card-tbl td[data-label=""]::before { content: none; display: none; }
  table.m-card-tbl tr:has(> td[data-m-title]) { display: flex; flex-direction: column; }
  table.m-card-tbl tr:has(> td[data-m-title]) > td[data-m-title] { order: -1; }
  /* заголовок — інша клітинка: перша (ЄДРПОУ, дата) — звичайний рядок із підписом, не другий «заголовок» */
  table.m-card-tbl tr:has(> td[data-m-title]) > td:first-child:not([data-m-title]) { text-align: right !important; font-weight: 400; font-size: inherit; padding-top: 5px !important; }
  table.m-card-tbl tr:has(> td[data-m-title]) > td:first-child:not([data-m-title])[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; float: left; }
  table.m-card-tbl td:empty, table.m-card-tbl td[data-m-empty], table.m-card-tbl td.m-hide { display: none !important; }
  table.m-card-tbl td[colspan] { text-align: left !important; }
  table.m-card-tbl tfoot tr { background: var(--accent-light) !important; }
  /* рядок дій у картці — кнопки праворуч, тап-зона 40px */
  table.m-card-tbl td.m-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 8px !important; }
  table.m-card-tbl td.m-actions::before { content: none; display: none; }
  table.m-card-tbl td .btn-sm, table.m-card-tbl td.m-actions .btn { min-height: 36px; }
  table.m-card-tbl td input[type=checkbox] { width: 20px; height: 20px; }
  /* обгортка-скролер картки не обрізає */
  .table-scroll:has(> table.m-card-tbl), .table-responsive:has(> table.m-card-tbl), .mv-wrap:has(> table.m-card-tbl) { overflow-x: visible !important; }

  /* таблиця-не-картка ширша за екран — гортається сама (js/mobile.js hscrollGuard) + тінь-підказка, поки є куди гортати */
  table.m-hscroll-tbl { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
  table.m-hscroll-tbl.m-hs-end { -webkit-mask-image: none; mask-image: none; }
}

@media (max-width: 768px) {
  /* .m-cards.m-grid — компактна картка: заголовок на всю ширину, далі пари «підпис над значенням» у ДВІ колонки
     (щільні числові таблиці: база лідів, реєстри) — картка вдвічі нижча */
  table.m-card-tbl.m-grid tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 2px; }
  table.m-card-tbl.m-grid td { display: block; text-align: left !important; padding: 4px 0 !important; min-width: 0; overflow-wrap: anywhere; }
  table.m-card-tbl.m-grid td::before { display: block; float: none; margin: 0 0 1px; max-width: none; font-size: 11px; font-weight: 600; text-transform: none; margin-bottom: 1px; }
  table.m-card-tbl.m-grid td:first-child, table.m-card-tbl.m-grid td[colspan], table.m-card-tbl.m-grid td.m-actions, table.m-card-tbl.m-grid td.m-wide { grid-column: 1 / -1; }
  table.m-card-tbl.m-grid td.m-actions { display: flex; }
  table.m-card-tbl td:first-child .btn-link { padding: 0 !important; background: none !important; text-align: left; white-space: normal; font-weight: 700; font-size: 15px; min-height: 0; }

  /* гамбургер — контрастніший (був ледь видно) */
  .mobile-menu-btn { color: var(--text-primary) !important; opacity: 1 !important; }
}

@media (max-width: 768px) {
  /* ---- 🎯 Ліди: тулбар — компактна сітка замість 6 рядків на весь перший екран ---- */
  #pageLeads .lead-tb { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; align-items: center; }
  #pageLeads .lead-tb-seg { grid-column: 1; justify-self: start; }
  #pageLeads .lead-tb-seg a { padding: 8px 12px !important; min-height: 36px; display: inline-flex; align-items: center; }
  #pageLeads .lead-tb-new { grid-column: 2; grid-row: 1; justify-self: end; margin: 0 !important; min-height: 40px; }
  #pageLeads .lead-tb-q { grid-column: 1 / -1; max-width: none !important; min-width: 0 !important; flex: none !important; }
  #pageLeads .lead-tb .filter-select { width: 100% !important; min-width: 0 !important; }
  #pageLeads .lead-tb-cnt { grid-column: 1 / -1; display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  #pageLeads .lead-tb-cnt::-webkit-scrollbar { display: none; }
  #pageLeads .lead-tb-cnt > a { flex: 0 0 auto; white-space: nowrap; display: inline-flex; align-items: center; }
  #pageLeads .lead-tb-reset { grid-column: 1 / -1; justify-self: start; }

  /* ---- 🎯 Канбан: колонка = майже екран, прилипання до колонки, сусідня визирає краєм ---- */
  #pageLeads .lead-stage-nav { margin: 0 0 10px; }
  #pageLeads .lead-kanban { scroll-snap-type: x mandatory; scroll-padding-left: 0; gap: 10px; -webkit-overflow-scrolling: touch; }
  #pageLeads .lead-col { min-width: calc(100vw - 56px) !important; max-width: calc(100vw - 56px) !important; scroll-snap-align: start; }
  #pageLeads .lead-card { padding: 12px 14px; }
  #pageLeads .lead-card .lead-tap { min-height: 36px; }
}

@media (max-width: 768px) {
  /* ---- Сегмент-контроли: правило mobile.css («один рядок зі скролом») перебивав apple-ui.css (flex-wrap:wrap),
     бо той підключений пізніше — на телефоні сегменти розповзались у 3–4 рядки. Тут — останнє слово ---- */
  .seg, .trs-seg { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .seg::-webkit-scrollbar, .trs-seg::-webkit-scrollbar { display: none; }
  .seg > *, .trs-seg > * { flex: 0 0 auto; white-space: nowrap; }
  .seg-btn, .trs-seg-btn { min-height: 38px; }
  /* у сітці таблиць/тулбарів сегмент не має розтягувати колонку */
  .lead-tb-seg { white-space: nowrap; }
  .lead-tb-seg a { white-space: nowrap; }
}

@media (max-width: 768px) {
  /* ---- 🎯 Картка ліда: дії та вкладки — по ОДНОМУ рядку зі скролом (було ~12 кнопок у 6 рядків = весь екран) ---- */
  .lead-detail-wrap { padding: 4px 0 !important; }
  .lead-detail-wrap .back-btn { padding: 6px 12px !important; font-size: 14px !important; min-height: 36px; }
  .lead-detail-wrap h2 { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
  .lead-acts, .lead-tabs {
    flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%; width: 100%;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  .lead-acts::-webkit-scrollbar, .lead-tabs::-webkit-scrollbar { display: none; }
  .lead-acts > *, .lead-tabs > * { flex: 0 0 auto; white-space: nowrap; min-height: 40px; }
  .lead-tabs { position: sticky; top: calc(52px + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--bg-primary, #f8fafc); padding: 6px 0; margin: 8px 0 !important; }
}

@media (max-width: 768px) {
  /* ---- Фільтр-бари (js/mobile.js): закрито — видно пошук + «⚙ Фільтри (n)», решта по тапу ---- */
  .m-filt-btn { flex: 0 0 auto; min-height: 44px; }
  /* закритий бар — пошук і «⚙ Фільтри» одним рядком; відкритий — кожен фільтр на всю ширину */
  :is(.filters-bar, .filter-bar, .cs-filterbar, [data-m-filters]):has(> .m-filt-btn) { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; gap: 8px; }
  :is(.filters-bar, .filter-bar, .cs-filterbar, [data-m-filters]):has(> .m-filt-btn) > :not(.m-filt-btn) { flex: 1 1 100%; min-width: 0; }
  :is(.filters-bar, .filter-bar, .cs-filterbar, [data-m-filters]):has(> .m-filt-btn) > :not(.m-filt-btn):not(.m-filt-collapsible) { flex: 1 1 160px; }
  :is(.filters-bar, .filter-bar, .cs-filterbar, [data-m-filters]):not(.m-filt-open) > .m-filt-collapsible { display: none !important; }
  :is(.filters-bar, .filter-bar, .cs-filterbar, [data-m-filters]).m-filt-open { gap: 8px; }
  .cs-filterbar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .cs-filterbar select { min-width: 0 !important; }
  .cs-filterbar > label, .filters-bar > label, .filter-bar > label { display: flex; align-items: center; gap: 8px; min-height: 40px; }

  /* ---- CC3: сторінка не розпирається вбік ---- */
  .page-header { flex-wrap: wrap; gap: 8px; }
  .page-header .page-actions { display: flex; flex-wrap: wrap; width: 100%; gap: 8px; }
  .page-actions .filter-select, .page-actions .filter-input { flex: 1 1 140px; min-width: 0 !important; width: auto !important; }
  [style*="grid-template-columns:1fr 1fr"]:not(.m-keep-grid), [style*="grid-template-columns: 1fr 1fr"]:not(.m-keep-grid), [style*="grid-template-columns:300px 1fr"]:not(.m-keep-grid) { grid-template-columns: minmax(0, 1fr) !important; }
  /* «1fr 1fr» як підрядок ловить і 3–4-колонкові сітки (зазвичай плитки-лічильники) — їм 2 колонки, не 1 */
  [style*="grid-template-columns:1fr 1fr 1fr"]:not(.m-keep-grid), [style*="grid-template-columns: 1fr 1fr 1fr"]:not(.m-keep-grid),
  [style*="grid-template-columns:repeat(3,1fr)"]:not(.m-keep-grid), [style*="grid-template-columns:repeat(4,1fr)"]:not(.m-keep-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [style*="grid-template-columns:repeat(5,1fr)"]:not(.m-keep-grid), [style*="grid-template-columns:repeat(6,1fr)"]:not(.m-keep-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .card, .cck-card, .grid > *, .stats-grid > * { min-width: 0; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; flex: 0 0 auto; }
  label:has(> input[type=checkbox]), label:has(> input[type=radio]) { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }

  /* ---- CC4: решта таб/пігулок-барів — один рядок зі свайпом ---- */
  .admin-tabs, .prj-chips, .ch-filters, .cck-pills, .tab-bar, .tabs, .clm-tabs, .clm-direction-tabs, .cs-tabs, .salc-tabs, .prj-tabs, .cck-seg {
    display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .admin-tabs::-webkit-scrollbar, .prj-chips::-webkit-scrollbar, .ch-filters::-webkit-scrollbar, .cck-pills::-webkit-scrollbar { display: none; }
  .admin-tabs > *, .prj-chips > *, .ch-filters > *, .cck-pills > *, .clm-tabs > *, .clm-direction-tabs > *, .cs-tabs > *, .salc-tabs > *, .prj-tabs > *, .cck-seg > * { flex: 0 0 auto; white-space: nowrap; min-height: 38px; }
  .clm-tabs::-webkit-scrollbar, .clm-direction-tabs::-webkit-scrollbar, .cs-tabs::-webkit-scrollbar, .salc-tabs::-webkit-scrollbar, .prj-tabs::-webkit-scrollbar, .cck-seg::-webkit-scrollbar { display: none; }

  /* ---- CC5: шухляда меню — тінь лише відкритій (закрита лишала сіру смугу зліва) ---- */
  .sidebar:not(.mobile-open) { box-shadow: none !important; visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
  .sidebar.mobile-open { visibility: visible; transition: transform .2s ease; }

  /* ---- CC6: асистент бази знань (#aiChatFab) — той самий розмір; ховаємо, коли відкрита модалка ---- */
  /* асистент БАЗИ ЗНАНЬ вставляється в body раз і лишався на всіх сторінках (дві 🤖) — лише на сторінках бази знань, над основним */
  #aiChatFab { width: 48px !important; height: 48px !important; right: 14px !important; bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important; }
  body:not(:has(#pageKnowledge.active)):not(:has(#pageSupportKb.active)) #aiChatFab { display: none !important; }
  body:has(.modal-overlay:not(.hidden)) .ai-assistant-btn, body:has(.modal-overlay:not(.hidden)) #aiChatFab { display: none !important; }

  /* ---- CC8: KPI по 2 в ряд, а не плитка на весь рядок ---- */
  .stats-grid, .ai-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .stats-grid .stat-card, .stats-grid > div { padding: 10px 12px !important; }
  .stat-card .stat-value, .stats-grid .stat-value { font-size: 20px !important; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

  /* ---- CC9: тап-зони й дрібний текст ---- */
  .cck-btn, .cck-pill, .cck-seg__btn, .pill, .prj-chip, .ch-fpill, .trs-btn, .admin-tab { min-height: 40px; }
  /* чип не стискається до «погодж/ено» (статус поруч із заголовком), а довгий (адреса, ПІБ) — переноситься по словах */
  .cck-chip { max-width: 100%; flex-shrink: 0; white-space: normal !important; overflow-wrap: break-word; }

  /* ---- CC10: без подвійних полів (контейнер 12px + контент 12px + картка 16px = ~280px під текст) ---- */
  .page-container .page-content { padding-left: 0 !important; padding-right: 0 !important; }
}

@media (max-width: 768px) {
  /* ---- Сортування карток (js/mobile.js sortBars) ---- */
  .m-sortbar { display: flex; gap: 8px; align-items: stretch; margin: 0 0 10px; }
  .m-sortbar select { flex: 1 1 auto; min-width: 0; }
  .m-sortbar .btn { flex: 0 0 44px; min-height: 40px; font-size: 18px; padding: 0; }
  .m-sortbar .m-selall:not([hidden]) { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; white-space: nowrap; flex: 0 0 auto; font-size: 14px; }
}
@media (min-width: 769px) { .m-sortbar { display: none !important; } }

@media (max-width: 768px) {
  /* ---- 💬 Чати: список ↔ розмова на весь екран (js/chats.js _mConv) ---- */
  #pageChats .ch-shell { grid-template-columns: minmax(0, 1fr) !important; height: calc(100dvh - 70px - env(safe-area-inset-top, 0px)); min-height: 0; border-radius: 14px; }
  #pageChats .ch-pane--card { display: none !important; }
  #pageChats .ch-shell:not(.is-conv) .ch-pane--conv { display: none; }
  #pageChats .ch-shell.is-conv .ch-pane--list { display: none; }
  #pageChats .ch-mback { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--novo-border, #E2E8F0);
    background: var(--novo-surface, #fff); color: var(--accent, #2563EB); font-weight: 600; font-size: 16px; cursor: pointer; flex: 0 0 auto; }
  #pageChats .ch-compbar { flex-wrap: wrap; gap: 6px; }
  #pageChats .ch-modes { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; max-width: 100%; }
  #pageChats .ch-mode, #pageChats .ch-meetbtn { min-height: 36px; display: inline-flex; align-items: center; white-space: nowrap; }
  #pageChats .ch-item { min-height: 56px; }
  /* у чатах асистент накриває поле вводу */
  body:has(#pageChats.active) .ai-assistant-btn { display: none !important; }
  body:has(#pageChats.active) .page-container { padding-bottom: 8px !important; }
}

@media (max-width: 768px) {
  /* ---- 📰 Новини: дії рядком під текстом ---- */
  .nw-card { flex-wrap: wrap; }
  .nw-card > div[style*="flex:1"] { flex: 1 1 calc(100% - 70px) !important; }
  .nw-actions { order: 3; width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .nw-actions .btn { min-height: 40px; }

  /* ---- 📚 База знань: одна колонка, категорії — смуга чипів ---- */
  .kb-layout, .kb-main { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  .kb-sidebar { padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
  .kb-sidebar .kb-cat-list { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; padding-bottom: 2px; }
  .kb-sidebar .kb-cat-list::-webkit-scrollbar { display: none; }
  .kb-sidebar .kb-cat-list li { margin: 0 !important; flex: 0 0 auto; }
  .kb-sidebar .kb-cat-list a { white-space: nowrap; min-height: 38px; display: flex !important; align-items: center; border: 1px solid var(--border-color); border-radius: 19px !important; padding: 6px 12px !important; }
  .kb-sidebar h4 { display: none; }

  /* ---- 🎓 Аналітика навчання: сітка не розпирається таблицею ---- */
  .ta-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .ta-grid > * { min-width: 0; }
}

@media (max-width: 768px) {
  /* ---- .m-strips: кожен дочірній блок — одна смуга зі свайпом (Кабінет → Замовлення та ін.) ---- */
  .m-strips > span { max-width: 100%; overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .m-strips > span::-webkit-scrollbar { display: none; }
  .m-strips > span > * { flex: 0 0 auto; white-space: nowrap; }
  .m-strips > span > a { min-height: 34px; display: inline-flex; align-items: center; }
}

@media (max-width: 768px) {
  /* ---- СЕБ-ІКО: шкала 0–10 — сітка 6×2 з тап-зоною 40px (11 кнопок у рядок не влазили, 9 і 10 за краєм) ---- */
  #plsNps { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px !important; }
  #plsNps .plsN { min-height: 40px; padding: 0; }

  /* ---- 🏦 Казначейство: плитки по 2 в ряд, суми не розпирають ---- */
  .trs-tile { min-width: 0 !important; flex: 1 1 calc(50% - 6px) !important; }
  .trs-hero { font-size: clamp(1.05rem, 5.2vw, 1.45rem) !important; overflow-wrap: anywhere; }
}

@media (max-width: 768px) {
  /* ---- 🎯 Кабінет → Огляд: KPI-картки команди по 2 в ряд (mobile.css робив mdash-grid в 1 колонку) ---- */
  .mdash-grid[style*="minmax(190px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .mdash-grid[style*="minmax(190px"] > .card { padding: 10px 12px !important; }
  .mdash-grid[style*="minmax(190px"] > .card > div:nth-child(2) { font-size: 17px !important; overflow-wrap: anywhere; }
}

@media (max-width: 768px) {
  /* ---- 🎯 Кабінет → Планування: рядки прогнозів (клієнт · сума · ціль/банк · дата) — переносяться:
     клієнт на всю ширину, далі поля парою; в один ряд поля стискались до ~20 px, дата вилазила за екран ---- */
  .cck-row.wb-srow, .cck-row.wb-irow, .cck-row.kv-row { flex-wrap: wrap !important; gap: 6px !important; }
  .cck-row.wb-srow > div:first-child, .cck-row.wb-irow > div:first-child, .cck-row.kv-row > div:first-child { flex: 1 1 100% !important; }
  .cck-row.wb-srow > input, .cck-row.wb-srow > select, .cck-row.wb-irow > input, .cck-row.wb-irow > select,
  .cck-row.kv-row > input, .cck-row.kv-row > select { flex: 1 1 calc(50% - 30px) !important; width: auto !important; min-width: 0 !important; min-height: 40px; }
  .cck-row.wb-srow > button, .cck-row.wb-irow > button, .cck-row.kv-row > button { flex: 0 0 40px; min-height: 40px; }
}

@media (max-width: 768px) {
  /* Lead Engine: рядок пошуку на всю ширину лише на телефоні */
  .ll-searchrow { flex: 1 1 100%; }
  .ll-searchrow #llSearch { flex: 1 1 auto; }
}
