:root{--pilot-safe-top:env(safe-area-inset-top,0px)}
:root{font-family:Inter,'Segoe UI',Arial,sans-serif;color:#16323e;background:#0d3440;font-size:16px}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}a{color:#146b7b}button,.pilot-button{font:inherit;font-size:14px;min-height:44px;padding:10px 12px;border:1px solid #b6c9d1;border-radius:7px;background:#fff;color:#173d46;cursor:pointer;text-align:center;text-decoration:none}button:disabled{cursor:wait;opacity:.55}button:focus-visible,a:focus-visible{outline:3px solid #149cba;outline-offset:3px}.primary{background:#0e766e;color:#fff;border-color:#0e766e}.pilot-header{height:calc(64px + var(--pilot-safe-top));padding:var(--pilot-safe-top) max(16px,env(safe-area-inset-right,0px)) 0 max(16px,env(safe-area-inset-left,0px));display:flex;align-items:center;justify-content:space-between;gap:12px;background:#0d3440;color:white}.pilot-header a{color:white;text-decoration:none;font-size:14px}.pilot-brand{font-weight:700;display:flex;align-items:center;gap:9px;font-size:18px!important}.pilot-brand span{color:#3be0bd;font-size:30px}.pilot-layout{height:calc(100dvh - 64px - var(--pilot-safe-top));display:grid;grid-template-columns:320px minmax(0,1fr);background:#f5f8fa}.pilot-sidebar{padding:20px;background:white;overflow:auto;border-right:1px solid #dbe3e8}h1{font-size:21px;margin:0 0 10px}p{font-size:14px;line-height:1.5;margin:8px 0 12px}.pilot-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.pilot-heading h1{margin:0}.pilot-hint{font-size:12px;color:#607984}.pilot-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}.pilot-actions button{width:100%;height:auto;min-height:44px}.map-wrap{position:relative;min-width:0;min-height:0}#map{width:100%;height:100%;background:#e8eff0}.leaflet-rotate-pane{z-index:400}.leaflet-control-attribution{font-size:10px!important}.pilot-marker{border:2px solid white;border-radius:50%;background:#0f5368;color:#fff;text-align:center;font:bold 14px/26px Arial;box-shadow:0 1px 5px #1236}.pilot-marker.dwell_met{background:#16846c}.pilot-marker.short{background:#b87513}.pilot-arrow{color:#ce3153;font:20px Arial;text-shadow:1px 0 white,-1px 0 white,0 1px white,0 -1px white}.pilot-arrow span{display:block;transform-origin:50% 50%}.pilot-page .follow-panel{left:12px;max-width:calc(100% - 24px)}.pilot-page #pilot-dwell{grid-column:1 / -1;grid-row:3;font-size:12px;margin:5px 0 0;color:#0b6d65;font-weight:600}.pilot-page #follow-status{grid-row:4}.pilot-page .follow-panel[data-compass-action="true"] .follow-actions{grid-row:5}.pilot-history-item{display:block;width:100%;text-align:left;margin:8px 0}.pilot-report{grid-column:1 / -1;overflow:auto;padding:24px;max-width:1100px;width:100%;margin:0 auto}.pilot-layout.show-report{display:block}.pilot-layout.show-report .pilot-sidebar{display:none}.pilot-report-head{display:flex;align-items:center;justify-content:space-between;gap:15px}.pilot-report-counts{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}.pilot-report-counts strong{background:#e9f4f1;padding:12px;border-radius:8px;font-size:15px}.pilot-report-stops{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.pilot-report-stop{border:1px solid #d5e3e7;border-radius:9px;background:#fff;padding:16px;break-inside:avoid}.pilot-report-stop h2{font-size:17px;margin:0 0 8px}.pilot-report-stop p{font-size:13px;margin:5px 0}.pilot-report-stop.review{border-color:#d5a553}.pilot-status-badge{font-size:13px;font-weight:700;color:#126d57}.pilot-status-badge.review{color:#97610d}.pilot-layout.needs-login{display:block}.pilot-layout.needs-login .pilot-sidebar{max-width:480px;margin:35px auto;border:1px solid #dbe3e8;border-radius:12px}.pilot-layout.needs-login .pilot-button{display:inline-flex;align-items:center}
@media(max-width:760px),(hover:none) and (pointer:coarse) and (orientation:portrait){.pilot-layout{display:flex;flex-direction:column}.pilot-sidebar{flex:none;padding:12px 16px;border-right:0;border-bottom:1px solid #dbe3e8;max-height:55dvh}.pilot-heading h1{font-size:18px}.pilot-sidebar #pilot-summary{margin:5px 0;font-size:12px}.map-wrap{flex:1;min-height:200px}.pilot-report{padding:16px}.pilot-report-stops{grid-template-columns:1fr}.pilot-report-head{align-items:flex-start;flex-wrap:wrap}.pilot-report-counts{gap:6px}.pilot-report-counts strong{font-size:13px;padding:10px}.pilot-layout.show-report{overflow:auto}.pilot-layout.needs-login .pilot-sidebar{margin:25px 16px}.pilot-actions button{font-size:13px}}
@media print{html,body{background:white;color:#111}.pilot-header,.pilot-sidebar,.map-wrap,.pilot-report-head button,.pilot-actions,#pilot-report-save{display:none!important}.pilot-layout{display:block!important;height:auto}.pilot-report{display:block!important;overflow:visible;padding:0;max-width:none}.pilot-report-stops{grid-template-columns:repeat(2,minmax(0,1fr))}.pilot-report-stop{box-shadow:none}.pilot-report-counts strong{background:#eee}}

.pilot-report-stops{display:block}.pilot-report .pilot-actions{align-items:stretch}.pilot-report .pilot-actions button{height:100%}@media print{.pilot-report-head,.pilot-report>.pilot-hint{display:none!important}.pilot-report-stops{display:block!important}.pilot-report{max-width:none}.pilot-worklist{width:100%}}

@media print{.pilot-layout{overflow:visible!important}}

.pilot-run-actions{align-items:stretch}.pilot-run-actions button{height:100%;min-height:44px}.pilot-danger{color:#fff;background:#cd293b;border-color:#cd293b}.pilot-history-item strong,.pilot-history-item small{display:block}.pilot-history-item small{font-size:12px;color:#607984;margin-top:4px}.pilot-print-help{font-size:13px;margin:16px 0}.pilot-print-help p{font-size:13px}.pilot-layout.show-report{height:calc(100dvh - 64px - var(--pilot-safe-top));overflow:auto}.pilot-layout.show-report .pilot-report{min-height:100%}@media print{.pilot-print-help{display:none!important}.pilot-layout.show-report{height:auto!important;overflow:visible!important}}

.pilot-history-toolbar{display:grid;gap:6px;font-size:13px;margin:12px 0}.pilot-history-toolbar select{font:inherit;font-size:16px;width:100%;min-width:0;height:44px;padding:8px 10px;border:1px solid #b6c9d1;border-radius:7px;background:#fff;color:#173d46}.pilot-history-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:8px 0;align-items:stretch}.pilot-history-row .pilot-history-item{margin:0;min-width:0;height:100%;overflow-wrap:anywhere}.pilot-history-row div.pilot-history-item{padding:10px 12px;border:1px solid #d7e4e8;border-radius:7px;font-size:14px}.pilot-history-action{height:100%;min-height:44px;min-width:68px}.pilot-history-action:not(:disabled){color:#8e2434}.pilot-history-row:has(>.pilot-history-item:only-child){grid-template-columns:minmax(0,1fr)}

.pilot-wake{margin:8px 0}.pilot-wake-row{display:flex;align-items:stretch;gap:8px}.pilot-wake-row label{display:flex;align-items:center;gap:8px;font-size:13px;line-height:1.3;min-height:44px;flex:1;min-width:0}.pilot-wake-row input{width:18px;height:18px;flex:none}.pilot-wake-row button{min-height:44px;font-size:12px}.pilot-wake small{display:block;font-size:12px;color:#607984}.pilot-note-dialog{width:min(460px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;border:1px solid #b6c9d1;border-radius:10px;padding:20px;color:#173d46}.pilot-note-dialog::backdrop{background:#102d4580}.pilot-note-dialog h2{font-size:19px;margin:0 0 12px}.pilot-note-dialog label{display:block;margin:12px 0 6px;font-size:14px;font-weight:600}.pilot-note-dialog select,.pilot-note-dialog textarea{font:inherit;font-size:16px;width:100%;max-width:100%;min-width:0;border:1px solid #b6c9d1;border-radius:6px;padding:10px;background:white;color:#173d46}.pilot-note-dialog select{height:44px}.pilot-note-dialog textarea{resize:vertical;min-height:92px}.pilot-note-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch}.pilot-note-actions button{min-height:44px;height:100%}#pilot-note-error{color:#8e2434;font-size:13px}.pilot-note-dialog .pilot-hint:empty{display:none}@media print{.pilot-note-dialog{display:none!important}}

.pilot-page button:disabled{cursor:default}.pilot-run-actions:has(#pilot-start[hidden]){grid-template-columns:minmax(0,1fr)}

.pilot-history-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch;margin-top:8px}.pilot-history-tools button{height:100%;min-height:44px;line-height:18px}.pilot-history-tools:has(#pilot-local-check[hidden]){grid-template-columns:minmax(0,1fr)}

/* Keep the document behind Safari's status area opaque; only the content panes scroll. */
@media screen{html:has(body.pilot-page),body.pilot-page{height:100%;overflow:hidden;background:#0d3440;overscroll-behavior:none}.pilot-page .pilot-header{position:fixed;inset:0 0 auto;z-index:1001;isolation:isolate;background:#0d3440;opacity:1;filter:none;backdrop-filter:none;-webkit-backdrop-filter:none}.pilot-page .pilot-layout{margin-top:calc(64px + var(--pilot-safe-top));min-height:0;overflow:hidden}.pilot-page .pilot-layout.show-report{overflow:auto}.pilot-page .pilot-sidebar,.pilot-page .pilot-report{overscroll-behavior:contain}.pilot-page .pilot-header a{min-height:44px;display:inline-flex;align-items:center}.pilot-history-item .pilot-upload-error{color:#8e2434}}
@media print{#pilot-report-upload-status{display:none!important}}

.pilot-report-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch;flex:0 1 430px;min-width:0}.pilot-report-nav :is(a,button){display:inline-flex;align-items:center;justify-content:center;min-width:0;height:100%;min-height:44px;margin:0;line-height:20px}@media(max-width:760px),(hover:none) and (pointer:coarse) and (orientation:portrait){.pilot-report-head h1{flex:1 1 100%}.pilot-report-nav{flex:1 1 100%;width:100%}}

.opening-report .pilot-layout{display:block}.opening-report .pilot-sidebar,.opening-report #pilot-map-wrap{display:none!important}.opening-report #pilot-report[hidden]{display:block!important;min-height:100%}.opening-report #pilot-report>.pilot-actions,.opening-report #pilot-report>.pilot-print-help,.opening-report #pilot-report-upload-status{display:none}

/* Keep controls centered when expanding history adds a scrollbar. */
.pilot-sidebar{scrollbar-gutter:stable both-edges}.pilot-run-actions button{display:flex;align-items:center;justify-content:center;line-height:20px}.pilot-run-actions{margin-inline:0}#pilot-history-details{margin-top:16px}#pilot-history-details>summary{cursor:pointer;min-height:44px;align-content:center}#pilot-start-status:empty,#pilot-save-status:empty{display:none}
#pilot-active-note{width:100%;min-height:44px;line-height:20px}

/* One compact control layout, in both the regular map and expanded map. */
@media screen {
 .pilot-page .pilot-sidebar {padding:12px 14px}
 .pilot-page .pilot-run-actions {gap:6px;margin:8px 0}
 .pilot-page .pilot-run-actions button {min-height:44px;padding:6px 8px;font-size:13px;line-height:18px}
 .pilot-page #pilot-summary {margin:4px 0 8px;font-size:12px;line-height:1.4}
 .pilot-page #pilot-latest {display:flex;align-items:center;justify-content:center;width:100%;min-height:44px;padding:6px 8px;font-size:13px;line-height:18px}
 .pilot-page .pilot-wake {margin:4px 0}
 .pilot-page .pilot-wake-row label {font-size:12px}
 .pilot-page #pilot-wake-status,.pilot-page #pilot-save-status,.pilot-page #pilot-notes-status {display:none}
 .pilot-page .is-running .pilot-run-actions,.pilot-page .is-running #pilot-start-status {display:none}
 .pilot-page .is-running .pilot-sidebar {padding-block:8px}
 .pilot-page .is-running #pilot-summary {margin-bottom:0}
 .pilot-page {--pilot-map-control-size:44px}
 .pilot-page #map .pilot-fullscreen {position:static;display:flex;align-items:center;justify-content:center;width:var(--pilot-map-control-size);height:var(--pilot-map-control-size);min-height:var(--pilot-map-control-size);padding:6px;border:1px solid #b6c9d1;color:#193c49;background:white;box-shadow:0 1px 6px #14394425}
 .pilot-fullscreen .fullscreen-exit,.pilot-fullscreen[aria-pressed="true"] .fullscreen-enter {display:none}
 .pilot-fullscreen[aria-pressed="true"] .fullscreen-exit {display:block}
 .pilot-page #map .leaflet-control-zoom {border:0;border-radius:7px;outline:1px solid #b6c9d1;box-shadow:0 1px 6px #14394425;overflow:hidden}
 .pilot-page #map .leaflet-control-zoom a {box-sizing:border-box;width:var(--pilot-map-control-size);height:var(--pilot-map-control-size);line-height:var(--pilot-map-control-size)}
 .pilot-page .follow-panel {width:min(460px,calc(100% - 24px));padding:8px 10px;max-height:calc(100% - 70px)}
 .pilot-page .follow-panel:is([data-phase="active"],[data-phase="starting"]) {grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:center}
 .pilot-page .follow-panel:is([data-phase="active"],[data-phase="starting"]) #follow-address {grid-column:1;grid-row:1;font-size:13px;line-height:17px}
 .pilot-page .follow-panel:is([data-phase="active"],[data-phase="starting"]) #follow-distance {grid-column:2;grid-row:1;margin:0;font-size:11px;line-height:17px;text-align:right;max-width:130px}
 .pilot-page .follow-panel #pilot-dwell {grid-column:1 / -1;grid-row:2;font-size:11px;line-height:16px;margin:0;font-weight:500}
 .pilot-page .follow-panel #follow-status {grid-column:1 / -1;grid-row:3;font-size:12px;line-height:16px;margin:0}
 .pilot-page .follow-panel .follow-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-column:1 / -1;grid-row:4;gap:6px;margin:2px 0 0;align-items:stretch}
 .pilot-page .follow-panel .follow-actions button {display:flex;align-items:center;justify-content:center;min-width:0;width:100%;height:100%;min-height:44px;padding:6px 8px;font-size:13px;line-height:16px;margin:0}
 .pilot-page .follow-panel #follow-compass {grid-column:1 / -1}
 .pilot-page .follow-panel[data-phase="starting"] #follow-stop {grid-column:1 / -1}
 .pilot-page.pilot-map-fullscreen {padding-top:var(--screen-safe-top);padding-bottom:env(safe-area-inset-bottom,0px)}
 .pilot-page.pilot-map-fullscreen > .pilot-header {display:none}
 .pilot-page.pilot-map-fullscreen > .pilot-layout {display:block;margin:0;min-height:0;overflow:hidden}
 .pilot-page.pilot-map-fullscreen .pilot-sidebar {display:none}
 .pilot-page.pilot-map-fullscreen #pilot-map-wrap {height:100%;width:100%}
}
@media screen and (min-width:761px) and (hover:hover) and (pointer:fine) {
 .pilot-page:not(.pilot-touch-device) {--pilot-map-control-size:36px}
 .pilot-page:not(.pilot-touch-device) .pilot-run-actions button,.pilot-page:not(.pilot-touch-device) #pilot-latest,.pilot-page:not(.pilot-touch-device) .pilot-fullscreen,.pilot-page:not(.pilot-touch-device) .follow-panel .follow-actions button {min-height:36px;padding:6px 8px}
}
@media screen and (orientation:portrait) {
 .pilot-page.pilot-touch-device .pilot-layout:not(.show-report):not(.needs-login) {display:flex;flex-direction:column}
 .pilot-page.pilot-touch-device .pilot-sidebar {flex:none;border-right:0;border-bottom:1px solid #dbe3e8;max-height:55dvh}
 .pilot-page.pilot-touch-device .map-wrap {flex:1;min-height:200px}
 .pilot-page.pilot-touch-device .pilot-heading h1 {font-size:18px}
 .pilot-page.pilot-touch-device.pilot-map-fullscreen .pilot-layout:not(.show-report):not(.needs-login) {display:block}
}
@media print {.pilot-fullscreen{display:none!important}}
