/* HotShot Load Board: white, black, grey and blue on Bootstrap 5.3 */
:root, [data-bs-theme=light] {
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: #0b0d12;
    --bs-body-bg: #ffffff;
    --bs-secondary-color: #6b7280;
    --bs-tertiary-bg: #f5f6f8;
    --bs-border-color: #e6e8ec;
    --bs-primary: #1d4ed8;
    --bs-primary-rgb: 29, 78, 216;
    --bs-primary-text-emphasis: #1e3a8a;
    --bs-primary-bg-subtle: #eef3ff;
    --bs-primary-border-subtle: #c7d6fb;
    --bs-link-color: #1d4ed8;
    --bs-link-color-rgb: 29, 78, 216;
    --bs-link-hover-color: #1e40af;
    --bs-border-radius: .625rem;
    --bs-border-radius-lg: .875rem;
    --bs-border-radius-xl: 1.25rem;
    --ink: #0b0d12;
    --soft: #f5f6f8;
}
body { -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
h1, h2, h3, h4, .display-5, .display-6 { letter-spacing: -.025em; font-weight: 700; }
.btn { --bs-btn-font-weight: 600; --bs-btn-padding-x: 1rem; border-radius: .625rem; }
.btn-primary { --bs-btn-bg: #1d4ed8; --bs-btn-border-color: #1d4ed8; --bs-btn-hover-bg: #1e40af; --bs-btn-hover-border-color: #1e40af; --bs-btn-active-bg: #1e3a8a; --bs-btn-disabled-bg: #1d4ed8; --bs-btn-disabled-border-color: #1d4ed8; }
.btn-dark { --bs-btn-bg: #0b0d12; --bs-btn-border-color: #0b0d12; }
.btn-outline-dark { --bs-btn-color: #0b0d12; --bs-btn-border-color: #d4d7dd; --bs-btn-hover-bg: #0b0d12; --bs-btn-hover-border-color: #0b0d12; }
.btn-lg { --bs-btn-padding-y: .8rem; --bs-btn-font-size: 1rem; }
.form-control, .form-select { border-radius: .625rem; padding: .65rem .85rem; border-color: #dfe2e7; }
.form-control:focus, .form-select:focus { border-color: #1d4ed8; box-shadow: 0 0 0 .2rem rgba(29, 78, 216, .15); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.form-check-input:checked { background-color: #1d4ed8; border-color: #1d4ed8; }
.text-primary { color: #1d4ed8 !important; }
.bg-soft { background: var(--soft) !important; }

/* Nav */
.navbar { --bs-navbar-padding-y: .75rem; }
.navbar .nav-link { font-weight: 500; color: #3f4450; border-radius: .5rem; padding: .45rem .75rem !important; }
.navbar .nav-link:hover { color: #0b0d12; background: var(--soft); }
.navbar .nav-link.active { color: #0b0d12; background: var(--soft); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #0b0d12; color: #fff; font-size: 1.1rem; }
.btn-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; color: #3f4450; }
.btn-icon:hover { background: var(--soft); }
.btn-avatar { width: 36px; height: 36px; border-radius: 50%; background: #1d4ed8; color: #fff; font-weight: 700; padding: 0; }
.btn-avatar:hover, .btn-avatar:focus { background: #1e40af; color: #fff; }
.dropdown-menu { --bs-dropdown-border-color: #e6e8ec; --bs-dropdown-link-active-bg: #1d4ed8; border-radius: .75rem; padding: .4rem; }
.dropdown-item { border-radius: .45rem; padding: .45rem .7rem; }
.notif-menu { width: min(360px, 92vw); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: block; padding: .7rem 1rem; border-bottom: 1px solid #f0f1f4; color: inherit; text-decoration: none; font-size: .9rem; }
.notif-item:hover { background: var(--soft); }
.notif-item.unread { background: #f4f7ff; }
.notif-item.unread::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #1d4ed8; margin-right: .45rem; vertical-align: middle; }

/* Cards & surfaces */
.card { --bs-card-border-color: #e6e8ec; --bs-card-border-radius: 1rem; --bs-card-cap-bg: #fff; box-shadow: 0 1px 2px rgba(11, 13, 18, .04); }
.card-hover { transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-hover:hover { border-color: #c7d6fb; box-shadow: 0 6px 24px rgba(11, 13, 18, .06); transform: translateY(-1px); }
.stat-card .value { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-card .label { color: #6b7280; font-size: .85rem; font-weight: 500; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: #6b7280; }
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.page-header { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.75rem; }
.page-header h1 { margin: 0; font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
.auth-card { max-width: 460px; margin: 1rem auto; }

/* Hero */
.hero { padding: clamp(2.5rem, 8vw, 6rem) 0 3rem; }
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.04; }
.hero .lead { color: #4b5160; max-width: 620px; }
.hero-panel { background: #0b0d12; color: #fff; border-radius: 1.5rem; padding: 1.5rem; }
.hero-panel .lane-row { display: flex; justify-content: space-between; align-items: center; padding: .9rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.hero-panel .lane-row:last-child { border-bottom: 0; }
.hero-panel .ppm { color: #93b4ff; font-weight: 600; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--bs-primary-bg-subtle); color: #1d4ed8; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; }

/* Load board */
.filters { background: var(--soft); border-radius: 1rem; padding: 1rem; }
.filters .form-label { font-size: .78rem; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.live-dot { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; color: #15803d; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 rgba(21,128,61,.5); animation: pulse 2s infinite; }
.live-dot.off { color: #9ca3af; }
.live-dot.off::before { animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(21,128,61,.45); } 70% { box-shadow: 0 0 0 8px rgba(21,128,61,0); } 100% { box-shadow: 0 0 0 0 rgba(21,128,61,0); } }
.board-table { --bs-table-hover-bg: #f7f8fa; }
.board-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; font-weight: 700; background: #fafbfc; border-bottom-width: 1px; white-space: nowrap; }
.board-table tbody tr { cursor: pointer; }
.board-table td { vertical-align: middle; padding-top: .9rem; padding-bottom: .9rem; }
.lane-cell .city { font-weight: 700; }
.lane-cell .arrow { color: #9ca3af; margin: 0 .35rem; }
.pay-cell { font-weight: 800; font-size: 1.05rem; }
.ppm-cell { color: #1d4ed8; font-weight: 700; }
tr.is-new td, .load-card.is-new { animation: flashnew 4s ease-out; }
@keyframes flashnew { 0% { background: #dbe6ff; } 100% { background: transparent; } }
.load-card { border: 1px solid #e6e8ec; border-radius: 1rem; padding: 1rem; background: #fff; display: block; color: inherit; text-decoration: none; }
.load-card .pay { font-size: 1.35rem; font-weight: 800; }
.attribution { font-size: .72rem; color: #9ca3af; }

/* Load detail */
.status-steps { display: flex; gap: .5rem; flex-wrap: wrap; }
.status-step { display: flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; color: #9ca3af; }
.status-step .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #d1d5db; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; }
.status-step.done { color: #0b0d12; }
.status-step.done .dot { background: #0b0d12; border-color: #0b0d12; color: #fff; }
.status-step.current { color: #1d4ed8; }
.status-step.current .dot { border-color: #1d4ed8; color: #1d4ed8; }
.status-step + .status-step::before { content: ""; width: 18px; height: 2px; background: #e5e7eb; margin-right: .1rem; }
.pay-hero .amount { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .95rem; }
.kv dt { color: #6b7280; font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; }
.map-frame { width: 100%; height: 280px; border: 0; border-radius: 1rem; background: var(--soft); }
.bid-card.best { border-color: #1d4ed8; box-shadow: 0 0 0 1px #1d4ed8; }
.bid-amount { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.stars { color: #1d4ed8; letter-spacing: .05em; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .75rem; border: 1px solid #e6e8ec; }
.checklist .step { display: flex; gap: .9rem; padding: 1rem 0; border-bottom: 1px solid #f0f1f4; }
.checklist .step:last-child { border-bottom: 0; }
.checklist .step-icon { width: 36px; height: 36px; border-radius: 50%; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); color: #6b7280; font-size: 1rem; }
.checklist .step.done .step-icon { background: #0b0d12; color: #fff; }
.checklist .step.now .step-icon { background: #1d4ed8; color: #fff; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.25rem; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: .45rem; width: 8px; height: 8px; border-radius: 50%; background: #1d4ed8; }
.timeline li::after { content: ""; position: absolute; left: 3.5px; top: 1rem; bottom: 0; width: 1px; background: #e5e7eb; }
.timeline li:last-child::after { display: none; }
.rating-input { display: inline-flex; flex-direction: row-reverse; gap: .2rem; }
.rating-input input { display: none; }
.rating-input label { font-size: 1.8rem; color: #d1d5db; cursor: pointer; line-height: 1; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: #1d4ed8; }

/* Admin tables */
.admin-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; font-weight: 700; white-space: nowrap; background: #fafbfc; }
.admin-table thead th a { color: inherit; text-decoration: none; }
.admin-table td { vertical-align: middle; font-size: .92rem; }
.table > :not(caption) > * > * { border-bottom-color: #eef0f3; }
.badge { font-weight: 600; }

/* Mobile */
@media (max-width: 991.98px) {
    .navbar-collapse { padding-top: .75rem; }
}
@media (max-width: 767.98px) {
    main.container-xl { padding-top: 1.25rem !important; }
    .sticky-actions { position: sticky; bottom: 0; background: #fff; padding: .75rem 0; border-top: 1px solid #e6e8ec; z-index: 5; }
    .btn-mobile-block { width: 100%; padding-top: .85rem; padding-bottom: .85rem; }
}

/* Cargo photos */
.cargo-thumb { position: relative; display: block; margin: 0; cursor: pointer; }
.cargo-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .75rem; border: 1px solid #e6e8ec; }
.cargo-thumb .cargo-remove { position: absolute; left: .4rem; bottom: .4rem; background: rgba(255,255,255,.92); border-radius: .5rem; padding: .1rem .45rem; font-size: .75rem; font-weight: 600; display: inline-flex; gap: .3rem; align-items: center; }
.cargo-thumb .form-check-input { margin: 0; }
.cargo-thumb.is-new .cargo-remove { background: #1d4ed8; color: #fff; }
.cargo-thumb:has(input:checked) img { opacity: .35; }
.cargo-hero { display: grid; grid-template-columns: 2fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.cargo-hero a:first-child { grid-row: span 2; }
.cargo-hero img { width: 100%; height: 100%; object-fit: cover; border-radius: .75rem; border: 1px solid #e6e8ec; aspect-ratio: 4 / 3; }
.cargo-hero.one { grid-template-columns: 1fr; }
.board-thumb { width: 56px; height: 56px; border-radius: .6rem; object-fit: cover; border: 1px solid #e6e8ec; flex: 0 0 56px; background: var(--soft); }
.load-card .board-thumb { width: 100%; height: 150px; flex: none; margin-bottom: .75rem; }
.cargo-hero.two { grid-template-columns: 1fr 1fr; }
.cargo-hero.two a:first-child { grid-row: auto; }

/* Header: keep bell, avatar and menu on the brand's row, at the right, on phones */
.navbar > .container-xl { flex-wrap: wrap; }
.navbar-brand { min-width: 0; flex-shrink: 1; }
.brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-tools { flex-shrink: 0; }
@media (max-width: 575.98px) {
    .navbar-brand { font-size: 1.05rem; gap: .45rem !important; }
    .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 1rem; }
    .nav-tools .navbar-toggler { padding: .25rem .4rem; }
}
@media (max-width: 359.98px) {
    .brand-text .text-primary { display: none; }
}
@media (max-width: 575.98px) {
    .nav-tools .btn:not(.btn-icon):not(.btn-avatar):not(.navbar-toggler) { padding: .35rem .7rem; font-size: .9rem; }
    .nav-tools .btn-link { padding-left: .35rem; padding-right: .35rem; }
}

/* Verification, signatures, tracking, app feel */
.badge-verified { background: #e8f0ff; color: #1d4ed8; font-weight: 600; }
.sig-wrap > summary { list-style: none; display: inline-flex; align-items: center; }
.sig-wrap > summary::-webkit-details-marker { display: none; }
.sig-pad { position: relative; height: 170px; border: 1.5px dashed #c5cad3; border-radius: .75rem; background: #fff; touch-action: none; overflow: hidden; }
.sig-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sig-pad .sig-hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: .8rem; color: #8a909c; pointer-events: none; }
.sig-pad.signed .sig-hint { display: none; }
.sig-pad.needs { border-color: #dc3545; }
.sig-pad.needs .sig-hint { color: #dc3545; }
.sig-img { max-width: 100%; height: 90px; object-fit: contain; object-position: left center; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: #fff; padding: 4px; }
.is-installed .hide-installed, .is-installed [data-install-app] { display: none !important; }

/* =========================================================================
   Signed-in shell. Two separate designs share one set of pages:
   a phone app (top bar, bottom tabs, sheets) below 992px, and a desktop console (sidebar, dense tables) above.
   ========================================================================= */
body.app-shell { background: #f4f5f7; }
.app-bar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sheet { border-radius: 1.25rem 1.25rem 0 0; border: 0 !important; }
.sheet-list { display: flex; flex-direction: column; }
.sheet-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 54px; padding: .5rem .25rem; border: 0; border-bottom: 1px solid #f0f1f4; background: none; color: #0b0d12; font-weight: 600; font-size: 1rem; text-align: left; text-decoration: none; width: 100%; }
.sheet-item:last-child { border-bottom: 0; }
.sheet-item > i:last-child { color: #c0c5ce; font-size: .9rem; }
.sheet-item.active { color: #1d4ed8; }
.sheet-item .bi-check-lg { visibility: hidden; color: #1d4ed8 !important; font-size: 1.2rem !important; }
.sheet-item.active .bi-check-lg { visibility: visible; }

/* ---- Load board pieces used by both designs ---- */
.board-toolbar { display: flex; gap: .5rem; align-items: center; }
.board-search { flex: 1; display: flex; align-items: center; gap: .6rem; margin: 0; background: #fff; border: 1px solid #dfe2e7; color: #6b7280; cursor: text; }
.board-search:focus-within { border-color: #1d4ed8; box-shadow: 0 0 0 .2rem rgba(29, 78, 216, .15); }
.board-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #0b0d12; font-size: 1rem; }
.board-filter-btn { position: relative; background: #fff; border: 1px solid #dfe2e7; color: #0b0d12; padding: 0; flex: 0 0 auto; }
.board-filter-btn .badge { position: absolute; top: -4px; right: -4px; }
.filters { background: #fff; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px; border: 1px solid #dfe2e7; background: #fff; color: #374151; font-size: .85rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.chip.on { background: #0b0d12; border-color: #0b0d12; color: #fff; }
.chip .bi-x-lg { font-size: .7rem; opacity: .75; }
.board-meta { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.board-meta-left { min-width: 0; }
.board-meta-right { display: flex; gap: .5rem; flex: 0 0 auto; }
.board-origin { font-size: .8rem; }
.board-origin i { font-size: .7rem; margin-right: .35rem; color: #1d4ed8; }
.board-origin .btn-link { font-size: inherit; font-weight: 600; text-decoration: none; min-height: 0 !important; }
.board-view-toggle .btn, .board-sort-btn { background: #fff; border: 1px solid #dfe2e7; color: #4b5563; height: 40px; padding: 0 .8rem; display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; min-height: 0 !important; }
.board-view-toggle .btn:hover, .board-sort-btn:hover { background: #f5f6f8; border-color: #cfd3da; color: #0b0d12; }
.board-view-toggle .btn.on { background: #0b0d12; border-color: #0b0d12; color: #fff; }
.board-rows { display: none; }
.board-cards { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.board-map-pane { display: none; position: relative; border-radius: 1rem; overflow: hidden; border: 1px solid #e6e8ec; background: #e9ecf1; }
#board-map { position: absolute; inset: 0; z-index: 0; }
.view-map .board-map-pane { display: block; }
.load-card-wrap { position: relative; min-width: 0; }
.board-cards .load-card, .map-peek .load-card { padding: 0; overflow: hidden; height: 100%; }
.load-card .board-thumb { width: 100%; height: 160px; flex: none; margin: 0; border: 0; border-radius: 0; }
.load-card .no-photo { display: none; }
.lc-body { padding: .9rem 1rem 1rem; }
.lc-lane { font-weight: 700; margin-bottom: .35rem; }
.load-card:has(.no-photo) .lc-lane { padding-right: 2.75rem; }
.lc-when { margin-bottom: .35rem; }
.lc-cargo { margin-bottom: .8rem; }
.lc-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem; }
.lc-deadhead { display: block; margin-top: .15rem; color: #374151; font-weight: 600; }
.lc-deadhead i { font-size: .68rem; margin-right: .3rem; color: #1d4ed8; }
.lc-bid { margin-top: .5rem; }
.load-card-wrap.picked .load-card { border-color: #1d4ed8; box-shadow: 0 0 0 1px #1d4ed8; }
.star-btn { border: 0; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .95); color: #374151; font-size: 1.1rem; box-shadow: 0 1px 4px rgba(11, 13, 18, .18); padding: 0; }
.star-btn.on { color: #1d4ed8; }
.load-card-wrap > .star-btn { position: absolute; top: .6rem; right: .6rem; }
.star-inline { vertical-align: middle; box-shadow: none; border: 1px solid #dfe2e7; margin-left: .35rem; font-size: 1rem; }
.star-cell { width: 1%; padding-right: 0 !important; }
.star-cell .star-btn { background: transparent; box-shadow: none; width: 32px; height: 32px; color: #9ca3af; }
.star-cell .star-btn.on { color: #1d4ed8; }
/* The compact row: the phone's list view, the map's side list and the card that pops up over the map. */
.view-list .load-card, .map-peek .load-card { display: flex; align-items: stretch; border-radius: .9rem; }
.view-list .load-card .board-thumb, .map-peek .load-card .board-thumb { width: 84px; height: auto; min-height: 84px; flex: 0 0 84px; }
.view-list .load-card .no-photo, .map-peek .load-card .no-photo { display: inline-flex; font-size: 1.3rem; }
.view-list .lc-body, .map-peek .lc-body { flex: 1; min-width: 0; padding: .6rem .75rem; }
.view-list .lc-lane, .map-peek .lc-lane { font-size: .93rem; margin-bottom: .15rem; padding-right: 2.1rem !important; }
.view-list .lc-when, .map-peek .lc-when { margin-bottom: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-list .lc-cargo, .map-peek .lc-cargo { display: none; }
.view-list .load-card .pay, .map-peek .load-card .pay { font-size: 1.1rem; line-height: 1.2; }
.view-list .load-card-wrap > .star-btn, .map-peek .star-btn { top: .2rem; right: .2rem; background: transparent; box-shadow: none; width: 36px; height: 36px; }
.map-pin-wrap { background: none; border: 0; }
.map-pin { position: absolute; transform: translate(-50%, -50%); background: #0b0d12; color: #fff; font: 700 .78rem/1 "Inter", system-ui, sans-serif; padding: .35rem .6rem; border-radius: 999px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(11, 13, 18, .3); white-space: nowrap; cursor: pointer; }
.map-pin.on { background: #1d4ed8; transform: translate(-50%, -50%) scale(1.12); }
.map-me { position: absolute; transform: translate(-50%, -50%); width: 16px; height: 16px; border-radius: 50%; background: #1d4ed8; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(29, 78, 216, .2); }
.map-note { position: absolute; top: .7rem; left: 50%; transform: translateX(-50%); z-index: 2; background: #fff; padding: .4rem .9rem; border-radius: 999px; font-size: .82rem; font-weight: 600; box-shadow: 0 2px 8px rgba(11, 13, 18, .15); white-space: nowrap; }
.map-peek { position: absolute; left: .6rem; right: .6rem; bottom: .6rem; z-index: 2; }
.map-peek .load-card { box-shadow: 0 6px 24px rgba(11, 13, 18, .22); }
.board-table tbody tr.is-new td { animation: flashnew 4s ease-out; }

/* ---- Phone app (and tablets held upright) ---- */
@media (max-width: 991.98px) {
    .side-nav, .app-footer, .app-bar-search, .app-bar-cta { display: none !important; }
    body.app-shell { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
    .app-bar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .7rem; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) .9rem 0 1rem; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid #e6e8ec; }
    .app-bar .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 1rem; text-decoration: none; flex: 0 0 auto; }
    .app-back { width: 40px; height: 40px; margin-left: -.6rem; margin-right: -.35rem; display: inline-flex; align-items: center; justify-content: center; color: #0b0d12; font-size: 1.3rem; border-radius: 50%; flex: 0 0 auto; }
    .app-back:active { background: #eceef2; }
    .app-bar-title { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
    .app-content { padding: 1rem 1rem calc(88px + env(safe-area-inset-bottom)); }
    .tab-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid #e6e8ec; padding: 0 .25rem env(safe-area-inset-bottom); }
    .tab { flex: 1 1 0; min-width: 0; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: .4rem 0; border: 0; background: none; color: #6b7280; font-size: .68rem; font-weight: 600; text-decoration: none; }
    .tab i { font-size: 1.35rem; line-height: 1; }
    .tab.active { color: #1d4ed8; }
    .tab:active i { transform: scale(.9); }
    .tab-cta i { color: #1d4ed8; font-size: 1.6rem; margin-top: -2px; }
    .toast-container { bottom: calc(64px + env(safe-area-inset-bottom)) !important; left: 0; }
    .sticky-actions { bottom: calc(58px + env(safe-area-inset-bottom)) !important; margin-left: -1rem; margin-right: -1rem; padding-left: 1rem !important; padding-right: 1rem !important; }

    /* Titles live in the top bar, so pages start with their content. */
    .app-shell .page-header { margin-bottom: 1rem; gap: .5rem; }
    .app-shell .page-header h1 { display: none; }
    .app-shell .page-header p { font-size: .9rem; }
    .app-shell .board-header { display: none; }

    /* Thumb-sized controls; 16px text so iPhones don't zoom into a field. */
    .app-shell .btn:not(.btn-sm):not(.btn-icon):not(.btn-avatar):not(.btn-close):not(.btn-link) { min-height: 48px; }
    .app-shell .btn-sm:not(.btn-link) { min-height: 38px; --bs-btn-padding-x: .85rem; display: inline-flex; align-items: center; justify-content: center; }
    .app-shell .form-control, .app-shell .form-select { min-height: 48px; font-size: 1rem; }
    .app-shell .input-group-text { min-height: 48px; }
    .app-shell .card { --bs-card-border-radius: 1.1rem; }
    .app-shell .notif-menu { position: fixed !important; inset: calc(56px + env(safe-area-inset-top)) .5rem auto .5rem !important; transform: none !important; width: auto; }

    /* Sheets slide up from the bottom, like a phone app. */
    .sheet { height: auto !important; max-height: 88dvh; padding-bottom: env(safe-area-inset-bottom); }
    .sheet .offcanvas-header { padding: 1.4rem 1.25rem .75rem; position: relative; }
    .sheet .offcanvas-header::before { content: ""; position: absolute; top: .55rem; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #d5d9e0; }
    .sheet .offcanvas-body { padding: .5rem 1.25rem 1.25rem; }
    .app-shell .modal-dialog { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; max-width: none; min-height: 0; align-items: flex-end; }
    .app-shell .modal.fade .modal-dialog { transform: translateY(40px); }
    .app-shell .modal.show .modal-dialog { transform: none; }
    .app-shell .modal-content { border: 0; border-radius: 1.25rem 1.25rem 0 0; padding-bottom: env(safe-area-inset-bottom); max-height: 90dvh; overflow-y: auto; }

    /* Tables become a stack of cards, one per row. */
    .app-shell .card:has(.admin-table) { background: transparent; border: 0; box-shadow: none; overflow: visible !important; }
    .app-shell .admin-table, .app-shell .admin-table tbody, .app-shell .admin-table tr, .app-shell .admin-table td { display: block; width: 100%; }
    .app-shell .admin-table thead { display: none; }
    .app-shell .admin-table tr { background: #fff; border: 1px solid #e6e8ec; border-radius: 1rem; padding: .55rem .9rem; margin-bottom: .6rem; }
    .app-shell .admin-table td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 0; padding: .3rem 0; text-align: right; background: transparent; min-height: 30px; overflow-wrap: anywhere; }
    .app-shell .admin-table td[data-label]::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
    .app-shell .admin-table td:empty { display: none; }
    .app-shell .admin-table td:not([data-label]) { display: block; text-align: left; }
    .app-shell .stat-card .value { font-size: clamp(1.25rem, 6.2vw, 1.9rem); overflow-wrap: normal; white-space: nowrap; }

    /* Load board */
    .board-toolbar { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 1020; margin: -1rem -1rem 0; padding: .7rem 1rem .6rem; background: #f4f5f7; }
    .board-search { height: 48px; border-radius: 999px; padding: 0 1.1rem; }
    .board-filter-btn { width: 48px; height: 48px; border-radius: 50%; font-size: 1.15rem; }
    .board-chips { display: flex; gap: .5rem; overflow-x: auto; margin: 0 -1rem; padding: .1rem 1rem .6rem; scrollbar-width: none; }
    .board-chips::-webkit-scrollbar { display: none; }
    .chip { min-height: 36px; }
    .filter-sheet .filters { padding: 0; border-radius: 0; }
    .filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
    .filter-grid .f-place, .filter-grid .f-actions { grid-column: 1 / -1; }
    .filter-grid .f-place .form-select { flex: 0 0 112px; }
    .f-actions { display: flex; gap: .6rem; position: sticky; bottom: 0; background: #fff; padding-top: .35rem; }
    .f-actions .btn-dark { flex: 1; }
    .board-meta { margin: .15rem 0 .75rem; flex-wrap: wrap; row-gap: .4rem; }
    .board-meta-left { display: contents; }
    #board-count { flex: 1; font-size: 1.05rem; }
    .board-origin { order: 3; flex: 0 0 100%; }
    .app-bar .nav-tools { gap: .7rem !important; }
    .board-view-toggle .btn, .board-sort-btn { height: 42px; padding: 0 .75rem; font-size: 1rem; }
    .view-list .board-cards { gap: .55rem; }
    .view-map #board-results { display: none; }
    .view-map .board-map-pane { height: calc(100dvh - 330px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 320px; }
}
@media (min-width: 640px) and (max-width: 991.98px) {
    .view-auto .board-cards, .view-cards .board-cards { grid-template-columns: 1fr 1fr; }
    .app-content { padding-left: 1.5rem; padding-right: 1.5rem; }
    .board-toolbar { margin-left: -1.5rem; margin-right: -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; }
    .app-shell .modal-dialog { left: 50%; right: auto; width: 520px; margin-left: -260px; }
}

/* ---- Desktop console ---- */
@media (min-width: 992px) {
    .tab-bar, .app-bar-lead { display: none !important; }
    .side-nav { position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 1035; display: flex; flex-direction: column; padding: 1.1rem .8rem 1rem; background: #0b0d12; color: #b6bcc8; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a2f3a transparent; }
    .side-brand { display: flex; align-items: center; gap: .7rem; padding: .2rem .5rem 1.2rem; color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; text-decoration: none; }
    .side-brand .brand-mark { background: #1d4ed8; }
    .side-brand-sub { color: #8b93a3; font-weight: 600; }
    .side-links { display: flex; flex-direction: column; gap: 2px; flex: 1; }
    .side-link { display: flex; align-items: center; gap: .75rem; padding: .5rem .7rem; border-radius: .55rem; color: #b6bcc8; font-size: .92rem; font-weight: 500; text-decoration: none; }
    .side-link i { width: 1.2rem; text-align: center; font-size: 1.05rem; }
    .side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
    .side-link.active { background: #1d4ed8; color: #fff; font-weight: 600; }
    .side-heading { padding: 1.1rem .7rem .35rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #6b7280; }
    .side-user { display: flex; align-items: center; gap: .65rem; margin-top: 1rem; padding: .85rem .4rem 0; border-top: 1px solid rgba(255, 255, 255, .1); }
    .side-avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: #1d4ed8; color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
    .side-user-text { flex: 1; min-width: 0; }
    .side-user-name { color: #fff; font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .side-user-role { font-size: .75rem; color: #8b93a3; }
    .side-logout { background: none; border: 0; padding: .3rem .45rem; border-radius: .4rem; color: #9aa1ae; font-size: 1.1rem; }
    .side-logout:hover { background: rgba(255, 255, 255, .08); color: #fff; }

    .app-main { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
    .app-bar { position: sticky; top: 0; z-index: 1030; height: 60px; display: flex; align-items: center; gap: 1.5rem; padding: 0 2rem; background: #fff; border-bottom: 1px solid #e6e8ec; }
    .app-bar-title { font-size: .92rem; font-weight: 600; color: #6b7280; flex: 0 0 auto; }
    .app-bar-search { flex: 0 1 440px; display: flex; align-items: center; gap: .6rem; height: 38px; margin: 0; padding: 0 .9rem; background: #f4f5f7; border: 1px solid transparent; border-radius: .6rem; color: #6b7280; }
    .app-bar-search:focus-within { background: #fff; border-color: #1d4ed8; }
    .app-bar-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: .9rem; }
    .app-content { flex: 1; width: 100%; max-width: 1600px; padding: 1.6rem 2rem 2rem; }
    .app-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 2rem; font-size: .8rem; color: #9ca3af; border-top: 1px solid #e6e8ec; }

    /* Denser everything: more rows and fields on screen. */
    .app-shell .page-header { margin-bottom: 1.25rem; }
    .app-shell .page-header h1 { font-size: 1.55rem; }
    .app-shell .form-control, .app-shell .form-select { padding: .5rem .75rem; font-size: .92rem; }
    .app-shell .input-group-text { font-size: .92rem; padding: .5rem .7rem; }
    .app-shell .table > :not(caption) > * > * { padding: .6rem .85rem; }
    .app-shell .admin-table td { font-size: .86rem; }
    .app-shell .board-table td { padding-top: .55rem; padding-bottom: .55rem; font-size: .9rem; }
    .app-shell .board-table .board-thumb { width: 42px; height: 42px; flex-basis: 42px; }
    .app-shell .board-table .pay-cell { font-size: 1rem; }
    .app-shell .board-table > :not(caption) > * > * { padding-left: .6rem; padding-right: .6rem; }
    .app-shell .board-table .lane-cell { white-space: nowrap; }
    .app-shell .board-table .lane-cell .small { white-space: normal; }
    .app-shell .board-table .when-cell { min-width: 7.5rem; }
    .app-bar-cta { white-space: nowrap; }

    /* Load board */
    .board-toolbar { margin-bottom: .75rem; }
    .board-search { max-width: 620px; height: 44px; border-radius: .7rem; padding: 0 1rem; }
    .filter-sheet .offcanvas-body { display: block; }
    .filters { border: 1px solid #e6e8ec; border-radius: .9rem; padding: .85rem 1rem; }
    .filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; align-items: end; }
    .filter-grid .f-place { grid-column: span 2; }
    .filter-grid .f-place .form-select { flex: 0 0 96px; }
    .f-actions { display: flex; gap: .5rem; }
    .f-actions .btn { white-space: nowrap; }
    .board-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
    .board-meta { margin: 1rem 0 .75rem; }
    .board-meta-left { display: flex; align-items: baseline; gap: 1.25rem; }
    .view-auto .board-rows, .view-list .board-rows { display: block; }
    .view-auto .board-cards, .view-list .board-cards { display: none; }
    .view-cards .board-cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
    .view-map .board-split { display: grid; grid-template-columns: minmax(340px, 430px) 1fr; gap: 1rem; align-items: start; }
    .view-map .board-cards { gap: .5rem; }
    .view-map .load-card { display: flex; align-items: stretch; border-radius: .9rem; }
    .view-map .load-card .board-thumb { width: 84px; height: auto; min-height: 84px; flex: 0 0 84px; }
    .view-map .load-card .no-photo { display: inline-flex; font-size: 1.3rem; }
    .view-map .lc-body { flex: 1; min-width: 0; padding: .6rem .75rem; }
    .view-map .lc-lane { font-size: .93rem; margin-bottom: .15rem; padding-right: 2.1rem !important; }
    .view-map .lc-when { margin-bottom: .15rem; }
    .view-map .lc-cargo { display: none; }
    .view-map .load-card .pay { font-size: 1.1rem; line-height: 1.2; }
    .view-map .load-card-wrap > .star-btn { top: .2rem; right: .2rem; background: transparent; box-shadow: none; width: 36px; height: 36px; }
    .view-map .board-map-pane { position: sticky; top: 76px; height: calc(100vh - 92px); min-height: 420px; }
    .map-peek { display: none !important; }
}


/* ---- Marketplace: messages, rules, extra charges, claims ---- */
.chat { display: flex; flex-direction: column; gap: .5rem; max-height: 380px; overflow-y: auto; overscroll-behavior: contain; padding: .25rem .1rem; }
.chat .b { max-width: 82%; padding: .55rem .8rem; border-radius: 1rem; font-size: .93rem; line-height: 1.35; overflow-wrap: anywhere; }
.chat .them { align-self: flex-start; background: #f0f1f4; border-bottom-left-radius: .3rem; }
.chat .me { align-self: flex-end; background: #1d4ed8; color: #fff; border-bottom-right-radius: .3rem; }
.chat .b img { display: block; max-width: 220px; width: 100%; border-radius: .6rem; margin-bottom: .25rem; }
.chat .b .at { display: block; font-size: .68rem; opacity: .65; margin-top: .15rem; text-align: right; }
.chat .b .who-line { font-size: .7rem; font-weight: 700; opacity: .7; margin-bottom: .1rem; }
.chat .t { font-size: .7rem; color: #9ca3af; align-self: center; margin: .25rem 0; }
.chat .sys { align-self: center; font-size: .78rem; color: #6b7280; background: #fff; border: 1px dashed #d1d5db; border-radius: 99px; padding: .2rem .7rem; text-align: center; }
.quick { display: flex; gap: .4rem; flex-wrap: wrap; }
.quick form { margin: 0; }
.quick-btn { border: 1px solid #d1d5db; border-radius: 99px; padding: .3rem .75rem; font-size: .8rem; font-weight: 600; background: #fff; color: #0b0d12; }
.quick-btn:hover, .quick-btn:focus-visible { border-color: #1d4ed8; color: #1d4ed8; }
.rule { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid #f0f1f4; font-size: .93rem; }
.rule:last-child { border-bottom: 0; }
.rule strong { text-align: right; }
.rule.on { background: #f5f8ff; margin: 0 -.75rem; padding: .65rem .75rem; border-radius: .6rem; border-bottom: 0; }
.count { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.bar { height: 8px; border-radius: 99px; background: #eef0f3; overflow: hidden; }
.bar i { display: block; height: 100%; background: #1d4ed8; }
.pick { border: 1.5px solid #e6e8ec; border-radius: .9rem; padding: .8rem; display: flex; gap: .7rem; align-items: flex-start; }
label.pick { cursor: pointer; margin: 0; }
.pick.sel { border-color: #1d4ed8; background: #f5f8ff; }
.pick .ic { width: 36px; height: 36px; border-radius: 50%; background: #f0f1f4; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; }
.pick.sel .ic { background: #1d4ed8; color: #fff; }
.pick .tick { visibility: hidden; }
.pick.sel .tick { visibility: visible; }
label.pick:focus-within { box-shadow: 0 0 0 3px rgba(29, 78, 216, .2); }
#messages, #extras, #claim, #cancel-box, #extra-box, #claim-box, #dispute-box, #ratecon { scroll-margin-top: 84px; }

/* Sign-in: Face ID / fingerprint and Google */
.auth-or { display: flex; align-items: center; gap: .75rem; color: #8a90a0; font-size: .8rem; margin: 1rem 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: #e4e7ec; }
.icon-tile { flex: 0 0 auto; width: 2.5rem; height: 2.5rem; border-radius: .75rem; background: #eef2ff; color: #1d4ed8; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.passkey-nudge { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1px solid #e4e7ec; border-radius: 1rem; padding: .75rem 1rem; margin-bottom: 1rem; }

/* Password reset, email confirmation, legal pages, plan management */
.auth-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--bs-primary-bg-subtle); color: #1d4ed8; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.auth-icon-muted { background: var(--soft); color: #6b7280; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-label-row a { font-size: .85rem; }
.agree-check { background: var(--soft); border-radius: .75rem; padding: .85rem 1rem .85rem 2.6rem; }
.agree-check .form-check-input { margin-top: .2rem; }
.agree-check .form-check-label { font-size: .9rem; }
.legal { max-width: 760px; margin: 0 auto; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.15rem; margin-top: 2rem; }
.legal p, .legal li { color: #30343c; line-height: 1.65; }
.legal .legal-toc { background: var(--soft); border-radius: .875rem; padding: 1rem 1.25rem; columns: 2; column-gap: 2rem; font-size: .9rem; }
.legal .legal-toc a { color: inherit; text-decoration: none; display: block; padding: .15rem 0; }
.legal .legal-toc a:hover { color: #1d4ed8; }
@media (max-width: 575.98px) { .legal .legal-toc { columns: 1; } .legal h1 { font-size: 1.6rem; } }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: inherit; text-decoration: none; }
.footer-links a:hover { color: #1d4ed8; }
.notice-bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: space-between; border: 1px solid var(--bs-primary-border-subtle); background: var(--bs-primary-bg-subtle); border-radius: .875rem; padding: .75rem 1rem; margin-bottom: 1rem; }
.plan-actions { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 575.98px) { .plan-actions { grid-template-columns: 1fr; } }
.plan-state { border-radius: .75rem; padding: .85rem 1rem; font-size: .925rem; }
