:root { --brand: #991018; --brand-ink: #ffffff; --brand-on-dark: #EF3E48; }
/* Shared by the client's website and the app: fonts, the neutral palette and
   type scale from the Pull Count design, and one brand color from
   client.config.mjs (build.mjs writes --brand and --brand-ink in front of
   this file). Light only. */

@font-face { font-family: 'Switzer'; src: url('/assets/fonts/switzer-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('/assets/fonts/switzer-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('/assets/fonts/switzer-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('/assets/fonts/switzer-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/plex-mono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/plex-mono-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #fafaf8;
  --paper-2: #f1f1ee;
  --surface: #ffffff;
  --ink: #111114;
  --text-2: #4a4a52;
  --text-3: #6b6b74;
  --line: rgba(17, 17, 20, .08);
  --line-hi: rgba(17, 17, 20, .16);
  --night: #0b0d14;
  --on-night: #f2f3f7;
  --ok: #1f8a4c;
  --warn: #b7791f;
  --bad: #b3311d;
  --star: #f5a524;

  /* Mixed from the brand color, so any client color gets matching tints. */
  --brand-soft: #FBECED;
  --brand-line: color-mix(in srgb, var(--brand) 30%, transparent);
  --brand-deep: #7A0C12;

  --f-sans: 'Switzer', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow: 0 1px 2px rgba(17, 17, 20, .06), 0 8px 24px rgba(17, 17, 20, .06);
}

/* The Pull Count app. Light only, Switzer, short copy, one clear action per
   screen (DESIGN.md). The client's color is --brand. Mobile first: a tab bar
   on a phone, a side nav from 900px. Nothing under 13px. */

:root {
  --lift: 0 1px 2px rgba(17, 17, 20, .06), 0 8px 24px -8px rgba(17, 17, 20, .18);
  --float: 0 2px 6px rgba(17, 17, 20, .06), 0 24px 60px -20px rgba(17, 17, 20, .28);
  --violet: #6b4cf0;
  /* The map's three colors, each readable with its pin text. */
  --c-red: #c0392b;
  --c-amber: #f0a62c;
  --c-green: #1f8a4c;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot svg { border-radius: 14px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .8; } }
.noscript { padding: 32px 20px; text-align: center; color: var(--text-2); }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-3); font-size: 14px; }
.center { text-align: center; justify-content: center; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px;
  font-weight: 600; font-size: 16px; letter-spacing: -.01em; line-height: 1.15;
  cursor: pointer; text-align: center;
  transition: transform .12s, background-color .15s, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn .i { width: 20px; height: 20px; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(17, 17, 20, .12), 0 8px 18px -8px var(--brand-line); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); }
.btn-secondary { background: var(--paper-2); color: var(--ink); }
.btn-secondary:hover { background: #e9e9e5; }
.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--paper-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-big { min-height: 56px; font-size: 17px; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-small .i { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 2px; border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 15px; cursor: pointer; }
.link-btn .i { width: 18px; height: 18px; }
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--paper-2); color: var(--ink); cursor: pointer; }
.icon-btn .i { width: 20px; height: 20px; }

/* ---------- Shell: top bar and tabs on a phone ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: calc(52px + var(--safe-t)); padding: var(--safe-t) 16px 0;
  background: rgba(250, 250, 248, .88);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.co { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.co > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-mark {
  width: var(--s); height: var(--s); flex: none; display: inline-grid; place-items: center;
  border-radius: calc(var(--s) * .3); background: var(--brand); color: var(--brand-ink);
  font-weight: 700; font-size: max(13px, calc(var(--s) * .4)); letter-spacing: -.02em;
}
.co-logo { border-radius: 8px; object-fit: contain; flex: none; }
.demo-pill { flex: none; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--brand-line); background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600; }
.side { display: none; }
#main { max-width: 720px; margin: 0 auto; padding: 4px 16px calc(100px + var(--safe-b)); outline: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative; flex: 1; min-width: 0; min-height: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 7px 2px 6px; color: var(--text-3); font-size: 13px; font-weight: 500;
}
.tabbar a .i { width: 24px; height: 24px; }
.tabbar a[aria-current] { color: var(--brand); }
.tabbar a[aria-current] .i { stroke-width: 2.2; }
.badge {
  position: absolute; top: 4px; left: calc(50% + 5px);
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--bad); color: #fff; font-style: normal; font-size: 13px; font-weight: 600; line-height: 20px; text-align: center;
}

/* ---------- Shell: side nav on a computer ---------- */

@media (min-width: 900px) {
  .topbar, .tabbar { display: none; }
  .shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
  .side {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; padding: 20px 14px;
    background: var(--surface); border-right: 1px solid var(--line);
  }
  .side-co { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
  .side-co strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
  .side-co > div > span { font-size: 13px; color: var(--text-3); }
  .side-items { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
  .side-items a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; font-size: 15px; }
  .side-items a:hover { background: var(--paper); }
  .side-items a[aria-current] { background: var(--brand-soft); color: var(--brand); }
  .side-items a:nth-child(5) { margin-top: 14px; }
  .is-driver .side-items a:nth-child(5) { margin-top: 0; }
  .side-items .badge { position: static; margin-left: auto; }
  .side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px; color: var(--text-3); font-size: 13px; font-weight: 600; }
  .side-foot svg { border-radius: 5px; }
  .side-foot .demo-pill { margin-left: auto; }
  #main { margin: 0; max-width: 880px; padding: 28px 40px 64px; }
}

/* ---------- Page heads ---------- */

.page-head { padding: 14px 0 18px; }
.back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 6px -6px; padding: 6px; color: var(--brand); font-size: 15px; font-weight: 500; }
.back .i { width: 20px; height: 20px; }
.page-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-titles { min-width: 0; }
.page-head h1 { font-size: 32px; line-height: 1.06; font-weight: 600; letter-spacing: -.04em; overflow-wrap: anywhere; }
.sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; color: var(--text-3); font-size: 15px; }
.ref { font-family: var(--f-mono); font-size: 13px; color: var(--text-3); }
@media (min-width: 900px) { .page-head h1 { font-size: 40px; } }

/* ---------- Cards, lists, rows ---------- */

.card { margin-bottom: 14px; padding: 18px; background: var(--surface); border-radius: 22px; box-shadow: var(--lift); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2, .card-title { font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.card-title { margin-bottom: 10px; }
.section-title { display: flex; gap: 8px; align-items: baseline; margin: 24px 4px 8px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.kicker { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--text-3); font-size: 13px; font-weight: 600; }
.list { list-style: none; margin: 0 0 14px; padding: 0; background: var(--surface); border-radius: 22px; box-shadow: var(--lift); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.list-card { padding: 0; overflow: hidden; }
.list-card > .card-title { padding: 16px 16px 4px; margin: 0; }
.list-card > .row + .row, .list-card > .card-title + .row { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 12px 16px;
  border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
}
a.row:hover, button.row:hover { background: #fcfcfa; }
.row-lead { flex: none; display: grid; place-items: center; color: var(--brand); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 14px; }
.row-right { flex: none; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.row-chev { width: 18px; height: 18px; color: #c2c2c8; }
.row.danger .row-title, .row.danger .row-lead { color: var(--bad); }
.row.add .row-title { color: var(--brand); }
.pad-row { padding: 16px; }
.empty { margin-bottom: 14px; padding: 28px 18px; text-align: center; color: var(--text-2); background: var(--surface); border-radius: 22px; box-shadow: var(--lift); }
.empty .muted { margin-top: 4px; }
.fine { display: flex; align-items: flex-start; gap: 8px; margin: 14px 4px; color: var(--text-3); font-size: 14px; line-height: 1.45; }
.fine .i { width: 18px; height: 18px; margin-top: 1px; }
.fine a { color: var(--brand); font-weight: 500; }
.stack-actions { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; }
.sticky-cta { margin-top: 22px; }

.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--paper-2); color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.ok { background: #e4f3ea; color: var(--ok); }
.pill.amber { background: #fcf0d9; color: #85550c; }
.pill.red { background: #fbe7e3; color: var(--bad); }
.pill.green { background: #e4f3ea; color: var(--ok); }
.dot { display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 50%; }
.dot.red { background: var(--c-red); }
.dot.amber { background: var(--c-amber); }
.dot.green { background: var(--c-green); }
.avatar { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--paper-2); color: var(--text-2); font-size: 15px; font-weight: 600; }
.avatar.pro { background: var(--brand-soft); color: var(--brand); }

/* ---------- Today and routes ---------- */

.counts { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; }
.count { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; background: var(--surface); border-radius: 999px; box-shadow: var(--lift); color: var(--text-2); font-size: 14px; }
.count i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.count.k-pickup i { background: var(--ink); }
.count.k-swap i { background: var(--violet); }
.count b { color: var(--ink); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.truck-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 0 2px; }
.truck-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.stops { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stop { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border-radius: 20px; box-shadow: var(--lift); }
.stop.next { box-shadow: 0 0 0 2px var(--brand), var(--lift); }
.stop-n { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--brand); color: var(--brand-ink); font-size: 16px; font-weight: 700; }
.stop-n .i { width: 20px; height: 20px; stroke-width: 2.6; }
.k-pickup .stop-n { background: var(--ink); color: #fff; }
.k-swap .stop-n { background: var(--violet); color: #fff; }
.stop.done .stop-n { background: var(--ok); color: #fff; }
.stop.done .stop-main { opacity: .6; }
.stop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.stop-kind { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 13px; }
.stop-kind b { color: var(--brand); font-weight: 600; }
.k-pickup .stop-kind b { color: var(--ink); }
.k-swap .stop-kind b { color: #5536d6; }
.stop-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.stop-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 14px; }
.next-tag { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600; }
.done-tag { flex: none; color: var(--ok); font-size: 13px; font-weight: 600; }
.note-row { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 14px 16px; border-radius: 18px; background: #fbe7e3; color: var(--bad); font-size: 15px; font-weight: 500; }
.note-row > span { flex: 1; }
.note-row .row-chev { color: var(--bad); }
.route-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.route-stats > div { display: flex; flex-direction: column; }
.route-stats strong { font-size: 30px; font-weight: 600; letter-spacing: -.035em; line-height: 1.05; }
.route-stats span { color: var(--text-3); font-size: 13px; }
.card.route-stats { padding: 16px 18px; }
.route-card .route-stats { margin-bottom: 16px; }
.day-strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 4px 16px 8px; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day {
  position: relative; flex: none; width: 62px; min-height: 76px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--surface); border-radius: 18px; box-shadow: var(--lift);
  color: var(--text-3); font-size: 13px; cursor: pointer;
}
.day strong { color: var(--ink); font-size: 21px; font-weight: 600; line-height: 1.15; }
.day strong .i { width: 22px; height: 22px; color: var(--brand); }
.day em { color: var(--bad); font-size: 13px; font-style: normal; font-weight: 500; }
.day.shut:not(.on) strong { color: var(--text-3); }
.day.on { background: var(--brand); color: rgba(255, 255, 255, .85); }
.day.on strong, .day.on em, .day.on strong .i { color: #fff; }
.day-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.seg { display: flex; gap: 4px; margin-bottom: 14px; padding: 4px; background: var(--paper-2); border-radius: 999px; }
.seg a { flex: 1; padding: 9px 8px; border-radius: 999px; color: var(--text-2); font-size: 15px; font-weight: 500; text-align: center; white-space: nowrap; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(17, 17, 20, .12); }
.seg b { margin-left: 3px; color: var(--text-3); font-weight: 600; }
.search { display: flex; align-items: center; gap: 10px; height: 50px; margin-bottom: 12px; padding: 0 14px; background: var(--surface); border-radius: 16px; box-shadow: var(--lift); color: var(--text-3); }
.search:focus-within { box-shadow: 0 0 0 2px var(--brand), var(--lift); }
.search input { flex: 1; height: 100%; min-width: 0; border: 0; outline: none; background: none; color: var(--ink); font-size: 16px; }
@media (min-width: 900px) { .day-strip { margin: 0 0 14px; padding: 4px 0 8px; } }

/* ---------- Map ---------- */

.map-wrap { margin-bottom: 14px; }
.map { position: relative; z-index: 0; overflow: hidden; background: #e8ebe5; border-radius: 22px; box-shadow: var(--lift); }
.map-big { height: 56vh; min-height: 320px; max-height: 620px; }
.map-route { height: 260px; margin-bottom: 14px; }
.map-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: var(--text-3); font-size: 15px; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; padding: 12px 14px; background: var(--surface); border-radius: 16px; box-shadow: var(--lift); color: var(--text-2); font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend b { color: var(--ink); font-weight: 600; }
.leaflet-container { font-family: var(--f-sans); }
.leaflet-control-attribution { font-size: 13px; }
.pin { display: grid; place-items: center; }
.pin span {
  display: block; height: 28px; padding: 0 9px; border: 2px solid #fff; border-radius: 999px;
  background: var(--c-green); color: #fff; box-shadow: 0 2px 8px rgba(17, 17, 20, .3);
  font: 600 13px/24px var(--f-sans); white-space: nowrap;
}
.pin::after { content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.pin-red span { background: var(--c-red); }
.pin-amber span { background: var(--c-amber); color: var(--ink); }
.pin-yard span { background: var(--ink); }
.pin-num span {
  display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid #fff; border-radius: 50%;
  background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(17, 17, 20, .3); font: 700 14px var(--f-sans);
}
.pin-num.k-pickup span { background: var(--ink); }
.pin-num.k-swap span { background: var(--violet); }
.pin-num.done span { background: var(--ok); }

/* ---------- A booking ---------- */

.stop-info .addr { font-size: 23px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
.stop-info .addr span { display: block; margin-top: 2px; color: var(--text-2); font-size: 16px; font-weight: 400; letter-spacing: 0; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.quick-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 0; border-radius: 16px; background: var(--brand-soft); color: var(--brand); font-size: 14px; font-weight: 600; cursor: pointer; }
.quick-btn:hover { background: color-mix(in srgb, var(--brand) 14%, white); }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.card > .facts:first-child > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { flex: none; color: var(--text-3); font-size: 15px; }
.facts dd { min-width: 0; text-align: right; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.due { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.due.red { background: #fbe7e3; color: var(--bad); }
.due.amber { background: #fcf0d9; color: #85550c; }
.due.green { background: #e4f3ea; color: var(--ok); }
.action-bar { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin: 0 0 14px; }
.action-bar > :only-child { grid-column: 1 / -1; }
.action-bar .btn { min-height: 56px; padding: 0 14px; }
.notes { color: var(--text-2); font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.big-num { margin: 2px 0 4px; font-size: 30px; font-weight: 600; letter-spacing: -.035em; }
.card .btn-block { margin-top: 14px; }

/* ---------- Forms ---------- */

.form .btn + .btn { margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; border: 0; padding: 0; }
.field > span:first-child { color: var(--text-2); font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid var(--line-hi); border-radius: 12px; outline: none;
  background: var(--surface); font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 104px; resize: vertical; line-height: 1.4; }
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b6b74' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input[readonly] { background: var(--paper-2); color: var(--text-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-err { margin: 2px 0 14px; color: var(--bad); font-size: 15px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 46px; padding: 0 16px; border: 1.5px solid transparent; border-radius: 999px; background: var(--paper-2); font-size: 15px; font-weight: 500; cursor: pointer; }
.chip input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 78px; }
.pw-toggle { position: absolute; top: 50%; right: 6px; height: 38px; padding: 0 12px; transform: translateY(-50%); border: 0; border-radius: 999px; background: none; color: var(--brand); font-size: 14px; font-weight: 600; cursor: pointer; }
.money-wrap { position: relative; display: block; }
.money-wrap::before { content: '$'; position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: var(--text-3); }
.money-wrap input { padding-left: 28px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; margin: 0; appearance: none; -webkit-appearance: none; border-radius: 999px; background: #d6d6da; cursor: pointer; transition: background-color .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.switch-row { cursor: pointer; }

/* ---------- Sheets ---------- */

#sheet { position: fixed; inset: 0; z-index: 80; }
.sheet-back { position: absolute; inset: 0; background: rgba(11, 13, 20, .42); opacity: 0; transition: opacity .2s; }
#sheet.open .sheet-back { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 90dvh; overflow: auto;
  padding: 10px 20px calc(18px + var(--safe-b));
  background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--float);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
#sheet.open .sheet { transform: none; }
.sheet-grab { width: 40px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: #d9d9dc; }
.sheet h2 { margin-bottom: 12px; font-size: 23px; font-weight: 600; letter-spacing: -.025em; outline: none; }
.sheet-lede { margin-bottom: 14px; color: var(--text-2); }
.sheet .chips + .field, .sheet .chips + .muted { margin-top: 14px; }
.sheet-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.preview { margin-top: 16px; padding: 12px 15px; border-radius: 20px 20px 6px 20px; background: var(--brand); color: var(--brand-ink); font-size: 15px; line-height: 1.42; }
@media (min-width: 700px) {
  .sheet { top: 50%; right: auto; bottom: auto; left: 50%; width: 460px; border-radius: 26px; opacity: 0; transform: translate(-50%, -46%); transition: transform .2s, opacity .2s; }
  #sheet.open .sheet { opacity: 1; transform: translate(-50%, -50%); }
  .sheet-grab { display: none; }
  .sheet h2 { margin-top: 8px; }
}

/* ---------- Toasts and the new-booking banner ---------- */

#toasts { position: fixed; z-index: 95; left: 12px; right: 12px; bottom: calc(78px + var(--safe-b)); display: flex; justify-content: center; pointer-events: none; }
.toast { max-width: 440px; padding: 12px 16px; border-radius: 16px; background: var(--night); color: var(--on-night); box-shadow: var(--float); font-size: 15px; font-weight: 500; line-height: 1.38; opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; }
.toast.in { opacity: 1; transform: none; }
.toast.demo { background: var(--brand-deep); }
.toast.bad { background: var(--bad); }
html.ob-on #toasts { bottom: calc(20px + var(--safe-b)); }
#banners { position: fixed; z-index: 85; top: calc(8px + var(--safe-t)); left: 8px; right: 8px; display: flex; justify-content: center; pointer-events: none; }
.banner {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, .97);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--float);
  text-align: left; cursor: pointer; pointer-events: auto;
  transform: translateY(-150%); transition: transform .38s cubic-bezier(.2, .9, .25, 1.12);
}
.banner.in { transform: none; }
.banner .tally { flex: none; border-radius: 9px; }
.banner-text { min-width: 0; display: flex; flex-direction: column; }
.banner-app { color: var(--text-3); font-size: 13px; }
.banner strong { font-size: 16px; font-weight: 600; }
.banner-text > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 14px; }
@media (min-width: 900px) {
  #toasts { left: 264px; bottom: 24px; }
  #banners { left: auto; right: 20px; top: 20px; width: 400px; }
}

/* ---------- Messages ---------- */

.thread-row.unread .row-title { font-weight: 700; }
.thread-row.unread .row-sub { color: var(--ink); }
.time { color: var(--text-3); font-size: 13px; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.bubbles { list-style: none; margin: 0; padding: 4px 0 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 84%; display: flex; flex-direction: column; gap: 3px; }
.bubble p { padding: 10px 14px; border-radius: 20px; font-size: 16px; line-height: 1.38; overflow-wrap: anywhere; }
.bubble span { padding: 0 8px; color: var(--text-3); font-size: 13px; }
.bubble.them { align-self: flex-start; }
.bubble.them p { background: var(--surface); box-shadow: var(--lift); border-bottom-left-radius: 6px; }
.bubble.us { align-self: flex-end; align-items: flex-end; }
.bubble.us p { background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; }
.bubble-empty { padding: 20px; color: var(--text-3); text-align: center; }
.composer { position: sticky; bottom: calc(58px + var(--safe-b)); z-index: 5; margin: 0 -16px; padding: 14px 16px 6px; background: linear-gradient(to top, var(--paper) 78%, rgba(250, 250, 248, 0)); }
.omw-btn { margin-bottom: 10px; background: var(--surface); box-shadow: var(--lift); }
.composer-row { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 16px; background: var(--surface); border-radius: 26px; box-shadow: var(--lift); }
.composer-row:focus-within { box-shadow: 0 0 0 2px var(--brand), var(--lift); }
.composer textarea { flex: 1; min-width: 0; max-height: 140px; padding: 9px 0; border: 0; outline: none; background: none; font-size: 16px; line-height: 1.4; resize: none; }
.send-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--brand); color: var(--brand-ink); cursor: pointer; }
.send-btn .i { width: 19px; height: 19px; }
.composer .fine { justify-content: center; margin: 8px 4px 0; font-size: 13px; }
.thread { display: flex; flex-direction: column; min-height: calc(100dvh - 160px - var(--safe-t) - var(--safe-b)); }
.thread .composer { margin-top: auto; }
@media (min-width: 900px) {
  .composer { bottom: 0; padding: 14px 0 12px; }
  .thread { min-height: calc(100vh - 92px); }
  .thread .composer { margin: auto 0 0; }
}

/* ---------- Invoices and contracts ---------- */

.amount { font-size: 15px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats strong { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.stats .bad { color: var(--bad); }
.stats span { color: var(--text-3); font-size: 13px; line-height: 1.3; }
.lines { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 15px; }
.lines td, .lines th { padding: 10px 0; border-top: 1px solid var(--line); text-align: left; font-weight: 400; }
.lines td:last-child, .lines th:last-child { padding-left: 12px; text-align: right; white-space: nowrap; }
.lines tfoot th { font-size: 17px; font-weight: 600; }
.inline-link { display: inline-flex; align-items: center; gap: 2px; margin-top: 12px; color: var(--brand); font-size: 15px; font-weight: 600; }
.inline-link .i { width: 16px; height: 16px; }
.filled { margin-bottom: 16px; padding: 14px 16px; border-radius: 16px; background: var(--brand-soft); }
.filled .kicker { color: var(--brand); margin-bottom: 6px; }
.filled .kicker .i { width: 16px; height: 16px; }
.filled p { font-size: 15px; }
.line-row { display: flex; gap: 8px; }
.line-row .grow { flex: 1; min-width: 0; }
.line-row .field { margin-bottom: 8px; }
.money-in { width: 112px; flex: none; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 14px; padding: 14px 0 0; border-top: 1px solid var(--line); }
.total-line strong { font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.terms { list-style: none; margin: 0; padding: 0; }
.terms li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.terms li:first-child { border-top: 0; padding-top: 0; }
.terms b { font-weight: 600; }
.signature { display: block; width: 100%; max-width: 360px; height: auto; margin: 4px 0 10px; border-radius: 12px; background: var(--paper); fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pad { position: relative; }
.pad canvas { display: block; width: 100%; aspect-ratio: 3 / 1; border: 1.5px dashed var(--line-hi); border-radius: 14px; background: var(--paper); cursor: crosshair; touch-action: none; }
.pad-clear { position: absolute; top: 2px; right: 10px; }
.field .rate { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.field .rate span { font-size: 15px; font-weight: 500; }
.field .rate input { width: 130px; flex: none; }

/* ---------- Setup ---------- */

.bin-no { min-width: 60px; padding: 4px 8px; border-radius: 8px; background: var(--paper-2); color: var(--ink); font-family: var(--f-mono); font-size: 14px; font-weight: 500; text-align: center; }
.limits p { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); font-size: 15px; }
.limits p + p { margin-top: 10px; }
.limits .i { width: 20px; height: 20px; color: var(--text-3); }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-bottom: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.price-size { grid-column: 1 / -1; margin-bottom: 8px; font-size: 17px; font-weight: 600; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 10px; }
.wd { position: relative; }
.wd input { position: absolute; opacity: 0; pointer-events: none; }
.wd span { display: grid; place-items: center; height: 50px; border-radius: 12px; background: var(--paper-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.wd input:checked + span { background: #fbe7e3; color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.wd input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Onboarding ---------- */

.ob { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(24px + var(--safe-t)) 20px calc(20px + var(--safe-b)); }
.ob-inner { width: 100%; max-width: 440px; margin: auto; display: flex; flex-direction: column; }
.ob h1 { font-size: 38px; line-height: 1.03; font-weight: 600; letter-spacing: -.05em; outline: none; }
.ob-mark { margin-bottom: 26px; }
.ob-mark .tally { border-radius: 18px; box-shadow: 0 14px 32px -12px rgba(153, 16, 24, .45); }
.ob-co { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--text-2); font-size: 17px; font-weight: 500; }
.ob-q { margin: 44px 0 14px; font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.ob-choices { display: flex; flex-direction: column; gap: 12px; }
.ob-choice { display: flex; align-items: center; gap: 16px; min-height: 88px; padding: 18px; border: 1.5px solid transparent; border-radius: 24px; background: var(--surface); box-shadow: var(--lift); transition: border-color .15s, transform .12s; }
.ob-choice:hover { border-color: var(--brand-line); }
.ob-choice:active { transform: scale(.99); }
.ob-ic { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 17px; background: var(--brand-soft); color: var(--brand); }
.ob-ic .i { width: 27px; height: 27px; }
.ob-txt { flex: 1; display: flex; flex-direction: column; }
.ob-txt strong { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.ob-txt small { color: var(--text-3); font-size: 15px; }
.ob-foot { margin-top: 28px; color: var(--text-3); font-size: 14px; text-align: center; }
.ob .back { align-self: flex-start; }
.ob-form h1 { margin: 14px 0 10px; font-size: 31px; }
.ob-lede { margin-bottom: 8px; color: var(--text-2); font-size: 17px; }
.ob-form .field:first-of-type { margin-top: 20px; }
.demo-note { display: flex; align-items: center; gap: 6px; margin: -4px 0 16px; color: var(--brand); font-size: 14px; font-weight: 500; }
.demo-note .i { width: 18px; height: 18px; }
.home-icon { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px auto 22px; }
.home-icon .tally { border-radius: 16px; box-shadow: 0 12px 28px -12px rgba(153, 16, 24, .45); }
.home-icon span { color: var(--text-2); font-size: 13px; font-weight: 500; }
.ob-install h1 { text-align: center; font-size: 32px; }
.ob-install .ob-lede { margin: 10px 0 20px; text-align: center; }
.ob-steps { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ob-step { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border-radius: 20px; box-shadow: var(--lift); }
.ob-n { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: 15px; font-weight: 700; }
.ob-step-txt { flex: 1; font-size: 16px; line-height: 1.35; }
.ob-step-txt b { font-weight: 600; }
.ob-pic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--paper-2); color: #0a7aff; }
.ob-pic .i { width: 24px; height: 24px; }
.ios-add { color: #0a7aff; font-size: 15px; font-weight: 600; }
.ob-host { margin: 0 0 18px; text-align: center; }
.host { margin-top: 8px; padding: 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--lift); font-family: var(--f-mono); font-size: 19px; font-weight: 500; overflow-wrap: anywhere; }
.ob-done { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 24px; color: var(--ok); font-weight: 600; }
.ob-install-now { margin: 4px 0 14px; text-align: center; }
.ob-install-now .muted { margin-top: 10px; }
.ob-install .btn-secondary { margin-bottom: 12px; }

/* ---------- Walkthrough ---------- */

html.tour-on, html.tour-on body { overflow: hidden; }
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-block { position: absolute; inset: 0; touch-action: none; }
.tour-hole {
  position: fixed; top: 50%; left: 50%; width: 0; height: 0;
  border-radius: 20px; outline: 2px solid rgba(255, 255, 255, .92); outline-offset: 0;
  box-shadow: 0 0 0 200vmax rgba(11, 13, 20, .64); pointer-events: none;
  transition: top .3s ease, left .3s ease, width .3s ease, height .3s ease, opacity .2s;
}
.tour-card { position: fixed; top: 50%; left: 16px; padding: 18px 18px 10px; background: var(--surface); border-radius: 24px; box-shadow: var(--float); transition: top .3s ease, left .3s ease; }
.tour-count { margin-bottom: 4px; color: var(--brand); font-family: var(--f-mono); font-size: 13px; font-weight: 500; }
.tour-card h2 { margin-bottom: 6px; font-size: 21px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
#tour-body { color: var(--text-2); font-size: 16px; line-height: 1.45; }
.tour-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.tour-actions .btn { min-height: 46px; }
.tour-actions .btn-primary { min-width: 124px; }
.tour-skip { display: block; margin: 6px auto 0; padding: 8px 10px; border: 0; background: none; color: var(--text-3); font-size: 14px; font-weight: 500; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Trip fees ---------- */

/* Drop-off date and Days sit side by side. A date input has a minimum width of
   its own on phones, and a plain 1fr column won't shrink below it, so the date
   box ran under the Days box. minmax(0, 1fr) lets the columns shrink, and the
   date input is told it may. */
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two > * { min-width: 0; }
.field input[type='date'] { display: block; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; text-align: left; }
.field input[type='date']::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.field input[type='date']::-webkit-datetime-edit { padding: 0; }
@media (max-width: 400px) { .two { gap: 10px; } .field input[type='date'] { padding-inline: 12px; font-size: 16px; } }

/* The price lines on a new booking, and the answer when it is too far. */
.quote { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 16px; padding: 14px 16px; border-radius: 14px; background: var(--paper-2); font-size: 15px; }
.quote-r { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); }
.quote-r b { flex: none; color: var(--ink); font-weight: 600; }
.quote-free b { color: var(--ok); }
.quote-t { margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--line-hi); color: var(--ink); font-size: 17px; font-weight: 600; }
.quote-out { gap: 4px; background: color-mix(in srgb, var(--bad) 8%, white); color: var(--text-2); line-height: 1.4; }
.quote-out b { color: var(--bad); font-weight: 600; }

/* The trip fee settings: the rule in plain words, then a worked example. */
.trip-rule { margin: 0 0 8px; color: var(--ink); font-size: 15px; line-height: 1.45; }
.trip-eg { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-size: 15px; font-weight: 600; line-height: 1.4; }

/* ---------- Invoices and phone fixes ---------- */

/* The big button that starts an invoice (a small one in the page head was
   easy to miss). Full width on a phone, its own size on a computer. */
.cta { margin: 0 0 16px; }
@media (min-width: 900px) { .cta { display: inline-flex; width: auto; padding: 0 28px; } }
.form-sub { margin: 18px 0 10px; color: var(--text-2); font-size: 15px; font-weight: 600; }
.note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: #fcf0d9; color: #85550c; font-size: 14px; line-height: 1.4; }
.note .i { width: 18px; height: 18px; margin-top: 1px; }
/* One line of an invoice: the words on top, the price and a remove button
   under them, so nothing is squeezed at 360px. */
.line-row { flex-direction: column; gap: 8px; margin-bottom: 10px; padding: 10px; border-radius: 16px; background: var(--paper); }
.line-row .field { margin-bottom: 0; }
.line-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.line-foot .money-in { width: 150px; flex: none; }
.quick-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 15px; font-weight: 600; cursor: pointer; }
.chip-btn .i { width: 18px; height: 18px; }
.due-note { margin: -6px 0 14px; }
/* Total and the save button stay in reach above the tab bar while the form
   scrolls, and the error shows right beside the button that caused it. */
.bill-bar { position: sticky; bottom: calc(66px + var(--safe-b)); z-index: 5; margin: 6px -8px -8px; padding: 12px; border-radius: 20px; background: rgba(255, 255, 255, .97); box-shadow: 0 -6px 24px -10px rgba(17, 17, 20, .25), var(--lift); }
.bill-bar .form-err { margin: 0 0 10px; }
.bill-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bill-total { display: flex; flex-direction: column; line-height: 1.1; }
.bill-total span { color: var(--text-3); font-size: 13px; }
.bill-total strong { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.bill-total strong.bad { color: var(--bad); }
.bill-row .btn { flex: 1 1 auto; max-width: 240px; padding: 0 16px; }
.preview.msg { white-space: pre-line; border-radius: 18px; overflow-wrap: anywhere; }
@media (min-width: 900px) { .bill-bar { bottom: 12px; } }
.inner-list { list-style: none; margin: 0; padding: 0; }
.inner-list > li { border-top: 1px solid var(--line); }
.pad-row .muted { margin-bottom: 2px; }
.pad-row .btn-block { margin-top: 10px; }
/* A toast over an open sheet would sit on its buttons: show it at the top. */
body:has(#sheet.open) #toasts { top: calc(12px + var(--safe-t)); bottom: auto; }
.filled p { overflow-wrap: anywhere; }
/* "On my way" wrapped onto two lines at 360px: the small button takes what it
   needs and the main one the rest. */
.action-bar { grid-template-columns: auto 1fr; }
.action-bar .btn { white-space: nowrap; }
.action-bar > :only-child { grid-column: 1 / -1; }
/* The driver's main buttons sat below the fold, half under the tab bar. On a
   phone they stay in reach above it; on a computer they flow with the page. */
.action-bar { position: sticky; bottom: calc(66px + var(--safe-b)); z-index: 5; margin: 0 -16px 14px; padding: 10px 16px; background: linear-gradient(to top, var(--paper) 70%, rgba(250, 250, 248, 0)); }
@media (min-width: 900px) { .action-bar { position: static; margin: 0 0 14px; padding: 0; background: none; } }

/* ---------- Maps and routes ---------- */

/* Leaflet's buttons are 30px; a thumb needs more. */
.leaflet-container .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; }
.leaflet-container .leaflet-bar .leaflet-control-zoom-in, .leaflet-container .leaflet-bar .leaflet-control-zoom-out { font-size: 22px; }
.pc-fit a { display: grid; place-items: center; color: var(--ink); }
.pc-fit .i { width: 20px; height: 20px; }

/* A bin pin is its number in a pill. When the map is zoomed out far enough
   that full-size pills would overlap, map.js (sizePins) puts a smaller size on
   the whole map, so every pin still looks alike and shows its number. The
   pill sits on the bottom of its box so the tip stays attached. */
.pins-s .pin, .pins-xs .pin { place-items: end center; }
.pins-s .pin span { height: 22px; padding: 0 7px; font-size: 12px; line-height: 18px; }
.pins-xs .pin span { height: 18px; padding: 0 5px; border-width: 1.5px; font-size: 11px; line-height: 15px; }
.pins-xs .pin::after { border-width: 4px; bottom: -4px; }
.pin.sel span, .pin-num.sel span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 45%, transparent), 0 2px 8px rgba(17, 17, 20, .3); }
/* The numbered stops are 32px; the tap area is a finger wide. */
.pin-num::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; }
.pin-num span { position: relative; }

/* The card under a tapped pin. On a phone it floats above the tab bar; on a
   computer it sits in the corner of the map. */
.map-wrap { position: relative; }
.pin-card {
  position: fixed; z-index: 25; left: 12px; right: 12px; bottom: calc(66px + var(--safe-b));
  max-width: 520px; margin: 0 auto; padding: 14px 16px 16px;
  background: var(--surface); border-radius: 22px; box-shadow: var(--float);
}
.pin-card[hidden] { display: none; }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin-bottom: 6px; }
.pc-pills { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pc-x { width: 40px; height: 40px; flex: none; display: grid; place-items: center; margin: -8px -8px -8px 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; }
.pc-x:hover { background: var(--paper-2); }
.pc-x .i { width: 20px; height: 20px; }
.pc-title { font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.pc-addr { margin-top: 2px; color: var(--text-2); font-size: 15px; }
.pc-facts { margin-top: 2px; color: var(--text-3); font-size: 14px; }
.pc-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pc-actions > :only-child { grid-column: 1 / -1; }
.pc-actions:has(> :nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
.pc-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; padding: 8px 6px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); font-size: 14px; font-weight: 600; }
.pc-act:hover { background: color-mix(in srgb, var(--brand) 14%, white); }
.pc-act.primary { background: var(--brand); color: var(--brand-ink); }
.pc-act.primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); }
.pc-act .i { width: 20px; height: 20px; }
.pill.violet { background: #ece8fd; color: #5536d6; }
@media (min-width: 900px) {
  .pin-card { position: absolute; left: 12px; right: auto; bottom: 12px; width: 380px; margin: 0; }
}

/* The drive under a route's numbers, and the card that says who has the route. */
.drive { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--text-2); font-size: 14px; }
.drive .i { width: 18px; height: 18px; flex: none; color: var(--brand); }
.route-card .drive { margin: 0; }
.map-route { height: 280px; }
.driver-card { padding: 14px 16px; }
.driver-line { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.4; }
.driver-line .i { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--ok); }
.driver-line b { font-weight: 600; }
.driver-more { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; margin-left: 30px; }
.driver-more .link-btn { padding-bottom: 0; }
.driver-card.warn { background: #fcf0d9; box-shadow: none; }
.driver-card.warn .driver-line .i { color: #85550c; }
.driver-card.warn .btn { margin: 10px 0 0 30px; }

/* The customer page's map: a picture of where they are, not a map to push
   around. The whole thing is one link, so a thumb scrolling past never drags it. */
.mini-map-wrap { position: relative; margin: 14px 0 0; }
.mini-map { height: 160px; border-radius: 16px; box-shadow: none; }
.mini-tap { position: absolute; z-index: 5; inset: 0 0 22px; display: flex; align-items: flex-end; padding: 8px; border-radius: 16px 16px 0 0; }
.mini-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .96); box-shadow: var(--lift); color: var(--brand); font-size: 14px; font-weight: 600; }
.mini-chip .i { width: 18px; height: 18px; }

/* The search above the Map. The list opens directly under the field and
   floats over the legend and map; 16px type so iOS doesn't zoom on focus. */
.mapfind { position: relative; z-index: 2; margin-bottom: 10px; }
.mapfind .search { margin-bottom: 0; }
.mapfind .search input { font-size: 16px; }
.mf-clear { width: 36px; height: 36px; flex: none; display: grid; place-items: center; margin-right: -8px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer; }
.mf-clear[hidden] { display: none; }
.mf-clear:hover { background: var(--paper-2); }
.mf-clear .i { width: 18px; height: 18px; }
.mf-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: min(340px, 45vh); overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); border-radius: 18px; box-shadow: var(--float); overscroll-behavior: contain; }
.mf-list[hidden] { display: none; }
.mf-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; border: 0; border-radius: 12px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.mf-list button:hover, .mf-list li.on button { background: var(--brand-soft); }
.mf-t { min-width: 0; display: grid; }
.mf-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; }
.mf-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 14px; }
.mf-none { padding: 12px 10px; color: var(--text-3); font-size: 15px; }

/* ---------- Today ---------- */

/* The hello: the date, a name, and one plain line on the day. */
.hello { padding: 14px 0 16px; }
.hello-date { color: var(--text-3); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.hello h1 { margin-top: 2px; font-size: 32px; line-height: 1.06; font-weight: 600; letter-spacing: -.04em; overflow-wrap: anywhere; }
.hello-sum { margin-top: 6px; color: var(--text-2); font-size: 16px; line-height: 1.45; }
@media (min-width: 900px) { .hello h1 { font-size: 40px; } }

/* Owner only: the two things an owner starts the day by doing. */
.quick-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.quick-acts .btn { padding: 0 10px; font-size: 16px; }

/* A stop is one card. The row opens its actions underneath, inside the same
   card, so they read as part of the stop. The fold animates the grid row
   from 0fr to 1fr, which needs no measured height. The closed panel is
   visibility:hidden so its buttons are out of the tab order and the reader. */
.tstop { position: relative; background: var(--surface); border-radius: 20px; box-shadow: var(--lift); scroll-margin: 68px 0 92px; }
.tstop.next { box-shadow: 0 0 0 2px var(--brand), var(--lift); }
.tstop .stop { width: 100%; border: 0; border-radius: 20px; background: none; box-shadow: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tstop .stop:hover { background: #fcfcfa; }
.tstop.open .stop { border-radius: 20px 20px 0 0; }
.tstop .row-chev { transition: transform .24s ease; }
.tstop.open .row-chev { transform: rotate(90deg); }
.tstop-more { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .26s cubic-bezier(.2, .7, .2, 1), visibility 0s .26s; }
.tstop.open .tstop-more { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .26s cubic-bezier(.2, .7, .2, 1), visibility 0s; }
.tstop-clip { min-height: 0; overflow: hidden; }
.tstop-acts { display: grid; gap: 8px; margin: 0 14px; padding: 12px 0 14px; border-top: 1px solid var(--line); }
.tstop-acts .btn { min-height: 48px; padding: 0 10px; font-size: 15px; }
.tstop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tstop-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (prefers-reduced-motion: reduce) {
  .tstop-more, .tstop.open .tstop-more, .tstop .row-chev { transition: none; }
}

.maps-link { min-height: 44px; margin: -6px 0 4px; }
.maps-link small { color: var(--text-3); font-size: 13px; font-weight: 500; }

.note-row + .note-row { margin-top: 8px; }
.note-info { background: var(--brand-soft); color: var(--brand); }
.note-info .row-chev { color: var(--brand); }

/* Later this week: the next few days, one line each. */
.later { margin-top: 26px; }
.later h2 { margin: 0 2px 10px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.later-list { margin-bottom: 0; }
.later-row { display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 10px 16px; }
.later-row:hover { background: #fcfcfa; }
.later-day { flex: none; width: 40px; display: flex; flex-direction: column; align-items: center; color: var(--text-3); font-size: 13px; font-weight: 600; line-height: 1.1; text-transform: uppercase; }
.later-day b { color: var(--ink); font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.later-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.later-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.later-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.later-kind { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600; }
.later-row.k-pickup .later-kind { background: var(--paper-2); color: var(--ink); }
.later-row.k-swap .later-kind { background: #ece8fd; color: #5536d6; }
.later-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 14px; }
.hello + .fine { margin-top: -6px; }

/* The top and bottom bars a shade darker than the page, so they read as frame. */
.topbar { background: rgba(239, 239, 235, .9); }
.tabbar { background: rgba(239, 239, 235, .94); }
@media (min-width: 900px) { .quick-acts { max-width: 480px; } }

/* ---------- Booking and invoice forms ---------- */

/* The customer picker (Take a booking, New invoice): a search over everyone on
   file, eight at a time, then the chosen person as one compact card. */
.picker { margin-bottom: 4px; }
.form-sub.first { margin-top: 0; }
.pick-search { margin-bottom: 10px; box-shadow: none; background: var(--paper-2); }
.pick-search:focus-within { box-shadow: 0 0 0 2px var(--brand); }
.pick-list { margin: 0 0 8px; border-radius: 16px; box-shadow: none; border: 1px solid var(--line-hi); }
.pick-list .row { min-height: 60px; padding: 10px 14px; }
.pick-list .row.add { background: var(--brand-soft); }
.pick-more { margin: 0 2px 10px; color: var(--text-3); font-size: 14px; }
.pick-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 16px; background: var(--brand-soft); }
.pick-who { flex: 1; min-width: 0; }
.pick-who p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.35; }
.pick-name { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.pick-card .link-btn { flex: none; min-height: 44px; padding: 0 4px; }
.pick-new { padding: 14px 14px 2px; border-radius: 16px; background: var(--paper-2); }
.pick-new .field input, .pick-new .field select { background: var(--surface); }
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pick-title { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.pick-note { margin: 0 0 12px; }
.pick-hint { margin: -6px 0 14px; padding: 10px 12px; border-radius: 12px; background: #fcf0d9; color: #85550c; font-size: 14px; line-height: 1.4; }
.pick-after { margin: 4px 2px 0; }

/* Take a booking: one card per part of the call. */
.bk .card { margin-bottom: 12px; }
.bk-note { margin: -4px 0 12px; line-height: 1.4; }
.bk-note.bad, .bk-when.bad { color: var(--bad); }
.bk-when { margin: 2px 0 0; color: var(--text-2); font-size: 15px; font-weight: 500; line-height: 1.4; }
.trip-line { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); color: var(--text-2); font-size: 15px; line-height: 1.4; }
.trip-line .i { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.trip-line b { color: var(--ink); font-weight: 600; }
.trip-free { background: #e4f3ea; color: var(--ok); }
.trip-fee { background: #fcf0d9; color: #85550c; }
.trip-fee b { color: #85550c; }
p.trip-line.muted { display: block; }
.bk .quote { margin-bottom: 14px; }
.quote-bad b { color: var(--bad); }

/* Days: a number between a minus and a plus, big enough for a thumb. */
.stepper { display: flex; align-items: center; gap: 10px; }
.step-btn { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--paper-2); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
.step-btn:active { transform: scale(.94); }
.step-btn .i { width: 22px; height: 22px; }
.step-val { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.step-val b { color: var(--text-2); font-size: 16px; font-weight: 500; }
.step-val input { width: 76px; min-height: 52px; padding: 0 8px; border: 1px solid var(--line-hi); border-radius: 12px; outline: none; background: var(--surface); text-align: center; font-size: 20px; font-weight: 600; -moz-appearance: textfield; }
.step-val input::-webkit-outer-spin-button, .step-val input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-val input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* How they pay: three whole-row choices, the way the Dashboard shows them. */
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--line-hi); border-radius: 16px; background: var(--surface); cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-dot { flex: none; width: 22px; height: 22px; margin-top: 1px; border: 2px solid #c2c2c8; border-radius: 50%; }
.opt-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-main b { font-size: 16px; font-weight: 600; }
.opt-main small { color: var(--text-3); font-size: 14px; line-height: 1.35; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt:has(input:checked) .opt-dot { border-color: var(--brand); background: radial-gradient(circle, var(--brand) 0 5px, transparent 6px); }
.opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

/* A real checkbox drawn as a big box, for the terms and the trip fee. */
.check-row { position: relative; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { flex: none; width: 26px; height: 26px; display: grid; place-items: center; margin-top: 0; border: 2px solid #c2c2c8; border-radius: 8px; background: var(--surface); color: transparent; }
.check-box .i { width: 16px; height: 16px; stroke-width: 3; }
.check-row:has(input:checked) .check-box { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.check-row:has(input:focus-visible) .check-box { outline: 2px solid var(--brand); outline-offset: 2px; }
.check-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.check-main b { font-size: 16px; font-weight: 600; line-height: 1.3; }
.check-main small { color: var(--text-2); font-size: 14px; line-height: 1.4; }
[data-waive] { margin-top: 2px; font-size: 15px; font-weight: 500; align-items: center; }
.terms-row .check-box { margin-top: 1px; }

/* Missing pieces, right above the button that needs them. */
.bill-missing { margin: 0 0 8px; color: var(--bad); font-size: 14px; font-weight: 500; line-height: 1.35; }
.bill-missing:empty { display: none; }

/* On a booking: what was agreed, under the money. */
.pay-fact { margin-top: 6px; font-size: 14px; line-height: 1.4; }
.terms-told { display: flex; align-items: flex-start; gap: 6px; color: var(--ok); font-weight: 500; }
.terms-told .i { flex: none; width: 17px; height: 17px; margin-top: 1px; }

/* ---------- Requests and timeline ---------- */
/* What customers ask for from their bin page: the card on Today and on a
   booking, and the small centered rows between texts in a thread. */
.req-card { margin: 0 0 24px; padding: 18px; background: var(--surface); border-radius: 22px; box-shadow: 0 0 0 2px var(--brand), var(--lift); }
.req-card .card-head { margin-bottom: 6px; }
.req-card .card-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.req-list, .req-done { list-style: none; margin: 0; padding: 0; }
.req { padding: 14px 0; }
.req + .req { border-top: 1px solid var(--line); }
.req:last-child { padding-bottom: 2px; }
.req-top { display: flex; align-items: center; gap: 12px; }
.req-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.req-ic .i { width: 22px; height: 22px; }
.req-main { display: flex; flex-direction: column; min-width: 0; }
.req-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; }
.req-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 14px; }
.req-ask { margin-top: 10px; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.req-pay { margin-top: 2px; color: var(--text-3); font-size: 14px; }
.req-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.req-open { margin-left: auto; padding: 8px 4px; color: var(--brand); font-size: 15px; font-weight: 600; }
.req-done { margin-top: 6px; }
.req-done li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.req-card .req-list + .req-done { margin-top: 10px; }
.req-state { flex: none; margin-top: 1px; padding: 2px 9px; border-radius: 999px; background: #e4f3ea; color: var(--ok); font-size: 13px; font-weight: 600; }
.req-state.declined { background: #fbe7e3; color: var(--bad); }
.req-what { min-width: 0; color: var(--text-2); overflow-wrap: anywhere; }
.req-what b { color: var(--ink); font-weight: 600; }
.req-what em { display: block; color: var(--text-3); font-style: normal; }

.bubbles .tl-event { align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 2px 4px; color: var(--text-3); font-size: 13px; line-height: 1.35; text-align: center; }
.tl-event::before, .tl-event::after { content: ''; flex: 1 1 12px; min-width: 12px; height: 1px; background: var(--line-hi); }
.tl-ic { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--paper-2); color: var(--text-2); }
.tl-ic .i { width: 13px; height: 13px; }
.tl-text { flex: 0 1 auto; max-width: 80%; overflow-wrap: anywhere; }
.tl-text time { color: var(--text-3); }
.tl-event.k-request .tl-ic { background: var(--brand-soft); color: var(--brand); }
.tl-event.k-request .tl-text { color: var(--ink); font-weight: 500; }
.tl-event.k-approved .tl-ic { background: #e4f3ea; color: var(--ok); }
.tl-event.k-declined .tl-ic { background: #fbe7e3; color: var(--bad); }
