:root{--navy:#112540;--orange:#ff873d;--muted:#485e78;--line:#d6e1ed;--paper:#fff;--bg:#eef3f8;--danger:#8a251d}
*{box-sizing:border-box}body{margin:0;color:var(--navy);background:var(--bg);font:16px/1.5 system-ui,sans-serif}a{color:#173f70;text-underline-offset:3px}button,input,select,textarea{font:inherit}button,a,input,textarea,select{touch-action:manipulation}
button{min-height:44px;padding:9px 13px;border:1px solid #b9c9d9;border-radius:8px;color:var(--navy);background:#fff;font-weight:700;cursor:pointer}button:hover{background:#edf3f9}button:disabled{opacity:.6;cursor:default}.primary{background:var(--orange);border-color:var(--orange)}.primary:hover{background:#ff9c5c}
[hidden]{display:none!important}.driver-head{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff;border-bottom:1px solid var(--line);padding:15px max(20px,calc((100% - 1080px)/2));font-weight:750}.driver-head img{display:block;width:190px;max-width:60vw;height:auto}.driver-wrap{max-width:1120px;padding:22px 20px 36px;margin:0 auto}.driver-intro{max-width:730px;margin:13px 0 22px}.driver-intro h1{font-size:clamp(28px,5vw,42px);line-height:1.1;letter-spacing:-.045em;margin:6px 0 12px}.driver-intro p{margin:4px 0}.eyebrow{color:#923b0d;font-size:12px;font-weight:800;letter-spacing:.12em}
.driver-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:16px}.driver-card{background:#fff;border:1px solid var(--line);padding:clamp(16px,3vw,25px);border-radius:13px;margin-bottom:14px;min-width:0;overflow-wrap:anywhere}.driver-card h2{font-size:20px;line-height:1.25;margin:0 0 13px}.driver-card h2:not(:first-child){margin-top:22px}.driver-card h3{font-size:17px;margin:0 0 7px}.driver-card p{margin:7px 0 12px}label{display:block;font-size:14px;font-weight:700;margin-bottom:12px}
input:not([type=checkbox]),select,textarea{display:block;width:100%;min-width:0;min-height:44px;margin-top:5px;padding:8px;border:1px solid #aebfd1;border-radius:7px;background:#fff;color:var(--navy);font-size:16px}textarea{resize:vertical}input[type=file]{font-size:14px;max-width:100%}input[type=checkbox]{margin:5px 0 0;width:18px;height:18px;flex:0 0 auto}.check{display:flex;gap:9px;font-weight:500}.driver-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px}.muted,small{color:var(--muted)}small{font-weight:500}
.driver-account,.driver-toolbar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 14px;margin-bottom:17px}.driver-account p{margin:3px 0;font-size:13px;color:var(--muted)}.driver-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:15px}.driver-tabs button{flex:1 0 auto}.driver-tabs button[aria-pressed=true]{background:var(--navy);color:#fff;border-color:var(--navy)}
.actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:13px}.actions a{display:inline-flex;align-items:center;min-height:44px;padding:7px 11px;border:1px solid #bdcddd;border-radius:7px;text-decoration:none;font-weight:700}.actions label{flex:1 1 170px;margin:0}.status{display:inline-block;background:#edf2f8;color:#24466f;font-weight:750;font-size:12px;border-radius:20px;padding:4px 8px}.error{color:var(--danger)!important}
#driver-message:not(:empty){padding:12px 14px;background:#fff4e9;border:1px solid #efc5a4;border-radius:9px;margin:0 0 18px}
.driver-route{font-weight:700}.job-photos{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0}.job-photos img{width:85px;height:70px;object-fit:cover;border:1px solid var(--line);border-radius:7px}.driver-signature{display:block;width:100%;max-width:600px;height:120px;touch-action:none;border:1px solid #aebfd1;border-radius:8px;background:#fff;margin-bottom:10px}
.tracking-note{border-left:3px solid #f08035;padding-left:10px;color:var(--muted);font-size:13px}.driver-footer{text-align:center;padding:22px;color:var(--muted);font-size:13px}
@media(max-width:720px){.driver-columns{grid-template-columns:1fr}.driver-wrap{padding:17px 14px}.driver-head{padding:13px 15px}.driver-tabs button{flex:1 1 40%}}
@media(max-width:430px){.driver-fields{grid-template-columns:1fr}}

.capacity-guide{margin:16px auto;padding:12px 16px;border:1px solid #ccd7e5;border-radius:12px;background:#fff;color:#112540;box-sizing:border-box;max-width:min(100%,72rem)}
.capacity-guide summary{cursor:pointer;font-weight:700}
.capacity-guide p{margin:10px 0}
.capacity-scroll{max-width:100%;overflow-x:auto}
.capacity-guide table{width:100%;min-width:530px;border-collapse:collapse;font-size:14px}
.capacity-guide caption{text-align:left;font-weight:700;padding:6px 0}
.capacity-guide th,.capacity-guide td{padding:8px;text-align:left;border-bottom:1px solid #dce5ef}
.capacity-guide thead th{background:#f0f4fa}

.driver-footer .company-details{display:grid;gap:3px;margin:8px 0;font-style:normal}
.driver-footer a{color:inherit}

#driver-menu{margin:0 0 18px}
#driver-menu .driver-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
#driver-menu .driver-tabs{display:contents}
#driver-menu .driver-menu-grid button,#driver-menu .capacity-guide > summary{
  display:grid;grid-template-rows:24px auto;align-content:center;justify-items:center;gap:6px;
  min-width:0;min-height:78px;width:100%;padding:10px 7px;text-align:center;
  font-size:.875rem;line-height:1.25;white-space:normal;overflow-wrap:anywhere;
}
#driver-menu .driver-tile-icon{font-size:20px;line-height:24px;color:#a64510}
#driver-menu button[aria-pressed=true] .driver-tile-icon{color:#ffae76}
#driver-menu .capacity-guide{margin:0;padding:0;max-width:none;min-width:0;border-color:#b9c9d9;border-radius:8px}
#driver-menu .capacity-guide[open]{grid-column:1/-1;padding:0 12px 12px}
#driver-menu .capacity-guide > summary{list-style:none}
#driver-menu .capacity-guide > summary::-webkit-details-marker{display:none}

.driver-nearby-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr);align-items:stretch}
.driver-nearby-actions button{min-width:0;padding:8px 4px;font-size:clamp(.8125rem,3.6vw,1rem);line-height:1.2;overflow-wrap:anywhere}

#driver-page-toolbar h1{flex:1 1 100%;order:1;margin:3px 0;font-size:clamp(24px,5vw,34px)}

.completed-job-tile{display:block;width:100%;text-align:left;margin:0 0 8px;overflow-wrap:anywhere}
.completed-job-tile small{display:block;margin-top:4px}
.completed-section summary{cursor:pointer;font-weight:750}
.completed-section a{display:inline-block;margin-top:8px}

.driver-nearby-actions:has(#driver-push-enable[hidden]){grid-template-columns:repeat(2,minmax(0,1fr))}

.driver-run-tile > summary{cursor:pointer;line-height:1.35}
.driver-run-tile > summary strong{font-size:17px}
.driver-run-tile > summary small{display:block;margin-top:5px;color:var(--muted)}
.driver-run-tile[open] > summary{margin-bottom:14px}

.driver-tip-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
.driver-tip{margin:0;padding:14px}
.driver-tip summary{cursor:pointer;font-weight:750;line-height:1.4}
.driver-tip p{margin-bottom:0}
.tip-scene{position:relative;overflow:hidden;height:125px;margin-top:12px;border-radius:8px;background:#edf3fa}
.tip-scene span{position:absolute}
.tip-van-body{left:24%;right:6%;top:14%;bottom:23%;border:3px solid #536985;border-radius:8px 6px 3px 0;background:#dbe6f3}
.tip-van-cab{left:6%;width:19%;height:47%;bottom:23%;background:#91a9c3;border:3px solid #536985;clip-path:polygon(0 40%,45% 0,100% 0,100% 100%,0 100%)}
.tip-van-wheels{left:13%;right:13%;bottom:13%;height:20px}
.tip-van-wheels::before,.tip-van-wheels::after{content:"";position:absolute;width:21px;height:21px;border:4px solid #293e57;border-radius:50%;background:#aabbd0}
.tip-van-wheels::after{right:0}
.tip-floor{left:24%;right:6%;bottom:23%;border-bottom:4px solid #536985}
.tip-bulkhead{left:25%;height:61%;bottom:24%;border-left:3px solid #536985}
.tip-load{left:39%;width:35%;height:34%;bottom:30%;background:linear-gradient(90deg,#e8bf8d 48%,#785632 49%,#785632 51%,#e8bf8d 52%);border:2px solid #785632;border-radius:3px}
.tip-load i{position:absolute;bottom:-10px;left:-5%;width:110%;height:9px;border-top:4px solid #89623c;background:repeating-linear-gradient(90deg,#89623c 0 15%,transparent 15% 42%)}
.tip-lashing{left:39%;width:14%;bottom:25%;height:43%;border:4px solid #a44709;border-bottom:0;border-radius:8px 8px 0 0;transform:skewX(-13deg)}
.tip-lashing-rear{left:62%}
.tip-anchors{left:35%;right:22%;bottom:23%;height:7px;border-left:7px solid #182e49;border-right:7px solid #182e49}
.tip-ratchet-scene{background:#e8eff7}
.tip-webbing{left:12%;right:10%;top:60%;border-bottom:8px solid #a44709}
.tip-spindle{left:44%;top:44%;width:24px;height:24px;border:6px solid #536985;border-radius:50%;background:#edf3fa}
.tip-handle{left:49%;width:35%;height:8px;top:53%;border-radius:5px;background:#182e49;transform-origin:left center}
.tip-tick{right:11%;top:7%;font-size:26px;font-weight:800;color:#186444}
@media(max-width:540px){.driver-tip-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:no-preference){
  .driver-tip-placement[open] .tip-load{animation:tip-position 2s ease both}
  .driver-tip-strap[open] .tip-lashing{animation:tip-anchor 2s ease both}
  .driver-tip-ratchet[open] .tip-webbing{animation:tip-feed 2s ease both}
  .driver-tip-ratchet[open] .tip-handle{animation:tip-pump 4s ease both}
  .driver-tip-check[open] .tip-tick{animation:tip-check 2s ease both}
}
@keyframes tip-position{0%{transform:translate(37%, -13%)}100%{transform:none}}
@keyframes tip-anchor{0%{transform:translateY(-22px) skewX(-13deg);opacity:.25}100%{transform:skewX(-13deg);opacity:1}}
@keyframes tip-feed{0%{clip-path:inset(0 55% 0 0)}60%,100%{clip-path:inset(0)}}
@keyframes tip-pump{0%,45%,72%{transform:rotate(-50deg)}60%,85%,100%{transform:none}}
@keyframes tip-check{0%,25%{opacity:0;transform:scale(.7)}100%{opacity:1;transform:none}}

.driver-collection-checklist{margin-bottom:18px}
.driver-collection-checklist form{margin-top:14px}
.driver-collection-checklist label{display:flex;align-items:flex-start;gap:10px;font-weight:400;line-height:1.5}
.driver-collection-checklist input[type=checkbox]{flex:0 0 auto;width:19px;height:19px;min-height:0;margin:2px 0 0;accent-color:#112540}

.booking-calendar-controls { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .75rem; }
.booking-calendar-controls h2 { margin: 0; }
.booking-calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: .25rem; text-align: center; }
.booking-calendar-grid button { display: grid; justify-items: center; gap: .2rem; padding: .35rem 0; min-width: 0; }
.booking-calendar-grid small { font-size: .7rem; }
#calendar-alert:not([hidden]) { margin-bottom: 1rem; }
#calendar-bookings article { margin-bottom: .75rem; }
#calendar-bookings form { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }

#driver-alert-map{height:clamp(280px,50vh,520px);margin:12px 0;border-radius:12px;z-index:0}

.message-thread { display: grid; gap: 8px; list-style: none; padding: 0; }
.message-thread li { padding: 10px 14px; background: #eef3f8; border-radius: 8px; }
.message-thread .message-own { background: #e8f4ec; }
.message-thread p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
[data-panel="messages"] textarea { display: block; width: 100%; font: inherit; }

#driver-message-admin[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

#driver-director-tools {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 14px;
}
#driver-director-tools > summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 750;
}
#driver-director-tools > p {
  margin: 0 0 12px;
}
.director-tool-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 10px;
  padding-bottom: 14px;
}
.director-tool-links section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.director-tool-links h2 {
  font-size: 1rem;
  margin: 0 0 6px;
}
.director-tool-links a {
  display: block;
  padding: 8px 0;
}

.prefilled-delivery-draft[href]{display:inline-flex;align-items:center;min-height:44px;padding:9px 13px;margin:5px 8px 5px 0;border-radius:8px;background:var(--orange);color:var(--navy);font-weight:700;text-decoration:none}

.director-dashboard-links{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin:14px 0 22px}
.director-dashboard-links a,.director-desk details a{display:block;padding:13px;color:#102644;font-weight:650}
.director-dashboard-links a{background:#eef3f8;border-left:4px solid #ef7026;border-radius:6px;text-decoration:none}
.director-desk details{border-top:1px solid #cbd4de;padding:12px 0}
.director-desk summary{cursor:pointer;font-weight:700;padding:6px}

#director-map-canvas{height:45vh;min-height:260px}

.director-dashboard-links{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr}
.director-dashboard-links a{display:flex;align-items:center;min-height:60px}
.director-desk details{border:1px solid var(--line);border-radius:8px;margin:10px 0;padding:0}
.director-desk summary{padding:14px}
.director-desk details a{margin:0 14px;border-top:1px solid var(--line)}
#director-invoice-results .driver-card{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#director-invoice-results .driver-card>:is(strong,p,input,a){grid-column:1/-1;margin:0}
#director-invoice-results button{width:100%;min-height:44px}
#website-quotes-list details{border-block-end:1px solid var(--line);padding:12px 0}
@media(min-width:700px){.director-dashboard-links{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:480px){#director-invoice-results .driver-card{grid-template-columns:minmax(0,1fr)}}

.director-payable{display:grid;gap:8px}.director-payable input,.director-payable button{width:100%;min-height:48px;margin:0}.director-payable p{margin:0}

.web-job-card{display:grid;grid-template-columns:minmax(0,1fr);gap:6px}.web-job-card>h2,.web-job-card>p{margin:0}.web-job-card>a{justify-self:start;padding:5px 0}

.driver-card :is(form,fieldset,label,details,button,select,textarea){min-width:0;max-width:100%}
.driver-card :is(button,summary){white-space:normal;overflow-wrap:break-word;line-height:1.35}
.driver-card input[type=date]{box-sizing:border-box;min-width:0;max-width:100%;appearance:none}
.driver-card input::-webkit-date-and-time-value{text-align:left}
[data-panel=directorInvoices]{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
[data-panel=directorInvoices]>details{border:1px solid var(--line);border-radius:9px;padding:0 12px}
[data-panel=directorInvoices] summary{cursor:pointer;font-weight:650;padding:12px 0;min-height:44px}
#director-invoice-results{display:grid;gap:12px}
#director-invoice-results .driver-card{margin:0;align-items:start;gap:10px}
#director-invoice-results .driver-card>:is(label,details,.invoice-customer){grid-column:1/-1;margin:0}
#director-invoice-results .invoice-customer{font-weight:600}
#director-invoice-results .driver-card>p{color:var(--muted);font-size:.92rem}
#director-invoice-results .driver-card>.invoice-status{color:var(--navy);font-size:.95rem}
#director-invoice-results details[open]>button{margin:4px 0}
@media(max-width:600px){
 .driver-card form>button,.driver-card .actions>button,.driver-card .actions>a{width:100%;justify-content:center}
 .driver-card .actions>label{flex-basis:100%}
 #director-invoice-results .driver-card{grid-template-columns:minmax(0,1fr)}
 .driver-card label input,.driver-card label select,.driver-card label textarea{font-weight:400}
}

#driver-shortcuts { margin: 0 0 14px; }
#driver-shortcuts summary, #driver-shortcuts nav {
  background: white; color: #102644; border: 1px solid var(--line); border-radius: 8px;
}
#driver-shortcuts summary { padding: 12px 14px; font-weight: 700; cursor: pointer; }
#driver-shortcuts nav { max-height: 55vh; overflow-y: auto; padding: 8px; }
#driver-shortcuts nav strong, #driver-shortcuts nav button { display: block; padding: 12px; }
#driver-shortcuts nav button { width: 100%; text-align: left; color: #102644; background: white; border: 0; }
@media (max-width: 700px) {
  .director-desk { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .director-desk[hidden] { display: none; }
  .director-desk > :is(h2,.director-dashboard-links,details[open]) { grid-column: 1 / -1; }
  .director-desk details { margin: 0; min-width: 0; }
  .director-desk summary { padding: 12px; }
  .director-dashboard-links { grid-auto-rows: 1fr; }
}

.driver-home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.driver-home-actions button { min-width: 0; min-height: 44px; }
#driver-signed:has(#driver-menu[hidden]) #driver-alert-controls,
#driver-signed:has(#driver-menu[hidden]) #driver-home-refresh { display: none; }

#driver-contacts { margin: 12px 0; background: white; border: 1px solid var(--line); border-radius: 8px; }
#driver-contacts summary { padding: 12px 14px; font-weight: 700; cursor: pointer; }
#driver-contacts-list { padding: 0 14px 12px; }
#driver-contacts-list > div { padding: 10px 0; }
.driver-contact-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 8px 0; }
.driver-contact-actions a { justify-content: center; text-align: center; }
.driver-contact-actions span { grid-column: 1/-1; }
