/* 9.0.0 / v14 — z-index isolation, twin bars, horizontal load cards, tablet split */

:root {
  --v14-bg: #f4f7fb;
  --v14-card: #ffffff;
  --v14-line: #e2e8f0;
  --v14-blue: #0066ff;
  --v14-soft: #e0f2fe;
  --v14-ink: #0f172a;
  --v14-body: #475569;
  --v14-mute: #94a3b8;
  --v14-live: #10b981;
  --v14-demo: #f59e0b;
  --v14-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --v14-glass: 0 8px 24px rgba(15, 23, 42, .05);
  --v14-z-base: 1;
  --v14-z-card: 20;
  --v14-z-chrome: 5000;
  --v14-z-menu: 7000;
  --v14-z-scrim: 8990;
  --v14-z-filter: 9000;
  --v14-z-dispo: 99999;
  --v14-z-toast: 100000;
}

html body.bu-board-page .bu-toast,
html body .bu-toast {
  z-index: 100000 !important;
  max-width: min(92vw, 560px) !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.35 !important;
  padding: 12px 18px !important;
  border-radius: 16px !important;
  background: #0f172a !important;
  color: #fff !important;
  font-weight: 800 !important;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .28) !important;
}

html body .bu-lang-menu,
html body .bu-lang-menu-float,
html body .bu-veh-drop-menu,
html body .bu-live-menu,
html body .bu-mshell-end .bu-lang-menu {
  z-index: 7000 !important;
}

html body.bu-board-page .bu-ccflag {
  display: inline !important;
  font-style: normal !important;
  font-size: 15px !important;
  line-height: 1 !important;
  margin-right: 4px !important;
}

/* ===== Desktop chrome above map / list / Dispo ===== */
@media (min-width: 1024px) {
  html body.bu-board-page:not(.bu-nalog-page) .bu-filter-chrome,
  html body.bu-board-page:not(.bu-nalog-page) .bu-board-bar {
    position: relative !important;
    z-index: 5000 !important;
    overflow: visible !important;
    isolation: isolate !important;
    flex: 0 0 auto !important;
  }
  html body.bu-board-page:not(.bu-nalog-page) .bu-term-grid {
    position: relative !important;
    z-index: 1 !important;
    isolation: isolate !important;
  }
  html body.bu-board-page #bu-map-pane,
  html body.bu-board-page .bu-board-map,
  html body.bu-board-page .leaflet-container {
    z-index: 1 !important;
  }
  html body.bu-board-page #bu-list-pane {
    z-index: 2 !important;
  }
  html body.bu-board-page #bu-dispo:not(.bu-ai-portal) {
    z-index: 2 !important;
  }

  html body.bu-board-page .bu-twin-bars {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: stretch !important;
    padding: 8px 12px 10px !important;
    box-sizing: border-box !important;
  }
  html body.bu-board-page .bu-alert-bar,
  html body.bu-board-page .bu-filter-bar,
  html body.bu-board-page #f-toggle {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 76px !important;
    padding: 12px 16px !important;
    overflow: visible !important;
    white-space: normal !important;
    border-radius: 16px !important;
    background: #fff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: var(--v14-glass) !important;
    text-align: left !important;
    opacity: 1 !important;
  }
  html body.bu-board-page .bu-alert-bar.is-blocked,
  html body.bu-board-page .bu-alert-bar.is-on,
  html body.bu-board-page .bu-alert-bar.is-locked {
    background: #fff !important;
    border-color: #e2e8f0 !important;
    box-shadow: var(--v14-glass) !important;
    opacity: 1 !important;
  }
  html body.bu-board-page .bu-filter-bar.is-open,
  html body.bu-board-page .bu-alert-bar.is-on {
    border-color: #0066ff !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, .12), var(--v14-glass) !important;
  }
  html body.bu-board-page .bu-filter-bar-main,
  html body.bu-board-page .bu-alert-bar-main {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }
  html body.bu-board-page .bu-filter-bar-main strong,
  html body.bu-board-page .bu-alert-txt {
    display: block !important;
    color: #0f172a !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
    white-space: normal !important;
  }
  html body.bu-board-page .bu-filter-bar-main small,
  html body.bu-board-page .bu-alert-hint {
    display: block !important;
    color: #475569 !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    overflow: visible !important;
    max-height: none !important;
  }
  html body.bu-board-page .bu-filter-bar-act,
  html body.bu-board-page .bu-alert-bar-act {
    flex: 0 0 auto !important;
    align-self: center !important;
    color: #0f172a !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    padding: 8px 12px !important;
    border-radius: 999px !important;
    background: #f1f5f9 !important;
  }
  html body.bu-board-page .bu-filter-bar.is-open .bu-filter-bar-act,
  html body.bu-board-page .bu-alert-bar.is-on .bu-alert-bar-act {
    background: #0066ff !important;
    color: #fff !important;
  }

  html body.bu-board-page #bu-filter-fold:not(.open),
  html body.bu-board-page #bu-filter-fold[hidden] {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    z-index: 0 !important;
  }
  html body.bu-board-page #bu-filter-fold.open,
  html body.bu-board-page #bu-filter-fold.open.bu-v14-ported {
    position: fixed !important;
    inset: auto !important;
    z-index: 9000 !important;
    display: flex !important;
    flex-direction: column !important;
    width: auto !important;
    height: auto !important;
    max-height: min(72dvh, calc(100dvh - 148px)) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .18) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  html body.bu-board-page #bu-filter-scrim:not([hidden]) {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 8990 !important;
    background: rgba(15, 23, 42, .28) !important;
    pointer-events: auto !important;
  }
  html body.bu-board-page #bu-filter-fold.open .bu-filter-sheet-head {
    display: flex !important;
    padding: 12px 16px 8px !important;
    color: #0f172a !important;
  }
  html body.bu-board-page #bu-filter-fold.open #bu-lanes,
  html body.bu-board-page #bu-filter-fold.open .bu-metrics-row,
  html body.bu-board-page #bu-filter-fold.open .bu-cargo-adv,
  html body.bu-board-page #bu-filter-fold.open .bu-truck-adv {
    padding: 0 16px !important;
  }
  html body.bu-board-page #bu-filter-fold.open #bu-lanes {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
  }
  html body.bu-board-page #bu-filter-fold.open #bu-search-row {
    display: flex !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 8 !important;
    flex: 0 0 auto !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    background: #fff !important;
    border-top: 1px solid #e2e8f0 !important;
  }

  html body #bu-detail,
  html body .bu-detail-modal {
    z-index: 9500 !important;
  }
  html body .bu-detail-modal-backdrop {
    z-index: 9400 !important;
  }
}

/* ===== Phone + tablet canvas ===== */
@media (max-width: 1023px) {
  html body.bu-board-page:not(.bu-nalog-page),
  html body.bu-board-page:not(.bu-nalog-page) .bu-board,
  html body.bu-board-page:not(.bu-nalog-page) .bu-board-main-col,
  html body.bu-board-page:not(.bu-nalog-page) .bu-term-grid,
  html body.bu-board-page .bu-board-list,
  html body.bu-board-page #bu-list-pane,
  html body.bu-board-page .bu-board-list-scroll,
  html body.bu-board-page .bu-feed {
    background: var(--v14-bg) !important;
    color: var(--v14-ink) !important;
  }
  html body .bu-mshell {
    z-index: 5000 !important;
  }
  html body .bu-mobdock,
  html body .bu-public-dock,
  html body #bu-dispo-fab {
    z-index: 5000 !important;
  }

  html body.bu-board-page .bu-feed .bu-item.compact,
  html body.bu-board-page .bu-feed .bu-item.bu-row.compact {
    display: block !important;
    flex-direction: unset !important;
    grid-template-columns: none !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  html body.bu-board-page .bu-feed .bu-item.compact > .bu-c,
  html body.bu-board-page .bu-feed .bu-item.compact > .bu-driver-card-cta {
    display: none !important;
  }
  html body.bu-board-page .bu-feed .bu-item.compact > .bu-c-fav {
    display: flex !important;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 3 !important;
  }
  html body.bu-board-page .bu-pcard,
  html body.bu-board-page .bu-v12-card,
  html body.bu-board-page .bu-v14-card {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 12px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: var(--v14-shadow) !important;
    color: #0f172a !important;
    position: relative !important;
  }
  html body.bu-board-page .bu-v14-top,
  html body.bu-board-page .bu-v12-card-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 18px;
  }
  html body.bu-board-page .bu-v14-route,
  html body.bu-board-page .bu-v12-route,
  html body.bu-board-page .bu-mcard-route {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }
  html body.bu-board-page .bu-v14-end,
  html body.bu-board-page .bu-v12-end,
  html body.bu-board-page .bu-mcard-end {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    color: #0f172a !important;
    font-size: 13px !important;
    font-weight: 800 !important;
  }
  html body.bu-board-page .bu-v14-end.is-to,
  html body.bu-board-page .bu-v12-end:last-of-type,
  html body.bu-board-page .bu-mcard-end:last-of-type {
    justify-content: flex-end !important;
    text-align: right !important;
  }
  html body.bu-board-page .bu-v14-end b,
  html body.bu-board-page .bu-v12-end b,
  html body.bu-board-page .bu-mcard-end b,
  html body.bu-board-page .bu-mcard-end small {
    display: inline !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    line-height: 1.25 !important;
  }
  html body.bu-board-page .bu-mcard-end small {
    font-weight: 700 !important;
    color: #334155 !important;
    margin-left: 4px !important;
  }
  html body.bu-board-page .bu-v14-arr,
  html body.bu-board-page .bu-v12-arr,
  html body.bu-board-page .bu-mcard-route > i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #0066ff !important;
    font-style: normal !important;
    font-weight: 900 !important;
    font-size: 16px !important;
    padding: 0 !important;
  }
  html body.bu-board-page .bu-v14-meta,
  html body.bu-board-page .bu-v12-specs,
  html body.bu-board-page .bu-mcard-meta {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px 8px !important;
  }
  html body.bu-board-page .bu-v14-goods,
  html body.bu-board-page .bu-v12-goods {
    display: inline !important;
    margin: 0 !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    color: #334155 !important;
  }
  html body.bu-board-page .bu-v12-box { display: none !important; }
  html body.bu-board-page .bu-v14-chip,
  html body.bu-board-page .bu-mchip {
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 8px !important;
    border-radius: 999px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }
  html body.bu-board-page .bu-demo-ribbon {
    display: inline-flex !important;
    align-items: center !important;
    padding: 3px 8px !important;
    border-radius: 999px !important;
    background: #f59e0b !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: .04em !important;
  }
  html body.bu-board-page .bu-v14-eur,
  html body.bu-board-page .bu-v12-eur {
    color: #0f172a !important;
    font-size: 14px !important;
    font-weight: 800 !important;
  }
  html body.bu-board-page .bu-v14-act {
    display: flex !important;
    justify-content: flex-end !important;
  }
  html body.bu-board-page .bu-v14-cta,
  html body.bu-board-page .bu-v12-req {
    margin-left: auto !important;
    border: 0 !important;
    background: #0066ff !important;
    color: #fff !important;
    border-radius: 12px !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  html body.bu-board-page .bu-mcard-foot { display: none !important; }
  html body.bu-board-page .bu-cols-head { display: none !important; }

  html body.bu-ai-open #bu-dispo,
  html body #bu-dispo.bu-ai-portal,
  html body #bu-dispo.is-sheet {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 99999 !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
    background: #f4f7fb !important;
    border-radius: 0 !important;
    pointer-events: auto !important;
  }
  html body #bu-mobile-detail-sheet {
    z-index: 98000 !important;
  }
  html body #bu-mobile-detail-backdrop {
    z-index: 97000 !important;
  }
}

/* Phone-only: full-screen filters, dock, pills */
@media (max-width: 767px) {
  html body.bu-board-page .bu-feed,
  html body.bu-board-page .bu-board-list-scroll {
    padding: 4px 12px 96px !important;
  }
  html body.bu-board-page #bu-filter-fold:not(.open) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    height: 0 !important;
    z-index: 0 !important;
  }
  html body.bu-board-page #bu-filter-fold.open,
  html body.bu-filters-sheet-open #bu-filter-fold {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9000 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    background: #fff !important;
    color: #0f172a !important;
    border-radius: 0 !important;
    overflow: auto !important;
  }
  html body.bu-board-page .bu-twin-bars { display: none !important; }
}

/* Tablet: list + map, identical twin bars, no 3rd Dispo column */
@media (min-width: 768px) and (max-width: 1023px) {
  html body.bu-board-page:not(.bu-nalog-page) {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    background: #f4f7fb !important;
  }
  html body.bu-board-page:not(.bu-nalog-page) .bu-board-shell-wrap,
  html body.bu-board-page:not(.bu-nalog-page) .bu-board-main-col,
  html body.bu-board-page:not(.bu-nalog-page) .bu-board {
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  html body.bu-board-page .bu-phonedock,
  html body.bu-board-page .bu-mobdock-3,
  html body.bu-board-page .bu-mobile-only,
  html body.bu-board-page .bu-pfilter-card,
  html body.bu-board-page .bu-pview,
  html body.bu-board-page .bu-ptabs,
  html body.bu-board-page .bu-v12-sound,
  html body.bu-board-page .bu-v12-search,
  html body.bu-board-page .bu-v12-togs {
    display: none !important;
  }
  html body.bu-board-page .bu-twin-bars {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 8px 12px 10px !important;
  }
  html body.bu-board-page .bu-alert-bar,
  html body.bu-board-page .bu-filter-bar,
  html body.bu-board-page #f-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 68px !important;
    padding: 10px 14px !important;
    background: #fff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: var(--v14-glass) !important;
    opacity: 1 !important;
  }
  html body.bu-board-page .bu-alert-bar.is-blocked,
  html body.bu-board-page .bu-alert-bar.is-on {
    background: #fff !important;
    border-color: #e2e8f0 !important;
  }
  html body.bu-board-page .bu-filter-bar.is-open,
  html body.bu-board-page .bu-alert-bar.is-on {
    border-color: #0066ff !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, .12) !important;
  }
  html body.bu-board-page:not(.bu-nalog-page) .bu-term-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr) !important;
    grid-template-areas: "list map" !important;
    gap: 12px !important;
    align-items: stretch !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
  }
  html body.bu-board-page #bu-list-pane,
  html body.bu-board-page #bu-list-pane.hidden-m,
  html body.bu-board-page.bu-term-view-map #bu-list-pane,
  html body.bu-board-page .bu-board-list {
    display: block !important;
    position: relative !important;
    grid-area: list !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    max-height: none !important;
    height: 100% !important;
    overflow: auto !important;
    z-index: 2 !important;
    pointer-events: auto !important;
    visibility: visible !important;
  }
  html body.bu-board-page #bu-map-pane,
  html body.bu-board-page #bu-map-pane.hidden-m,
  html body.bu-board-page .bu-board-map,
  html body.bu-board-page:not(.bu-term-view-map) #bu-map-pane {
    display: flex !important;
    position: relative !important;
    grid-area: map !important;
    width: auto !important;
    height: 100% !important;
    min-height: 420px !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 1 !important;
  }
  html body.bu-board-page #bu-dispo:not(.bu-ai-portal) {
    display: none !important;
    pointer-events: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    z-index: 0 !important;
  }
  html body.bu-board-page #bu-dispo-fab { display: flex !important; }
  html body.bu-board-page #bu-filter-fold:not(.open) {
    display: none !important;
    pointer-events: none !important;
    z-index: 0 !important;
  }
  html body.bu-board-page #bu-filter-fold.open {
    position: fixed !important;
    top: 12vh !important;
    left: 8vw !important;
    right: 8vw !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    max-height: 76dvh !important;
    z-index: 9000 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border-radius: 20px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .2) !important;
    overflow: auto !important;
  }
  html body.bu-board-page #bu-filter-scrim:not([hidden]) {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 8990 !important;
    background: rgba(15, 23, 42, .32) !important;
  }
}

html body .bu-ai-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 10px 12px !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  text-align: left !important;
  color: #0f172a !important;
}
html body .bu-ai-card .bu-v12-ai-go {
  margin-left: auto;
  background: #0066ff !important;
  color: #fff !important;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
html body .bu-dispo-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}
html body .bu-dispo-chip {
  border-radius: 999px !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}
