/* GitTrukin: mobile-first styles. No framework. */
:root {
    --bg: #f3f5f7;
    --surface: #ffffff;
    --surface-2: #f8fafb;
    --text: #1b242c;
    --muted: #5c6a76;
    --border: #d9e0e6;
    --brand: #1f2a33;
    --brand-text: #ffffff;
    --accent: #2e6b1f;
    --accent-soft: #eef6ea;
    --danger: #b00020;
    --danger-soft: #fdecee;
    --warn: #8a5a00;
    --warn-soft: #fff4dc;
    --info: #1f5f99;
    --info-soft: #e8f1fa;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 2px 8px rgba(16, 24, 32, .05);
    --tap: 46px;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--info); }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
p { margin: .4rem 0; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.icon { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---- Top bar and navigation ---- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 10px;
    min-height: 56px; padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    background: var(--brand); color: var(--brand-text);
}
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.tenant { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: .85rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }
/* Phones: the menu is a full-width strip under the bar that swipes sideways
   from edge to edge. Desktop: the same links sit inline in the bar. */
.topbar { flex-wrap: wrap; }
.mainnav {
    order: 1; flex: 0 0 auto; width: calc(100% + 24px); margin: 0 -12px;
    display: flex; align-items: center; gap: 4px;
    padding: 6px 12px 8px; border-top: 1px solid rgba(255,255,255,.12);
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding: 0 12px;
    scrollbar-width: none;
}
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a, .mainnav .linkish {
    flex: none; display: flex; align-items: center; gap: 6px; white-space: nowrap;
    padding: 8px 12px; border-radius: 999px; scroll-snap-align: start;
    color: #dfe6ec; text-decoration: none; font-size: .95rem;
    border: 0; background: rgba(255,255,255,.06); cursor: pointer; font-family: inherit;
}
.mainnav a:hover, .mainnav .linkish:hover { background: rgba(255,255,255,.12); color: #fff; }
.mainnav a.active { background: var(--accent); color: #fff; font-weight: 700; }
.mainnav small { color: #b6c2cc; font-weight: 400; }
.mainnav a.active small { color: inherit; }
.nav-user { flex: none; display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-user form { margin: 0; }
/* Drivers already have the bottom tab bar on phones, so the strip only needs their profile and sign out. */
@media (max-width: 959px) {
    body.role-driver .mainnav > a { display: none; }
    body.role-driver .nav-user { margin-left: 0; }
}

/* Wide screens have room for the whole menu inline in the bar. */
@media (min-width: 1280px) {
    .topbar { flex-wrap: nowrap; }
    .tenant { margin-left: 0; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.25); max-width: 40vw; }
    .mainnav {
        order: 0; flex: 0 1 auto; width: auto; min-width: 0; margin: 0 0 0 auto;
        padding: 0; border: 0; scroll-snap-type: none;
    }
    .mainnav a, .mainnav .linkish { padding: 8px 10px; border-radius: 8px; background: transparent; }
    .mainnav a:hover, .mainnav .linkish:hover { background: rgba(255,255,255,.08); }
    .mainnav a.active { background: rgba(255,255,255,.14); }
}

.acting-bar { background: var(--warn-soft); color: var(--warn); padding: 8px 16px; font-size: .9rem; text-align: center; }

/* Driver tab bar at the bottom of the phone screen. */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; font-size: .72rem; color: var(--muted); text-decoration: none; }
.tabbar a.active { color: var(--accent); font-weight: 700; }
.tabbar .icon { width: 24px; height: 24px; }
body.role-driver .page { padding-bottom: 96px; }
@media (min-width: 960px) { .tabbar { display: none; } body.role-driver .page { padding-bottom: 32px; } }

/* ---- Page layout ---- */
.page { max-width: 1180px; margin: 0 auto; padding: 16px 16px 32px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin: 4px 0 14px; }
.page-head .sub { color: var(--muted); margin: 0; }
.page-head .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.tenant > span { overflow: hidden; text-overflow: ellipsis; }
.company-logo { flex: none; width: auto; height: 36px; max-width: 90px; object-fit: contain; border-radius: 6px; }
.logo-preview { display: block; max-width: 160px; max-height: 160px; margin: 8px 0; border-radius: 8px; }
/* Trip report band, like the PDF header: company logo in the upper right corner. */
.trip-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #2e3138; color: #fff; border-radius: 8px; padding: 12px 12px 12px 18px; margin: 4px 0 18px; border-bottom: 4px solid #e8762b; box-shadow: 0 3px 0 #26b0a5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.trip-brand-title { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.trip-brand-sub { font-size: .9rem; color: #e8762b; font-weight: 600; }
.trip-brand-sub a { color: #fff; }
.trip-brand img { width: 72px; height: 72px; object-fit: contain; border-radius: 6px; flex: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; }

.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid-main { grid-template-columns: 2fr 1fr; } .cols-2 { grid-template-columns: 1fr 1fr; } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .88rem; }
.stat.warn b { color: var(--warn); }

/* ---- Forms ---- */
label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], input[type=search], input:not([type]), select, textarea {
    width: 100%; min-height: var(--tap); padding: 10px 12px;
    font: inherit; font-size: 16px; color: var(--text);
    background: #fff; border: 1px solid #a9b4bd; border-radius: 8px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(46, 107, 31, .25); border-color: var(--accent); }
.form .actions, .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 14px; }
@media (min-width: 640px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.help { font-size: .88rem; color: var(--muted); margin: 3px 0 6px; font-weight: 400; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.input-row .btn { flex: none; }
[data-dot-result] .alert { margin: 8px 0 0; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: var(--tap); padding: 10px 16px;
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    color: var(--text); background: var(--surface); border: 1px solid #a9b4bd; border-radius: 8px;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #255a18; }
.btn-danger { color: var(--danger); border-color: #e3a6b0; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-big { min-height: 56px; font-size: 1.1rem; }
.btn[disabled] { opacity: .6; cursor: default; }
.inline { display: inline; margin: 0; }
.linkish { font: inherit; }

/* ---- Alerts and badges ---- */
.alert { padding: 12px 14px; border-radius: 8px; margin: 0 0 14px; border: 1px solid; }
.alert-success { background: var(--accent-soft); border-color: #a9cf9b; color: #1f4a14; }
.alert-error { background: var(--danger-soft); border-color: #eab0b9; color: #7a0016; }
.alert-warning { background: var(--warn-soft); border-color: #ecd08f; color: var(--warn); }
.alert-info { background: var(--info-soft); border-color: #a8c8e6; color: #174a78; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: #e6ebef; color: #3b4752; }
.badge-dispatched, .badge-arrived, .badge-submitted { background: var(--info-soft); color: var(--info); }
.badge-in_progress, .badge-maintenance { background: var(--warn-soft); color: var(--warn); }
.badge-completed, .badge-active, .badge-complete { background: var(--accent-soft); color: var(--accent); }
.badge-cancelled, .badge-out_of_service, .badge-inactive, .badge-suspended, .badge-skipped { background: var(--danger-soft); color: var(--danger); }

/* ---- Tables become cards on phones ---- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 16px; }
@media (max-width: 759px) {
    .table.stack thead { display: none; }
    .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
    .table.stack tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
    .table.stack td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
    .table.stack td[data-label]::before { content: attr(data-label); flex: 0 0 38%; color: var(--muted); font-size: .85rem; }
    .table.stack td.primary { font-weight: 700; font-size: 1.05rem; }
    .table.stack td.primary::before { display: none; }
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); font-size: .9rem; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Routes and stops ---- */
.route-card { display: block; text-decoration: none; color: inherit; }
.route-card .ref { font-weight: 700; font-size: 1.05rem; }
.route-card .lane { color: var(--muted); }
.progress { height: 6px; border-radius: 6px; background: #e3e8ec; overflow: hidden; margin: 8px 0 2px; }
.progress span { display: block; height: 100%; background: var(--accent); }

.stops { list-style: none; margin: 0; padding: 0; counter-reset: stop; }
.stop { position: relative; padding: 0 0 18px 40px; }
.stop::before {
    counter-increment: stop; content: counter(stop);
    position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: .85rem;
    background: #e3e8ec; color: var(--text);
}
.stop::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: #e3e8ec; }
.stop:last-child::after { display: none; }
.stop.done::before { background: var(--accent); color: #fff; }
.stop.arrived::before { background: var(--info); color: #fff; }
.stop.current { }
.stop .stop-type { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stop .stop-name { font-weight: 700; }
.stop .stop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.stop .stop-actions form { margin: 0; }

.stop-editor { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; background: var(--surface-2); }
.stop-editor-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stop-editor-head strong { font-size: .95rem; }
.stop-editor .tools { display: flex; gap: 6px; }

/* ---- Messages ---- */
.messages { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: #cfe3c6; }
.msg .meta { font-size: .78rem; color: var(--muted); }
.msg p { margin: 2px 0 0; white-space: pre-wrap; }

/* ---- Driver today view ---- */
.hero { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.hero .muted { color: #b6c2cc; }
.hero h1 { color: #fff; }
.hero .btn { background: #fff; border-color: #fff; }
.next-stop { background: rgba(255,255,255,.08); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.big-actions { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-top: 12px; }

/* ---- Trip report (ported from the iLandClearing form) ---- */
.trip { max-width: 640px; margin: 0 auto; font-size: 17px; }
.trip fieldset { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 18px; }
.trip legend { font-weight: 700; padding: 0 6px; }
.trip .half { display: flex; gap: 10px; margin: 6px 0 0; }
.trip .half label { flex: 1; margin: 0; border: 2px solid #999; border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; font-weight: 700; background: #fff; position: relative; }
.trip .half input { position: absolute; opacity: 0; }
.trip .half label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.trip .half label.is-done { opacity: .55; }
.trip .thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.trip .thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; border: 1px solid #ccc; display: block; }
.trip .tile { position: relative; }
.trip .tile .del { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--danger); color: #fff; font-size: 16px; line-height: 22px; text-align: center; border: 2px solid #fff; cursor: pointer; }
.trip .file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.trip .add { display: inline-block; margin: 4px 0 0; padding: 10px 16px; border: 2px dashed var(--accent); border-radius: 8px; color: var(--accent); font-weight: 700; cursor: pointer; }
.trip .doc { display: flex; align-items: center; max-width: 100%; padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; background: #f6f6f6; font-size: 14px; word-break: break-all; }
.trip .count { font-size: 14px; margin-top: 4px; }
.trip .count.bad { color: var(--danger); }
.trip .submit { width: 100%; padding: 14px; font-size: 18px; font-weight: 700; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
.trip .submit[disabled] { opacity: .6; }
.trip .msg-box { padding: 12px; border-radius: 6px; margin: 0 0 16px; display: none; }
.trip .msg-box.ok { display: block; background: var(--accent-soft); border: 1px solid var(--accent); }
.trip .msg-box.err { display: block; background: var(--danger-soft); border: 1px solid var(--danger); }
.trip .load-fixed { font-size: 1.15rem; font-weight: 700; }

.gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery a { display: block; }
.gallery img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
@media (min-width: 640px) { .gallery img { width: 150px; height: 150px; } }
.gallery .pdf-tile { width: 120px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); text-decoration: none; color: var(--text); font-size: 12px; padding: 6px; text-align: center; word-break: break-all; }
@media (min-width: 640px) { .gallery .pdf-tile { width: 150px; height: 150px; } }

/* ---- Guest (sign in) ---- */
body.guest { background: var(--brand); min-height: 100vh; }
.guest-wrap { max-width: 420px; margin: 0 auto; padding: 48px 16px; }
.guest-brand { display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; font-size: 1.6rem; font-weight: 800; margin-bottom: 20px; }
.guest-card { padding: 22px; }
.guest-card h1 { margin-bottom: 8px; }
.guest-card .btn { margin-top: 18px; }

@media print {
    .topbar, .tabbar, .no-print, .acting-bar { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; }
}

.guest-foot { text-align: center; color: #dfe6ec; }
.guest-foot a { color: #fff; font-weight: 700; }

/* ---- Fleet (ELD data) ---- */
.fleet-map { height: 420px; padding: 0; overflow: hidden; z-index: 0; }
@media (max-width: 759px) { .fleet-map { height: 300px; } }
.badge-error, .badge-paused { background: var(--warn-soft); color: var(--warn); }
.badge-duty-driving, .badge-duty-d { background: var(--info-soft); color: var(--info); }
.badge-duty-on_duty, .badge-duty-on { background: var(--warn-soft); color: var(--warn); }
.badge-duty-off_duty, .badge-duty-sleeper, .badge-duty-sb, .badge-duty-off { background: #e6ebef; color: #3b4752; }
.hos-low { color: var(--danger); font-weight: 700; }
.eld-edit summary, details.card summary { cursor: pointer; }
.eld-edit { margin-top: 12px; }
.eld-conn .kv { margin-bottom: 10px; }
.eld-live { border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 10px; }
.eld-live .help { margin: 6px 0 8px; }
.badge-off { background: #e6ebef; color: #3b4752; }
.eld-method { border: 0; padding: 0; margin: 12px 0 4px; }
.eld-method legend { font-weight: 600; margin-bottom: 4px; }
.eld-method .check { display: block; margin: 4px 0; }
.eld-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.eld-row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eld-link { display: flex; gap: 6px; margin: 0; }
.eld-link select { width: auto; min-height: 36px; padding: 6px 10px; }
.eld-unmatched .card-head { flex-wrap: wrap; }
.eld-unmatched .btn { white-space: nowrap; }

/* ---- Truck and driver documents ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.doc-upload-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.doc-picked { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.doc-picked li { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.doc-picked img, .doc-picked .tag { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; flex: none; display: flex; align-items: center; justify-content: center; background: #fff; font-size: 12px; font-weight: 700; }
.doc-picked .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.doc-picked .del { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 18px; cursor: pointer; flex: none; }
.doc-form .msg-box, form[data-doc-upload] .msg-box { display: none; padding: 12px; border-radius: 6px; margin: 0 0 12px; }
.doc-form .msg-box.err, form[data-doc-upload] .msg-box.err { display: block; background: var(--danger-soft); border: 1px solid var(--danger); }
.doc-title { font-weight: 700; font-size: 1.05rem; margin-left: 6px; }
.doc-card .card-head { align-items: flex-start; }
.doc-file { display: flex; flex-direction: column; gap: 4px; }
.doc-file-meta { display: flex; gap: 10px; align-items: center; min-height: 28px; }
.doc-file-meta .check { margin: 0; }
.danger-link { color: var(--danger); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.combine-bar { border-color: var(--accent); }
.ssn-saved { margin: 4px 0; display: flex; gap: 10px; align-items: center; font-family: ui-monospace, monospace; }
.mark-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

/* ---- Route map and miles ---- */
.route-map { height: 340px; margin: 0 -16px 12px; z-index: 0; }
@media (max-width: 759px) { .route-map { height: 260px; } }
.plan-pin { box-sizing: border-box; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); background: #6b7a88; color: #fff; font-weight: 800; font-size: .85rem; }
.plan-pin-pickup { background: #1e8a4c; }
.plan-pin-delivery { background: #1f6fb2; }
.plan-pin-done { opacity: .55; }
.plan-total { font-size: 1.15rem; margin-bottom: 8px; }
.plan-legs td.num, .plan-legs th:not(:first-child) { text-align: right; white-space: nowrap; }
.plan-total-row td { font-weight: 700; background: var(--surface-2); }
.warn-text { color: var(--warn); }
.plan-miles-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.fmcsa-card h3 { margin: 18px 0 8px; font-size: 1rem; }
.fmcsa-card .table-wrap { overflow-x: auto; box-shadow: none; }

/* ---- Load board and brokers ---- */
.load-card { display: block; text-decoration: none; color: inherit; }
.load-card .card-head { margin-bottom: 4px; align-items: flex-start; }
.load-card .lane { font-weight: 700; font-size: 1.05rem; }
.load-rate { font-weight: 700; color: var(--accent); white-space: nowrap; }
.load-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .92rem; margin-bottom: 4px; }
.load-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.load-tags:empty { display: none; }
.load-filters select { flex: 1 1 140px; }
.offers { gap: 0; }
.offer { padding: 12px 0; border-top: 1px solid var(--border); }
.offer:first-child { border-top: 0; padding-top: 0; }
.offer .card-head { margin-bottom: 2px; }
.offer-declined, .offer-withdrawn { opacity: .6; }
.broker-docs { gap: 0; }
.broker-doc { padding: 10px 0; border-top: 1px solid var(--border); }
.broker-doc:first-child { border-top: 0; padding-top: 0; }
.broker-doc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.broker-doc-file { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; }
.broker-doc-file a { display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.broker-upload { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 4px; }
input[type=file] { width: 100%; min-height: var(--tap); padding: 8px 0; font: inherit; }
.mail-way { border: 0; padding: 0; margin: 4px 0 8px; }
.mail-way legend { font-weight: 600; margin-bottom: 4px; }
.mail-way .check { display: flex; align-items: flex-start; margin: 8px 0; }
.mail-way .check input { margin-top: 3px; }
.mail-way small { display: block; color: var(--muted); }
.mail-fields { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 6px; }
