/* Shared responsive layout for the pilot web app and /mobile. */
.mobile-masthead { display: none; }
.field-links { display: none; }
.mobile-entry { display: inline-flex; align-items: center; position: fixed; right: 16px; bottom: 16px; z-index: 800; padding: 10px 14px; border-radius: 12px; background: #244d96; color: #fff; text-decoration: none; box-shadow: 0 8px 25px #06173588; }
.field-app .mobile-entry, .field-app .side-note { display: none; }
.field-app .field-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.field-app .field-links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; color: #dbe9ff; background: #21375c; border-radius: 9px; text-decoration: none; }
.field-app .detail-panel { scroll-margin-top: 12px; }
.field-app form input, .field-app form select, .field-app form textarea { font-size: 16px; max-width: 100%; }
.device-live-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 8px; margin: 14px 0; }
.device-live-card { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border: 1px solid #446396; background: #13294e; border-radius: 13px; text-align: left; }
.device-live-copy { display: grid; flex: 1; min-width: 0; gap: 2px; }
.device-live-copy strong { font-size: 14px; }
.device-live-copy small, .device-live-copy > span { color: #b8c9e6; font-size: 11px; overflow-wrap: anywhere; }
.device-live-arrow { color: #bcd9ff; font-size: 11px; white-space: nowrap; }
.device-signal { color: #a8c9ff; font-weight: 650; }
.device-signal.warning { color: #ffca8a; }
.device-signal.waiting { color: #d7c8a6; }
.device-signal.empty { color: #a8b6cc; }
.map-device-detail { display: grid; gap: 5px; margin: 10px 0; padding: 12px 14px; border: 1px solid #405f9180; border-radius: 14px; background: #18335b; }
.map-device-detail[hidden] { display: none; }
.map-device-detail strong { color: #fff; font-size: 14px; }
.map-device-detail small { color: #b7c8e1; line-height: 1.4; }
.map-mobile-picker { display: none; }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.map-panel:fullscreen, .map-panel.map-expanded { display: flex; flex-direction: column; padding: 14px; background: #081832; border-radius: 0; }
.map-panel:fullscreen { width: 100vw; height: 100vh; }
.map-panel.map-expanded { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 2000; }
.map-panel:fullscreen .map-frame, .map-panel.map-expanded .map-frame { flex: 1; min-height: 0; }
.map-panel:fullscreen #track-map, .map-panel.map-expanded #track-map { height: 100%; min-height: 0; }
body.map-open { overflow: hidden; }
@media (max-width: 770px) {
 html { scroll-padding-top: 12px; }
 body { min-width: 320px; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
 main, .field-app main { max-width: 690px; margin: 0 auto; padding: 14px 16px 26px; }
 .mobile-masthead { display: flex; align-items: center; gap: 10px; min-height: 58px; margin-bottom: 10px; }
 .mobile-masthead img { width: 37px; height: 37px; object-fit: contain; }
 .mobile-masthead strong, .mobile-masthead small { display: block; }
 .mobile-masthead strong { font-size: 18px; line-height: 1.1; letter-spacing: .12em; }
 .mobile-masthead small { color: #a4b9dc; font-size: 8px; letter-spacing: .14em; }
 .mobile-masthead-label { margin-left: auto; color: #a7c4f3; background: #14294c; border: 1px solid #3e5b87; border-radius: 99px; padding: 5px 9px; font-size: 10px; letter-spacing: .1em; }
 .sidebar, .field-app .sidebar { position: fixed; inset: auto 0 0; width: 100%; max-width: none; height: auto; margin: 0; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); z-index: 900; overflow: visible; border: 0; border-top: 1px solid #5b79ae70; border-radius: 18px 18px 0 0; background: #08172ff5; box-shadow: 0 -12px 36px #071227a8; backdrop-filter: blur(18px); }
 .sidebar .brand, .sidebar .nav-caption, .sidebar .side-note { display: none; }
 .sidebar nav, .field-app .sidebar nav { display: grid; position: static; inset: auto; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 2px; padding: 0; border: 0; margin: 0; background: transparent; }
 .sidebar nav button, .field-app .sidebar nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 60px; padding: 5px 2px; border-radius: 12px; font-size: 10px; line-height: 1.15; white-space: normal; text-align: center; }
 .sidebar nav button[aria-current="true"] { background: #203e71; box-shadow: inset 0 0 0 1px #689de17d; }
 .sidebar .nav-icon { width: 26px; height: 26px; object-fit: contain; }
 .sidebar .nav-count { position: absolute; margin: -28px 0 0 27px; }
 .topbar { min-height: 37px; padding-bottom: 9px; }
 .breadcrumb { font-size: 11px; }
 #refresh { padding: 7px 10px; min-height: 34px; font-size: 11px; white-space: nowrap; }
 .page-title { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin: 18px 0 14px; }
 .page-title h1 { font-size: clamp(26px,7vw,32px); }
 .page-title p { line-height: 1.5; }
 .modebar { justify-content: flex-start; gap: 8px; }
 .modebar button { min-height: 38px; }
 .overview-stats, .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
 .overview-stat, .stat { min-height: 91px; padding: 12px; }
 .stat-copy span, .stat span { font-size: 11px; }
 .stat-copy strong, .stat strong { font-size: 25px; }
 .metric-icon { width: 34px; height: 34px; }
 .dashboard-feature, .dashboard-lower, .board, .tracking-layout, .overview-grid, .history-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
 .dashboard-feature { display: flex; flex-direction: column; }
 .dashboard-feature > .glass { width: 100%; flex: none; }
 .dashboard-feature > .glass { min-height: 0; }
 .feature-card { min-height: 235px !important; background-position: center; }
 .feature-copy { max-width: 210px; }
 .health-card .action-queue { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; margin-top: 12px; }
 .health-card .action-queue button { min-height: 52px; }
 .alert-card #overview-alarms { max-height: none; }
 .health-card, .alert-card { grid-column: auto; }
 .glass { padding: 16px; border-radius: 16px; }
 .tracking-layout .map-panel { order: 1; }
 .tracking-layout .map-selector { display: none; }
 .map-mobile-picker { display: grid; margin: 8px 0 12px; }
 .map-mobile-picker label { display: grid; gap: 5px; font-size: 12px; }
 .map-mobile-picker select { width: 100%; min-height: 44px; font-size: 16px; }
 .map-tools button { min-height: 38px; }
 .map-panel.map-expanded .map-mobile-picker, .map-panel:fullscreen .map-mobile-picker { margin-bottom: 9px; }
 .device-live-cards { grid-template-columns: minmax(0,1fr); }
 .table-wrap { max-width: 100%; overflow-x: auto; }
 #track-map { height: min(56vh,480px); min-height: 330px; }
 .map-toolbar { align-items: flex-start; }
 .map-toolbar button { min-height: 36px; }
 .toolbar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
 .toolbar .search { grid-column: 1/-1; }
 .toolbar > * { min-width: 0; }
 .list-panel, .detail-panel { min-width: 0; }
 .field-app #journey { display: block; }
 .field-app #journey[hidden] { display: none; }
 .field-app .board { display: grid; }
 .field-app .actions { display: grid; grid-template-columns: minmax(0,1fr); }
 .field-app #track-map { height: min(58vh,440px); min-height: 310px; }
 button, input, select { touch-action: manipulation; }
 input, select, textarea { max-width: 100%; }
 .mobile-entry { display: none; }
}
@media (max-width: 390px) {
 main, .field-app main { padding-inline: 12px; }
 .sidebar nav button, .field-app .sidebar nav button { font-size: 9px; }
 .sidebar .nav-icon { width: 23px; height: 23px; }
 .glass { padding: 13px; }
 .overview-stat { gap: 4px; }
}

@media (max-width: 720px) {
 #warehouse-in, #complete-stop { padding: 16px; margin-block: 14px; }
 #warehouse-in button, #complete-stop button { width: 100%; min-height: 48px; }
 .warehouse-status { margin-block: 14px; font-size: .91rem; }
}
