.app-shell {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 18px 14px 34px;
}

[hidden] { display: none !important; }

.topbar, .phone-status, .stage-tabs, .unit-title, .route-stats, .tool-row, .photo-actions, .sig-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Compact: one line of company + route number, small actions on the right. The old
   two-line "Route 3 - ePOD" heading plus a full-size Log out pushed the first useful
   thing on every screen a whole thumb-scroll down. */
.topbar { margin-bottom: 10px; align-items: flex-start; }
.topbar .eyebrow { margin-bottom: 0; font-size: 0.75rem; }
.topbar h1 { margin: 0; font-size: 1.35rem; line-height: 1.2; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; padding-top: 2px; }
.topbar-actions .text-button { min-height: 44px; padding: 0 8px; font-size: 0.85rem; }
.who-am-i { white-space: nowrap; font-size: 0.85rem; }
.app-version { white-space: nowrap; font-size: 0.75rem; }
.topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
.sync-panel { padding: 10px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 0.83rem; }
.sync-panel summary { cursor: pointer; font-weight: 800; }
.sync-panel p { margin: 7px 0; overflow-wrap: anywhere; }
.sync-error { color: #a13d2d; font-weight: 700; }
.sync-discard { min-height: 44px; padding: 0 8px; margin-left: 6px; font-size: 0.82rem; color: var(--red); text-decoration: underline; }
.drop-order-label { margin: 12px 3px 0; color: var(--muted); font-size: 0.84rem; font-weight: 800; }
.lock-reason { color: #8b4d0a !important; font-weight: 800; }
.checklist-tools { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 7px 9px; margin: 10px 0; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: 0 3px 12px rgba(16,24,32,.1); font-size: .85rem; }
.checklist-tools strong { min-width: 0; }
.checklist-tools button { flex: none; }

h1 { font-size: 1.7rem; }
h2 { margin-bottom: 4px; font-size: 1.18rem; }
h3 { margin-bottom: 3px; font-size: 1rem; }
.app-shell .primary-button, .app-shell .ghost-button { min-height: 48px; }
.app-shell .route-pick-list button, .app-shell .drop-card { min-height: 52px; }
.back-overview { display: inline-flex; align-items: center; margin: 4px 0 8px; padding-left: 4px; color: var(--brand); }

/* ---- Route picker: one card per route, Load / Drive buttons inside it ----------- */
.route-pick-list { display: grid; gap: 10px; margin-top: 10px; }
.route-pick-card {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.route-pick-card.is-complete { opacity: 0.6; background: #f4f6f7; }
.route-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.route-pick-head strong { font-size: 1.2rem; text-transform: uppercase; }
.route-pick-badge { flex: none; padding: 3px 9px; border-radius: 999px; background: #eef2f5; color: var(--muted); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.route-pick-badge.loading { background: var(--blue-soft); color: var(--blue); }
.route-pick-badge.loaded { background: var(--green-soft); color: var(--green); }
.route-pick-badge.out { background: var(--green); color: white; }
.route-pick-badge.done { background: #e2e6ea; color: var(--muted); }
.route-pick-lock-note { display: block; font-weight: 600; font-size: 0.82rem; color: var(--amber, #b45309); }
.route-pick-complete-note { display: block; font-weight: 600; color: var(--green, #1f8b59); }
.route-pick-meta { display: block; font-weight: 500; font-size: 0.86rem; color: var(--muted); overflow-wrap: anywhere; }
/* Load = blue (the loading side of the app), Drive = green (the delivering side):
   the same two colours the mode banner uses once a route is open, so the choice on
   the picker and the screen it leads to read as one thing. */
.route-pick-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 10px; }
.pick-action {
  min-height: 50px;
  padding: 0 12px;
  border-radius: 8px;
  border: 2px solid;
  background: white;
  font-weight: 800;
  font-size: 1rem;
}
.pick-action.pick-load { border-color: var(--blue); color: var(--blue); }
.pick-action.pick-drive { border-color: var(--green); color: var(--green); }
.pick-action.pick-load.is-primary { background: var(--blue); color: white; }
.pick-action.pick-drive.is-primary { background: var(--green); color: white; }
.pick-action:disabled { opacity: 0.45; cursor: not-allowed; background: #f2f4f6; border-color: var(--line); color: var(--muted); }
.route-pick-notes { display: grid; gap: 2px; margin-top: 6px; }
.route-pick-notes small::first-letter { text-transform: uppercase; }

.phone-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  box-shadow: 0 2px 12px rgba(16, 24, 32, 0.05);
}

/* ---- Mode banner: LOADING (blue) / DELIVERING (green) / COMPLETE (grey) --------- */
.mode-banner {
  display: grid;
  gap: 2px;
  margin: -10px -10px 10px;
  padding: 12px 14px;
  border-radius: 8px 8px 0 0;
  color: white;
}
.mode-banner strong { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.04em; }
.mode-banner span { font-size: 0.86rem; opacity: 0.95; }
.mode-banner.mode-loading { background: var(--blue); }
.mode-banner.mode-delivering { background: var(--green); }
.mode-banner.mode-done { background: #58656e; }
@media (max-width: 520px) { .mode-banner { border-radius: 0; } }

.phone-status {
  flex-wrap: wrap;
  padding: 9px 10px;
  border-radius: 6px;
  background: #f0f3f4;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}
/* One-glance color for the driver's only always-visible sync indicator -- "Synced" and
   "3 blocked - needs review" used to look identical (plain --ink text). synced/offline
   are calm on purpose (offline is an expected, working state, not a problem); blocked is
   the one that should actually catch the eye, since it means a write the server rejected
   outright is sitting there until someone looks at it. */
.sync-status { padding: 2px 8px; border-radius: 999px; }
.sync-status.synced { color: var(--green); }
.sync-status.offline { color: var(--amber); }
.sync-status.syncing { color: var(--blue); } /* matches the blue "Syncing…" item badges elsewhere in the app */
.sync-status.blocked { background: var(--red-soft); color: var(--red); }
/* A separate signal from sync-status above -- whether the periodic route poll itself
   is reaching the server, not the offline queue/navigator.onLine (see renderSyncStatus()
   in driver.mjs). Calm/muted normally; .stale (the poll is actively failing) gets the
   same "needs a look" amber treatment as the office portal's own contact-status text. */
#lastUpdated { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
#lastUpdated.stale { color: var(--amber); font-weight: 800; }
.departure-status { margin: 8px 2px 2px; color: var(--green); font-size: 0.84rem; font-weight: 800; }

.team-line-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 800;
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  text-align: left;
}

.route-panel { border: 0; padding: 10px 4px 4px; }
.route-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.route-panel-head h2 { margin: 0; font-size: 1.3rem; text-transform: uppercase; }
.route-panel-status { flex: none; color: var(--muted); font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.order-card, .pod-document {
  background: var(--surface);
}

.route-stats { flex-wrap: wrap; margin-top: 8px; }
.route-stats span { display: inline-flex; min-height: 26px; align-items: center; padding: 3px 9px; border-radius: 999px; background: #eef2f5; color: var(--muted); font-size: 0.82rem; font-weight: 800; }

.drop-list { display: grid; gap: 10px; margin-top: 10px; }
.drop-card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}
.drop-card.active { border-left-color: var(--brand); background: #fff8f9; }
.drop-card:disabled { background: #f1f3f5; cursor: not-allowed; }
.drop-card span { color: var(--muted); font-size: 0.88rem; }
/* A fully loaded (Ready for Departure) or fully delivered (POD complete) drop is
   greyed out to read as done at a glance, even though it can stay clickable (e.g. to
   review it before departure). .active wins over .complete's dimming so re-opening a
   finished drop doesn't look inactive. */
.drop-card.complete { border-left-color: var(--green); background: #f4f6f7; opacity: 0.8; }
.drop-done-label { color: #15693f; font-weight: 800; } /* darker than --green: 6.2:1 on a finished card, not 3.9:1 */
.drop-card.complete.active { opacity: 1; background: #fff8f9; }

/* Two numbered steps, coloured to match the mode banner: Load is blue, Deliver is
   green. Whichever step you're on is filled; the other is outlined (or greyed with
   the hint below saying why it's not available yet). */
.stage-tabs { margin: 12px 0 0; padding: 4px; border-radius: 9px; background: #e7edf2; }
.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px; /* 44px+ = the common minimum comfortable thumb target on a phone */
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 1rem;
}
.tab-step { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #c9d2da; color: white; font-size: 0.82rem; font-weight: 900; }
.tab.active { background: white; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 32, 0.1); }
.tab[data-stage="load"].active { box-shadow: inset 0 -3px var(--blue), 0 1px 3px rgba(16, 24, 32, 0.08); }
.tab[data-stage="load"].active .tab-step { background: var(--blue); }
.tab[data-stage="deliver"].active { box-shadow: inset 0 -3px var(--green), 0 1px 3px rgba(16, 24, 32, 0.08); }
.tab[data-stage="deliver"].active .tab-step { background: var(--green); }
.tab:not(:disabled):not(.active) { color: var(--ink); }
.tab:disabled:not(.active) { color: #8d979f; cursor: not-allowed; }
.stage-hint { margin: 6px 4px 0; color: var(--muted); font-size: 0.82rem; font-weight: 600; }

.job-header { padding: 7px 3px 14px; border-bottom: 1px solid var(--line); }
.job-header h2 { margin: 5px 0 7px; font-size: 1.3rem; }
.job-header p { margin: 5px 0; overflow-wrap: anywhere; }
.job-header address { margin: 8px 0; font-style: normal; line-height: 1.45; font-weight: 700; }
.job-header a { color: var(--green); font-weight: 800; }

.tool-row { margin: 10px 0; gap: 8px; }
.tool-row input[type="text"] { flex: 1; }
.remaining-toggle { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.remaining-toggle input { width: 18px; height: 18px; }

.stage { display: none; }
.active-stage { display: block; }

.order-card {
  margin-bottom: 10px;
  padding: 0 14px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.order-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.order-card > summary::-webkit-details-marker { display: none; }
.order-card > summary span:first-child { display: grid; min-width: 0; gap: 4px; }
.order-card small { color: var(--muted); font-size: 0.8rem; }
.chevron { width: 10px; height: 10px; flex: none; margin-right: 5px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.order-card[open] .chevron { transform: rotate(225deg); }

.order-progress { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.order-progress-bar { flex: 1; height: 6px; border-radius: 999px; background: #e7edf2; overflow: hidden; }
.order-progress-bar > span { display: block; height: 100%; background: var(--green); }
.order-progress-count { font-size: 0.82rem; color: var(--muted); font-weight: 800; white-space: nowrap; }

.mark-all-row { display: flex; justify-content: flex-end; margin-bottom: 6px; }

.unit-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.unit-card.is-complete { background: #f1f3f4; }
.unit-card.is-complete .unit-seq { border-color: #a7b0b6; color: #58656e; background: #e5e9eb; }
.unit-card.is-complete .unit-title h3,
.unit-card.is-complete p.location { color: #68747c; }
.unit-card.is-returned { background: #fff8ea; }
/* Fixed-size badge, top-aligned -- it used to stretch to the full row height, so a
   row with a long description or an open issue block became a tall empty box. */
.unit-seq { display: grid; width: 40px; height: 40px; place-items: center; border: 2px solid var(--ink); border-radius: 8px; font-weight: 900; font-size: 0.82rem; }
.unit-main { min-width: 0; }
.unit-title { align-items: flex-start; }
.unit-title h3 { margin: 0; overflow-wrap: anywhere; font-size: 0.92rem; line-height: 1.35; }
.unit-card input[type="checkbox"] { width: 26px; height: 26px; flex: none; accent-color: var(--green); }
/* The load/deliver tick is the single most-tapped control in the whole app -- dozens of
   times per route, often one-handed and outdoors -- so it's the one most worth a real
   44px+ hit area, not just a bigger visual box. The label wraps just the checkbox (no
   text) and uses padding + an equal negative margin to grow the actual clickable zone
   without shifting anything else in the row or changing the checkbox's visual size much. */
.tick-hit-area { display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 10px; margin: -10px; }
.unit-card p.location { margin: 2px 0; color: var(--green); font-weight: 800; font-size: 0.85rem; }

.unit-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.unit-tags:empty { display: none; }

/* One row of quiet secondary actions: "Report issue · Details" (+ "Customer refused"
   on delivery). Still ~36px tall tap targets, just side by side instead of stacked. */
.unit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; margin-top: 2px; font-size: 0.82rem; }
.unit-details { font-size: 0.82rem; }
.unit-details[open] { flex-basis: 100%; }
.unit-details summary { display: inline-flex; align-items: center; width: fit-content; min-height: 44px; color: var(--green); cursor: pointer; font-weight: 700; }
.unit-details-body p, .unit-details-body ul { margin: 4px 0; overflow-wrap: anywhere; }
.unit-details-body ul { padding-left: 18px; }
.unit-details-body { padding-bottom: 4px; }
.group-review { margin: 8px 0; padding: 9px; background: var(--amber-soft); border-radius: 6px; font-size: .82rem; }
.group-review p { margin: 0 0 5px; font-weight: 800; }
.group-review ul { margin: 0; padding-left: 18px; overflow-wrap: anywhere; }
.group-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
/* 44px is the common minimum recommended touch target (Apple HIG / Android Material) --
   these action buttons sit in a dense checklist a driver is tapping through quickly,
   often one-handed while holding a box, so a target that's genuinely easy to hit
   reliably matters more here than it would in a mouse-driven desktop UI. */
.group-actions button { min-height: 44px; padding: 6px 9px; border: 1px solid var(--ink); border-radius: 6px; background: white; font-weight: 700; }
.group-actions .confirm-group { color: white; background: var(--green); border-color: var(--green); }

.issue-block { margin-top: 6px; padding: 8px; border-radius: 6px; background: var(--amber-soft); }
.issue-block.resolved { background: var(--green-soft); }
.issue-block p { margin: 2px 0; font-size: 0.8rem; }
.resolve-issue-button { min-height: 44px; padding-left: 0; color: var(--brand); }

.issue-button { min-height: 44px; margin: 0; padding: 0; border: 0; background: none; color: var(--amber); font-weight: 700; font-size: 0.9rem; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.return-button { min-height: 44px; margin: 0; padding: 0; border: 0; background: none; color: #8b4d0a; font-weight: 700; font-size: 0.9rem; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }

.reference-list { padding: 10px 0 4px; border-top: 1px solid var(--line); }
.reference-list h3 { display: flex; justify-content: space-between; font-size: 0.9rem; }
.reference-list h3 span { color: var(--muted); }
.reference-list > p.hint { color: var(--muted); font-size: 0.8rem; margin: 2px 0 6px; }
.reference-row { padding: 5px 0; border-top: 1px solid var(--line); font-size: 0.82rem; }
.reference-row-top { display: flex; align-items: baseline; gap: 8px; }
.reference-row-top .ref-seq { color: var(--muted); min-width: 20px; flex: none; }
.reference-row-top strong { overflow-wrap: anywhere; }
.reference-row-desc { margin-top: 1px; color: var(--muted); font-size: 0.82rem; overflow-wrap: anywhere; }

.locked-notice { padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--muted); }

.arrival-prompt { padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: white; text-align: center; }
.arrival-prompt-title { margin: 0 0 6px; font-weight: 800; font-size: 1.05rem; }
.arrival-prompt p:not(.arrival-prompt-title) { margin: 0 0 4px; color: var(--muted); }
.arrival-prompt .primary-button { width: 100%; margin-top: 12px; }

/* Route complete: once every drop is signed off, an unmistakable "you're done, head
   back" state above the stage tabs -- no separate "confirm back at depot" step, just a
   state that's hard to miss (see the routeComplete check in stages.mjs's render()). */
.route-complete-banner { margin: 10px 2px 14px; padding: 14px 16px; border: 1px solid var(--green); border-radius: 8px; background: var(--green-soft); text-align: center; }
.route-complete-title { margin: 0 0 4px; font-weight: 800; font-size: 1.1rem; color: var(--green); }
.route-complete-banner p:not(.route-complete-title) { margin: 0; color: var(--ink); font-size: 0.86rem; }

/* Office-authored per-drop notes (exact location, access instructions -- see
   handleSetDropNotes server-side). Amber, matching the app's other "needs your
   attention" surfaces (issue blocks, the arrival prompt's sibling group-review box). */
.drop-note-box { margin: 10px 0; padding: 10px 12px; border-radius: 6px; background: var(--amber-soft); font-size: 0.86rem; }
.drop-note-box p { margin: 0; }
.drop-note-box p + p { margin-top: 4px; }
.drop-note-label { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--amber); }
.drop-note-meta { color: var(--muted); font-size: 0.82rem; }
.drop-note-chip { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; vertical-align: middle; }

.primary-button { width: 100%; margin-top: 12px; }

.photo-actions { margin: 6px 0; justify-content: flex-start; flex-wrap: wrap; }
.photo-button { display: inline-flex; align-items: center; min-height: 44px; }
/* Photos block above the sign-off form: available from arrival onwards. */
.delivery-photos { margin: 0 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.delivery-photos-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.delivery-photos-head .field-label { margin: 0; }
.delivery-photos-hint { margin: 2px 0 4px; font-size: 0.82rem; }
.delivery-photos .photo-actions .photo-button { flex: 1 1 140px; justify-content: center; }

#issueDialog { max-height: min(calc(100dvh - 24px), var(--issue-visual-height, 100dvh)); overflow-y: auto; }
#issueDialog .dialog-actions { position: sticky; bottom: 0; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); background: white; }

.pod-document { margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fffef8; }
.pod-subsection { margin-top: 18px; padding: 16px 4px 4px; border-top: 2px solid var(--line); }
.pod-subsection[hidden], .pod-document[hidden], #podForm[hidden] { display: none; }
.pod-document h2 { font-size: 1.05rem; }
.pod-document .muted { color: var(--muted); font-size: 0.85rem; }
.sig-actions { margin: 4px 0 6px; justify-content: flex-end; }

@media (max-width: 520px) {
  #issueDialog { position: fixed; top: var(--issue-visual-top, 12px); right: 0; bottom: auto; left: 0; margin: 0 auto; }
  .app-shell { padding: 10px 0 24px; }
  .topbar { padding: 0 12px; }
  .phone-shell { border-radius: 0; border-left: 0; border-right: 0; }
}

/* ---- Driver login screen ------------------------------------------------------ */
#driverLoginScreen select, #driverLoginScreen input { width: 100%; margin-bottom: 4px; }
#driverLoginScreen .primary-button { width: 100%; margin-top: 10px; }
.form-error { margin-top: 10px; padding: 8px 10px; border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: 0.85rem; }

.signature-declaration { margin: 0 0 6px; font-size: 0.8rem; font-style: italic; }
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.reason-chips button { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: 0.85rem; font-weight: 700; color: var(--ink); }
.reason-chips button:active { background: var(--blue-soft); }

/* Route changes (route-changes.mjs): drops the office skipped or cancelled, cancelled
   orders and the "loaded behind" hint. */
.rc-flag { display: inline-block; justify-self: start; margin-top: 2px; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem !important; font-weight: 800; }
.rc-skipped { background: var(--amber-soft); color: var(--amber) !important; }
.rc-cancelled { background: var(--red-soft); color: var(--red) !important; }
.rc-hint { color: #8b4d0a !important; font-size: 0.8rem !important; font-weight: 700; }
.rc-job-extras { display: grid; gap: 8px; margin-top: 10px; }
.rc-job-extras .rc-hint { margin: 0; }
.rc-notice { display: grid; gap: 2px; padding: 10px 12px; border-radius: 6px; font-size: 0.86rem; }
.rc-notice span { color: var(--ink); }
.rc-notice-skipped { background: var(--amber-soft); }
.rc-notice-cancelled { background: var(--red-soft); }
.rc-notice-cancelled strong { color: var(--red); }
.order-card.rc-order-cancelled { opacity: 0.72; background: #f1f3f5; }
.rc-order-note { display: grid; gap: 2px; margin: 0 12px 10px; padding: 8px 10px; border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: 0.85rem; font-weight: 800; }
.rc-order-note small { color: var(--ink); font-weight: 600; }

/* Separate loading */
.picker-hint { margin: -4px 0 8px; font-size: 0.85rem; }
.route-pick-loaded-note { display: block; color: var(--green); font-weight: 700; font-size: 0.82rem; }
/* "I'm driving this route too" on the loading-complete dialog. */
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fb; cursor: pointer; }
.checkbox-row input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--green); }
.checkbox-row span { display: grid; gap: 2px; font-size: 0.9rem; }
.checkbox-row small { color: var(--muted); font-size: 0.8rem; }
.loaded-status { background: var(--green-soft); color: var(--green); }
.release-loading { width: 100%; margin-top: 10px; color: var(--muted); }

/* Confirm arrival with a property photo, and the address card (address-card.mjs). */
.arrival-prompt .arrival-gallery { width: 100%; min-height: 44px; margin-top: 6px; color: var(--muted); font-weight: 700; }
.arrival-photo { display: block; width: 100%; max-height: 320px; margin: 8px 0; border-radius: 6px; object-fit: contain; background: #eef1f4; }
.arrival-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px; margin-top: 10px; }
.arrival-actions .primary-button, .arrival-actions .ghost-button { width: 100%; min-height: 48px; margin-top: 0; }
.address-card { margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 7px; background: white; }
.address-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.address-card-label { margin: 0; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); }
.address-card-count { color: var(--muted); font-size: 0.82rem; }
.address-card-body { display: flex; gap: 12px; margin-top: 8px; align-items: flex-start; }
.address-card-photo { position: relative; flex: none; width: 96px; height: 96px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #eef1f4; cursor: zoom-in; }
.address-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.address-card-photo span { position: absolute; left: 3px; bottom: 3px; padding: 1px 6px; border-radius: 999px; background: rgba(16, 24, 32, 0.75); color: white; font-size: 0.75rem; font-weight: 800; }
.address-card-main { flex: 1; min-width: 0; }
.address-card-notes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.address-card-notes p { margin: 0; font-size: 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.address-card-meta { display: block; margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; }
.address-card-empty { margin: 0; color: var(--muted); font-size: 0.86rem; }
.address-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.address-card-actions .ghost-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; }
.address-photo-dialog { width: min(96vw, 900px); }
.address-photo-dialog img { display: block; width: 100%; max-height: 75vh; object-fit: contain; border-radius: 6px; background: #eef1f4; }
.address-note-count { margin: 4px 0 0; text-align: right; font-size: 0.82rem; }
@media (max-width: 420px) { .address-card-photo { width: 76px; height: 76px; } }

/* The driver-notes group on the address card, set apart from the office notes above it
   (kept here rather than as an inline style on the label). */
.address-card-driver { margin-top: 10px; }

/* v0.8.19: each order's closed card says whether it's done or how many are left. */
.order-status { display: inline-flex; align-items: center; gap: 5px; justify-self: start; margin-top: 2px; padding: 2px 8px; border-radius: 999px; font-size: 0.82rem; font-weight: 800; }
.order-status.is-done { background: var(--green-soft); color: var(--green); }
.order-status.is-todo { background: var(--amber-soft); color: var(--amber); }
.order-card.order-done { border-left: 4px solid var(--green); }
.photo-count-short { color: var(--amber) !important; font-weight: 800; }
.photo-count-ok { color: var(--green) !important; font-weight: 800; }

/* ---- v0.8.20 ------------------------------------------------------------------------- */
/* Route picker grouped by day. */
.route-pick-day { margin: 10px 0 0; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.route-pick-day.is-today { color: var(--ink); }
.route-pick-list > .route-pick-day:first-child { margin-top: 0; }
.route-pick-hidden-note, .route-pick-none-today { margin: 6px 0 0; font-size: 0.82rem; }

/* Navigate / Call / Open job -- big enough for a gloved thumb. */
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.job-actions > a, .job-actions > button { flex: 1 1 140px; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 1rem; font-weight: 800; }
.job-contact { margin: 4px 0 0; }

/* The delivery overview's next stop. */
.next-stop-card { margin: 10px 0 12px; padding: 14px; border: 2px solid var(--green); border-radius: 10px; background: var(--green-soft); }
.next-stop-card .eyebrow { margin: 0 0 2px; color: var(--green); }
.next-stop-card h2 { margin: 0 0 4px; font-size: 1.25rem; }
.next-stop-card address { font-style: normal; font-weight: 700; }
.next-stop-note { margin: 6px 0 0; padding: 6px 8px; border-radius: 6px; background: var(--amber-soft); color: var(--ink); font-size: 0.88rem; }

/* What's coming back to the depot. */
.returns-list { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--amber); border-radius: 8px; background: var(--amber-soft); }
.returns-list .eyebrow { margin: 0 0 6px; color: var(--amber); }
.returns-list ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 0.9rem; }
.returns-list p { margin: 8px 0 0; font-size: 0.82rem; }
.returns-reason { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: white; color: var(--amber); font-size: 0.75rem; font-weight: 800; }

/* Offline / can't send -- hard to miss, only when something's wrong. */
.offline-bar { margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; font-weight: 800; font-size: 0.92rem; }
.offline-bar.is-warn { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber); }
.offline-bar.is-bad { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); }

/* Bigger tick boxes (the hit area was already 44px+; the box itself is now easier to see
   and hit with gloves). */
.unit-card input[type="checkbox"] { width: 34px; height: 34px; }
.tick-hit-area { padding: 12px; margin: -12px; }

/* Top bar on a phone: the title keeps to one line; version, name and Log out wrap under
   it rather than squeezing it. */
@media (max-width: 480px) {
  .topbar { flex-wrap: wrap; row-gap: 4px; }
  .topbar h1 { white-space: nowrap; font-size: 1.2rem; }
  .topbar-actions { flex: 1 1 auto; justify-content: flex-end; gap: 6px; }
  .app-version { font-size: 0.75rem; }
}
.job-actions > a.ghost-button { color: var(--ink); border: 2px solid var(--ink); background: white; }

/* Tap targets and text size for outdoor use (v0.8.36): every driver button at least
   44 px tall and no text below 0.75 rem. Dialogs sit outside .app-shell, so they need
   their own rule -- their buttons used to get the shared 40 px. */
dialog .primary-button, dialog .ghost-button, dialog .danger-button { min-height: 48px; }
dialog .dialog-actions .primary-button { margin-top: 0; }
.app-shell .text-button, .team-line-button { min-height: 44px; }
.thumb .thumb-status { font-size: 0.75rem; }
