/* JetBrains Mono for numbers, IDs and money, as in the mockup. Inter itself comes from app.css. */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* Fulfillment order page (#932). Loaded from App.razor's static head, not the page: HeadContent CSS
   doesn't ship on a full refresh. Shared by FulfillmentOrderDetail and its child cards (dispatch, Rx viewer,
   invoice, dialogs), which is why it isn't scoped CSS.

   Density: Comfortable is the default; .fo.is-compact tightens the same cards. CSS only, one layout.
   Pharmacist pages have no dark mode, so there is no dark set here; the tokens below point at the
   portal's own --nx-* values. */

:root {
    --fo-surface: #fff;
    --fo-surface-2: #fafafa;
    --fo-sunken: #f3f3f5;
    --fo-border: var(--nx-border, #e5e5ea);
    --fo-border-strong: #d2d2d7;
    --fo-text: #1d1d1f;
    --fo-text-2: #3a3a3c;
    --fo-muted: #6e6e73;
    --fo-faint: #8e8e93;
    --fo-ink: var(--nx-primary, #1a1a1a);
    --fo-green: var(--nx-accent-green, #119555);
    --fo-green-bg: var(--nx-accent-green-bg, #dbf6e8);
    --fo-amber: #8a5a00;
    --fo-amber-bg: var(--nx-accent-amber-bg, #fff3e0);
    --fo-orange: #f97316;
    --fo-red: var(--nx-accent-red, #dc3545);
    --fo-red-bg: var(--nx-accent-red-bg, #fee2e2);
    --fo-blue: var(--nx-accent-blue, #0369a1);
    --fo-blue-bg: var(--nx-accent-blue-bg, #e0f2fe);
    /* The phone action bar's next-step button (PM pick, 2026-10-29). */
    --fo-main: #6d28d9;
    --fo-r: 12px;
    --fo-r-sm: 8px;
    --fo-gap: 16px;
    --fo-pad-x: 16px;
    --fo-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --fo-bg: #f5f5f7;
    --fo-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
}

/* The mockup's cool grey page instead of the portal's warm beige, on this page only. The layout paints its
   wrapper with var(--nx-bg-warm), so redefining the token reaches it too. */
body:has(.fo) { --nx-bg-warm: var(--fo-bg); --bs-body-bg: var(--fo-bg); background-color: var(--fo-bg); }

/* Tokens live on :root because the dialogs and the not-found state render outside .fo. */
.fo {
    container: fo / inline-size;
    display: flex;
    flex-direction: column;
    gap: var(--fo-gap);
    color: var(--fo-text);
    font-family: Inter, system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 8px;
}
.fo.is-compact { --fo-gap: 10px; --fo-pad-x: 12px; font-size: 13px; }

.fo :focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; border-radius: 6px; }
.fo-mono { font-family: var(--fo-mono); font-size: .92em; }
.fo-muted, .fo-sub { color: var(--fo-muted); }
.fo-sub { font-size: 12px; }
.fo-text { color: var(--fo-text); }
.fo-grow { flex: 1; min-width: 0; }

/* ── App bar ── */
.fo-app-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fo-back { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--fo-border); background: var(--fo-surface); padding: 6px 12px; border-radius: 999px; color: var(--fo-text-2); font-size: 13px; text-decoration: none; min-height: 32px; }
.fo-back:hover { background: var(--fo-sunken); color: var(--fo-text); }
.fo-crumb { color: var(--fo-muted); font-size: 13px; }
.fo-crumb b { color: var(--fo-text); font-weight: 500; }
.fo-seg { display: inline-flex; background: var(--fo-sunken); border-radius: 8px; padding: 2px; }
.fo-seg button { background: none; border: 0; color: var(--fo-muted); padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.fo-seg button[aria-pressed="true"] { background: var(--fo-surface); color: var(--fo-text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ── Order header ── */
.fo-order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--fo-surface); border: 1px solid var(--fo-border); border-radius: var(--fo-r); padding: 16px 18px; box-shadow: var(--fo-shadow); }
.fo-eyebrow { display: flex; gap: 8px; align-items: center; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fo-muted); }
.fo-order-title { font-size: 20px; font-weight: 600; margin: 4px 0 2px; letter-spacing: -.01em; }
.fo-order-sub { font-size: 12.5px; color: var(--fo-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fo-order-when { display: inline-flex; align-items: center; gap: 5px; }
.fo-delivery-pill { font-size: 12px; font-weight: 600; color: var(--fo-text); }
.fo-delivery-pill.is-amber { color: var(--fo-amber); }
.fo-delivery-pill svg { width: 13px; height: 13px; }
.fo-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fo-head-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* Compact keeps the Comfortable header card on purpose (PM, 2026-10-28). */

/* ── Pills ── */
.fo-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--fo-sunken); color: var(--fo-text-2); white-space: nowrap; }
.fo-pill.is-green { background: var(--fo-green-bg); color: var(--fo-green); }
.fo-pill.is-amber { background: var(--fo-amber-bg); color: var(--fo-amber); }
.fo-pill.is-red { background: var(--fo-red-bg); color: var(--fo-red); }
.fo-pill.is-blue { background: var(--fo-blue-bg); color: var(--fo-blue); }
.fo-pill.is-chan { font-family: var(--fo-mono); font-size: 10.5px; letter-spacing: .03em; background: var(--fo-ink); color: #fff; }
.fo-pill.is-chan.is-ns { background: var(--fo-blue-bg); color: var(--fo-blue); }
.fo-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Layout: 55 / 45 on desktop ── */
.fo-grid { display: grid; grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); gap: var(--fo-gap); align-items: start; }
.fo-col { display: flex; flex-direction: column; gap: var(--fo-gap); min-width: 0; }

/* ── Cards ── */
.fo-card { background: var(--fo-surface); border: 1px solid var(--fo-border); border-radius: var(--fo-r); box-shadow: var(--fo-shadow); min-width: 0; }
.fo-card-t svg { flex: none; align-self: center; }
.fo-card-b.is-oneline { padding: 12px var(--fo-pad-x); }
.fo-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px var(--fo-pad-x) 0; }
.fo-card-t { font-size: 13px; font-weight: 600; margin: 0; display: flex; align-items: baseline; gap: 8px; letter-spacing: -.005em; }
.fo-card-b { padding: 12px var(--fo-pad-x) 16px; }
.fo-card-b.is-flush { padding: 8px 0 4px; }
.fo.is-compact .fo-card-h { padding-top: 9px; }
.fo.is-compact .fo-card-t { font-size: 12.5px; }
.fo.is-compact .fo-card-b { padding-top: 7px; padding-bottom: 10px; }
.fo.is-compact .fo-card-b.is-flush { padding: 4px 0 2px; }

.fo-empty { font-size: 13px; color: var(--fo-muted); display: flex; align-items: center; gap: 8px; }
.fo-link { color: var(--fo-blue); text-decoration: none; overflow-wrap: anywhere; }
.fo-link:hover { text-decoration: underline; }
.fo-link.is-quiet { color: var(--fo-text-2); }
.fo-link svg, .fo-link-btn svg { vertical-align: -1px; }
.fo-center { text-align: center; }
.fo-alt-link { margin-top: 10px; text-align: center; }
.fo-link-btn { background: none; border: 0; padding: 0; color: var(--fo-muted); font-size: 12.5px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.fo-link-btn:hover { color: var(--fo-text); }
.fo-link-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Patient */
.fo-patient-name { font-size: 15.5px; font-weight: 600; color: #0a58ca; } /* #986: patient name blue */
.fo-patient-name .fo-link-btn { margin-left: 6px; vertical-align: middle; font-weight: 400; } /* #1002: copy name */
.fo-contact-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 13px; color: var(--fo-text-2); }
.fo-contact-row > span { display: inline-flex; align-items: center; gap: 6px; }
.fo-contact-row > span > svg { color: var(--fo-muted); }
/* The patient's number is what the pharmacist reads out and dials, so it sits just under the name (15.5px). */
.fo-contact-row .fo-mono { font-size: 15px; font-weight: 500; }
/* Name and contacts on the left, scan-to-call QR on the right (FulfillmentCallQr). */
.fo-patient-b { display: flex; align-items: flex-start; gap: 16px; }
.fo-patient-main { flex: 1; min-width: 0; }
.fo-call-qr { flex: none; padding: 4px; background: #fff; border: 1px solid var(--fo-border); border-radius: 8px; }
.fo-call-qr img, .fo-call-qr canvas { display: block; width: 56px; height: 56px; }
.fo.is-compact .fo-call-qr img, .fo.is-compact .fo-call-qr canvas { width: 48px; height: 48px; }
/* Compact: name on its own line, phone and email side by side under it. */
.fo.is-compact .fo-patient-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.fo.is-compact .fo-patient-main .fo-patient-name { flex-basis: 100%; }
.fo.is-compact .fo-patient-name { font-size: 15.5px; }
.fo.is-compact .fo-contact-row { margin-top: 0; }

/* Items */
.fo-item { display: flex; align-items: center; gap: 12px; padding: 10px var(--fo-pad-x); }
.fo-item + .fo-item { border-top: 1px solid var(--fo-border); }
.fo-thumb { width: 36px; height: 36px; border-radius: 8px; background: var(--fo-sunken); display: grid; place-items: center; color: var(--fo-faint); flex: none; }
.fo-item-main { flex: 1; min-width: 0; }
.fo-item-name { font-weight: 500; overflow-wrap: anywhere; }
.fo-item-variant { font-weight: 400; color: var(--fo-text-2); margin-left: .3em; }
.fo-item-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.fo-qty { font-family: var(--fo-mono); font-size: 13px; color: var(--fo-text-2); white-space: nowrap; }
.fo-item.is-refunded .fo-item-name { text-decoration: line-through; color: var(--fo-muted); }
.fo.is-compact .fo-item { padding-top: 6px; padding-bottom: 6px; gap: 10px; }
.fo.is-compact .fo-thumb { width: 26px; height: 26px; border-radius: 6px; }

/* Discount */
.fo-id-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px; border: 1px solid var(--fo-border); border-radius: var(--fo-r-sm); background: var(--fo-surface-2); }
.fo-id-links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fo.is-compact .fo-id-row { padding: 6px 8px; }
.fo-inline-form { margin-top: 12px; padding: 12px; border: 1px solid var(--fo-border); border-radius: 10px; background: var(--fo-surface-2); display: flex; flex-direction: column; gap: 8px; }
.fo-inline-form.is-compact { margin-top: 10px; padding: 8px 10px; gap: 6px; }
.fo-compact-t { font-size: 12px; font-weight: 600; color: var(--fo-text-2); display: flex; align-items: center; }
.fo-track-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fo-track-row .fo-input { padding: 6px 8px; font-size: 12.5px; min-height: 32px; }
.fo-track-row .fo-track-courier { flex: 0 0 128px; width: 128px; }
.fo-track-row .fo-track-cost { flex: 0 0 84px; width: 84px; }
.fo-track-row .fo-track-url, .fo-track-row .fo-track-note { flex: 1 1 160px; }

/* Address */
.fo-address { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }

/* ── Billing (FulfillmentInvoiceCard + FulfillmentLineBilling) ── */
.fo-bill .ns-invoice-line { font-size: 13px; }
.fo-bill .ns-invoice-calculations, .fo-bill .ns-invoice-sales { padding: 6px var(--fo-pad-x); color: var(--fo-text-2); }
.fo-bill .ns-invoice-sales { border-top: 1px dashed var(--fo-border); }
.fo-bill dd { color: var(--fo-text); }
.fo-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px var(--fo-pad-x) 4px; border-top: 1px solid var(--fo-border); }
.fo-total-lbl { font-size: 13px; font-weight: 600; }
.fo-total-amt { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fo.is-compact .fo-total { padding-top: 8px; }
.fo.is-compact .fo-total-amt { font-size: 18px; }
.fo.is-compact .fo-bill .ns-invoice-summary-row { padding: 1px 0; font-size: 12px; }
.fo.is-compact .fo-bill .ns-invoice-line { padding-top: 4px !important; padding-bottom: 4px !important; }
.fo .nx-items-table { font-size: 12.5px; margin-bottom: 0; }
.fo .nx-items-table thead th { background: var(--fo-surface-2); color: var(--fo-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.fo .nx-items-table tbody td { padding: .55rem .65rem; border-bottom: 1px solid var(--fo-border); }
.fo .nx-items-table tfoot td { background: var(--fo-surface-2); padding: .5rem .65rem; }

/* ── Dispatch card ── */
.fo-h-right { display: flex; align-items: center; gap: 4px; margin-right: -6px; }
.fo-icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; cursor: pointer; color: var(--fo-muted); }
.fo-icon-btn:hover:not([disabled]) { background: var(--fo-sunken); color: var(--fo-text); }
.fo-icon-btn[disabled] { opacity: .45; cursor: not-allowed; }
.fo-icon-btn.is-spinning svg { animation: fo-spin 1s linear infinite; }
@keyframes fo-spin { to { transform: rotate(360deg); } }

.fo-courier-list { display: flex; flex-direction: column; gap: 8px; }
.fo-courier-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--fo-border); border-radius: 10px; background: var(--fo-surface); font: inherit; color: inherit; cursor: pointer; }
.fo-courier-opt:hover:not([disabled]) { border-color: var(--fo-border-strong); }
/* Selected: a soft fill and a firmer grey edge, not a black frame (PM, 2026-11-10). */
.fo-courier-opt[aria-checked="true"] { border-color: var(--fo-border-strong); background: var(--fo-surface-2); }
.fo-courier-opt[disabled] { cursor: default; }
.fo-courier-opt:not([role]) { cursor: default; }
.fo-radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--fo-border-strong); flex: none; display: grid; place-items: center; }
.fo-courier-opt[aria-checked="true"] .fo-radio { border-color: var(--fo-ink); }
.fo-courier-opt[aria-checked="true"] .fo-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fo-ink); }
.fo-logo { width: 32px; height: 32px; border-radius: 8px; background: var(--fo-ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.fo-logo.is-lalamove { background: #f16622; }
.fo-logo.is-grab { background: #00b14f; }
.fo-logo.is-angkas { background: #1b4fa0; }
.fo-courier-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fo-courier-name { font-weight: 600; }
.fo-tag { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--fo-green-bg); color: var(--fo-green); margin-left: 6px; vertical-align: 1px; }
.fo-fee { font-family: var(--fo-mono); font-weight: 500; font-size: 14px; white-space: nowrap; }
.fo-skeleton { display: inline-block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--fo-sunken), var(--fo-border), var(--fo-sunken)); background-size: 200% 100%; animation: fo-sk 1.2s infinite; }
@keyframes fo-sk { to { background-position: -200% 0; } }
.fo-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.fo.is-compact .fo-courier-opt { padding: 8px 12px; }
.fo.is-compact .fo-logo { width: 26px; height: 26px; font-size: 12px; }
.fo.is-compact .fo-stack { margin-top: 8px; }

.fo-booked { border: 1px solid var(--fo-border); border-radius: 10px; overflow: hidden; }
.fo-booked-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; }
.fo-booked-name { font-weight: 600; }
.fo-rider { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--fo-border); background: var(--fo-surface-2); font-size: 13px; }
.fo-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--fo-sunken); display: grid; place-items: center; color: var(--fo-muted); flex: none; }
.fo-avatar.is-photo { width: 40px; height: 40px; object-fit: cover; }
.fo-avatar.is-initials { width: 40px; height: 40px; font-weight: 600; font-size: 14px; color: var(--fo-text); }
.fo-plate { border: 1px solid var(--fo-border); border-radius: 4px; padding: 0 5px; }
.fo-steps { display: flex; list-style: none; margin: 0; padding: 12px 14px; border-top: 1px solid var(--fo-border); }
/* Progress (PM, 2026-11-10): small monochrome dots, thin lines; the current step is a solid dot with a soft halo. */
.fo-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 11px; color: var(--fo-faint); position: relative; text-align: center; }
.fo-step::before { content: ""; position: absolute; top: 4px; left: -50%; right: 50%; height: 1.5px; background: var(--fo-border); }
.fo-step:first-child::before { display: none; }
.fo-step i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--fo-border-strong); background: var(--fo-surface); position: relative; z-index: 1; box-sizing: border-box; }
.fo-step.is-done { color: var(--fo-text-2); }
.fo-step.is-done i { background: var(--fo-text-2); border-color: var(--fo-text-2); }
.fo-step.is-done::before, .fo-step.is-now::before { background: var(--fo-text-2); }
.fo-step.is-now { color: var(--fo-text); font-weight: 500; }
.fo-step.is-now i { background: var(--fo-ink); border-color: var(--fo-ink); box-shadow: 0 0 0 4px rgba(29, 29, 31, .10); animation: fo-step-pulse 1.8s ease-in-out infinite; }
@keyframes fo-step-pulse { 50% { box-shadow: 0 0 0 6px rgba(29, 29, 31, .03); } }
@media (prefers-reduced-motion: reduce) { .fo-step.is-now i { animation: none; } }
.fo.is-compact .fo-booked-top, .fo.is-compact .fo-steps { padding: 8px 12px; }
.fo.is-compact .fo-rider { padding: 6px 12px; }
/* Lalamove's proof-of-delivery photo on a delivered booking; opens full size in a new tab. */
.fo-pod { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--fo-border); color: var(--fo-text); font-size: 13px; text-decoration: none; }
.fo-pod img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--fo-border); background: var(--fo-sunken); }

/* Booking details (PM/Bryan, 2026-11-10): who booked it, the route and the pin, so a booking is never a black box. */
.fo-booked-by { color: var(--fo-muted); font-size: 12px; margin-top: 1px; }
.fo-booked-by b { color: var(--fo-text); font-weight: 500; }
.fo-trip { border-top: 1px solid var(--fo-border); padding: 8px 14px; display: flex; gap: 12px; align-items: center; }
.fo-trip-route { flex: 1; min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.fo-trip-route li { display: grid; grid-template-columns: 14px 58px minmax(0, 1fr); gap: 6px; align-items: baseline; position: relative; }
.fo-trip-route li > i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--fo-text-2); background: var(--fo-surface); box-sizing: border-box; align-self: center; justify-self: center; }
.fo-trip-route li.is-drop > i { background: var(--fo-text-2); }
.fo-trip-route li:first-child::after { content: ""; position: absolute; left: 6px; top: calc(50% + 6px); height: calc(100% - 4px); border-left: 1.5px solid var(--fo-border-strong); }
.fo-trip-k { color: var(--fo-muted); font-size: 12px; }
.fo-trip-v { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.fo-trip-map { flex: none; width: 96px; height: 52px; border-radius: 8px; overflow: hidden; border: 1px solid var(--fo-border); position: relative; display: block; background: var(--fo-sunken); }
.fo-trip-tiles { position: absolute; left: var(--tx); top: var(--ty); width: 768px; height: 768px; pointer-events: none; }
.fo-trip-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; }
.fo-trip-pin { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -12px 0 0 -6px; background: var(--fo-ink); border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.fo-trip-osm { position: absolute; left: 2px; top: 1px; font-size: 7px; line-height: 1.3; color: #555; background: rgba(255, 255, 255, .7); padding: 0 2px; border-radius: 2px; }
.fo-trip-open { position: absolute; right: 3px; bottom: 3px; font-size: 10px; font-weight: 500; line-height: 1.5; background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--fo-text); padding: 0 5px; border-radius: 4px; }
.fo-trip-of { border-top: 1px solid var(--fo-border); padding: 8px 14px; font-size: 12.5px; background: var(--fo-surface-2); color: var(--fo-text-2); display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.fo-trip-of a { color: var(--fo-text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--fo-border-strong); text-underline-offset: 2px; }
.fo-trip-of b { color: var(--fo-text); font-weight: 600; }
.fo-trip-stops { display: inline-flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; font-family: var(--fo-mono); font-size: 12px; }
.fo-trip-arrow { color: var(--fo-faint); }
.fo-finding { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--fo-border); font-size: 13px; }
.fo-finding .fo-spinner { color: var(--fo-faint); width: 16px; height: 16px; }
.fo.is-compact .fo-trip, .fo.is-compact .fo-trip-of, .fo.is-compact .fo-finding { padding: 6px 12px; }
/* Combine orders into one trip (#977): plain list on a soft fill, monochrome controls. */
.fo-batch { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: var(--fo-surface-2); border: 1px solid var(--fo-border); }
.fo-batch-t { font-size: 12px; font-weight: 600; color: var(--fo-text-2); }
.fo-batch-stops { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fo-batch-stop { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--fo-surface); border: 1px solid var(--fo-border); border-radius: 8px; font-size: 13px; min-width: 0; }
.fo-batch-n { width: 20px; height: 20px; border-radius: 50%; background: var(--fo-sunken); color: var(--fo-text-2); font-size: 11px; font-weight: 600; display: grid; place-items: center; flex: none; }
.fo-batch-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fo-batch-stop .fo-batch-name { display: block; }
.fo-batch-addr { font-size: 12px; color: var(--fo-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fo-batch-acts { display: flex; gap: 2px; flex: none; }
.fo-icon-btn.is-sm { width: 28px; height: 28px; font-size: 13px; color: var(--fo-text-2); }
.fo-batch-cands { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--fo-border); }
.fo-batch-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.fo-batch-cand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; margin: 0; }
.fo-batch-cand:hover { background: var(--fo-sunken); }
.fo-batch-cand.is-off { opacity: .5; cursor: not-allowed; }
.fo-batch-who { overflow: hidden; text-overflow: ellipsis; }
.fo-check { width: 16px; height: 16px; accent-color: var(--fo-ink); flex: none; margin: 0; }



.fo-blocked { display: flex; gap: 10px; padding: 12px; border-radius: 10px; background: var(--fo-sunken); font-size: 13px; color: var(--fo-text-2); }
.fo-blocked > svg { flex: none; margin-top: 1px; }
.fo-blocked b { display: block; font-weight: 600; color: var(--fo-text); }
.fo-alert > svg { flex: none; margin-top: 1px; }
.fo-field { font-size: 12px; color: var(--fo-muted); display: flex; flex-direction: column; gap: 4px; margin: 0; }
.fo-field .fo-input { flex: none; width: 100%; }

/* Alerts */
.fo-alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; margin-bottom: 10px; }
.fo > .fo-alert { margin-bottom: 0; align-items: center; }
.fo-alert.is-red { background: var(--fo-red-bg); color: var(--fo-red); }
.fo-alert.is-amber { background: var(--fo-amber-bg); color: var(--fo-amber); }
.fo-alert.is-green { background: var(--fo-green-bg); color: var(--fo-green); }
.fo-alert b { display: block; font-weight: 600; margin-bottom: 1px; }
.fo-alert-det { color: var(--fo-text-2); overflow-wrap: anywhere; }

/* ── Buttons ── */
.fo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; border: 1px solid var(--fo-border-strong); background: var(--fo-surface); color: var(--fo-text); padding: 9px 14px; font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; min-height: 36px; }
.fo-btn:hover:not([disabled]) { background: var(--fo-sunken); color: var(--fo-text); }
.fo-btn.is-sm { min-height: 32px; padding: 5px 10px; font-size: 12.5px; }
.fo-btn.is-primary { background: var(--fo-ink); color: #fff; border-color: var(--fo-ink); }
.fo-btn.is-primary:hover:not([disabled]) { background: #333; color: #fff; }
.fo-btn.is-success { background: var(--fo-green); color: #fff; border-color: var(--fo-green); }
.fo-btn.is-success:hover:not([disabled]) { background: #0d7a45; color: #fff; }
.fo-btn.is-danger { color: var(--fo-red); border-color: rgba(220, 53, 69, .4); background: transparent; }
.fo-btn.is-danger:hover:not([disabled]) { background: var(--fo-red-bg); color: var(--fo-red); }
.fo-btn.is-ghost { border-color: transparent; background: transparent; color: var(--fo-muted); }
.fo-btn.is-block { width: 100%; }
.fo-btn.is-sm { padding: 4px 10px; min-height: 28px; font-size: 12px; border-radius: 8px; }
.fo-btn[disabled] { opacity: .45; cursor: not-allowed; }
.fo-spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: fo-spin .8s linear infinite; flex: none; }
.fo.is-compact .fo-btn:not(.is-sm) { padding: 6px 12px; min-height: 32px; }

/* ── Tabs ── */
.fo-tabs { display: flex; gap: 2px; padding: 4px; margin: 12px var(--fo-pad-x) 0; background: var(--fo-sunken); border-radius: 10px; overflow-x: auto; scrollbar-width: none; }
.fo-tab { flex: 1; border: 0; background: none; padding: 7px 8px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--fo-muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fo-tab[aria-selected="true"] { background: var(--fo-surface); color: var(--fo-text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.fo-tab-count { font-size: 10.5px; font-weight: 600; background: var(--fo-border); color: var(--fo-text-2); border-radius: 999px; padding: 0 6px; }
.fo-tab-count.is-red { background: var(--fo-red-bg); color: var(--fo-red); }
.fo-tabpanel { padding: 14px var(--fo-pad-x) 16px; }
.fo-tabpanel:focus-visible { outline-offset: -2px; }
.fo.is-compact .fo-tabs { margin-top: 9px; padding: 3px; }
.fo.is-compact .fo-tab { padding: 5px 8px; }
.fo.is-compact .fo-tabpanel { padding-top: 10px; padding-bottom: 12px; }

.fo-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; font-size: 13px; margin: 0; }
.fo-kv dt { color: var(--fo-muted); font-weight: 400; }
.fo-kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.fo.is-compact .fo-kv { gap: 3px 16px; font-size: 12.5px; }
/* Paid via (#971): gateway logo beside the method, same marks as the Rx checkout. */
.fo-pay-via { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; text-align: right; }
.fo-pay-via > span:last-child { min-width: 0; }
.fo-pay-mark { width: 38px; height: 24px; flex: none; border-radius: 4px; object-fit: contain; }
.fo-pay-mark.is-generic { display: inline-flex; align-items: center; justify-content: center; background: var(--fo-sunken); border: 1px solid var(--fo-border); color: var(--fo-muted); }

/* Rx viewer */
.fo-rx-viewer { border: 1px solid var(--fo-border); border-radius: 10px; overflow: hidden; background: var(--fo-sunken); }
.fo-rx-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--fo-border); background: var(--fo-surface); font-size: 12px; color: var(--fo-muted); }
.fo-rx-actions { display: inline-flex; align-items: center; gap: 10px; }
.fo-rx-frame { display: block; width: 100%; height: 420px; border: 0; background: #fff; }
.fo-rx-frame.is-image, .fo-fs-doc.is-image { overflow: auto; background: #fff; }
.fo-rx-frame.is-image img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.fo.is-compact .fo-rx-frame { height: 320px; }
.fo-rx-frame.is-external { height: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; font-size: 13px; color: var(--fo-text-2); }
.fo-fs { position: fixed; inset: 0; z-index: 1080; background: rgba(0,0,0,.88); display: flex; flex-direction: column; padding: 20px; }
.fo-fs-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #fff; padding: 0 4px 12px; font-size: 13px; }
.fo-fs .fo-btn { background: #fff; color: #000; border-color: #fff; }
.fo-fs-doc { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; border: 0; border-radius: 10px; background: #fff; }
/* Photos fit the screen on the dark backdrop: no white box left over below a short image. */
.fo-fs-doc.is-image { display: flex; align-items: center; justify-content: center; min-height: 0; background: transparent; }
.fo-fs-doc.is-external { flex: 0 0 auto; display: flex; justify-content: center; padding: 32px 16px; }
.fo-fs-doc.is-image img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; background: #fff; }

/* Audit */
.fo-sec-label { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--fo-faint); margin-bottom: 4px; }
.fo-sys-notes { font-family: var(--fo-mono); font-size: 11.5px; white-space: pre-wrap; background: var(--fo-sunken); border-radius: 8px; padding: 8px 10px; color: var(--fo-text-2); margin-bottom: 10px; max-height: 110px; overflow: auto; overflow-wrap: anywhere; }
.fo-audit-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--fo-faint); margin-bottom: 6px; }
.fo-audit-scroll { max-height: 340px; overflow: auto; overscroll-behavior: contain; margin: 0 calc(-1 * var(--fo-pad-x)); padding: 0 var(--fo-pad-x); border-top: 1px solid var(--fo-border); border-bottom: 1px solid var(--fo-border); }
.fo-audit { list-style: none; margin: 0; padding: 0; }
.fo-audit li { display: flex; gap: 10px; padding: 10px 0; font-size: 12.5px; }
.fo-audit-ic { width: 18px; flex: none; display: grid; place-items: center; align-self: flex-start; padding-top: 3px; color: var(--fo-faint); }
.fo-audit-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fo-audit-body { flex: 1; min-width: 0; }
.fo-audit li + li { border-top: 1px solid var(--fo-border); }
.fo-audit-top { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.fo-audit-act { font-weight: 600; }
.fo-audit-who { color: var(--fo-muted); overflow-wrap: anywhere; }
.fo-audit-when { margin-left: auto; color: var(--fo-faint); font-size: 11.5px; white-space: nowrap; }
.fo-audit-det { color: var(--fo-text-2); margin-top: 2px; overflow-wrap: anywhere; }
.fo-audit-err { color: var(--fo-red); margin-top: 2px; overflow-wrap: anywhere; }
.fo-audit li.is-note .fo-audit-det { background: var(--fo-sunken); padding: 6px 8px; border-radius: 6px; margin-top: 4px; }
.fo-audit li.is-failed .fo-audit-act { color: var(--fo-red); }
.fo-role { font-size: 10px; font-weight: 600; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; background: var(--fo-sunken); color: var(--fo-muted); text-transform: uppercase; }
.fo-composer { display: flex; gap: 8px; margin-top: 12px; }
.fo-input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--fo-border-strong); border-radius: 8px; background: var(--fo-surface); color: var(--fo-text); font: inherit; font-size: 13px; }
.fo.is-compact .fo-audit-scroll { max-height: 260px; }
.fo.is-compact .fo-audit li { padding: 6px 0; }

/* ── Action bar ── */
.fo-actionbar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); border: 1px solid var(--fo-border); border-radius: var(--fo-r); padding: 10px 14px; box-shadow: var(--fo-shadow); }
.fo-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.fo.is-compact .fo-actionbar { padding: 6px 12px; }

/* ── Phone action bar: Call, the next step, ⋯ More. Replaces the action bar on a phone (see the container query). ── */
.fo-mbar { display: none; }
.fo-msheet-scrim { position: fixed; inset: 0; z-index: 1070; background: rgba(0,0,0,.38); display: flex; align-items: flex-end; justify-content: center; }
.fo-msheet { width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; background: var(--fo-surface); border-radius: 18px 18px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
.fo-msheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fo-border-strong); margin: 0 auto 12px; }
.fo-msheet-t { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.fo-msheet-addr { display: flex; flex-direction: column; gap: 2px; background: var(--fo-sunken); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.fo-msheet-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fo-muted); }
.fo-msheet-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--fo-border); background: none; color: var(--fo-text); font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
.fo-msheet-item:disabled { opacity: .5; }
.fo-msheet-item small { display: block; font-size: 12px; color: var(--fo-muted); }
.fo-msheet-item.is-danger { color: var(--fo-red); border-bottom: 0; margin-top: 6px; }
.fo-msheet-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--fo-sunken); display: grid; place-items: center; flex: none; font-size: 15px; }
.fo-msheet-item.is-danger .fo-msheet-ic { background: var(--fo-red-bg); color: var(--fo-red); }
.fo-msheet .fo-btn.is-primary, .fo-msheet .fo-btn.is-primary:hover:not([disabled]) { background: var(--fo-main); border-color: var(--fo-main); color: #fff; }
.fo-msheet .fo-link-btn { justify-content: center; color: var(--fo-main); font-size: 14px; font-weight: 600; }
@keyframes fo-flash-out { to { opacity: 0; visibility: hidden; } }

/* ── Workflow steps (#946): left column = check the order, right column = pack & ship ── */
.fo-step-h { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--fo-muted); padding: 2px 2px 0; margin-bottom: calc(var(--fo-gap) * -0.5); }
.fo-step-n { width: 18px; height: 18px; border-radius: 50%; background: var(--fo-ink); color: #fff; display: grid; place-items: center; font-size: 10.5px; letter-spacing: 0; }

/* ── Packing photos (#946) ── */
.fo-proof-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 4px 6px 0; font-size: 12.5px; color: var(--fo-muted); }
.fo-proof-empty b { font-size: 13.5px; font-weight: 600; color: var(--fo-text); }
.fo-proof-empty span:last-child { max-width: 320px; }
.fo-proof-empty-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--fo-sunken); display: grid; place-items: center; margin-bottom: 4px; }
.fo-proof-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fo-proof-thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; border: 0; padding: 0; background: var(--fo-sunken); cursor: pointer; display: grid; place-items: center; }
.fo-proof-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left bottom; } /* keeps the stamp in view */
.fo-proof-thumb.is-add { background: transparent; border: 1.5px dashed var(--fo-border-strong); color: var(--fo-muted); font-size: 12px; font-weight: 500; }
.fo-proof-thumb.is-add span { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fo-proof-thumb.is-busy { cursor: default; color: var(--fo-muted); }
.fo-proof-busy { position: relative; display: flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 500; }
.fo-proof-busy .fo-spinner { width: 11px; height: 11px; }
.fo-proof-tag { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border-radius: 4px; font-size: 9.5px; font-weight: 600; padding: 1px 5px; }
/* fixed, not absolute: an absolute input with no positioned parent stretched the page below the footer */
.fo-proof-picker { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.fo-proof-scrim { position: fixed; inset: 0; z-index: 1070; background: rgba(0,0,0,.38); display: flex; align-items: flex-end; justify-content: center; padding: 8px 8px calc(16px + env(safe-area-inset-bottom)); }
.fo-proof-sheet { width: 100%; max-width: 400px; }
.fo-proof-sheet-group { background: rgba(249,249,251,.98); border-radius: 14px; overflow: hidden; }
.fo-proof-sheet-t { padding: 12px 16px; text-align: center; font-size: 12.5px; color: var(--fo-muted); border-bottom: 1px solid #d8d8dc; }
.fo-proof-sheet-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 0; border: 0; background: none; padding: 15px; font-size: 17px; color: #007aff; cursor: pointer; }
.fo-proof-sheet-btn + .fo-proof-sheet-btn { border-top: 1px solid #d8d8dc; }
.fo-proof-sheet-btn svg { width: 19px; height: 19px; }
.fo-proof-sheet-btn.is-cancel { margin-top: 8px; background: #fff; border-radius: 14px; font-weight: 600; }
.fo-proof-sheet-btn .is-desk { display: none; }
/* A mouse-and-keyboard screen has no camera to open: one "Choose a file" option, sheet centred. */
@media (hover: hover) and (pointer: fine) {
    .fo-proof-scrim { align-items: center; }
    .fo-proof-sheet-btn.is-camera { display: none; }
    .fo-proof-sheet-btn .is-phone { display: none; }
    .fo-proof-sheet-btn .is-desk { display: inline; }
}
.fo-proof-delete { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1090; display: flex; align-items: center; gap: 8px; background: #1d1d1f; color: #fff; padding: 8px 10px 8px 14px; border-radius: 999px; font-size: 13px; }
.fo-proof-delete .fo-btn { background: #fff; }

/* Page states */
.fo-page-state { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40vh; text-align: center; color: var(--nx-text-muted, #6e6e73); }

/* ── Compact, desktop: invoice math beside the Sales rows ── */
@container fo (min-width: 821px) {
    .fo.is-compact .fo-bill-cols { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "calc sales" "total total"; }
    .fo.is-compact .fo-b-calc { grid-area: calc; }
    .fo.is-compact .fo-b-sales { grid-area: sales; border-top: 0; border-left: 1px solid var(--fo-border); grid-template-columns: 1fr; }
    .fo.is-compact .fo-b-total { grid-area: total; }
}

/* ── Tablet and phone: one column, the two desktop columns one after the other (#946). ── */
@container fo (max-width: 820px) {
    .fo-grid { display: flex; flex-direction: column; align-items: stretch; }
    .fo-col { display: contents; }
    .fo-h-check { order: 1; }
    .fo-c-patient { order: 2; }
    .fo-c-items { order: 3; }
    .fo-c-rx { order: 4; }
    .fo-c-disc { order: 5; }
    .fo-c-bill { order: 6; }
    .fo-h-ship { order: 7; margin-top: 6px; }
    .fo-c-addr { order: 8; }
    .fo-c-dispatch { order: 9; }
    .fo-c-proof { order: 10; }
    .fo-c-tabs { order: 11; }
}

@container fo (max-width: 560px) {
    .fo { --fo-pad-x: 14px; }
    .fo-crumb { display: none; }
    /* Header on a phone (PM sketch, 2026-10-28): channel label; order # with its status pills on one row;
       date | delivery underneath; print top right. display: contents on the left column lets its
       children wrap around the status pills as one row. */
    .fo-order-head { position: relative; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; column-gap: 10px; row-gap: 6px; padding: 14px; }
    .fo-order-head > div:first-child { display: contents; }
    .fo-eyebrow { order: 0; width: 100%; padding-right: 44px; }
    .fo-order-title { order: 1; font-size: 26px; font-weight: 700; margin: 0; }
    .fo-order-word { display: none; }
    /* PM mockup 2026-11-12: channel | print; order # + pills; date | delivery; owner on its own row last.
       display: contents lets the pills and the owner chip take separate rows. The Shopify "Ref" is desktop-only. */
    .fo-eyebrow .fo-mono { display: none; }
    .fo-head-right { display: contents; }
    .fo-head-pills { order: 2; justify-content: flex-start; }
    .fo-owner { order: 5; width: 100%; margin-top: 2px; }
    /* Invisible full-width break so date | delivery always starts its own row under the pills. */
    .fo-order-head::after { content: ""; order: 3; width: 100%; height: 0; }
    /* No delivery type (mostly NowExpress): date and owner share one row. */
    .fo-order-head:not(:has(.fo-delivery-pill)) .fo-order-sub { width: auto; }
    .fo-order-head:not(:has(.fo-delivery-pill)) .fo-owner { width: auto; margin: 0 0 0 6px; }
    .fo-hide-phone { display: none; }
    /* Date | delivery stay on ONE line: no wrap, same 13px for both, a long delivery name ellipses. */
    .fo-order-sub { order: 4; width: 100%; flex-wrap: nowrap; gap: 10px; margin-top: -2px; font-size: 13px; min-width: 0; }
    .fo-order-sub svg { width: 15px; height: 15px; flex: none; }
    .fo-order-when { display: inline-flex; align-items: center; gap: 5px; flex: none; white-space: nowrap; }
    .fo-order-sub .fo-delivery-pill { gap: 6px; padding: 0 0 0 12px; border-left: 1px solid var(--fo-border-strong); border-radius: 0; background: none; color: var(--fo-text-2); font-size: 13px; font-weight: 400; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .fo-order-sub .fo-delivery-pill.is-amber { color: var(--fo-amber); }
    .fo-order-head .fo-icon-btn { position: absolute; top: 0; right: 4px; }
    .fo-pill.is-chan, .fo-pill.is-chan.is-ns { padding: 0; background: none; color: var(--fo-muted); font-family: inherit; font-size: 11px; letter-spacing: .06em; }
    /* Number and email stack tight; their 44px tap targets are invisible ::after boxes, not layout height. */
    .fo-contact-row { flex-direction: column; gap: 10px; margin: 4px 0 0; }
    .fo-contact-row .fo-mono { font-size: 15px; }
    /* Desktop only: on a phone the number itself dials, so the scan-to-call QR is noise. */
    .fo-call-qr { display: none; }
    .fo-trip-map { width: 64px; }
    .fo-trip-tiles { left: calc(var(--tx) - 16px); }
    .fo-trip-route li { grid-template-columns: 14px 52px minmax(0, 1fr); }
    .fo-trip-osm { font-size: 0; }
    .fo-trip-osm::after { content: "© OSM"; font-size: 7px; }
    .fo-trip-open { font-size: 0; padding: 0 3px; }
    .fo-trip-open::after { content: "↗"; font-size: 10px; }
    .fo-link-btn { min-height: 44px; display: inline-flex; align-items: center; }
    .fo-contact-row a, .fo-contact-row .fo-link-btn, .fo-patient-name .fo-link-btn { min-height: 0; position: relative; display: inline-flex; align-items: center; }
    .fo-contact-row a::after, .fo-contact-row .fo-link-btn::after, .fo-patient-name .fo-link-btn::after { content: ""; position: absolute; inset: -12px -6px; }
    .fo-btn, .fo-btn.is-sm, .fo.is-compact .fo-btn:not(.is-sm) { min-height: 44px; }
    .fo-icon-btn { width: 44px; height: 44px; }
    .fo-seg button { min-height: 44px; }
    .fo-courier-opt { min-height: 56px; }
    .fo-tab { font-size: 12px; padding: 10px 4px; min-height: 44px; }
    .fo-input, .fo-input-16, .fo input, .fo select, .fo textarea { font-size: 16px; }
    .fo-rx-frame { height: 300px; }
    .fo-audit-scroll { max-height: 300px; }
    .fo-audit-when { margin-left: 0; width: 100%; }
    .fo-total-amt { font-size: 20px; }
    /* The phone bar shows the next step; the rare actions move into its ⋯ More sheet. */
    .fo-actionbar { display: none; }
    .fo-mbar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 8px; margin: 0 -12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--fo-border); border-radius: 14px 14px 0 0; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
    .fo-mbar .fo-btn { min-height: 48px; border-radius: 12px; font-size: 14px; font-weight: 600; }
    .fo-mbar .fo-mbar-call, .fo-mbar .fo-mbar-call:hover:not([disabled]) { padding: 0 12px; color: var(--fo-green); background: var(--fo-green-bg); border-color: rgba(17,149,85,.35); }
    .fo-mbar .fo-mbar-main, .fo-mbar .fo-mbar-main:hover:not([disabled]) { flex: 1; min-width: 0; background: var(--fo-main); border-color: var(--fo-main); color: #fff; }
    .fo-mbar .fo-mbar-main.is-success, .fo-mbar .fo-mbar-main.is-success:hover:not([disabled]) { background: var(--fo-green); border-color: var(--fo-green); }
    .fo-mbar .fo-mbar-main.is-plain, .fo-mbar .fo-mbar-main.is-plain:hover:not([disabled]) { background: var(--fo-surface); border-color: var(--fo-border-strong); color: var(--fo-text); }
    .fo-mbar .fo-mbar-more { flex: none; width: 48px; padding: 0; font-size: 20px; }
    .fo-mbar-wait { flex: 1; min-width: 0; text-align: center; font-size: 13px; color: var(--fo-muted); }
    /* Messages float above the bar instead of sitting at the top, out of sight; the green ones fade. */
    .fo-flash { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 1065; margin: 0; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
    .fo-flash.is-green { animation: fo-flash-out .3s ease 6s forwards; }
}

/* Lalamove booking sheet (phone): Pickup Contact + Delivery Remarks read at the drop-off card's size
   and grey, not the 16px phone input size. PM 2026-11-13: 14px always, even while typing (iOS may zoom). */
@media (max-width: 560px) {
    .fo-pickup-contact .fo-input, .fo-remarks .fo-input { font-size: 14px; color: var(--fo-text-2); }
}

/* The dialogs render outside .fo, so their 16px inputs (no iOS zoom) are set here. */
@media (max-width: 560px) {
    .fo-input-16 { font-size: 16px !important; }
}

/* ── #986 owner chip in the order header: same size as the status pills, on the line under them ── */
.fo-owner { display: inline-flex; align-items: center; }
.fo-ochip {
    display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 11.5px; font-weight: 500; color: var(--fo-text-2, #495057);
    background: #fff; border: 1px solid #dee2e6; border-radius: 999px; padding: 1px 8px 1px 2px; white-space: nowrap; line-height: 1.5;
}
.fo-ochip.is-me { color: #00594f; font-weight: 600; }
.fo-ochip.is-un { color: #6c757d; background: #f1f3f5; border: 1px dashed #adb5bd; padding-left: 8px; }
.fo-ochip.is-none { color: #adb5bd; padding-left: 8px; }
.fo-av {
    display: inline-flex; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; align-items: center; justify-content: center;
    color: #fff; font-size: 8.5px; font-weight: 700;
}
button.fo-ochip { cursor: pointer; }
button.fo-ochip:hover:not(:disabled) { border-color: #adb5bd; }
button.fo-ochip:disabled { cursor: default; }
.fo-ochip-caret { color: #adb5bd; font-size: 10px; }

/* copy icon right after the address text (header Copy removed to cut noise) */
.fo-addr-copy { display: inline-flex; vertical-align: -2px; margin-left: 4px; padding: 0 2px; }
/* Pickup hub selector (Dispatch card) — selected hub uses the page purple, not black */
.fo-hub-btn.is-sel,
.fo-hub-btn.is-sel:hover,
.fo-hub-btn.is-sel:focus,
.fo-hub-btn.is-sel:disabled {
    background: var(--fo-main, #6d28d9);
    border-color: var(--fo-main, #6d28d9);
    color: #fff;
}

/* ── #989 Deliver by (order page, under Delivery Address) ── */
.fo-dby { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--fo-border); font-size: 13.5px; }
.fo-dby-k { color: var(--fo-muted); font-size: 12.5px; min-width: 70px; }
.fo-dby-d { font-weight: 600; color: var(--fo-text); }
.fo-dby-d.is-muted { font-weight: 500; color: var(--fo-muted); }
.fo-dby-why { width: 100%; padding-left: 78px; font-size: 12px; color: var(--fo-faint, #8e8e93); margin-top: -4px; }
.fo-pencil { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--fo-faint, #8e8e93); }
.fo-pencil:hover { color: var(--fo-text); background: var(--fo-sunken); }
.fo-dby-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
/* Header due pill: phone only, on the owner's line. */
.fo-due-pill { display: none; }
@media (max-width: 560px) {
    .fo-due-pill { display: inline-flex; margin-right: 6px; }
    .fo-dby-why { padding-left: 0; }
    .fo-pencil { width: 44px; height: 44px; }
}
