/* 8.9.0 — crash fix leftovers, desktop twin bars, detail sheet, Dispo z-index */

@media (max-width: 899px) {
  html body.bu-board-page #bu-filter-fold:not(.open) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    z-index: -1 !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  html body.bu-ai-open #bu-dispo,
  html body #bu-dispo.is-sheet,
  html body #bu-dispo.bu-ai-portal {
    z-index: 2147483645 !important;
  }
  html body #bu-mobile-detail-sheet {
    z-index: 2147483600 !important;
  }
  html body #bu-mobile-detail-backdrop {
    z-index: 2147483590 !important;
  }
  html body #bu-mobile-detail-body .bu-dpro-route-pair,
  html body #bu-mobile-detail-body .bu-dpro-specs {
    display: none !important;
  }
  html body #bu-mobile-detail-body .bu-v13-fuel,
  html body #bu-mobile-detail-body .bu-dpro-profile,
  html body #bu-mobile-detail-body .bu-fuel-card {
    display: block !important;
    margin-top: 12px;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 18px !important;
    color: #0f172a !important;
    padding: 12px !important;
  }
  html body .bu-v13-fuel-card .bu-fuel-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  html body .bu-v13-fuel-card .bu-fuel-stat {
    background: #f8fafc !important;
    border-radius: 12px;
    padding: 10px !important;
  }
  html body .bu-v13-fuel-card .bu-fuel-stat small { color: #94a3b8 !important; font-size: 11px; font-weight: 700; }
  html body .bu-v13-fuel-card .bu-fuel-stat b { color: #0f172a !important; font-size: 16px; display: block; }
  html body .bu-v13-fuel-card .bu-fuel-stat span { color: #64748b !important; font-size: 11px; }
  html body .bu-v13-fuel-card .bu-fuel-inputs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
    margin-top: 10px;
  }
  html body .bu-v13-fuel-card input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px;
    color: #0f172a;
    background: #fff;
  }
  html body .bu-mdetail-foot .bu-dpro-contact-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
    margin-top: 8px;
  }
  html body .bu-mdetail-foot .bu-dpro-contact-grid .bu-btn {
    min-height: 42px;
    border-radius: 12px !important;
    font-size: 12.5px !important;
  }
}

@media (min-width: 900px) {
  html body.bu-board-page:not(.bu-nalog-page) .bu-filter-chrome,
  html body.bu-board-page:not(.bu-nalog-page) .bu-board-bar {
    overflow: visible !important;
    flex: 0 0 auto !important;
    max-height: none !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;
  }
  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: 12px !important;
    min-height: 72px !important;
    height: auto !important;
    max-width: none !important;
    width: 100% !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: 0 8px 24px rgba(15, 23, 42, .05) !important;
  }
  html body.bu-board-page .bu-alert-bar.is-blocked {
    opacity: .92;
    background: #fff7ed !important;
    border-color: #fdba74 !important;
  }
  html body.bu-board-page .bu-alert-bar.is-on {
    background: #ecfdf5 !important;
    border-color: #6ee7b7 !important;
  }
  html body.bu-board-page .bu-filter-bar.is-open {
    border-color: #0066ff !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, .12) !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;
  }
  html body.bu-board-page .bu-filter-bar-main strong,
  html body.bu-board-page .bu-alert-txt {
    display: block !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #0f172a !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;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    color: #475569 !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;
    padding: 8px 12px !important;
    border-radius: 999px !important;
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
  }
  html body.bu-board-page #bu-filter-fold.open {
    display: flex !important;
    flex-direction: column !important;
    max-height: min(68dvh, calc(100dvh - 168px)) !important;
    overflow: hidden !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    margin: 0 12px 10px !important;
    padding: 0 !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08) !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;
    overflow: auto;
  }
  html body.bu-board-page #bu-filter-fold.open #bu-lanes {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !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-board-page #bu-filter-fold.open #f-go,
  html body.bu-board-page #bu-filter-fold.open #f-reset {
    position: static !important;
    max-width: none !important;
    min-height: 44px !important;
  }
  html body.bu-board-page #f-swap { display: none !important; }
  html body.bu-board-page .bu-v12-togs { display: none !important; }

  html body #bu-detail,
  html body .bu-detail-modal {
    z-index: 80 !important;
  }
  html body .bu-detail-modal-sheet {
    background: #f4f7fb !important;
    color: #0f172a !important;
    border-radius: 20px !important;
    overflow: auto !important;
    max-height: calc(100dvh - 48px) !important;
  }
  html body .bu-v13-sheet {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 4px 16px;
  }
  html body .bu-v13-sheet .bu-dpro-card {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    color: #0f172a !important;
    padding: 14px !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
  }
  html body .bu-v13-sheet .bu-dpro-card h3,
  html body .bu-v13-sheet .bu-dpro-addr,
  html body .bu-v13-sheet dt,
  html body .bu-v13-sheet dd {
    color: #0f172a !important;
  }
  html body .bu-v13-specs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 !important;
  }
  html body .bu-v13-specs .bu-dpro-row {
    display: flex !important;
    justify-content: space-between !important;
    gap: 10px;
    padding: 10px 8px !important;
    border-bottom: 1px solid #f1f5f9;
  }
  html body .bu-v13-specs dt { color: #64748b !important; font-weight: 650; }
  html body .bu-v13-specs dd { margin: 0; font-weight: 800; text-align: right; }
  html body .bu-fuel-wide,
  html body .bu-v13-fuel-card {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 14px !important;
    color: #0f172a !important;
  }
  html body .bu-fuel-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  html body .bu-fuel-stat {
    background: #f8fafc !important;
    border-radius: 12px;
    padding: 10px !important;
  }
  html body .bu-fuel-stat small,
  html body .bu-fuel-stat span { color: #64748b !important; }
  html body .bu-fuel-stat b { color: #0f172a !important; }
  html body .bu-fuel-inputs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
    margin-top: 10px;
  }
  html body .bu-fuel-field { color: #0f172a !important; font-size: 12px; font-weight: 700; }
  html body .bu-fuel-field input {
    width: 100%;
    margin-top: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 10px;
    color: #0f172a;
    background: #fff;
  }
  html body .bu-dpro-profile-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
}

html body.bu-ai-open #bu-dispo,
html body #bu-dispo.is-sheet {
  z-index: 2147483645 !important;
}
