:root { --brand: #2337d6; --brand-ink: #ffffff; }
/* 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: color-mix(in srgb, var(--brand) 9%, white);
  --brand-line: color-mix(in srgb, var(--brand) 30%, transparent);
  --brand-deep: color-mix(in srgb, var(--brand) 70%, black);

  --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(35, 55, 214, .6); }
.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(35, 55, 214, .6); }
.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; }
}
