:root{
  --bg:#0b1220; --panel:#131c2e; --panel2:#1a2438; --line:#25324b;
  --ink:#e8edf6; --muted:#93a1bb; --accent:#4f9cf9; --ok:#31c48d; --warn:#f0a63a; --bad:#f2626b;
  --r:14px;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--ink);font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased}
#app{max-width:820px;margin:0 auto;padding:0 0 88px}
.boot{padding:40px;text-align:center;color:var(--muted)}

/* header */
.hdr{position:sticky;top:0;z-index:20;background:rgba(11,18,32,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);padding:12px 16px;display:flex;align-items:center;gap:12px}
.hdr h1{font-size:16px;margin:0;font-weight:650;letter-spacing:.2px}
.hdr .sub{font-size:12px;color:var(--muted)}
.spacer{flex:1}
.pill{font-size:11px;padding:3px 9px;border-radius:999px;border:1px solid var(--line);color:var(--muted);white-space:nowrap}
.pill.on{background:rgba(49,196,141,.14);border-color:rgba(49,196,141,.4);color:var(--ok)}
.pill.off{background:rgba(242,98,107,.12);border-color:rgba(242,98,107,.4);color:var(--bad)}
.pill.warn{background:rgba(240,166,58,.12);border-color:rgba(240,166,58,.4);color:var(--warn)}

/* layout */
.wrap{padding:16px}
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:16px;margin-bottom:14px}
.card h2{margin:0 0 4px;font-size:14px;letter-spacing:.3px;text-transform:uppercase;color:var(--muted);font-weight:600}
.row{display:flex;gap:10px;align-items:center}
.grid{display:grid;gap:10px}
.muted{color:var(--muted)}
.small{font-size:12px}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px}

/* controls */
button{font:inherit;cursor:pointer;border-radius:10px;border:1px solid var(--line);background:var(--panel2);color:var(--ink);padding:11px 14px;transition:.12s}
button:active{transform:scale(.985)}
button:disabled{opacity:.45;cursor:not-allowed}
button.primary{background:var(--accent);border-color:var(--accent);color:#04162e;font-weight:650}
button.ok{background:var(--ok);border-color:var(--ok);color:#04261a;font-weight:650}
button.bad{background:transparent;border-color:rgba(242,98,107,.5);color:var(--bad)}
button.wide{width:100%}
button.sm{padding:7px 11px;font-size:13px}
input,select,textarea{font:inherit;width:100%;padding:11px 12px;border-radius:10px;border:1px solid var(--line);background:#0e1626;color:var(--ink)}
textarea{min-height:74px;resize:vertical}
label{display:block;font-size:12px;color:var(--muted);margin:0 0 5px}
.field{margin-bottom:12px}

/* tabs */
.tabs{position:fixed;bottom:0;left:0;right:0;z-index:30;display:flex;background:rgba(13,20,35,.97);backdrop-filter:blur(12px);border-top:1px solid var(--line);padding:8px max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-bottom))}
.tabs button{flex:1;background:none;border:none;color:var(--muted);font-size:12px;padding:10px 2px;letter-spacing:.2px}
.tabs button.sel{color:var(--accent)}

/* stops */
.stop{display:flex;gap:12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel2);margin-bottom:10px}
.stop.done{opacity:.62;border-color:rgba(49,196,141,.35)}
.stop.next{border-color:var(--accent);box-shadow:0 0 0 1px rgba(79,156,249,.25)}
.seq{width:26px;height:26px;flex:none;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:700;background:var(--line);color:var(--ink)}
.stop.done .seq{background:var(--ok);color:#04261a}
.stop.next .seq{background:var(--accent);color:#04162e}
.addr{font-weight:600}
.svc{font-size:12px;color:var(--muted)}

/* map
   The slot is what a screen renders; the map element itself is owned by map.js and
   moved into the slot after each repaint, so the Google map is built once and keeps
   the zoom the crew set. Both carry the height, or the card collapses in the moment
   between the repaint and the re-parent. */
.mapslot{width:100%;height:260px;border-radius:12px;overflow:hidden;background:#0a1120;border:1px solid var(--line)}
.map{width:100%;height:260px;border-radius:12px;background:#0a1120;display:block;position:relative}
.offlineMapTag{position:absolute;right:8px;bottom:8px;font-size:10px;color:var(--muted);background:rgba(4,22,46,.75);padding:2px 7px;border-radius:6px}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:11px;color:var(--muted);margin-top:8px}
.dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:5px;vertical-align:middle}

/* table */
table{width:100%;border-collapse:collapse;font-size:12.5px}
th,td{text-align:left;padding:7px 6px;border-bottom:1px solid var(--line);vertical-align:top}
th{color:var(--muted);font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.3px}
.scroll{overflow-x:auto}

/* misc */
.thumb{width:74px;height:74px;object-fit:cover;border-radius:9px;border:1px solid var(--line)}
.thumbs{display:flex;gap:8px;flex-wrap:wrap}
#toast{position:fixed;left:50%;bottom:88px;transform:translateX(-50%);z-index:60;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.toast{background:#1f2b44;border:1px solid var(--line);padding:10px 16px;border-radius:999px;font-size:13px;box-shadow:0 8px 24px rgba(0,0,0,.45)}
.toast.bad{border-color:rgba(242,98,107,.55);color:#ffd7da}
.toast.ok{border-color:rgba(49,196,141,.55);color:#c9f5e4}
.banner{background:rgba(240,166,58,.12);border:1px solid rgba(240,166,58,.4);color:#ffdca6;padding:9px 13px;border-radius:10px;font-size:12.5px;margin-bottom:14px}
.login{max-width:390px;margin:0 auto;padding:44px 20px}
.brand{text-align:center;margin-bottom:26px}
.brand h1{margin:8px 0 2px;font-size:21px}
.acct{display:flex;justify-content:space-between;gap:8px;padding:9px 11px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);margin-bottom:7px;cursor:pointer;font-size:13px}
.acct:hover{border-color:var(--accent)}
.chain{font-family:ui-monospace,Menlo,monospace;font-size:10px;color:#5f7590}

/* ---- time on the job + parts used ----
   Both sit inside the stop card, on the working side of the Complete button. A crew
   records these while they are doing the job, not while filling in a form afterwards.
   Indented off the card's left edge so they read as detail about the stop above them
   rather than as two more stops. */
.jobBlk{margin-top:10px;padding:10px 11px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.02)}
.jobBlkHd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted);margin-bottom:8px}
.jobBlkHd strong{color:var(--ink);font-size:13px}
.partList{display:flex;flex-direction:column;gap:7px}
.partRow{display:flex;align-items:center;gap:9px;padding:8px 9px;border:1px solid var(--line);border-radius:9px;background:var(--panel2)}
.partName{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.qty{font-size:13px;font-weight:700;color:var(--accent);white-space:nowrap}
/* Wide enough for three digits, no wider — a quantity box that fills the row pushes
   the Add button off a phone screen. */
.qtyIn{width:64px;flex:0 0 auto;padding:8px 9px;text-align:center}
button.warn{border-color:rgba(240,166,58,.45);color:var(--warn)}
.outcomeList{display:flex;flex-direction:column;gap:6px}
.outcomeRow{display:flex;align-items:center;gap:9px;padding:9px 10px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);margin:0;color:var(--ink);font-size:13px;cursor:pointer}
.outcomeRow input{width:auto;flex:0 0 auto}

/* ================================================================ people screens
   Hours, HR & Training, Forms and Me (public/app/people.js). These arrived with the
   2026-08-21 slim-down and share four primitives: a tappable row, a big number, a
   progress bar and a sub-tab strip. Everything is sized for a gloved thumb - 44px is
   the smallest thing anyone is asked to hit. */

/* A whole card that is also a button. Resets the button chrome rather than styling a
   div as clickable, so it stays keyboard-reachable and announces itself as a button. */
.cardBtn{display:block;width:100%;text-align:left;font:inherit;color:inherit;cursor:pointer}
.cardBtn:active{transform:scale(.995)}

.listRow{display:flex;align-items:center;gap:11px;width:100%;min-height:52px;padding:11px 2px;
  background:none;border:none;border-bottom:1px solid var(--line);border-radius:0;color:inherit;
  font:inherit;text-align:left;cursor:pointer}
.listRow:last-child{border-bottom:none}
.listRow:active{background:rgba(255,255,255,.03)}
.listRow.static{cursor:default}
.listRow.static:active{background:none}
.chev{color:var(--muted);font-size:17px;flex:0 0 auto;line-height:1}

/* The headline number on the Hours screen. Tabular figures so it does not jitter as
   the running total ticks over. */
.statBig{font-size:34px;font-weight:700;letter-spacing:-.5px;margin:2px 0 4px;font-variant-numeric:tabular-nums;white-space:nowrap}

.bar{height:6px;border-radius:999px;background:var(--panel2);overflow:hidden;margin:12px 0 4px}
.bar span{display:block;height:100%;background:var(--accent);border-radius:999px}

/* Two-up label/value pairs. Grid rather than flex so the values line up down the
   column even when one label wraps. */
.kv{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.kv > div{display:flex;flex-direction:column;gap:2px}

.subtabs{display:flex;gap:7px;overflow-x:auto;padding-bottom:4px;margin-bottom:14px;-webkit-overflow-scrolling:touch}
.subtabs::-webkit-scrollbar{display:none}
.subtabs button{flex:0 0 auto;padding:8px 13px;font-size:13px;border-radius:999px;background:var(--panel);color:var(--muted)}
.subtabs button.sel{background:var(--accent);border-color:var(--accent);color:#04162e;font-weight:650}

.badge{display:inline-block;min-width:18px;padding:1px 6px;border-radius:999px;background:var(--line);
  color:var(--ink);font-size:11px;font-weight:700;text-align:center;line-height:16px}
.badge.warn{background:var(--warn);color:#2a1a02}
.subtabs button.sel .badge{background:rgba(4,22,46,.25);color:#04162e}

/* Count on the bottom tab bar. Absolute so it rides the label without changing the
   tab's width - a bar that reflows when a number appears is disorienting. */
.tabs button{position:relative}
.tabDot{position:absolute;top:2px;left:50%;margin-left:12px;min-width:16px;height:16px;line-height:16px;
  padding:0 4px;border-radius:999px;background:var(--warn);color:#2a1a02;font-size:10px;font-weight:700;text-align:center}

.hrIcon{width:38px;height:38px;flex:0 0 auto;border-radius:10px;background:var(--panel2);border:1px solid var(--line);
  display:grid;place-items:center;font-size:16px;color:var(--accent)}

/* 16:9 without an aspect-ratio dependency, because iOS Safari in the wild is old. */
.videoWrap{position:relative;width:100%;padding-top:56.25%;border-radius:12px;overflow:hidden;
  background:#000;border:1px solid var(--line);margin-bottom:6px}
.videoWrap iframe,.videoWrap video{position:absolute;inset:0;width:100%;height:100%;border:0;display:block}

/* Policy prose. Wider line height and a real paragraph rhythm - this is the one place
   in the app somebody actually reads more than a line. */
.doc{font-size:14.5px;line-height:1.62;color:var(--ink)}
.doc p{margin:0 0 12px}
.doc p:last-child{margin-bottom:0}

.formHead{font-size:12px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);font-weight:650;
  margin:20px 0 10px;padding-top:14px;border-top:1px solid var(--line)}
.field:first-child .formHead,.formHead:first-child{margin-top:0;padding-top:0;border-top:none}
.req{color:var(--bad);font-weight:700}

.checkList{display:flex;flex-direction:column;gap:6px}
.checkRow{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 11px;margin:0;
  border:1px solid var(--line);border-radius:10px;background:var(--panel2);
  color:var(--ink);font-size:13.5px;cursor:pointer}
.checkRow input{width:20px;height:20px;flex:0 0 auto;margin:0}
.checkRow:has(input:checked){border-color:rgba(79,156,249,.55);background:rgba(79,156,249,.09)}

.stepDot{width:24px;height:24px;flex:0 0 auto;border-radius:50%;display:grid;place-items:center;
  font-size:11px;font-weight:700;background:var(--line);color:var(--muted)}

.banner.warn{background:rgba(240,166,58,.14);border-color:rgba(240,166,58,.45)}
button.banner{display:block;width:100%;cursor:pointer;font:inherit}

/* Signature pad. The canvas is a fixed 600x200 internally and CSS-scaled to the screen,
   so the stroke stays the same weight on every phone and the stored PNG is a predictable
   size. touch-action:none is what stops the page scrolling under the finger mid-stroke. */
.sigWrap{position:relative;border:1px dashed var(--line);border-radius:10px;background:#0e1626;overflow:hidden}
.sigWrap.signed{border-style:solid;border-color:rgba(79,156,249,.5)}
.sigPad{display:block;width:100%;height:auto;aspect-ratio:3/1;touch-action:none;cursor:crosshair}
.sigHint{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;color:var(--muted);font-size:13px}
/* The hint has to go the moment the pen touches down, not on the next repaint —
   otherwise "Sign here with your finger" sits underneath the signature. */
.sigWrap.signed .sigHint{display:none}
/* ================================================================ phones
 *
 * Added 2026-08-23. The app is opened on a phone in a truck and had no media query
 * and no touch-size floor anywhere. These rules are last in the file so they win
 * without editing the ones above.
 */

/* THE ONE THAT ACTUALLY BIT PEOPLE. iOS Safari zooms the whole page in when a text
   field smaller than 16px takes focus, and then leaves it zoomed. Every input here
   inherited the body's 15px. 16px is the threshold, not a preference. */
input,select,textarea{font-size:16px}

/* Apple and Android both put the minimum comfortable target at 44px. Buttons were
   coming out at roughly 40, and the tab bar at 38. */
button{min-height:44px}
button.sm{min-height:36px}
.tabs button{min-height:48px;font-size:11.5px;padding:8px 4px;white-space:nowrap}

/* A tab label must never wrap. With a long label the flex row would rather scroll
   than stack a word onto a second line and shove the bar over the safe area. */
.tabs{overflow-x:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs button{flex:1 0 auto;min-width:64px}

/* The fixed tab bar sits on top of the last card. The bar itself already respects the
   home-indicator inset; the scroll container did not, so on a notched iPhone the final
   card hid behind it. */
#app{padding-bottom:calc(96px + env(safe-area-inset-bottom))}

/* Service addresses, emails and truck notes are arbitrary text in a narrow column.
   Without this a single long token widens the card and the whole page scrolls sideways. */
.addr,.svc,.muted,.card,.stop{overflow-wrap:anywhere}

/* Below this the 16px padding either side costs too much of the line. */
@media (max-width:420px){
  .wrap{padding:12px}
  .card{padding:13px;border-radius:12px}
  .hdr{padding:10px 12px;gap:8px}
  .hdr h1{font-size:15px}
  /* Stacked, not squeezed: two buttons side by side on a 360px screen leave neither
     wide enough to read or to hit. */
  .row.stack{flex-direction:column;align-items:stretch}
  .row.stack>*{width:100%}
}

/* Nothing may push the page sideways. */
html,body{overflow-x:hidden}


/* report a problem
   One control, top right of the sticky header, so it is on screen on every tab and at
   every scroll position. The panel is fixed and sits above the tab bar; it is appended
   to <body>, not to #app, so a repaint cannot take what was typed with it. */
/* Report a problem. Fixed at the bottom right, above the tab bar, on every screen.
   Ali 2026-08-28: the same control in the same corner as the admin console, "at the
   right button part of it". The tab bar is ~60px plus the home indicator, so the
   launcher clears it and the panel clears the launcher. */
.bugBtn{position:fixed;z-index:65;right:12px;bottom:calc(72px + env(safe-area-inset-bottom));
  background:var(--panel);border:1px solid var(--line);border-radius:999px;color:var(--muted);
  font:inherit;font-size:11px;padding:6px 12px;white-space:nowrap;cursor:pointer;
  box-shadow:0 2px 10px rgba(0,0,0,.35)}
.bugBtn:active{color:var(--ink);border-color:var(--accent)}
.bugPanel{position:fixed;z-index:70;left:12px;right:12px;bottom:calc(116px + env(safe-area-inset-bottom));max-width:520px;margin:0 auto;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:14px;box-shadow:0 18px 48px rgba(0,0,0,.55)}
.bugPanel.hidden{display:none}
.bugHead{display:flex;align-items:center;justify-content:space-between;font-size:13px;color:var(--muted);margin-bottom:9px}
.bugX{background:none;border:none;color:var(--muted);font:inherit;font-size:12px;text-decoration:underline;cursor:pointer;padding:0}
.bugNote{width:100%;background:var(--panel2);border:1px solid var(--line);border-radius:10px;color:var(--ink);font:inherit;font-size:13px;padding:9px 11px;resize:vertical}
.bugRow{display:flex;gap:10px;align-items:center;margin-top:9px}
.bugSend{background:var(--accent);border:none;border-radius:999px;color:#04142e;font:inherit;font-size:12.5px;font-weight:600;padding:8px 16px;cursor:pointer}
.bugSend:disabled{opacity:.55}
.bugMsg{color:var(--muted);font-size:12px}

.buildSwitch{display:flex;justify-content:flex-end;align-items:center;gap:6px;font-size:13px;margin:8px 0;white-space:nowrap}
.buildSwitch input{width:auto;height:auto;margin:0;flex:none}

/* Sign-in, as the platform's page (ppcrm 14cg): navy bands behind one white card. */
.authView{position:relative;display:flex;justify-content:center;align-items:flex-start;padding:12vh 16px 32px}
.authCard,.authCard *{box-sizing:border-box}
.authCard{width:100%;max-width:400px;background:var(--pp-white);color:var(--pp-ink);border:1px solid var(--pp-line);border-radius:12px;box-shadow:var(--pp-shadow);padding:28px 28px 30px}
.authLogo{display:block;height:52px;width:auto;margin:0 auto 18px;object-fit:contain}
.authTitle{margin:0;font-size:23px;font-weight:800;letter-spacing:-.02em;text-align:center;color:var(--pp-ink)}
.authSub{margin:4px 0 20px;font-size:13px;text-align:center;color:var(--pp-text-2)}
.gsiButton{display:flex;flex-direction:column;align-items:center;gap:10px;min-height:44px}
.authOr{display:flex;align-items:center;gap:10px;margin:18px 0 14px;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--pp-text-2)}
.authOr::before,.authOr::after{content:"";flex:1;height:1px;background:var(--pp-line)}
.gsiButton.hidden,.authOr.hidden{display:none}
.authForm{display:grid;gap:6px}
.authLabel{margin-top:8px;font-size:11.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--pp-text-2)}
.authLabelRow{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-top:8px}
.authLabelRow .authLabel{margin-top:0}
.authInput{width:100%;height:42px;padding:0 12px;background:var(--pp-white);color:var(--pp-ink);border:1px solid var(--pp-line-2);border-radius:8px;font:inherit;font-size:16px;outline:none}
.authInput::placeholder{color:var(--pp-text-2)}
.authInput:focus{border-color:var(--pp-accent);box-shadow:0 0 0 3px var(--pp-accent-soft)}
.authNote{margin:2px 0 0;font-size:12.5px;color:var(--pp-text-2)}
.authBtn{width:100%;height:42px;margin-top:14px;background:var(--pp-accent);color:var(--pp-white);border:1px solid var(--pp-accent);border-radius:8px;font:inherit;font-size:14px;font-weight:600;cursor:pointer}
.authBtn:hover{background:var(--pp-accent-hover)}
.authBtn:disabled{opacity:.55;cursor:default}
.authLink{background:none;border:0;padding:0;font:inherit;font-size:12.5px;font-weight:600;color:var(--pp-accent);cursor:pointer}
.authLink:hover{text-decoration:underline}
.authLink:disabled{opacity:.55;cursor:default}
.authLinks{display:flex;justify-content:space-between;gap:10px;margin-top:12px}
.authLinksEnd{justify-content:flex-end}
.authForm .authBtn + .authLinksEnd{margin-top:20px}
.authPw{position:relative}
.authPw .authInput{padding-right:42px}
.authEye{position:absolute;top:0;right:0;width:42px;height:42px;display:flex;align-items:center;justify-content:center;background:none;border:0;color:var(--pp-text-2);cursor:pointer}
.authEye:hover,.authEye[aria-pressed="true"]{color:var(--pp-accent)}
.authEye svg{width:18px;height:18px}

/* Jobs on the web, as the phone list: stop number, name, address, status. */
.jobRow{display:flex;align-items:center;gap:12px;width:100%;padding:12px 16px;background:none;border:0;border-top:1px solid var(--pp-line);text-align:left;font:inherit;color:inherit;cursor:pointer}
.jobRow:first-child{border-top:0}
.jobNo{flex:0 0 28px;height:28px;border-radius:50%;border:1px solid var(--pp-line-2);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600}
.jobNo.next{background:var(--pp-accent);border-color:var(--pp-accent);color:var(--pp-white)}
.jobText{flex:1;display:flex;flex-direction:column;gap:2px}
.linkBtn{background:none;border:0;padding:4px 0 10px;font:inherit;font-weight:600;color:var(--pp-accent);cursor:pointer}
.card textarea{width:100%;box-sizing:border-box;font:inherit;font-size:16px;padding:8px;border:1px solid var(--pp-line-2);border-radius:8px}
.authLinksEnd + .authLinksEnd{margin-top:8px}
.jobStatus{display:inline-flex;align-items:center;gap:6px;font-size:13px;margin-top:2px}
.jobDot{width:8px;height:8px;border-radius:50%;background:var(--pp-line-3)}
.jobDot.on{background:var(--pp-accent)}
.jobDot.ok{background:var(--pp-success)}
.jobDot.warn{background:var(--pp-warning)}
.jobDot.bad{background:var(--pp-danger)}
