/* Mr. Delivery Man — base design system (SPEC §2). Every page loads this file first; pages.css holds page-scoped rules only.
   Order: tokens, reset, type, layout, buttons, forms, segmented, stepper, steps, badges, cards, alerts, tables, rate-table, summary,
   kpi, list, timeline, stops, tabs/filters, empty/skeleton, dropzone, map, drawer, dialog, toast, public shell, mobile bar,
   admin shell, request layout, tap targets, hover guards, reduced motion, print. */

:root {
  color-scheme: light;
  --bg: #ffffff; --card: #ffffff; --band: #F5F5F7; --app-bg: #F5F5F7;
  --surface: #F5F5F7; --surface-2: #E8E8ED; --border: #E8E8ED; --border-strong: #D2D2D7; --border-control: #86868B;
  --text: #1D1D1F; --text-2: #55555C; --text-3: #6E6E73; --fill-off: #C8C8CE;
  --accent: #1D1D1F; --accent-hover: #333336; --on-accent: #ffffff;
  --red: #D2002F; --red-hover: #B40028; --red-soft: #FCE8EC; --on-red: #ffffff;
  --brand: #D2002F; --brand-hover: #B40028;
  --ink: #111114; --ink-2: #1B1B21; --ink-3: #26262E;
  --ok: #166F40; --ok-bg: #E8F5EE; --warn: #945800; --warn-bg: #FFF4E0; --danger: #C62828; --danger-bg: #FDECEC; --info: #0B5CB8; --info-bg: #E9F1FD;
  --header-bg: rgba(255, 255, 255, .78); --header-line: rgba(17, 17, 20, .08);
  --radius: 14px; --radius-sm: 10px; --radius-xs: 6px; --radius-lg: 20px; --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, .06), 0 28px 64px rgba(0, 0, 0, .16);
  --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand);
  --focus-soft: 0 0 0 3px rgba(210, 0, 47, .22);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1120px; --gutter: 24px; --header-h: 60px;
}
html[data-theme="dark"] {
  /* Apple's dark: a black page, one lifted grey for cards, hairlines instead of borders, quieter secondary text. */
  color-scheme: dark;
  --bg: #000000; --card: #161617; --band: #0A0A0A; --app-bg: #000000;
  --surface: #1D1D1F; --surface-2: #2C2C2E; --border: rgba(255, 255, 255, .09); --border-strong: rgba(255, 255, 255, .16); --border-control: #6E6E73;
  --text: #F5F5F7; --text-2: #A1A1A6; --text-3: #86868B; --fill-off: #3A3A3C;
  --accent: #F5F5F7; --accent-hover: #FFFFFF; --on-accent: #000000;
  --red: #D2002F; --red-hover: #E5153F; --red-soft: rgba(255, 69, 90, .16); --on-red: #ffffff;
  --brand: #FF4D6A; --brand-hover: #FF7088;
  --ink: #161617; --ink-2: #1D1D1F; --ink-3: #2C2C2E;
  --ok: #34C76F; --ok-bg: rgba(52, 199, 111, .14); --warn: #FFB547; --warn-bg: rgba(255, 181, 71, .13); --danger: #FF5A52; --danger-bg: rgba(255, 90, 82, .14); --info: #64A8FF; --info-bg: rgba(100, 168, 255, .13);
  --header-bg: rgba(22, 22, 23, .78); --header-line: rgba(255, 255, 255, .08);
  --shadow-sm: none;
  --shadow: 0 12px 32px rgba(0, 0, 0, .6);
  --shadow-lg: 0 28px 64px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
  --focus-soft: 0 0 0 3px rgba(255, 77, 106, .3);
}
@media (max-width: 720px) { :root { --gutter: 16px; } }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
main { flex: 1 0 auto; width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { padding: 0; border: 0; min-width: 0; min-inline-size: 0; }
legend { padding: 0; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: var(--brand); text-decoration: none; }
a:focus-visible { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
p { max-width: 60ch; }
small, .small { font-size: 13px; line-height: 1.4; }
strong, b { font-weight: 500; }
code, .mono { font-family: var(--font); font-variant-numeric: tabular-nums; }
.mono--code { font-variant-numeric: normal; }   /* order and invoice codes: Inter's tnum widens the hyphen, so "MDM-1035" reads as "MDM - 1035" */

/* ---------- Type ---------- */
h1, .h1 { font-size: 32px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
h2, .h2 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
h3, .h3 { font-size: 16px; font-weight: 600; letter-spacing: -.005em; line-height: 1.35; }
h4, .h4 { font-size: 15px; font-weight: 500; line-height: 1.4; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.num { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap-anywhere { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Skip link only (other .sr-only nodes are hidden radios, file inputs and labels that must stay clipped): visible pill on keyboard focus. */
a.sr-only[href="#main"]:focus-visible { position: fixed; top: 8px; left: 8px; width: auto; height: auto; margin: 0; padding: 8px 12px; clip: auto; overflow: visible; white-space: normal; background: var(--card); color: var(--brand); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow), var(--focus); z-index: 100; }
@media (max-width: 720px) { h1, .h1 { font-size: 26px; } }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container--narrow { max-width: calc(760px + var(--gutter) * 2); }
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: end; padding-top: 48px; margin-bottom: 32px; }
.page-head > * { grid-column: 1; }
.page-head__desc { margin-top: 8px; color: var(--text-2); font-size: 17px; line-height: 1.45; max-width: 52ch; }
.page-head__actions { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.page-head--stack { display: block; }
.page-head--stack .page-head__actions { justify-content: flex-start; margin-top: 20px; }
.admin__content .page-head { padding-top: 0; margin-bottom: 24px; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: start; margin-bottom: 20px; }
.section-head > * { grid-column: 1; }
.section-head__desc { margin-top: 4px; color: var(--text-2); max-width: 60ch; }
.section-head__action { grid-column: 2; grid-row: 1; padding-top: 3px; white-space: nowrap; }
.section + .section, hr.divider + .section { margin-top: 48px; }
hr.divider { margin-top: 48px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.stack-1 > * + * { margin-top: 4px; }
.stack-2 > * + * { margin-top: 8px; }
.stack-3 > * + * { margin-top: 12px; }
.stack-4 > * + * { margin-top: 16px; }
.stack-5 > * + * { margin-top: 20px; }
.stack-6 > * + * { margin-top: 24px; }
.stack-8 > * + * { margin-top: 32px; }
.row, .row-2 { display: flex; align-items: center; gap: 8px; }
.row-3 { display: flex; align-items: center; gap: 12px; }
.row-4 { display: flex; align-items: center; gap: 16px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--start { align-items: flex-start; }
.grow { flex: 1 1 auto; min-width: 0; }
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.thumb { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); flex: none; }
.show-mobile, .show-touch { display: none; }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .page-head { grid-template-columns: 1fr; padding-top: 28px; margin-bottom: 24px; }
  .page-head__actions { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 16px; }
  .section-head { grid-template-columns: 1fr; }
  .section-head__action { grid-column: 1; grid-row: auto; padding-top: 6px; }
  .section + .section, hr.divider + .section, hr.divider { margin-top: 40px; }
  .grid-2:not(.grid-2--keep), .grid-3 { grid-template-columns: 1fr; gap: 16px; }
  .grid-2--keep { gap: 12px; }
  .show-mobile { display: initial; }
  .hide-mobile { display: none !important; }
}
@media (max-width: 480px) { .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dt { margin-top: 8px; font-size: 13px; } }
@media (hover: none) { .show-touch { display: initial; } .show-hover { display: none !important; } }

/* ---------- Icons ---------- */
.icon { flex: none; vertical-align: middle; }
.icon--muted { color: var(--text-3); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--radius-pill); border: 1px solid transparent; background: none; font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; color: var(--text); transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease; }
.btn .icon { width: 16px; height: 16px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn--secondary { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.btn--ghost { color: var(--text-2); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn--lg { height: 48px; padding: 0 24px; font-size: 16px; }
.btn--xl { height: 54px; padding: 0 28px; font-size: 17px; }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading > .icon { display: none; }
.btn.is-loading::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.form { max-width: 640px; }
.form > * + * { margin-top: 16px; }
.field { display: block; }
.field + .field { margin-top: 16px; }
.grid-2 > .field, .grid-3 > .field { margin-top: 0; }
.field > label, .field__label { display: block; font-size: 14px; font-weight: 500; line-height: 1.4; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--text-3); }
.field__hint { font-size: 13px; line-height: 1.4; color: var(--text-2); margin-top: 6px; }
.field__error { font-size: 13px; line-height: 1.4; color: var(--danger); margin-top: 6px; }
.field__error:empty, .field.is-invalid .field__hint { display: none; }
.input, .select, .textarea { display: block; width: 100%; height: 40px; padding: 0 14px; background: var(--card); color: var(--text); border: 1px solid var(--border-control); border-radius: var(--radius-sm); appearance: none; transition: border-color .2s ease, box-shadow .2s ease; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--focus-soft); outline: none; }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface); color: var(--text-2); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid, .field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea { border-color: var(--danger); }
.input.is-invalid:focus, .field.is-invalid .input:focus { box-shadow: 0 0 0 3px rgba(198, 40, 40, .2); }
.input::-webkit-search-decoration, .input::-webkit-search-cancel-button { -webkit-appearance: none; }
.input--sm, .select--sm { height: 34px; font-size: 13px; padding: 0 12px; }
.textarea { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.select { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c5c66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-group { display: flex; gap: 8px; }
.input-group .btn { flex: none; }
.input-affix { position: relative; }
.input-affix .input { padding-left: 52px; }
.input-affix__prefix { position: absolute; left: 12px; top: 0; height: 100%; display: flex; align-items: center; font-size: 14px; color: var(--text-2); pointer-events: none; }
/* Box sits on the first label line (not centred against label + hint); padding-top 12px keeps a one-line row centred in the 44px target. */
.checkbox, .radio { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; align-items: start; align-content: start; padding-top: 12px; min-height: 44px; cursor: pointer; font-size: 15px; }
.field > label.checkbox, .field > label.radio { display: grid; font-size: 15px; font-weight: 400; margin-bottom: 0; }
.checkbox input, .radio input { width: 18px; height: 18px; margin: 2px 0 0; grid-row: 1; accent-color: var(--text); cursor: pointer; }
.checkbox .hint, .radio .hint { display: block; font-size: 13px; color: var(--text-2); font-weight: 400; }
.checkbox__hint, .radio__hint { grid-column: 2; font-size: 13px; line-height: 1.4; color: var(--text-2); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.form-actions > .btn--primary:last-child { margin-left: auto; }
@media (max-width: 720px) { .input, .select, .textarea { font-size: 16px; } }

/* Segmented control: <fieldset class="segmented"> of <label> options, each wrapping an .sr-only radio. Selection via :has() or input + label.
   iOS style: a grey track, the chosen option is a raised white pill. */
.segmented { display: flex; gap: 2px; width: 100%; padding: 3px; border: 0; border-radius: 12px; background: var(--surface-2); }
.segmented > label, .segmented > .segmented__option { position: relative; flex: 1 1 0; min-width: 0; min-height: 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--text-2); cursor: pointer; text-align: center; transition: background-color .25s var(--ease-out), color .2s ease, box-shadow .25s var(--ease-out); }
.segmented small { display: block; font-size: 12px; font-weight: 400; line-height: 1.3; color: var(--text-3); }
.segmented label:has(> input:checked), .segmented input:checked + label { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 3px 8px rgba(0, 0, 0, .08), inset 0 0 0 1px var(--border-strong); }
.segmented label:has(> input:checked) small, .segmented input:checked + label small { color: var(--text-2); }
.segmented label:has(> input:focus-visible), .segmented input:focus-visible + label { box-shadow: inset 0 0 0 2px var(--brand); z-index: 1; }
.segmented label:has(> input:disabled), .segmented input:disabled + label { opacity: .5; cursor: not-allowed; }
.segmented--stack { flex-direction: column; }
.filters .segmented { width: auto; }
.filters .segmented > label { flex: none; }
html[data-theme="dark"] .segmented { background: var(--surface); }
html[data-theme="dark"] .segmented label:has(> input:checked), html[data-theme="dark"] .segmented input:checked + label { background: #3A3A3C; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
@media (max-width: 420px) {
  .segmented:has(> label:nth-of-type(3)) { flex-direction: column; }
}

/* Stepper: <ol class="stepper"> of text items, no circles or connector lines. */
.stepper { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.stepper__item { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--text-3); white-space: nowrap; }
.stepper__item[aria-current="step"] { color: var(--text); border-bottom-color: var(--text); }
.stepper__item.is-done { color: var(--text-2); }
.stepper__item.is-done .stepper__num { display: none; }
.stepper__item .icon { width: 16px; height: 16px; }
.stepper__link, .stepper__item > button { display: inline-flex; align-items: center; gap: 6px; color: inherit; font: inherit; }
.stepper__item { min-width: 0; }
.stepper__progress { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--text-2); display: none; white-space: nowrap; }
@media (max-width: 720px) {
  .stepper { gap: 16px; }
  .stepper__item:not([aria-current="step"]) .stepper__label { display: none; }
  .stepper__progress { display: block; }
}

/* Steps: home "How it works" rows. */
.steps__item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 6px 32px; padding: 20px 0; align-items: start; }
.steps__item + .steps__item { border-top: 1px solid var(--border); }
.steps__head { display: flex; align-items: baseline; gap: 12px; }
.steps__num { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; min-width: 16px; }
.steps__title { font-size: 16px; }
.steps__text { font-size: 15px; color: var(--text-2); }
@media (max-width: 720px) { .steps__item { grid-template-columns: 1fr; padding: 16px 0; } .steps__text { padding-left: 28px; } }

/* ---------- Badges, tags, counts ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; background: var(--surface-2); color: var(--text-2); vertical-align: middle; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--neutral { background: var(--surface-2); color: var(--text-2); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--radius-xs); border: 1px solid var(--border); font-size: 12px; line-height: 1; color: var(--text-2); background: var(--card); white-space: nowrap; }
.count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.count.is-hot { background: var(--warn-bg); color: var(--warn); padding: 0 6px; border-radius: 999px; font-weight: 500; line-height: 18px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); min-width: 0; }
.card--link { display: block; color: inherit; text-decoration: none; cursor: pointer; transition: border-color .2s ease, box-shadow .35s var(--ease-out), transform .35s var(--ease-out); }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.card__header h2, .card__header h3 { font-size: 16px; line-height: 1.4; }
.card__body { padding: 16px; }
.card__body + .card__body { border-top: 1px solid var(--border); }
.card__footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); }
.card > .list > .list__item, .card > .rate-table > .rate-table__row { padding-left: 16px; padding-right: 16px; }
.card > .empty { padding-left: 16px; padding-right: 16px; }
.card > .table-wrap { border-radius: var(--radius); }
@media (min-width: 720px) {
  .card__body { padding: 24px; }
  .card__header { padding: 18px 24px; }
  .card__footer { padding: 14px 24px; }
  .card > .list > .list__item, .card > .rate-table > .rate-table__row, .card > .empty { padding-left: 24px; padding-right: 24px; }
}

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 0; border-radius: var(--radius); background: var(--surface); font-size: 14px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.alert > .icon { width: 16px; height: 16px; margin-top: 2px; }
.alert__body { flex: 1 1 auto; min-width: 0; }
.alert__title { font-weight: 500; }
.alert__title + * { margin-top: 2px; }
.alert__action { display: inline-block; margin-top: 6px; font-weight: 500; }
.alert p { max-width: none; }
/* Tinted, borderless; a 3px coloured edge keeps the kind readable without relying on the tint alone. */
.alert--info { background: var(--info-bg); box-shadow: inset 3px 0 0 var(--info); }
.alert--warn { background: var(--warn-bg); box-shadow: inset 3px 0 0 var(--warn); }
.alert--danger { background: var(--danger-bg); box-shadow: inset 3px 0 0 var(--danger); }
.alert--ok { background: var(--ok-bg); box-shadow: inset 3px 0 0 var(--ok); }
.alert--info > .icon { color: var(--info); }
.alert--warn > .icon { color: var(--warn); }
.alert--danger > .icon { color: var(--danger); }
.alert--ok > .icon { color: var(--ok); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table th, .table td { padding: 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); font-size: 15px; }
.table th { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--text-2); white-space: nowrap; }
.table td { height: 48px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-selected { background: var(--surface); }
.table__sub { display: block; font-size: 13px; color: var(--text-2); }
.table__address { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table td > a:not(.btn) { color: inherit; font-weight: 500; }
.table--compact th, .table--compact td { padding: 8px 12px; }
.table--compact td { height: 40px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.pagination__actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 720px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .table--stack, .table--stack tbody { display: block; }
  .table--stack tr { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
  .table--stack tr + tr { margin-top: 8px; }
  .table--stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex: 1 1 100%; height: auto; padding: 3px 0; border: 0; text-align: left; }
  /* Labelled cells are a two-column grid: the ::before label left, every value node (text, badge, name + .table__sub) stacked in the right
     column, so a cell with two nodes never spreads them across the row. Primary and action cells have no label and stay flex. */
  .table--stack td[data-label] { display: grid; grid-template-columns: minmax(96px, auto) minmax(0, 1fr); column-gap: 12px; align-items: baseline; justify-items: end; }
  .table--stack td[data-label]::before { content: attr(data-label); font-size: 13px; color: var(--text-2); flex: none; grid-column: 1; justify-self: start; }
  .table--stack td[data-label] > * { grid-column: 2; }
  .table--stack td.table__primary { display: flex; order: -1; flex: 1 1 auto; padding-bottom: 6px; }
  .table--stack td.table__primary ~ td.table__primary { flex: 0 0 auto; }
  .table--stack td.table__primary::before { content: none; }
  .table--stack td.num { justify-content: space-between; }
  .table--stack .table__address { max-width: none; white-space: normal; overflow-wrap: anywhere; }   /* td or an inner span: the stacked row shows the whole address */
  .table--stack tbody tr:last-child td { border-bottom: 0; }
  .card > .table-wrap .table--stack tr { border-left: 0; border-right: 0; border-radius: 0; margin: 0; }
  .card > .table-wrap .table--stack tr:last-child { border-bottom: 0; }
  .pagination { padding: 12px 0; flex-wrap: wrap; }
  .card > .pagination { padding: 12px 16px; }
}

/* Rate table: label · value rows (rates, order details, bank details, invoice header). */
/* Label column sized to its text (capped at 60% of the row) so a long value wraps instead of crushing the label mid-word; the value keeps the rest. */
.rate-table__row { display: grid; grid-template-columns: fit-content(60%) minmax(0, 1fr); gap: 16px; align-items: center; min-height: 40px; padding: 8px 0; }
.rate-table__row + .rate-table__row { border-top: 1px solid var(--border); }
.rate-table__row--head { min-height: 0; padding-top: 16px; padding-bottom: 4px; font-size: 13px; font-weight: 500; color: var(--text); }
.rate-table__row--head:first-child { padding-top: 0; }
.rate-table__label { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.rate-table__label small { display: block; color: var(--text-3); }
.rate-table__value { font-size: 15px; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.rate-table__value small { display: block; font-weight: 400; color: var(--text-2); }

/* Summary: order totals card. */
.summary { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 16px; }
.summary__line { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 8px 0; font-size: 15px; }
.summary__line small, .summary__line .sub { display: block; font-size: 13px; color: var(--text-2); font-weight: 400; }
.summary__line--fee { color: var(--text-2); }
.summary__desc { min-width: 0; overflow-wrap: anywhere; }
.summary__sub { display: block; font-size: 13px; line-height: 1.4; color: var(--text-2); }
.summary__amount { font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.summary__rule { border-top: 1px solid var(--border-strong); margin: 6px 0; }
.summary__total { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary__head { padding: 10px 0 4px; font-size: 15px; }
@media (min-width: 720px) { .summary { padding: 12px 20px; } }

/* KPI row: one card, divided columns. */
.kpi-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kpi { min-width: 0; padding: 16px 20px; border-left: 1px solid var(--border); }
.kpi:first-child { border-left: 0; }
.kpi__label { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.kpi__value { font-size: 24px; font-weight: 600; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi__note { font-size: 13px; line-height: 1.4; color: var(--text-3); margin-top: 4px; }
@media (max-width: 1100px) {
  .kpi-row { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3n + 1) { border-left: 0; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--border); }
}
@media (max-width: 720px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 16px; border-left: 1px solid var(--border); border-top: 0; }
  .kpi:nth-child(2n + 1) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); }
}

/* List rows (needs attention, packages, notes). */
.list__item { display: flex; align-items: center; gap: 16px; padding: 12px 0; min-width: 0; }
.list__item + .list__item { border-top: 1px solid var(--border); }
.list__item--link { width: 100%; color: inherit; text-decoration: none; cursor: pointer; transition: background-color .15s ease; }
.list__main { flex: 1 1 auto; min-width: 0; }
.list__title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.list__meta { font-size: 13px; line-height: 1.4; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.list__aside { flex: none; text-align: right; font-size: 13px; color: var(--text-2); }

/* Timeline: dot at x=0, per-item 1px line so it stops at the last dot. */
.timeline { padding-left: 20px; }
.timeline__item { position: relative; padding-bottom: 16px; font-size: 15px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before { content: ""; position: absolute; left: -20px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.timeline__item::after { content: ""; position: absolute; left: -16px; top: 17px; bottom: -9px; width: 1px; background: var(--border-strong); }
.timeline__item:last-child::after { display: none; }
.timeline__item.is-done::before { background: var(--text); }
.timeline__item.is-current::before { background: var(--card); box-shadow: inset 0 0 0 2px var(--brand); }
.timeline__item.is-upcoming { color: var(--text-3); }
.timeline__label { font-weight: 500; overflow-wrap: anywhere; }
.timeline__time { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.timeline__detail { font-size: 13px; line-height: 1.4; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.timeline__flag { font-size: 13px; color: var(--text-3); margin-left: 6px; }

/* Stops: route list with numbered markers (square pickup, circle drop-off, outlined square return). */
.stop { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; }
.stop + .stop { border-top: 1px solid var(--border); }
.stop__marker { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--card); font-size: 12px; font-weight: 500; color: var(--text-2); }
.stop__marker .icon { width: 14px; height: 14px; }
.stop--pickup .stop__marker { border-radius: var(--radius-xs); }
.stop--return .stop__marker { border-radius: var(--radius-xs); border: 2px solid var(--text); color: var(--text); }
.stop.is-done .stop__marker { background: var(--text); border-color: var(--text); color: var(--bg); }
.stop.is-current .stop__marker { border: 2px solid var(--brand); color: var(--brand); }
.stop.is-failed .stop__marker { background: var(--danger); border-color: var(--danger); color: #fff; }
.stop__title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.stop__meta { font-size: 13px; line-height: 1.4; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.stop__aside { font-size: 13px; color: var(--text-2); text-align: right; white-space: nowrap; padding-top: 3px; }
.stop.is-failed .stop__aside { color: var(--danger); }

/* ---------- Tabs, filters ---------- */
/* Tabs are pills: the chosen one is filled ink. The row scrolls sideways on narrow screens without a visible bar. */
.tabs { display: flex; gap: 6px; padding: 2px 0 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; transition: background-color .25s var(--ease-out), color .2s ease; }
.tab[aria-selected="true"] { color: var(--bg); background: var(--text); }
.tab[aria-selected="true"] .count { color: inherit; opacity: .75; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters .select, .filters .input { width: auto; min-width: 150px; }
.filters .input[type="search"] { min-width: 220px; }
.filters__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--card); font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
@media (max-width: 720px) { .filters .select, .filters .input, .filters .input[type="search"] { flex: 1 1 100%; width: 100%; } }

/* ---------- Empty, skeleton ---------- */
.empty { padding: 32px 0; }
.empty__title { font-size: 15px; font-weight: 500; }
.empty__hint { font-size: 13px; line-height: 1.4; color: var(--text-2); margin-top: 4px; max-width: 60ch; }
.empty .btn { margin-top: 16px; }
.skeleton { display: block; background: var(--surface-2); border-radius: var(--radius-xs); min-height: 1em; color: transparent; }

/* ---------- Dropzone (slip and photo upload) ---------- */
.dropzone { position: relative; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); padding: 24px; transition: border-color .15s ease; }
.dropzone.is-over { border-color: var(--brand); border-style: solid; }
.dropzone:has(> input:focus-visible), .dropzone:has(> .dropzone__body > input:focus-visible) { box-shadow: var(--focus); }
.dropzone__title { font-size: 15px; font-weight: 500; }
.dropzone__hint { font-size: 13px; line-height: 1.4; color: var(--text-2); margin-top: 2px; }
.dropzone .btn { margin-top: 12px; }
.dropzone__preview { display: flex; align-items: center; gap: 12px; }
.dropzone__thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--card); flex: none; }
.dropzone__thumb--pdf { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; color: var(--text-2); }
.dropzone__file { flex: 1 1 auto; min-width: 0; }
.dropzone__name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.dropzone__size { font-size: 13px; color: var(--text-2); }
.dropzone__preview .btn { margin-top: 0; flex: none; }
@media (hover: none) { .dropzone__drag { display: none; } }
@media (max-width: 720px) { .dropzone { padding: 16px; } }

/* ---------- Map (MapLibre) ---------- */
.map { position: relative; z-index: 0; width: 100%; height: 300px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.map--short { height: 240px; }
.map--tall { height: 420px; }
.map--fill { height: 100%; min-height: 300px; }
.map__overlay { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 8px; }
.map:has(> .map__overlay) .maplibregl-ctrl-top-right { top: 44px; }
.map__fallback { position: absolute; inset: 0; z-index: 3; padding: 16px; background: var(--surface); display: flex; align-items: flex-start; }
.map__fallback .alert { max-width: 480px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 10px; height: 10px; display: inline-block; border-radius: 50%; }
.map-legend i.pickup { background: var(--text); border-radius: 3px; }
.map-legend i.dropoff { background: var(--brand); }
.map-legend i.done { background: var(--ok); }
.map-legend i.failed { background: var(--danger); }
.map-legend i.return { background: var(--card); border: 2px solid var(--text); border-radius: 3px; }
.map-legend i.driver { background: var(--red); border: 2px solid var(--card); }
.maplibregl-map { font: inherit; }
.maplibregl-ctrl-group { border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: none; }
/* SPEC §2.6: tap targets on public and driver pages are at least 44px; the MapLibre zoom buttons default to 29px. */
body.page-track .maplibregl-ctrl-group button, body.page-driver .maplibregl-ctrl-group button { width: 44px; height: 44px; }
.maplibregl-ctrl-attrib { font-size: 11px; color: var(--text-3); }
.maplibregl-ctrl-attrib a { color: var(--text-2); }
.maplibregl-popup-content { padding: 10px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font: 400 13px/1.45 var(--font); color: var(--text); }
.marker { cursor: default; }   /* no position here: MapLibre positions .maplibregl-marker absolutely and owns its transform */
.marker--pickup { width: 14px; height: 14px; background: var(--text); border: 2px solid #fff; border-radius: 4px; box-shadow: 0 0 0 1px rgba(17, 17, 20, .25); }
.marker--dropoff { width: 14px; height: 14px; background: var(--brand); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(17, 17, 20, .25); }
.marker--return { width: 14px; height: 14px; background: #fff; border: 2px solid var(--text); border-radius: 4px; }
.marker--done { background: var(--ok); }
.marker--failed { background: var(--danger); }
.marker--return.marker--done { border-color: var(--ok); }
.marker--return.marker--failed { border-color: var(--danger); }
.marker--point { width: 0; height: 0; }
.marker--driver { z-index: 2; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid var(--brand); border-radius: 50%; color: var(--brand); box-shadow: 0 0 0 1px rgba(17, 17, 20, .15); }
.marker--driver .icon { width: 16px; height: 16px; transform: rotate(calc(var(--heading, 0deg) - 45deg)); } /* the navigation glyph points north-east at rest, so -45deg makes heading 0 face north */
.marker--driver.is-stale { opacity: .5 !important; } /* MapLibre writes an inline opacity on marker elements every move */
.marker__label { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 4px); white-space: nowrap; font-size: 11px; font-weight: 500; line-height: 1.4; padding: 1px 6px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); }
.marker--point .marker__label { top: 50%; transform: translate(-50%, -50%); }
@media (min-width: 720px) { .map { height: 420px; } .map--short { height: 280px; } .map--tall { height: 560px; } .map--fill { min-height: 420px; } }

/* ---------- Drawer (right panel; a persistent node uses the hidden attribute when closed) ---------- */
/* Desktop: a floating sheet with rounded corners that slides in; phones: full screen. ui.js toggles .is-open after un-hiding, so
   these are transitions (in .45s with an ease-out, out .2s) and it hides the node 200ms after closing. */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .2s ease; }
.drawer-backdrop.is-open { opacity: 1; transition-duration: .35s; }
.drawer { position: fixed; top: 8px; right: 8px; z-index: 61; width: min(480px, calc(100vw - 16px)); height: calc(100dvh - 16px); display: flex; flex-direction: column; overflow: hidden; background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateX(32px); transition: transform .2s ease, opacity .2s ease; }
.drawer.is-open { opacity: 1; transform: none; transition: transform .45s var(--ease-out), opacity .3s ease; }
.drawer--lg { width: min(640px, calc(100vw - 16px)); }
.drawer__header { flex: none; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 12px 0 24px; border-bottom: 1px solid var(--border); }
.drawer__title { font-size: 19px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__close { margin-left: auto; }
.drawer__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 24px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.drawer__section { padding: 24px 0; }
.drawer__section + .drawer__section { border-top: 1px solid var(--border); }
.drawer__section > h3 { margin-bottom: 12px; }
.drawer__footer { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--card); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@media (max-width: 720px) {
  .drawer, .drawer--lg { top: 0; right: 0; width: 100vw; height: 100dvh; border-radius: 0; transform: translateY(24px); }
  .drawer__header { padding: 0 8px 0 16px; }
  .drawer__body { padding: 0 16px; }
  .drawer__footer { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Dialog (native <dialog> + showModal()) ---------- */
.dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); overflow: auto; }
.dialog::backdrop { background: rgba(0, 0, 0, .32); animation: fade-in .3s ease; }
.dialog[open] { animation: dialog-in .4s var(--ease-out); }
.dialog--wide { width: min(720px, calc(100vw - 32px)); }
.dialog__body, .dialog__form { padding: 24px; font-size: 15px; color: var(--text-2); }
.dialog__message { color: var(--text-2); max-width: none; }
.dialog__fields { color: var(--text); }
.dialog__fields > .field, .dialog__fields > .field + .field { margin-top: 16px; }
.dialog__error { margin-top: 12px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 24px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--border); }
.file-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-pick__thumb { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); }
.file-pick__name { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.dialog__title { font-size: 19px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; color: var(--text); margin-bottom: 8px; }
.dialog__body .field { color: var(--text); margin-top: 16px; }
.dialog__body p { max-width: none; }
.dialog__body img { max-height: 70dvh; width: auto; margin: 0 auto; }
.dialog__footer { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--border); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: calc(20px + var(--bottombar-h, 0px) + env(safe-area-inset-bottom)); z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
/* Toasts never take a click meant for the page under them (a form's Save button sits bottom-right too): only the action and close
   buttons catch the pointer, and hovering one of them pauses the timer (ui.js). */
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 14px; line-height: 1.45; color: var(--text); pointer-events: none; overflow-wrap: anywhere;
  opacity: 0; transform: translateY(12px) scale(.97); transition: opacity .2s ease, transform .2s ease; }
.toast.is-in { opacity: 1; transform: none; transition: opacity .3s ease, transform .5s var(--ease-out); }
.toast__action, .toast__close { pointer-events: auto; }
.toast > .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--text-2); }
.toast--ok > .icon { color: var(--ok); }
.toast--warn > .icon { color: var(--warn); }
.toast--danger > .icon { color: var(--danger); }
.toast--info > .icon { color: var(--info); }
.toast__close { margin-left: auto; margin-top: -6px; margin-right: -6px; }

@media (max-width: 720px) { .toasts { right: auto; left: 50%; transform: translateX(-50%); width: calc(100vw - 32px); bottom: calc(var(--bottombar-h, 0px) + env(safe-area-inset-bottom) + 12px); } }

/* ---------- Public shell ---------- */
/* Frosted bar in three columns: the main links left, the logo in the middle, account + CTA right. Phones: menu left, logo middle,
   CTA right. The hairline appears once the page scrolls (shell.js). */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: var(--header-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid transparent; transition: border-color .3s ease; }
.site-header.is-scrolled, .site-header.is-menu { border-bottom-color: var(--header-line); }
.site-header > .container { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 16px; }
.site-header > .container > .brand { grid-column: 2; grid-row: 1; }
.site-header__toggle { grid-column: 1; grid-row: 1; justify-self: start; }
.brand { display: inline-flex; align-items: center; color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.site-nav { grid-column: 1; grid-row: 1; justify-self: start; display: flex; align-items: center; gap: 2px; margin-left: -12px; }
.site-nav a { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: var(--radius-pill); color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface); }
.site-nav .site-nav__cta, .site-nav .site-header__account, .site-nav .site-nav__more, .site-nav .site-nav__theme { display: none; }
.site-header__actions { grid-column: 3; grid-row: 1; justify-self: end; display: flex; align-items: center; gap: 6px; }
.site-header__actions .site-header__account { color: var(--text-2); }
.site-header__cta-short { display: none; }
.site-header__menu, .site-header__toggle { display: none; }
.notice-bar { background: var(--surface); padding: 10px 0; font-size: 13px; line-height: 1.4; color: var(--text-2); text-align: center; }
/* footer: see Brand layer below */
@media (max-width: 960px) {
  .site-header > .container { column-gap: 8px; }
  /* Phone menu: a full-height sheet under the bar (absolute to the sticky header; a fixed child would be trapped by backdrop-filter). */
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; height: calc(100dvh - var(--header-h)); margin: 0; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
    padding: 12px var(--gutter) calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; background: var(--bg);
    visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .3s ease, transform .45s var(--ease-out), visibility 0s; }
  .site-nav a { height: 56px; padding: 0; border-radius: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--text); background: none !important; border-bottom: 1px solid var(--border); }
  .site-nav .site-nav__more, .site-nav .site-header__account { display: flex; }
  .site-nav .site-nav__more { font-size: 17px; font-weight: 500; height: 48px; color: var(--text-2); }
  .site-nav .site-header__account { font-size: 17px; font-weight: 500; height: 48px; color: var(--text-2); border-bottom: 0; justify-content: flex-start; }
  .site-nav .site-nav__cta { display: flex; margin-top: 20px; height: 52px; border: 0; border-radius: var(--radius-pill); font-size: 17px; justify-content: center; }
  .site-nav.is-open > * { animation: menu-in .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms + 40ms); }
  .site-header__actions .site-header__account { display: none; }
  .site-header__cta-long { display: none; }
  .site-header__cta-short { display: inline; }
  .site-header__actions .btn--brand { height: 34px; padding: 0 14px; font-size: 14px; }
  .site-header__menu, .site-header__toggle { display: inline-flex; }
  html.menu-open, html.menu-open body { overflow: hidden; }
}
@media (max-width: 480px) {
  .site-header__actions .theme-toggle { display: none; }
  .site-nav .site-nav__theme { display: inline-flex; align-self: center; margin-top: 16px; }
}
@media (max-width: 400px) { .site-header .brand__word { display: none; } }   /* phones: the mark alone in the middle */
@keyframes menu-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- The rider (shell.js RIDER): the logo in parts, so the bike can ride ----------
   Parts: .rider__all > streaks, two boxes, body (with the helmet), frame and two wheels. Every part transforms about its own box
   (fill-box), so a wheel turns about its centre and a box hops from its base. Lengths inside the SVG are logo units (the logo is
   640 wide), so the same keyframes read the same at every size. --roll (deg) turns the wheels and --jig (px) lifts the boxes from
   script (the header follows the scroll); the classes below play the moves:
   .rider-enter (an ancestor) rides the logo in once: the bike rolls in on its back wheel, the wheels spin down, the boxes drop
   onto the rack one after the other and the streaks flick out. Hovering a brand link pops a wheelie. .is-riding loops a ride;
   .is-rolling only bounces the load (the wheels follow --roll). */
.rider { display: block; overflow: visible; }
.rider g, .rider path { transform-box: fill-box; }
.rider__all { transform-origin: 21% 100%; }
.rider__wheel, .rider__wheel > path { transform-origin: 50% 50%; }
.rider__wheel > path { transform: rotate(var(--roll, 0deg)); }
.rider__box { transform-origin: 50% 100%; }
.rider__box > path { transform: translateY(var(--jig, 0px)); }
.rider__streak { transform-origin: 100% 50%; }
.rider__helmet { transform-origin: 30% 90%; }
.rider-enter .rider__all { animation: rider-in 1.15s cubic-bezier(.2, .85, .25, 1) both; }
.rider-enter .rider__wheel { animation: rider-spin-in 1.3s cubic-bezier(.2, .8, .3, 1) both; }
.rider-enter .rider__box { animation: rider-drop .8s cubic-bezier(.3, 1.45, .5, 1) .55s both; }
.rider-enter .rider__box--a { animation-delay: .72s; }
.rider-enter .rider__streak { animation: rider-streak-in .5s var(--ease-out) 1.05s both; }
.rider-enter .rider__helmet { animation: rider-nod .55s ease-in-out 1s both; }
@keyframes rider-in { 0% { transform: translateX(-160%); } 58% { transform: translateX(4%) rotate(-14deg); } 80% { transform: translateX(-1%) rotate(2deg); } 100% { transform: none; } }
@keyframes rider-spin-in { from { transform: rotate(-1080deg); } to { transform: none; } }
@keyframes rider-drop { 0% { opacity: 0; transform: translateY(-460px) rotate(-14deg); } 25% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes rider-streak-in { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: none; } }
@keyframes rider-nod { 50% { transform: rotate(9deg); } }
@media (hover: hover) {
  :is(.brand, .site-footer__logo):hover .rider__all { animation: rider-wheelie .95s var(--ease-out); }
  :is(.brand, .site-footer__logo):hover .rider__wheel { animation: rider-spin-in 1s cubic-bezier(.2, .8, .3, 1); }
  :is(.brand, .site-footer__logo):hover .rider__box { animation: rider-jolt .75s var(--ease-out); }
  :is(.brand, .site-footer__logo):hover .rider__box--a { animation-delay: .07s; }
  :is(.brand, .site-footer__logo):hover .rider__streak { animation: rider-flick .6s ease-in-out; }
}
@keyframes rider-wheelie { 35% { transform: rotate(-17deg); } 72% { transform: rotate(3deg); } 100% { transform: none; } }
@keyframes rider-jolt { 30% { transform: translateY(-70px) rotate(-9deg); } 62% { transform: translateY(10px); } 100% { transform: none; } }
@keyframes rider-flick { 45% { opacity: .35; transform: translateX(-46px) scaleX(1.4); } }
.rider.is-riding .rider__wheel { animation: rider-spin .42s linear infinite; }
.rider.is-riding .rider__box--b { animation: rider-hop .3s ease-in-out infinite alternate; }
.rider.is-riding .rider__box--a { animation: rider-hop .3s ease-in-out -.15s infinite alternate; }
.rider.is-riding .rider__body { animation: rider-bob .3s ease-in-out -.08s infinite alternate; }
.rider.is-riding .rider__streak { animation: rider-flick .5s ease-in-out infinite; }
.rider.is-rolling .rider__box--b { animation: rider-hop .26s ease-in-out infinite alternate; }
.rider.is-rolling .rider__box--a { animation: rider-hop .26s ease-in-out -.13s infinite alternate; }
.rider.is-rolling .rider__body { animation: rider-bob .26s ease-in-out infinite alternate; }
@keyframes rider-spin { to { transform: rotate(360deg); } }
@keyframes rider-hop { to { transform: translateY(-24px) rotate(-3deg); } }
@keyframes rider-bob { to { transform: translateY(-8px); } }
/* The header logo rides in on every page (shell.js rideLogo): the tile pops, the rider arrives, then the name slides in. */
.brand--enter .brand__mark { animation: mark-in .9s var(--ease-out) both; }
.brand--enter .brand__word { animation: word-in .8s var(--ease-out) .45s both; }
@keyframes mark-in { from { opacity: 0; transform: scale(.6) rotate(-10deg); } to { opacity: 1; transform: none; } }
@keyframes word-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Mobile bar (request page < 960px) ---------- */
.mobile-bar { display: none; }
@media (max-width: 960px) {
  .mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: calc(56px + env(safe-area-inset-bottom)); padding: 0 var(--gutter) env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--border); }
  .mobile-bar__total { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
  .mobile-bar__meta { font-size: 13px; color: var(--text-2); line-height: 1.3; }
  body.page-request, body.has-mobile-bar { --bottombar-h: 56px; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
}

/* ---------- Admin shell ---------- */
.admin { flex: 1 0 auto; display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; width: 100%; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--card); border-right: 1px solid var(--border); }
.sidebar__brand { flex: none; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--border); }
.sidebar__nav { flex: 1 1 auto; overflow-y: auto; padding: 12px; }
.sidebar__nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color .15s ease, color .15s ease; }
.sidebar__nav a .icon { width: 16px; height: 16px; }
.sidebar__nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.sidebar__nav a .count { margin-left: auto; }
.sidebar__group { padding: 14px 10px 4px; font-size: 13px; color: var(--text-3); }
.sidebar__foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.sidebar-backdrop { display: none; }
.admin__main { min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.topbar { display: none; }
.admin__content { flex: 1 0 auto; padding: 24px; }
.admin__content--flush { padding: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.auth { flex: 1 0 auto; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--surface); }
.auth__card { width: min(400px, 100%); padding: 32px; }
.auth__card .brand { margin-bottom: 24px; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .admin { grid-template-columns: 1fr; }
  /* Closed drawer is visibility:hidden so its links leave the tab order and the accessibility tree; the delayed visibility
     transition keeps the slide-out (visible at once on open, hidden after the .2s slide on close). */
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 65; width: 280px; max-width: calc(100vw - 48px); transform: translateX(-100%); visibility: hidden; box-shadow: none; transition: transform .2s ease, visibility 0s linear .2s; }
  .sidebar.is-open { transform: none; visibility: visible; transition-delay: 0s; box-shadow: var(--shadow); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 64; background: rgba(17, 17, 20, .4); animation: fade-in .2s ease; }
  .topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 12px 0 16px; background: var(--card); border-bottom: 1px solid var(--border); }
  .topbar__title { font-size: 16px; font-weight: 600; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
  .admin__content { padding: 16px; }
  .auth { padding: 16px; }
  .auth__card { padding: 24px; }
}

/* ---------- Request page layout ---------- */
.req-layout, .request-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.req-layout__panel, .request-layout__panel { position: sticky; top: 80px; }
@media (max-width: 960px) {
  .req-layout, .request-layout { grid-template-columns: 1fr; }
  .req-layout__panel, .request-layout__panel { display: none; }
}

/* ---------- Tap targets ≥ 44px on public and driver pages (admin keeps 40px and .btn--sm 32px) ---------- */
body.page-home .btn:not(.btn--sm), body.page-request .btn:not(.btn--sm), body.page-checkout .btn:not(.btn--sm), body.page-track .btn:not(.btn--sm), body.page-business .btn:not(.btn--sm), body.page-driver .btn:not(.btn--sm),
body.page-home .input, body.page-request .input, body.page-checkout .input, body.page-track .input, body.page-business .input, body.page-driver .input,
body.page-home .select, body.page-request .select, body.page-checkout .select, body.page-track .select, body.page-business .select, body.page-driver .select,
body.page-home .segmented > label, body.page-request .segmented > label, body.page-checkout .segmented > label, body.page-track .segmented > label, body.page-business .segmented > label, body.page-driver .segmented > label,
body.page-home .tab, body.page-request .tab, body.page-checkout .tab, body.page-track .tab, body.page-business .tab, body.page-driver .tab,
body.page-home .list__item--link, body.page-request .list__item--link, body.page-checkout .list__item--link, body.page-track .list__item--link, body.page-business .list__item--link, body.page-driver .list__item--link,
body.page-request .stepper__link { min-height: 44px; }
body.page-home .input--sm, body.page-request .input--sm, body.page-checkout .input--sm, body.page-track .input--sm, body.page-business .input--sm, body.page-driver .input--sm { min-height: 0; }
body.page-home .btn--sm, body.page-request .btn--sm, body.page-checkout .btn--sm, body.page-track .btn--sm, body.page-business .btn--sm, body.page-driver .btn--sm { position: relative; }
body.page-home .btn--sm::after, body.page-request .btn--sm::after, body.page-checkout .btn--sm::after, body.page-track .btn--sm::after, body.page-business .btn--sm::after, body.page-driver .btn--sm::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; } /* invisible hit area brings a 32px button to 44px without changing layout */
body.page-home .checkbox, body.page-request .checkbox, body.page-checkout .checkbox, body.page-track .checkbox, body.page-business .checkbox, body.page-driver .checkbox,
body.page-home .radio, body.page-request .radio, body.page-checkout .radio, body.page-track .radio, body.page-business .radio, body.page-driver .radio { min-height: 44px; }

/* ---------- Hover (pointer devices only) ---------- */
@media (hover: hover) {
  a:hover { text-decoration: underline; text-underline-offset: 2px; }
  .btn:hover, .brand:hover, .site-nav a:hover, .sidebar__nav a:hover, .list__item--link:hover, .card--link:hover, .table td > a:hover, .stepper__link:hover { text-decoration: none; }
  .btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
  .btn--secondary:hover:not(:disabled), .btn--ghost:hover:not(:disabled) { background: var(--surface); color: var(--text); }
  .btn--danger:hover:not(:disabled) { background: #a92222; }
  .card--link:hover { border-color: var(--border-strong); }
  .table tr.is-clickable:hover { background: var(--surface); }
  .list__item--link:hover { background: var(--surface); }
  .tab:hover { color: var(--text); }
  .site-nav a:hover, .site-footer a:hover, .sidebar__nav a:hover { color: var(--text); }
  .site-nav a:hover, .sidebar__nav a:hover { background: var(--surface); }
  .site-nav .site-nav__cta:hover { background: var(--red-hover); color: var(--on-red); }
  .segmented label:not(:has(> input:checked)):hover { background: var(--surface); color: var(--text); }
  .dropzone:hover { border-color: var(--brand); }
  .stepper__item.is-done .stepper__link:hover { color: var(--text); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn.is-loading::before { animation: spin 1.2s linear infinite !important; }
}


/* ---------- Brand layer: logo, red accent, footer, portal chrome ---------- */
.brand { gap: 10px; }
.brand__mark { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.brand__mark svg { width: 27px; height: auto; }
.brand__word { font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.dot { color: var(--brand); }   /* the red full stop on headlines */
.btn--brand { background: var(--red); color: var(--on-red); font-weight: 600; border-color: var(--red); }
.btn--on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn--pill { padding: 0 22px; }
.btn--pill.btn--lg { padding: 0 28px; }
.btn { transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .25s var(--ease-out); }
.btn:active:not(:disabled) { transform: scale(.97); }
@media (hover: hover) {
  .btn--brand:hover:not(:disabled) { background: var(--red-hover); border-color: var(--red-hover); }
  .btn--on-dark:hover:not(:disabled) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .5); }
  .card--link:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
}
.stepper__item[aria-current="step"] { border-bottom-color: var(--red); border-bottom-width: 3px; }
.marker--driver { background: var(--red); border-color: #fff; color: #fff; box-shadow: 0 2px 8px rgba(17, 17, 20, .35); }

/* Footer: light and quiet, as on apple.com. */
.site-footer { margin-top: 96px; padding: 48px 0 28px; background: var(--surface); color: var(--text-2); font-size: 13px; line-height: 1.5; }
.site-footer a:not(.btn) { color: var(--text-2); }
.site-footer .brand { color: var(--text); }
.site-footer__main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 48px; }
.site-footer__tagline { margin-top: 14px; max-width: 36ch; font-size: 14px; color: var(--text-2); }
.site-footer__reach { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.site-footer__hours { margin-top: 14px; color: var(--text-3); }
.site-footer__mail { margin-top: 2px; }
.site-footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.site-footer__title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.site-footer__col li + li { margin-top: 6px; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border-strong); color: var(--text-3); }
@media (hover: hover) { .site-footer a:not(.btn):hover { color: var(--text); } }
@media (max-width: 860px) { .site-footer__main { grid-template-columns: 1fr; gap: 32px; } }
@media (max-width: 520px) { .site-footer { margin-top: 64px; padding-top: 36px; } .site-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Portal chrome: a light sidebar (macOS style) with grouped nav, a frosted top bar with the go-to search, New order and riders online. */
.admin__main { background: var(--app-bg); }
.sidebar { background: var(--card); border-right: 1px solid var(--border); color: var(--text-2); }
.sidebar__brand { border-bottom: 0; }
.sidebar__brand .brand { color: var(--text); }
.sidebar__nav { padding: 4px 12px 16px; }
.sidebar__group { padding: 18px 10px 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.sidebar__nav a { height: 36px; border-radius: var(--radius-sm); color: var(--text-2); transition: background-color .2s ease, color .2s ease; }
.sidebar__nav a .icon { color: var(--text-3); transition: color .2s ease; }
.sidebar__nav a[aria-current="page"] { background: var(--red-soft); color: var(--text); font-weight: 600; }
.sidebar__nav a[aria-current="page"] .icon { color: var(--red); }
.sidebar__nav a .count { background: var(--surface-2); color: var(--text-2); border-radius: 999px; min-width: 22px; height: 20px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.sidebar__nav a .count.is-hot { background: var(--red); color: #fff; }
.sidebar__foot { border-top: 1px solid var(--border); color: var(--text); justify-content: flex-start; gap: 10px; padding: 14px 16px 14px 20px; }
.sidebar__avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.sidebar__who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar__name { font-size: 14px; font-weight: 500; color: var(--text); }
.sidebar__role { font-size: 12px; color: var(--text-3); }
.sidebar__signout { margin-left: auto; color: var(--text-2); }
@media (hover: hover) {
  .sidebar__nav a:hover:not([aria-current="page"]) { background: var(--surface); color: var(--text); }
  .sidebar__signout:hover { background: var(--surface); color: var(--text); }
}
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: var(--header-h); padding: 0 24px; background: var(--header-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--header-line); }
.topbar__menu { display: none; }
.topbar__title { display: none; font-size: 16px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__search { position: relative; flex: 1 1 320px; max-width: 460px; color: var(--text-3); }
.topbar__search > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.topbar__search-input { height: 38px; padding-left: 38px; padding-right: 52px; border-radius: var(--radius-pill); background: var(--surface); border-color: transparent; }
.topbar__kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-strong); font-size: 11px; font-weight: 500; color: var(--text-3); pointer-events: none; }
.topbar__search:focus-within .topbar__kbd { display: none; }
.topbar__search-btn { display: none; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar__live { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 13px; font-weight: 500; white-space: nowrap; }
.topbar__live.is-idle { background: var(--surface-2); color: var(--text-2); }
.topbar__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(22, 111, 64, .18); animation: live-pulse 2.4s ease-in-out infinite; }
.topbar__live.is-idle .topbar__dot { box-shadow: none; animation: none; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 6px rgba(22, 111, 64, 0); } }
.admin__content { padding: 32px 36px 48px; }
.admin__content .page-head h1 { font-size: 30px; }
.admin .card, .admin .kpi-row { border-color: transparent; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .admin .card, html[data-theme="dark"] .admin .kpi-row { border-color: transparent; box-shadow: none; }
html[data-theme="dark"] .card { border-color: transparent; }
html[data-theme="dark"] .card--link:hover { border-color: transparent; box-shadow: 0 0 0 1px var(--border-strong); }
html[data-theme="dark"] .site-footer { background: #0A0A0A; }
html[data-theme="dark"] .site-footer__bottom { border-top-color: var(--border); }
html[data-theme="dark"] .drawer, html[data-theme="dark"] .dialog, html[data-theme="dark"] .toast, html[data-theme="dark"] .goto { background: #1C1C1E; border-color: transparent; }
html[data-theme="dark"] .drawer__footer { background: #1C1C1E; }
.admin .table th { background: var(--surface); }
@media (max-width: 960px) {
  .topbar { height: 56px; padding: 0 12px 0 8px; gap: 8px; }
  .topbar__menu { display: inline-flex; }
  .topbar__title { display: block; }
  .topbar__search { display: none; }
  .topbar__search-btn { display: inline-flex; }
  .topbar.is-searching .topbar__search { display: block; position: absolute; left: 8px; right: 8px; top: 9px; max-width: none; }
  .topbar.is-searching .topbar__search-input { height: 38px; background: var(--card); box-shadow: var(--shadow); }
  .topbar__live-text { display: none; }
  .topbar__live { padding: 0 10px; }
  .admin__content { padding: 20px 16px 32px; }
  .admin__content .page-head h1 { font-size: 26px; }
}
@media (max-width: 520px) { .topbar__new-label { display: none; } .topbar__new { width: 40px; padding: 0; } }
.admin[data-view="orders"] .topbar__new { display: none; }

/* Go-to palette (shell.js): suggestions under the top bar search; ⌘K, Ctrl+K or / focuses it. */
.goto { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 70; max-height: min(440px, 70dvh); overflow-y: auto; padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); color: var(--text);
  animation: goto-in .25s var(--ease-out); }
.goto__group { padding: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.goto__item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text); font-size: 14px; cursor: pointer; text-decoration: none; }
.goto__item .icon { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.goto__main { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goto__meta { flex: none; font-size: 12px; color: var(--text-3); }
.goto__item[aria-selected="true"] { background: var(--red-soft); }
.goto__item[aria-selected="true"] .icon { color: var(--red); }
.goto__empty { padding: 14px 10px; font-size: 14px; color: var(--text-2); }
@keyframes goto-in { from { opacity: 0; transform: translateY(-4px) scale(.99); } to { opacity: 1; transform: none; } }

/* Public inner pages: a large title on white, no band. */
:is(body.page-request, body.page-checkout, body.page-track, body.page-business, body.page-driver, body.page-login, body.page-account, body.page-store, body.page-staff) main .page-head h1 { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1.08; }
@media (max-width: 720px) {
  :is(body.page-request, body.page-checkout, body.page-track, body.page-business, body.page-driver, body.page-login, body.page-account, body.page-store, body.page-staff) main .page-head { padding-top: 28px; margin-bottom: 24px; }
  :is(body.page-request, body.page-checkout, body.page-track, body.page-business, body.page-driver, body.page-login, body.page-account, body.page-store, body.page-staff) main .page-head h1 { font-size: 32px; }
}

/* ---------- Motion (js/motion.js) ---------- */
html.motion [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0ms); }
html.motion [data-reveal="fade"] { transform: none; }
html.motion [data-reveal="scale"] { transform: scale(.94); }
html.motion [data-reveal="left"] { transform: translateX(-24px); }
html.motion [data-reveal="right"] { transform: translateX(24px); }
html.motion [data-reveal].is-in { opacity: 1; transform: none; }
.w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .14em; margin-bottom: -.14em; }
.wi { display: inline-block; }
html.motion [data-split] .wi { transform: translateY(108%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 55ms + var(--d, 0ms)); }
html.motion [data-split].is-in .wi { transform: none; }
[data-fill] .fw { color: var(--fill-off); transition: color .26s ease; }
[data-fill] .fw.is-on { color: inherit; }
html.reduce-motion [data-reveal], html.reduce-motion [data-split] .wi { opacity: 1 !important; transform: none !important; transition: none !important; }
/* Static page titles settle in on load; MDM.motion.enter(container) staggers a freshly rendered view's blocks in once. */
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
main .page-head > * { animation: rise-in .8s var(--ease-out) both; }
main .page-head > * + * { animation-delay: .07s; }
.admin main .page-head > * { animation: none; }   /* office views re-render; they ease in through MDM.motion.enter on navigation */
.motion-enter { animation: rise-in .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
@media (prefers-reduced-motion: reduce) { main .page-head > *, .motion-enter { animation: none !important; } }

/* Theme switch, footer logo, and dark-mode fixes for third-party and non-token pieces. */
.theme-toggle { color: var(--text-2); border-radius: 999px; }
.theme-toggle .icon { width: 18px; height: 18px; }
@media (hover: hover) { .theme-toggle:hover { color: var(--text); background: var(--surface); } }
.site-footer__logo { display: inline-block; border-radius: 18px; overflow: hidden; line-height: 0; }
.site-footer__logo .rider { width: 72px; height: 72px; overflow: hidden; }
html[data-theme="dark"] .maplibregl-ctrl-group { background: var(--card); box-shadow: 0 0 0 1px var(--border); }
html[data-theme="dark"] .maplibregl-ctrl-group button + button { border-top-color: var(--border); }
html[data-theme="dark"] .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1); }
html[data-theme="dark"] .maplibregl-ctrl-attrib { background: rgba(0, 0, 0, .65) !important; color: #9a9aa0; }
html[data-theme="dark"] .maplibregl-ctrl-attrib a { color: #c4c4ca; }
html[data-theme="dark"] .maplibregl-ctrl-attrib-button { filter: invert(1); }
html[data-theme="dark"] .auth .auth__card { box-shadow: inset 0 0 0 1px var(--border); }
html[data-theme="dark"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
html[data-theme="dark"] img.thumb, html[data-theme="dark"] .dropzone__thumb { background: var(--surface); }
body { transition: background-color .3s ease, color .3s ease; }

/* Office sign-in: a card on the light app background. */
.auth { background: var(--app-bg); }
.auth .auth__card { border-radius: var(--radius-lg); border: 0; box-shadow: var(--shadow); }

/* ---------- Print ---------- */
@media print {
  @page { size: A4; margin: 20mm; }
  .site-header, .site-footer, .notice-bar, .sidebar, .sidebar-backdrop, .topbar, .btn, .toasts, .drawer, .drawer-backdrop, .mobile-bar, .map__overlay, .no-print { display: none !important; }
  body { display: block; min-height: 0; background: #fff; color: #000; }
  .admin { display: block; min-height: 0; }
  .admin__main { background: #fff; }
  .admin__content { padding: 0; }
  a { color: inherit; text-decoration: none; }
  body.page-invoice { --text: #000; --text-2: #000; --text-3: #333; --border: #999; --border-strong: #666; font-size: 12px; }
  body.page-invoice .table th, body.page-invoice .table td { border-bottom: 1px solid #999; }
  body.page-invoice .card, body.page-invoice .summary { border-color: #999; }
  body.page-invoice thead { display: table-header-group; }
  body.page-invoice tr, body.page-invoice .rate-table__row { break-inside: avoid; }
  body.page-invoice h1 { font-size: 22px; }
  body.page-invoice h2 { font-size: 16px; }
}
