/* Truck marketplace (Home/TruckMarketplace).
   Port of biztech.cloud/internal/designs/truckon/marketplacev2.html. Every class is tm-
   prefixed and every rule scoped under .tm, so Bootstrap's .card/.btn/.badge/.toast/.carousel
   and the rest of the site are untouched. Loaded only by Views/TruckInventory/Marketplace.cshtml.

   Phone first, exactly like the reference. In the admin layout (.tm--web) the list becomes a
   card grid from 768px and the detail page splits into photos | details from 992px; the
   mobile layout (Public users, phones, the app) always stays phone width. */

/* The mobile layout caps pages at 450px with overflow:hidden. Keep the 450px cap (phone view)
   but lift overflow:hidden, which breaks the sticky header and CTA bar - the class is added by
   the page, :has() covers first paint. */
.mobile-container.tm-wide,
.mobile-container:has(> .tm) {
  overflow: visible;
}

.tm {
  --tm-blue: #2F8FDB;
  --tm-blue-600: #1E73B8;
  --tm-blue-700: #175C94;
  --tm-navy: #0F2A44;
  --tm-ink: #10243A;
  --tm-muted: #64748B;
  --tm-faint: #9AA7B8;
  --tm-line: #E6ECF3;
  --tm-surface: #F5F8FC;
  --tm-card: #FFFFFF;
  --tm-tint: #EAF3FC;
  --tm-seg: #E9EEF5;
  --tm-green: #2E9E6B;
  --tm-green-tint: #E4F5EC;
  --tm-red: #E0475B;
  --tm-amber: #B7791F;
  --tm-amber-tint: #FDF3E1;
  --tm-radius: 18px;
  --tm-shadow: 0 1px 2px rgba(16, 36, 58, .06);
  --tm-shadow-lg: 0 8px 24px rgba(16, 36, 58, .14);
  --tm-glass: rgba(245, 248, 252, .9);

  font-family: "Plus Jakarta Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: var(--tm-ink);
  background: var(--tm-surface);
  -webkit-font-smoothing: antialiased;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 70vh;
  border-radius: 20px;
  position: relative;
}

html[data-bs-theme="dark"] .tm {
  --tm-navy: #E8F0F8;
  --tm-ink: #DCE6F0;
  --tm-muted: #93A4B8;
  --tm-faint: #6F8196;
  --tm-line: #24313F;
  --tm-surface: #0F1720;
  --tm-card: #161F29;
  --tm-tint: #16283A;
  --tm-seg: #1C2733;
  --tm-green-tint: #12291F;
  --tm-amber-tint: #2A2112;
  --tm-glass: rgba(15, 23, 32, .9);
  --tm-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --tm-shadow-lg: 0 8px 24px rgba(0, 0, 0, .45);
}

.tm *, .tm *::before, .tm *::after { box-sizing: border-box; }
.tm a { color: inherit; text-decoration: none; }
.tm button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tm input, .tm select, .tm textarea { font: inherit; color: inherit; }
.tm h1, .tm h2, .tm h3, .tm h4, .tm p { margin: 0; }
.tm :focus-visible { outline: 2px solid var(--tm-blue); outline-offset: 2px; }

.tm-view { animation: tm-fade .22s ease; padding-bottom: 8px; }
@keyframes tm-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Top bar ---------- */
.tm-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 14px; background: var(--tm-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 20px 20px 0 0; }
.tm-topbar h1 { flex: 1; font-size: 18px; font-weight: 800; text-align: center; color: var(--tm-navy); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-topbar .tm-spacer { flex: 1; }
/* Show the full heading: it wraps onto a second line instead of ending in "…" when the
   top-bar buttons crowd it; the bar grows to fit. */
.tm-topbar { height: auto; min-height: 60px; }
.tm-topbar h1 { min-width: 0; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; overflow-wrap: break-word; padding: 6px 0; }
/* When the heading would get narrower than 140px, the top-bar buttons (Add Inventory, Offers,
   Favourites) move to a second row on the right instead of crushing it. */
.tm-topbar { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; padding-top: 8px; padding-bottom: 8px; }
.tm-topbar h1 { flex: 1 1 0; min-width: 140px; }
.tm-topbar--float { padding-top: 10px; }
@media (max-width: 419.98px) {
  .tm-topbar h1 { font-size: 16px; }
}
.tm-top-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 11px; font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--tm-navy); background: var(--tm-card); border: 1px solid var(--tm-line); text-decoration: none; transition: transform .15s; }
.tm-top-btn:active { transform: scale(.96); }
/* Topbar actions follow the site theme: Add Inventory and Offers use the btn-primary background
   (as Schedule A Consultation) with white text and no hover change; Favorites = tinted primary icon button. */
/* Scoped under .tm so it outranks `.tm a { color: inherit }` - otherwise the text is only white on hover. */
.tm .tm-top-btn--primary,
.tm .tm-top-btn--primary:hover,
.tm .tm-top-btn--primary:focus-visible,
.tm .tm-top-btn--outline,
.tm .tm-top-btn--outline:hover,
.tm .tm-top-btn--outline:focus-visible { background: var(--theme-primary, #01589f); border-color: var(--theme-primary, #01589f); color: #fff; }
@media (max-width: 419.98px) {
  .tm-top-btn { padding: 0 10px; }
  .tm-top-btn i { display: none; }
}
.tm-icon-btn { position: relative; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 15px; color: var(--tm-navy); background: var(--tm-card); border: 1px solid var(--tm-line); transition: transform .15s; }
.tm-icon-btn:active { transform: scale(.92); }
.tm-icon-btn .tm-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tm-red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--tm-surface); }
.tm-icon-btn.is-fav { color: var(--tm-red); }
.tm .tm-icon-btn--fav { background: rgba(var(--theme-primary-rgb, 1, 88, 159), .12); border-color: rgba(var(--theme-primary-rgb, 1, 88, 159), .35); color: var(--theme-primary, #01589f); text-decoration: none; }
.tm .tm-icon-btn--fav:hover, .tm .tm-icon-btn--fav:focus-visible { background: rgba(var(--theme-primary-rgb, 1, 88, 159), .22); color: var(--theme-primary, #01589f); }
.tm .tm-icon-btn--fav.is-fav, .tm .tm-icon-btn--fav.is-fav:hover { color: var(--tm-red); }
.tm-icon-btn.is-hidden { visibility: hidden; }
.tm-topbar--float { position: absolute; top: 0; left: 0; right: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; padding-top: 10px; }
.tm-topbar--float .tm-icon-btn { background: rgba(255, 255, 255, .9); color: #0F2A44; border-color: transparent; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* ---------- Search & filters ---------- */
.tm-sticky-head { position: sticky; top: 0; z-index: 20; background: var(--tm-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-bottom: 10px; border-radius: 20px 20px 0 0; }
.tm-sticky-head .tm-topbar { position: static; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.tm-searchbar { display: flex; gap: 10px; padding: 0 16px 12px; }
.tm-search { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 12px; transition: border-color .15s; margin: 0; }
.tm-search:focus-within { border-color: var(--tm-blue-600); }
.tm-search > i { color: var(--tm-muted); }
.tm-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15.5px; font-weight: 500; }
.tm-search input::placeholder { color: var(--tm-faint); }
.tm-search input::-webkit-search-cancel-button, .tm-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.tm-search .tm-clear { color: var(--tm-muted); font-size: 14px; display: none; }
.tm-search.has-value .tm-clear { display: block; }
.tm-filter-btn { position: relative; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; background: #0F2A44; color: #fff !important; display: grid; place-items: center; font-size: 15px; }
html[data-bs-theme="dark"] .tm-filter-btn { background: #1E73B8; }
.tm-filter-btn .tm-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--tm-blue); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--tm-surface); }
.tm-chips { display: flex; gap: 8px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tm-chips::-webkit-scrollbar { display: none; }
.tm-chip { flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 700; background: var(--tm-card) !important; border: 1px solid var(--tm-line) !important; color: var(--tm-ink); transition: all .15s; white-space: nowrap; }
.tm-chip.is-on { background: #0F2A44 !important; border-color: #0F2A44 !important; color: #fff; }
html[data-bs-theme="dark"] .tm-chip.is-on { background: #1E73B8 !important; border-color: #1E73B8 !important; }
.tm-results-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px 4px; color: var(--tm-muted); font-size: 13.5px; font-weight: 500; }
.tm-results-bar strong { color: var(--tm-navy); font-weight: 800; }
/* Sort: a padded pill with the chevron drawn inside it. */
.tm-sort { position: relative; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--tm-muted); margin: 0; white-space: nowrap; }
.tm-sort select {
  min-height: 36px; padding: 7px 34px 7px 14px; margin: 0;
  border: 1px solid var(--tm-line); border-radius: 999px; background: var(--tm-card); box-shadow: var(--tm-shadow);
  font: inherit; font-weight: 700; line-height: 1.2; color: var(--tm-blue-600);
  outline: 0; -webkit-appearance: none; appearance: none; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.tm-sort select:hover { border-color: var(--tm-blue); background: var(--tm-tint); }
.tm-sort select:focus-visible { border-color: var(--tm-blue); box-shadow: 0 0 0 3px rgba(47, 143, 219, .25); }
.tm-sort select option { color: var(--tm-ink); background: var(--tm-card); font-weight: 600; }
.tm-sort > i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--tm-blue-600); pointer-events: none; }
html[data-bs-theme="dark"] .tm-sort select,
html[data-bs-theme="dark"] .tm-sort > i { color: var(--tm-blue); }
/* On narrow phones the Sort control drops below the truck count rather than squeezing it. */
.tm-results-bar { flex-wrap: wrap; }

/* ---------- Cards ---------- */
.tm-cards { display: flex; flex-direction: column; gap: 14px; padding: 8px 16px 32px; }
.tm-card { background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: var(--tm-radius); padding: 8px; box-shadow: var(--tm-shadow); display: block; transition: transform .15s, box-shadow .15s; }
.tm-card:active { transform: scale(.985); }
.tm-card__media { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; }
.tm-ph { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, .92); background: linear-gradient(135deg, hsl(var(--h, 208) 45% 46%), hsl(calc(var(--h, 208) + 18) 50% 28%)); position: relative; overflow: hidden; }
.tm-ph::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .05) 0 10px, transparent 10px 22px); pointer-events: none; }
.tm-ph i { font-size: 64px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.tm-ph--img { background: #0F2A44; }
.tm-ph--img::after { background: linear-gradient(180deg, rgba(15, 42, 68, .25) 0%, rgba(15, 42, 68, 0) 40%); }
.tm-ph--img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-ph .tm-ph__label { position: absolute; left: 12px; bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .02em; opacity: .9; z-index: 1; color: #fff; }
.tm-ph--img .tm-ph__label { background: rgba(15, 42, 68, .55); padding: 4px 9px; border-radius: 999px; opacity: 1; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tm-tags { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 1; max-width: calc(100% - 60px); }
.tm-tag { height: 26px; padding: 0 9px; border-radius: 8px; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 5px; background: rgba(255, 255, 255, .94); color: #0F2A44; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); white-space: nowrap; }
.tm-tag--new { background: var(--tm-green); color: #fff; }
.tm-tag--used { background: rgba(15, 42, 68, .8); color: #fff; }
.tm-tag--bid { background: #F5B301; color: #0F2A44; }
.tm-tag--sold { background: var(--tm-red); color: #fff; }
.tm-fav-btn { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .94) !important; color: #0F2A44 !important; display: grid; place-items: center; font-size: 16px; box-shadow: var(--tm-shadow); transition: transform .15s; z-index: 2; }
.tm-fav-btn.is-fav { color: var(--tm-red) !important; }
.tm-fav-btn:active { transform: scale(.85); }
@keyframes tm-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.tm-fav-btn.tm-pop i, .tm-icon-btn.tm-pop i { animation: tm-pop .35s ease; display: inline-block; }
.tm-photos-tag { position: absolute; right: 10px; bottom: 10px; height: 26px; padding: 0 9px; border-radius: 8px; background: rgba(15, 42, 68, .55); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; z-index: 1; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tm-card__body { padding: 12px 8px 6px; }
.tm-card__title { font-size: 16.5px; font-weight: 800; line-height: 1.25; color: var(--tm-navy); letter-spacing: -.01em; }
.tm-card__sub { color: var(--tm-muted); font-size: 13px; margin-top: 3px; font-weight: 500; }
.tm-card__price { font-size: 21px; font-weight: 800; color: var(--tm-navy); margin-top: 10px; letter-spacing: -.02em; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tm-card__price small { font-size: 12.5px; font-weight: 600; color: var(--tm-muted); }
.tm-card__bid { margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--tm-amber); display: flex; align-items: center; gap: 6px; }
.tm-card__specs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tm-card__specs span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--tm-surface); border: 1px solid var(--tm-line); color: var(--tm-ink); font-size: 12.5px; font-weight: 600; }
.tm-card__specs i { color: var(--tm-blue); font-size: 11px; }
.tm-empty { text-align: center; padding: 60px 30px; color: var(--tm-muted); grid-column: 1 / -1; }
.tm-empty > i { font-size: 40px; color: #C6D3E1; margin-bottom: 14px; display: block; }
.tm-empty h3 { color: var(--tm-navy); font-size: 18px; margin-bottom: 6px; font-weight: 800; }
.tm-skeleton { border-radius: var(--tm-radius); background: linear-gradient(90deg, var(--tm-card) 0%, var(--tm-line) 50%, var(--tm-card) 100%); background-size: 200% 100%; animation: tm-shimmer 1.2s infinite linear; height: 320px; border: 1px solid var(--tm-line); }
@keyframes tm-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Buttons ---------- */
.tm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 12px; font-size: 15px; font-weight: 700; transition: transform .12s, background .12s; white-space: nowrap; }
.tm-btn:active { transform: scale(.97); }
.tm-btn--primary { background: #1E73B8 !important; color: #fff !important; }
.tm-btn--primary:hover { background: #175C94 !important; }
.tm-btn--primary:disabled { opacity: .5; cursor: not-allowed; }
.tm-btn--ghost { background: var(--tm-card) !important; color: var(--tm-navy) !important; border: 1px solid var(--tm-line) !important; }
.tm-btn--soft { background: var(--tm-tint) !important; color: var(--tm-blue-600) !important; }
.tm-btn--amber { background: #F5B301 !important; color: #0F2A44 !important; }
.tm-btn--danger { background: transparent !important; color: var(--tm-red) !important; border: 1px solid var(--tm-line) !important; }
.tm-btn--sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.tm-btn--block { width: 100%; }

/* ---------- Detail ---------- */
.tm-detail-wrap { position: relative; }
.tm-carousel { position: relative; background: #0F2A44; border-radius: 20px; overflow: hidden; }
.tm-carousel__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 3; }
.tm-carousel__track::-webkit-scrollbar { display: none; }
.tm-carousel__slide { flex: 0 0 100%; scroll-snap-align: start; cursor: zoom-in; }
.tm-carousel__slide .tm-ph i { font-size: 96px; }
.tm-carousel__dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.tm-carousel__dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: all .2s; }
.tm-carousel__dots span.is-on { background: #fff; width: 22px; border-radius: 3px; }
.tm-carousel__count { position: absolute; right: 14px; bottom: 14px; height: 26px; padding: 0 10px; border-radius: 8px; background: rgba(15, 42, 68, .6); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; pointer-events: none; }
.tm-carousel__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .92) !important; color: #0F2A44 !important; display: grid; place-items: center; font-size: 13px; z-index: 1; }
.tm-carousel__nav--prev { left: 12px; }
.tm-carousel__nav--next { right: 12px; }
.tm-detail { padding: 18px 16px 24px; }
.tm-tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tm-tagrow .tm-tag { background: var(--tm-tint); color: var(--tm-blue-600); }
.tm-tagrow .tm-tag--new { background: var(--tm-green); color: #fff; }
.tm-tagrow .tm-tag--used { background: rgba(15, 42, 68, .8); color: #fff; }
.tm-tagrow .tm-tag--bid { background: #F5B301; color: #0F2A44; }
.tm-tagrow .tm-tag--sold { background: var(--tm-red); color: #fff; }
.tm-detail h2 { font-size: 23px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: var(--tm-navy); }
.tm-detail .tm-sub { color: var(--tm-muted); font-size: 14.5px; margin-top: 4px; font-weight: 500; }
.tm-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 14px 16px; background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 14px; }
.tm-price-row .tm-price { font-size: 26px; font-weight: 800; color: var(--tm-navy); letter-spacing: -.02em; }
.tm-price-row .tm-est { font-size: 12.5px; color: var(--tm-muted); font-weight: 600; }
.tm-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; color: var(--tm-muted); font-size: 13px; font-weight: 500; }
.tm-meta span { display: inline-flex; align-items: center; gap: 6px; }
.tm-meta i { color: var(--tm-blue); }
.tm-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.tm-quick div { background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 12px; padding: 12px 6px; text-align: center; min-width: 0; }
.tm-quick i { color: var(--tm-blue); font-size: 15px; }
.tm-quick b { display: block; font-size: 13px; margin-top: 7px; line-height: 1.2; color: var(--tm-navy); font-weight: 800; overflow-wrap: anywhere; }
.tm-quick small { display: block; color: var(--tm-muted); font-size: 11px; margin-top: 2px; font-weight: 600; overflow-wrap: anywhere; }
.tm-section { margin-top: 24px; }
.tm-section h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; color: var(--tm-navy); letter-spacing: -.01em; }
.tm-section h3 a, .tm-section h3 button { font-size: 13px; color: var(--tm-blue-600); font-weight: 700; }
.tm-specs { background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 14px; overflow: hidden; margin: 0; }
.tm-specs div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 14px; border-top: 1px solid var(--tm-line); }
.tm-specs div:first-child { border-top: 0; }
.tm-specs dt { color: var(--tm-muted); font-weight: 500; }
.tm-specs dd { margin: 0; font-weight: 700; text-align: right; color: var(--tm-navy); overflow-wrap: anywhere; }
.tm-mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.tm-desc { color: var(--tm-ink); opacity: .85; font-size: 14.5px; line-height: 1.6; font-weight: 500; white-space: pre-line; }
.tm-feat { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-feat span { height: 32px; padding: 0 11px; border-radius: 8px; background: var(--tm-card); border: 1px solid var(--tm-line); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.tm-feat i { color: var(--tm-green); font-size: 11px; }
.tm-dealer { background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 14px; padding: 14px; display: flex; gap: 12px; align-items: center; }
.tm-dealer .tm-avatar { width: 46px; height: 46px; border-radius: 12px; background: var(--tm-tint); color: var(--tm-blue-600); display: grid; place-items: center; font-size: 20px; flex: 0 0 auto; }
.tm-dealer b { display: block; font-size: 15px; color: var(--tm-navy); font-weight: 800; }
.tm-dealer small { color: var(--tm-muted); font-size: 12.5px; display: flex; align-items: center; gap: 5px; margin-top: 3px; font-weight: 500; }
.tm-dealer .tm-call { width: 42px; height: 42px; border-radius: 11px; background: var(--tm-tint); color: var(--tm-blue-600); display: grid; place-items: center; font-size: 16px; flex: 0 0 auto; }
.tm-hscroll { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.tm-hscroll::-webkit-scrollbar { display: none; }
.tm-mini { flex: 0 0 200px; background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 14px; overflow: hidden; padding: 6px; scroll-snap-align: start; }
.tm-mini .tm-ph { height: auto; aspect-ratio: 16 / 10; border-radius: 10px; }
.tm-mini .tm-ph i { font-size: 40px; }
.tm-mini .tm-b { padding: 10px 8px 6px; }
.tm-mini b { font-size: 13.5px; display: block; line-height: 1.25; color: var(--tm-navy); font-weight: 800; }
.tm-mini small { color: var(--tm-muted); font-size: 12px; font-weight: 500; }
.tm-mini .tm-p { color: var(--tm-navy); font-weight: 800; font-size: 14px; margin-top: 5px; }
.tm-footnote { font-size: 11.5px; color: var(--tm-faint); margin-top: 16px; line-height: 1.5; font-weight: 500; }
.tm-cta-bar { position: sticky; bottom: 0; z-index: 15; display: flex; gap: 10px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--tm-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--tm-line); border-radius: 0 0 20px 20px; }
.tm-cta-bar .tm-btn--primary { flex: 1; min-width: 0; }
.tm-cta-bar .tm-btn--ghost { width: 50px; padding: 0; flex: 0 0 auto; }
.tm-cta-bar .tm-cta-secondary { flex: 0 0 auto; padding: 0 14px; }
/* Every CTA shows its full label (Submit Inquiry, Make/Update Offer, Bid/Raise Bid). When they
   don't fit on one row the bar wraps: Submit Inquiry (with the call button) keeps the first row
   and the Offer/Bid buttons share the next, each stretching to fill its row. */
.tm-cta-bar { flex-wrap: wrap; }
.tm-cta-bar .tm-btn--primary { flex: 1 0 auto; min-width: max-content; }
.tm-cta-bar .tm-cta-secondary { flex: 1 0 auto; min-width: max-content; padding: 0 14px; }
@media (max-width: 419.98px) {
  .tm-cta-bar { gap: 8px; }
  .tm-cta-bar .tm-cta-secondary { width: 50px; padding: 0; }
  .tm-cta-bar .tm-cta-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* Show the Offer/Bid labels on small phones too - the bar wraps instead of hiding them. */
  .tm-cta-bar .tm-cta-secondary { width: auto; padding: 0 14px; }
  .tm-cta-bar .tm-cta-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

/* Bid / offer status panels on the detail page */
.tm-panel { background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 14px; padding: 14px 16px; }
.tm-panel + .tm-panel { margin-top: 10px; }
.tm-panel--bid { border-color: #F5D37A; background: var(--tm-amber-tint); }
.tm-panel__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tm-panel__row + .tm-panel__row { margin-top: 8px; }
.tm-panel__label { color: var(--tm-muted); font-size: 13px; font-weight: 600; }
.tm-panel__value { color: var(--tm-navy); font-size: 16px; font-weight: 800; text-align: right; }
.tm-panel__value--lg { font-size: 22px; letter-spacing: -.02em; }
.tm-panel__note { margin-top: 10px; font-size: 12.5px; color: var(--tm-muted); font-weight: 500; line-height: 1.45; }
.tm-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tm-status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 800; background: var(--tm-tint); color: var(--tm-blue-600); }
.tm-status--Pending { background: var(--tm-tint); color: var(--tm-blue-600); }
.tm-status--Countered { background: var(--tm-amber-tint); color: var(--tm-amber); }
.tm-status--Accepted, .tm-status--Active { background: var(--tm-green-tint); color: var(--tm-green); }
.tm-status--Rejected, .tm-status--Withdrawn { background: var(--tm-seg); color: var(--tm-muted); }

/* ---------- Forms ---------- */
.tm-form { padding: 8px 16px 40px; display: flex; flex-direction: column; gap: 18px; max-width: 640px; margin: 0 auto; }
.tm-mini-card { display: flex; gap: 12px; align-items: center; background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 14px; padding: 8px 12px 8px 8px; }
.tm-mini-card .tm-ph { width: 92px; height: 64px; border-radius: 10px; flex: 0 0 auto; }
.tm-mini-card .tm-ph i { font-size: 28px; }
.tm-mini-card b { display: block; font-size: 14.5px; line-height: 1.25; color: var(--tm-navy); font-weight: 800; }
.tm-mini-card small { color: var(--tm-muted); font-size: 12.5px; font-weight: 500; }
.tm-mini-card .tm-p { color: var(--tm-navy); font-weight: 800; font-size: 14px; }
.tm-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; color: var(--tm-navy); }
.tm-field label em { color: var(--tm-red); font-style: normal; }
.tm-field label .tm-opt { color: var(--tm-faint); font-weight: 500; }
/* Form labels wrap in the narrow two/three-column rows instead of running past the field. */
.tm-field { min-width: 0; }
.tm-field label { overflow-wrap: anywhere; }
.tm-panel__label, .tm-specs dt { overflow-wrap: anywhere; }
.tm-field input, .tm-field textarea, .tm-field select { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--tm-line); border-radius: 12px; background: var(--tm-card); outline: 0; font-size: 15px; font-weight: 500; transition: border-color .15s; color: var(--tm-ink); }
.tm-field textarea { height: auto; min-height: 112px; padding: 13px 16px; resize: vertical; line-height: 1.5; }
.tm-field input:focus, .tm-field textarea:focus { border-color: var(--tm-blue-600); }
.tm-field.is-error input, .tm-field.is-error textarea { border-color: var(--tm-red); }
.tm-field .tm-err { display: none; color: var(--tm-red); font-size: 12.5px; margin-top: 6px; font-weight: 600; }
.tm-field.is-error .tm-err { display: block; }
.tm-field .tm-hint { color: var(--tm-muted); font-size: 12.5px; margin-top: 6px; font-weight: 500; }
.tm-money { position: relative; }
.tm-money::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--tm-muted); }
.tm-money input { padding-left: 28px; font-size: 18px; font-weight: 800; }
.tm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tm-field input[readonly] { background: var(--tm-surface); color: var(--tm-muted); font-weight: 700; cursor: default; }
.tm-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--tm-seg); padding: 4px; border-radius: 12px; }
.tm-seg button { height: 36px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--tm-muted); }
/* Keep segment labels (e.g. "Financing" in the 4-way picker) whole on narrow phones. */
.tm-seg button { min-width: 0; padding: 0 4px; line-height: 1.1; overflow-wrap: anywhere; }
.tm-seg button.is-on { background: var(--tm-card); color: var(--tm-navy); box-shadow: 0 1px 2px rgba(16, 36, 58, .1); }
.tm-seg--3 { grid-template-columns: repeat(3, 1fr); }
.tm-pills { display: flex; gap: 8px; }
.tm-pills button { flex: 1; height: 42px; border-radius: 10px; border: 1px solid var(--tm-line); background: var(--tm-card); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--tm-ink); }
.tm-pills button.is-on { border-color: #0F2A44; background: #0F2A44; color: #fff; }
html[data-bs-theme="dark"] .tm-pills button.is-on { border-color: #1E73B8; background: #1E73B8; }
.tm-check { display: flex; align-items: center; gap: 12px; font-size: 14.5px; padding: 13px 14px; background: var(--tm-card); border-radius: 12px; border: 1px solid var(--tm-line); cursor: pointer; margin: 0; }
.tm-check b { color: var(--tm-navy); }
.tm-check input { width: 20px; height: 20px; accent-color: var(--tm-blue-600); margin: 0; flex: 0 0 auto; }
.tm-privacy { font-size: 12px; color: var(--tm-faint); line-height: 1.5; text-align: center; font-weight: 500; }
.tm-success { text-align: center; padding: 60px 28px 40px; max-width: 520px; margin: 0 auto; }
.tm-success .tm-ok { width: 96px; height: 96px; border-radius: 24px; background: var(--tm-green-tint); color: var(--tm-green); display: grid; place-items: center; font-size: 46px; margin: 0 auto 24px; animation: tm-pop .5s ease; }
.tm-success h2 { font-size: 24px; font-weight: 800; color: var(--tm-navy); letter-spacing: -.02em; }
.tm-success p { color: var(--tm-muted); margin-top: 10px; line-height: 1.55; font-weight: 500; }
.tm-success .tm-ref { display: inline-block; margin-top: 16px; padding: 9px 16px; border-radius: 10px; background: var(--tm-card); border: 1px solid var(--tm-line); font-weight: 800; letter-spacing: .04em; color: var(--tm-navy); }
.tm-success .tm-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 32px; }
.tm-signin { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--tm-amber-tint); color: var(--tm-ink); font-size: 13.5px; font-weight: 600; }
.tm-signin i { color: var(--tm-amber); }
.tm-signin a { color: var(--tm-blue-600); font-weight: 800; text-decoration: underline; }

/* List a truck */
.tm-seg--2 { grid-template-columns: repeat(2, 1fr); }
.tm-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.tm-form-group { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--tm-faint); margin: 6px 0 -6px; }
.tm-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tm-photo-tile { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--tm-seg); border: 1px solid var(--tm-line); }
.tm-photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-photo-tile__cover { position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 7px; background: #1E73B8; color: #fff; font-size: 11px; font-weight: 800; }
.tm-photo-tile__btn { position: absolute; top: 6px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; background: rgba(15, 42, 68, .72); color: #fff; }
.tm-photo-tile__btn--remove { right: 6px; }
.tm-photo-tile__btn--cover { right: 38px; }
.tm-photo-tile__state { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: #fff; background: rgba(15, 42, 68, .55); }
.tm-photo-tile.is-done .tm-photo-tile__state { background: rgba(46, 158, 107, .55); }
.tm-photo-tile.is-failed .tm-photo-tile__state { background: rgba(224, 71, 91, .6); }
.tm-photo-add { aspect-ratio: 4 / 3; border-radius: 12px; border: 1.5px dashed var(--tm-line); background: var(--tm-card); color: var(--tm-blue-600); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 700; cursor: pointer; margin: 0; }
.tm-photo-add i { font-size: 20px; }
.tm-photo-add input { display: none; }
.tm-progress { height: 6px; border-radius: 6px; background: var(--tm-seg); overflow: hidden; }
.tm-progress span { display: block; height: 100%; width: 0; background: var(--tm-blue-600); transition: width .2s; }
@media (max-width: 419.98px) {
  .tm-row3 { grid-template-columns: 1fr 1fr; }
  .tm-row3 > :first-child { grid-column: 1 / -1; }
}

/* My offers list */
.tm-offer-list { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 32px; max-width: 760px; margin: 0 auto; }
.tm-offer { background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 14px; padding: 14px 16px; }
.tm-offer__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tm-offer__head b { color: var(--tm-navy); font-size: 15px; font-weight: 800; }
.tm-offer__head small { display: block; color: var(--tm-muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- Drawer ---------- */
.tm-backdrop { position: fixed; inset: 0; background: rgba(15, 42, 68, .45); z-index: 1040; opacity: 0; pointer-events: none; transition: opacity .25s; }
.tm-backdrop.is-open { opacity: 1; pointer-events: auto; }
.tm-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 86%; max-width: 380px; z-index: 1041; background: var(--tm-surface); box-shadow: var(--tm-shadow-lg); transform: translateX(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; border-radius: 18px 0 0 18px; overflow: hidden; visibility: hidden; }
.tm-drawer.is-open { transform: none; visibility: visible; }
.tm-drawer__head { display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--tm-line); background: var(--tm-card); }
.tm-drawer__head h2 { flex: 1; font-size: 18px; font-weight: 800; color: var(--tm-navy); }
.tm-drawer__head .tm-reset { font-size: 13.5px; font-weight: 700; color: var(--tm-blue-600); padding: 6px 8px; }
.tm-drawer__body { flex: 1; overflow-y: auto; padding: 6px 20px 20px; scrollbar-width: thin; }
.tm-fsec { padding: 16px 0; border-bottom: 1px solid var(--tm-line); }
.tm-fsec:last-child { border-bottom: 0; }
.tm-fsec h4 { margin: 0 0 10px; font-size: 13.5px; font-weight: 800; display: flex; justify-content: space-between; color: var(--tm-navy); }
.tm-fsec h4 span { color: var(--tm-blue-600); font-weight: 700; }
.tm-togs { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-tog { height: 36px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--tm-line) !important; background: var(--tm-card) !important; font-size: 13.5px; font-weight: 600; }
.tm-tog.is-on { background: #0F2A44 !important; border-color: #0F2A44 !important; color: #fff; }
html[data-bs-theme="dark"] .tm-tog.is-on { background: #1E73B8 !important; border-color: #1E73B8 !important; }
.tm input[type=range] { width: 100%; accent-color: var(--tm-blue-600); margin: 6px 0 0; }
.tm-range-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--tm-muted); font-weight: 600; }
.tm-drawer__foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--tm-card); border-top: 1px solid var(--tm-line); }

/* ---------- Lightbox ---------- */
.tm-lightbox { position: fixed; inset: 0; z-index: 1060; background: #070D15; display: none; flex-direction: column; animation: tm-fade .2s ease; }
.tm-lightbox.is-open { display: flex; }
.tm-lightbox__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; color: #fff; }
.tm-lightbox__head b { font-size: 14px; opacity: .9; }
.tm-lightbox__head .tm-icon-btn { color: #fff; background: rgba(255, 255, 255, .12); border-color: transparent; }
.tm-lightbox__track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.tm-lightbox__track::-webkit-scrollbar { display: none; }
.tm-lightbox__slide { flex: 0 0 100%; scroll-snap-align: start; display: grid; place-items: center; padding: 10px; }
.tm-lightbox__slide .tm-ph { aspect-ratio: 4 / 3; height: auto; max-height: 100%; max-width: 1100px; border-radius: 16px; }
.tm-lightbox__slide .tm-ph--img { aspect-ratio: 3 / 2; }
.tm-lightbox__slide .tm-ph--img img { object-fit: contain; }
.tm-lightbox__slide .tm-ph i { font-size: 120px; }
.tm-lightbox__thumbs { display: flex; gap: 8px; padding: 12px; justify-content: center; overflow-x: auto; }
.tm-lightbox__thumbs button { width: 54px; height: 40px; border-radius: 8px; overflow: hidden; opacity: .45; border: 2px solid transparent; transition: all .15s; flex: 0 0 auto; }
.tm-lightbox__thumbs button.is-on { opacity: 1; border-color: #fff; }
.tm-lightbox__thumbs .tm-ph i { font-size: 18px; }
.tm-lightbox__hint { text-align: center; color: rgba(255, 255, 255, .5); font-size: 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); font-weight: 500; }

/* ---------- Toast ---------- */
.tm-toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); z-index: 1070; background: #0F2A44; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; opacity: 0; pointer-events: none; transition: all .25s; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(16, 36, 58, .14); }
.tm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.tm-toast i { color: #7FD0A0; }
.tm-toast a { color: #9FD1FF; text-decoration: underline; pointer-events: auto; }

/* ---------- Admin (desktop web) layout ----------
   Inside _LayoutAdminDesign the page sits in its .container as a rounded panel, like the
   other admin-layout pages; sticky bars stick to the window. */
.tm--web { box-shadow: var(--tm-shadow); border: 1px solid var(--tm-line); overflow: clip; }
.tm--web .tm-cta-bar { border-radius: 0; }

/* ---------- Small phones ---------- */
@media (max-width: 359.98px) {
  .tm-quick { grid-template-columns: repeat(2, 1fr); }
  .tm-row2 { grid-template-columns: 1fr; }
  .tm-seg { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Tablet / desktop web (admin layout only - the mobile layout stays phone width) ---------- */
@media (min-width: 768px) {
  .tm--web .tm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; padding: 12px 20px 40px; }
  .tm--web .tm-card:hover { box-shadow: var(--tm-shadow-lg); transform: translateY(-2px); }
  .tm--web .tm-searchbar { padding: 0 20px 12px; }
  .tm--web .tm-chips { padding: 0 20px; }
  .tm--web .tm-results-bar { padding: 14px 24px 4px; }
  .tm-toast { bottom: 32px; }
}

/* ---------- Responsive refinements ---------- */
/* Price lines, headings with a "See all" link and offer headers wrap rather than squeeze. */
.tm-card__price, .tm-price-row, .tm-offer__head, .tm-section h3, .tm-panel__row, .tm-fsec h4 { flex-wrap: wrap; }
.tm-section h3 { gap: 6px 12px; }
/* Don't let the photo carousel grow taller than the screen on tablets / landscape phones. */
.tm-carousel__track { max-height: min(72vh, 620px); }
.tm-lightbox__slide .tm-ph { max-width: min(1100px, 100%); }

@media (max-width: 359.98px) {
  .tm-detail { padding: 16px 12px 20px; }
  .tm-detail h2 { font-size: 20px; }
  .tm-price-row { padding: 12px; }
  .tm-price-row .tm-price { font-size: 22px; }
  .tm-card__price { font-size: 19px; }
  .tm-cards, .tm-form, .tm-offer-list { padding-left: 12px; padding-right: 12px; }
  .tm-searchbar { padding: 0 12px 12px; }
  .tm-chips { padding: 0 12px; }
  .tm-results-bar { padding: 12px 14px 4px; }
  .tm-cta-bar { padding-left: 12px; padding-right: 12px; }
  .tm-success { padding: 40px 18px 32px; }
  .tm-drawer { width: 92%; }
}

/* Class chips: on phones (and always in the phone-width mobile layout) every class is shown -
   the chips wrap onto extra rows instead of scrolling sideways off-screen. */
.tm--mobile .tm-chips { flex-wrap: wrap; overflow-x: visible; gap: 6px; }
.tm--mobile .tm-chip { height: 32px; padding: 0 11px; font-size: 13px; }
@media (max-width: 767.98px) {
  .tm-chips { flex-wrap: wrap; overflow-x: visible; gap: 6px; }
  .tm-chip { height: 32px; padding: 0 11px; font-size: 13px; }
}

/* Large phones / small tablets in the admin layout: two cards per row instead of one wide card. */
@media (min-width: 576px) and (max-width: 767.98px) {
  .tm--web .tm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; padding: 10px 16px 32px; }
}
@media (min-width: 768px) {
  .tm--web .tm-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
}

@media (min-width: 992px) {
  .tm--web .tm-detail-wrap--split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; padding: 70px 20px 0; align-items: start; }
  .tm--web .tm-detail-wrap--split .tm-topbar--float { padding: 10px 20px 0; }
  .tm--web .tm-detail-wrap--split .tm-media-col { position: sticky; top: 16px; }
  .tm--web .tm-detail-wrap--split .tm-detail { padding: 0 0 24px; }
  .tm--web .tm-detail-wrap--split .tm-cta-bar { grid-column: 1 / -1; }
}
