/* ============================================================================
   DOFT Loadboard — Round 10 UX / mobile / fit fixes (2026-07-30)
   Base: Round 9 fixed bundle + 30.zip audit items.
   Loaded last; safe visual / interaction overrides only.
   ============================================================================ */

/* --------------------------------------------------------------------------
   1) AI Call on driver Loads: default = clean row (no checkboxes) so both
      PHONE + ROBOT fit; Select mode reveals checkboxes and bulk actions.
   -------------------------------------------------------------------------- */
html[data-refresh] body.ai-call-enabled .loads-page #dTable .t-head .ai-call-selall-wrap,
html[data-refresh] body.ai-call-enabled .loads-page #dTable .t-body .ai-call-cb-slot,
html[data-refresh] body.ai-call-enabled .loads-page #dTable .t-body .ai-call-cb-placeholder {
  display: none !important;
}
html[data-refresh] body.ai-call-enabled.ai-call-select-mode .loads-page #dTable .t-body .ai-call-cb-slot,
html[data-refresh] body.ai-call-enabled.ai-call-select-mode .loads-page #dTable .t-body .ai-call-cb-placeholder {
  display: inline-flex !important;
  align-items: center !important;
}
/* Select mode re-shows the body's fixed 29px checkbox gutter; the header
   select-all stays hidden (Select All now lives in #aiCallSelectModeBar). Without
   a matching gutter the header AGE and body AGE misalign by 29px on desktop, so
   reserve the same 29px in the header as a NON-functional, invisible spacer. */
html[data-refresh] body.ai-call-enabled.ai-call-select-mode .loads-page #dTable .t-head .ai-call-selall-wrap {
  display: inline-flex !important;
  visibility: hidden !important;
  flex: 0 0 29px !important;
  width: 29px !important;
  min-width: 29px !important;
  max-width: 29px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}
/* Select mode: keep the AI-Call ROBOT visible (it is the AI-call affordance) and
   hide the phone-call icon instead — bulk selection is about AI calls, so the
   phone just adds clutter. */
html[data-refresh] body.ai-call-enabled.ai-call-select-mode .loads-page #dTable .t-body .c-contactlinks .phone-link:not(.ai-call-btn) {
  display: none !important;
}
html[data-refresh] body.ai-call-enabled .loads-page #dTable .t-body .c-contactlinks {
  gap: 6px !important;
}
html[data-refresh] body.ai-call-enabled .loads-page #dTable .ai-call-cb-wrap {
  padding-left: 6px !important;
  padding-right: 4px !important;
}
/* The Select bar lives INLINE inside #loadsCountBlock, immediately left of
   "N loads found" on the same line (JS prepends it). Keep it inline so it never
   forms its own row and pushes the table down. */
html[data-refresh] body.ai-call-enabled .loads-page #aiCallSelectModeBar {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  vertical-align: middle;
  margin: 0 12px 0 0;
  font-weight: normal;
  /* On the main driver loadboard #loadsCountBlock is visibility:hidden until an
     origin/dest filter is applied, but loads (and thus bulk-select) still exist.
     visibility is independently settable on a child, so force the bar visible so
     Select is always reachable. host.hide() still uses display:none for 0 rows. */
  visibility: visible !important;
}
html[data-refresh] body.ai-call-enabled .loads-page .ai-call-select-mode-bar__actions {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
/* Fit BOTH the phone and the AI-Call robot in the contact column without
   clipping: widen it past round9's single-icon 48px AND shrink each icon's box.
   round5 sizes .phone-link at 30px !important (2×30+6gap = 66px > column) — an
   ellipsis-less spill left into Book/Bid. Override both icons to 22px !important
   (2×22+6 = 50px content, fits the 60px column's ~54px inner box). The flexible
   company column (flex:1) absorbs the extra width. */
@media (min-width: 768px) {
  html[data-refresh] body.ai-call-enabled .loads-page #dTable :is(.c-contactlinks, .cb-contactlinks) {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
  }
  html[data-refresh] body.ai-call-enabled .loads-page #dTable .cb-contactlinks {
    flex: 0 0 60px !important;
  }
  html[data-refresh] body.ai-call-enabled .loads-page #dTable .t-body .c-contactlinks .phone-link {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
  }
}
html[data-refresh] body.ai-call-enabled .loads-page .ai-call-select-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--red-600, #f12908);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
html[data-refresh] body.ai-call-enabled .loads-page .ai-call-select-link:hover {
  text-decoration: underline;
}
html[data-refresh] body.ai-call-enabled .loads-page .ai-call-select-link:not(.ai-call-select-link--primary) {
  color: var(--text-muted, #6f7782);
}
html[data-refresh] body.ai-call-enabled .loads-page .ai-call-select-link#aiCallSelectModeBtn {
  color: var(--red-600, #f12908);
}

/* mobile/tablet: suppress the old header select-all bar entirely; the inline bar
   in the count line mirrors iOS Select / Select All / Cancel. */
@media (max-width: 991px) {
  html[data-refresh] body.ai-call-enabled .loads-page #dTable .t-head:has(.ai-call-selall) {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   2) Footer Appearance: keep label + switch on one tight line.
   -------------------------------------------------------------------------- */
html[data-refresh] .doft-theme-footer-slot {
  /* Round 9 made this a 2-col grid whose first column is minmax(0,1fr) — it eats
     all the slack in the wide footer column and shoves the sun/moon switch to the
     far right. Make BOTH columns content-width and pack them to the start so
     "Appearance" and the switch sit together on one line with a small gap. */
  grid-template-columns: auto auto !important;
  justify-content: start !important;
  column-gap: 8px !important;
}
html[data-refresh] .doft-theme-footer-slot > .theme-footer-row {
  justify-content: flex-start !important;
}
/* On narrow / mobile viewports the footer copyright column centers (style.css
   @max-width:991px: .col.copyright text-align:center + .subscribe margin:0 auto).
   The start-packing above then leaves the Appearance label+switch hugging the left
   of that centered block, so it reads as shifted left. Center the pair on mobile to
   line up under the centered copyright + Terms; desktop stays start-packed. */
@media (max-width: 991px) {
  html[data-refresh] .doft-theme-footer-slot {
    justify-content: center !important;
  }
  html[data-refresh] .doft-theme-footer-slot > .theme-footer-row {
    justify-content: center !important;
  }
}

/* --------------------------------------------------------------------------
   3) Mobile slide-out / dropdown panel: replace the bright white divider with
      a neutral gray seam.
   -------------------------------------------------------------------------- */
html[data-refresh] #navbar-mobile .dropdown-menu,
html[data-refresh] #navbar-mobile .navbar-collapse,
html[data-refresh] #navbar-mobile .main-menu-content,
html[data-refresh] #navbar-mobile .navigation,
html[data-refresh] .main-menu.menu-light,
html[data-refresh] .main-menu.menu-dark {
  border-color: rgba(122, 134, 149, .35) !important;
}
html[data-theme="dark"][data-refresh] #navbar-mobile .dropdown-menu,
html[data-theme="dark"][data-refresh] #navbar-mobile .navbar-collapse,
html[data-theme="dark"][data-refresh] #navbar-mobile .main-menu-content,
html[data-theme="dark"][data-refresh] #navbar-mobile .navigation {
  border-right-color: rgba(122, 134, 149, .35) !important;
  box-shadow: inset -1px 0 0 rgba(122, 134, 149, .28) !important;
}

/* --------------------------------------------------------------------------
   4) AI Calls Settings -> Transaction History: NOTE must remain visible on
      mobile Safari / browser widths.
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  html[data-refresh] #aicTxTable {
    table-layout: fixed !important;
  }
  html[data-refresh] #aicTxTable th:nth-child(1) { width: 72px !important; }
  html[data-refresh] #aicTxTable th:nth-child(2) { width: 54px !important; }
  html[data-refresh] #aicTxTable th:nth-child(3) { width: 86px !important; }
  html[data-refresh] #aicTxTable th:nth-child(4) { width: 60px !important; }
  html[data-refresh] #aicTxTable th:nth-child(5),
  html[data-refresh] #aicTxTable td:nth-child(5) {
    min-width: 108px !important;
    width: auto !important;
  }
  html[data-refresh] #aicTxTable .aic-tx-note {
    display: block !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.25 !important;
    max-height: 2.5em !important;
  }
}

/* --------------------------------------------------------------------------
   5) Load cards: forecast chip stays on one line; map fills the available card
      area tighter so the black frame disappears.
   -------------------------------------------------------------------------- */
html[data-refresh] .iload .premium-show-price,
html[data-refresh] .itruck .premium-show-price {
  white-space: nowrap !important;
}
html[data-refresh] .iload .map-wrp,
html[data-refresh] .itruck .map-wrp {
  padding: 4px !important;
}
html[data-refresh] .iload .map,
html[data-refresh] .itruck .map {
  background: transparent !important;
}
html[data-refresh] .iload .l-col2,
html[data-refresh] .itruck .l-col2 {
  max-width: 320px;
  min-width: 320px;
}
@media (max-width: 1199px) {
  html[data-refresh] .iload .l-col2,
  html[data-refresh] .itruck .l-col2 {
    max-width: 308px;
    min-width: 308px;
  }
}

/* --------------------------------------------------------------------------
   6) Driver load list: price columns can breathe — remove any inline bolt icon
      footprint and give the forecast pill a little more room on iPad widths.
   -------------------------------------------------------------------------- */
html[data-refresh] #dTable :is(.c-price, .c-permile) > :is(i.fa-bolt, i.fas.fa-bolt, .fa-bolt, .fas.fa-bolt) {
  display: none !important;
}
/* Rate-intel "good rate" ⚡ (refresh.css: .wow-goodrate .c-price::before) eats
   ~10px in the narrow price column and pushes the dollar figure out so it clips.
   Drop the glyph on the loads list — the price number must fit. */
html[data-refresh].wow-rateintel #dTable .t-body .b-load.wow-goodrate .c-price::before,
html[data-refresh] #dTable .t-body .b-load .c-price::before {
  content: none !important;
  margin: 0 !important;
}
@media (min-width: 768px) {
  html[data-refresh] #dTable .premium-show-price,
  html[data-refresh] #dTable :is(.c-price, .c-permile) > a {
    max-width: 60px !important;
    font-size: 9.5px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
}
@media (min-width: 768px) and (max-width: 1080px) {
  html[data-refresh] #dTable .c-price,
  html[data-refresh] #dTable .c-permile {
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
  }
}

/* --------------------------------------------------------------------------
   7) Shipper -> Trucks detail map: same visual treatment as carrier cards.
   -------------------------------------------------------------------------- */
html[data-refresh] .itruck .wrp .map-wrp {
  min-height: 210px;
}
html[data-refresh] .itruck .wrp .map > div {
  visibility: visible;
}
