/* One Full Box Transport — clean, modern, mobile-first */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #1a2433;
  --muted: #6b7789;
  --brand: #0b6de0;
  --brand-dark: #0957b3;
  --ok: #12805c;
  --warn: #b7791f;
  --bad: #c0392b;
  --line: #e4e9f0;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.nav .brand {
  font-weight: 700;
  font-size: 1.05rem;
  margin-right: auto;
  color: #fff;
  text-decoration: none;
}
.nav a {
  color: #cfd9e6;
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
}
.nav a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
/* Two-row dispatcher header: top row = brand (left) + Messages/actions
   (top-right corner); second row = section links. */
.nav-links { flex-basis: 100%; display: flex; gap: 0.6rem; flex-wrap: wrap; }
/* Right-aligned header cluster (staff link, language, name + logout):
   pinned to the right edge on desktop; on phones the nav wraps and the
   cluster takes its own row, spread edge to edge (language far left,
   account/login far right) — Steven 2026-10-03. */
.nav-right { margin-left: auto; display: inline-flex; align-items: center;
  gap: 0.6rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 639px) {
  .nav-right { width: 100%; margin-left: 0; justify-content: space-between; }
}

/* ── Layout ── */
.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.2rem 1rem 3rem;
}

/* ── Desktop real estate (Steven 2026-10-02) ──────────────────────
   Pages were capped at 880px, leaving big empty margins on desktop
   monitors. On large screens, general pages widen a step and Dispatch
   goes near-full-width so its card grid spreads across the screen. */
@media (min-width: 1200px) {
  .wrap { max-width: 1080px; }
  .wrap-dispatch { max-width: 1560px; }
  .wrap-dispatch #cards { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(16,24,40,0.06);
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.muted { color: var(--muted); font-size: 0.9rem; }

/* ── Forms ── */
label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0.8rem 0 0.3rem; }
input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 0;
  border-color: var(--brand);
}
textarea { min-height: 80px; resize: vertical; }
.row { display: grid; gap: 0.8rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row { grid-template-columns: 1fr 1fr; } }

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  margin-top: 1rem;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.ghost { background: #eef2f7; color: var(--ink); }
.btn.small { padding: 0.4rem 0.75rem; font-size: 0.85rem; margin-top: 0; }
.btn.danger { background: var(--bad); }

.price-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: #eaf3fe;
  border: 1px solid #bcd7f7;
  font-size: 1.1rem;
}
.price-box strong { font-size: 1.5rem; color: var(--brand-dark); }

.err {
  display: none;
  background: #fdecea;
  color: var(--bad);
  border: 1px solid #f5c6c0;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  margin: 0.8rem 0;
  font-size: 0.92rem;
}
.ok-msg {
  background: #e6f6ee;
  color: var(--ok);
  border: 1px solid #bfe6d2;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  margin: 0.8rem 0;
  font-size: 0.92rem;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

/* ── Mobile-friendly tables (Steven 2026-10-06) ─────────────────────
   On phones, wide admin tables become stacked cards instead of forcing
   left/right scrolling. Cells are labeled from the table's <thead> by the
   table labeler in js/config.js, which sets data-label on each td. */
@media (max-width: 639px) {
  .table-wrap { overflow-x: visible; }
  .table-wrap table, .table-wrap tbody { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap table tr { display: block; border: 1px solid var(--line);
    border-radius: var(--radius); margin-bottom: 0.7rem; padding: 0.35rem 0.9rem;
    background: var(--card); }
  .table-wrap table tr:last-child { margin-bottom: 0; }
  .table-wrap td { display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 0.4rem 0.9rem; border-bottom: 1px solid var(--line);
    padding: 0.55rem 0; text-align: right; }
  .table-wrap td > .btn { flex-shrink: 0; }
  .table-wrap td:last-child { border-bottom: none; }
  .table-wrap td::before { content: attr(data-label); font-weight: 700;
    color: var(--muted); font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.03em; text-align: left; flex-shrink: 0; max-width: 42%; }
  .table-wrap td[data-label=""]::before, .table-wrap td:not([data-label])::before { display: none; }
  .table-wrap td[data-label=""] { justify-content: flex-end; }
  .table-wrap td[colspan] { display: block; text-align: left; }
  .table-wrap td[colspan]::before { display: none; }
}
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eef2f7;
  color: var(--ink);
}
.badge.pending { background: #fff3d6; color: #8a5a00; }
.badge.assigned { background: #e0edff; color: #0b4fc4; }
.badge.in_progress { background: #e6f0ff; color: #0b4fc4; }
.badge.completed { background: #e6f6ee; color: var(--ok); }
.badge.cancelled { background: #f1f2f5; color: var(--muted); }
.badge.paid { background: #e6f6ee; color: var(--ok); }
.badge.unpaid { background: #fff3d6; color: #8a5a00; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(16,24,40,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 14px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.3rem;
}
.modal h3 { margin-top: 0; }

/* ── Inline field validation ── */
.field-err {
  display: none;
  color: var(--bad);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
input.input-invalid, select.input-invalid, textarea.input-invalid {
  border-color: var(--bad);
}
input.input-invalid:focus, select.input-invalid:focus, textarea.input-invalid:focus {
  outline-color: var(--bad);
  border-color: var(--bad);
}

/* ── Preset route finder (Steven 2026-10-06): boarding-pass style cards ── */
#preset-tools { display: flex; flex-direction: column; gap: 0.55rem; margin: 0.7rem 0 0.9rem; }
#preset-search {
  width: 100%; font: inherit; font-size: 0.95rem; padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: inherit;
}
#preset-search:focus { outline: none; border-color: var(--brand); }
#preset-nav:empty { display: none; }
#preset-nav { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.2rem 0 0.7rem; }
.preset-back {
  align-self: flex-start; background: none; border: none; padding: 0.2rem 0;
  color: var(--brand); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.preset-nav-title { font-weight: 700; font-size: 1.02rem; margin: 0; }
.preset-grid { display: grid; gap: 0.6rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .preset-grid { grid-template-columns: 1fr 1fr; } }
.preset-grid.squares { grid-template-columns: repeat(3, 1fr); }
/* Square route cards (Steven 2026-10-06): compact like the vehicle cards but
   distinct — white with the airport-signage badge (vans are grey/green). */
.preset-grid.routesq { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .preset-grid.routesq { grid-template-columns: repeat(3, 1fr); } }
.preset-card.route {
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; aspect-ratio: 1 / 1; gap: 0.3rem; padding: 0.6rem 0.5rem;
}
.preset-card.route .pc-pname {
  font-weight: 700; font-size: 0.88rem; line-height: 1.25; width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.preset-card.route .pc-price { text-align: center; }
/* Selected route expands full-width with the plain-language details. */
.preset-card.route.selected {
  grid-column: 1 / -1; aspect-ratio: auto; padding: 0.8rem 0.9rem;
}
.pc-detail { display: none; }
.preset-card.route.selected .pc-detail {
  display: block; width: 100%;
  border-top: 1px dashed var(--line); padding-top: 0.55rem; margin-top: 0.15rem;
}
.pc-dhint { color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
/* Grouped route card (Steven 2026-10-07): one card per route, its vehicle
   variants are picked inside the expanded card. */
.preset-card.group { cursor: pointer; }
.preset-card.group:focus-visible { outline: 2px solid #14407c; outline-offset: 2px; }
.pc-vlist { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.pc-vrow {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  border: 2px solid var(--line); background: #fff; border-radius: 12px;
  padding: 0.55rem 0.7rem; font: inherit; color: inherit; cursor: pointer; text-align: left;
}
.pc-vrow.picked { border-color: #16a34a; background: #f0fdf4; }
.pcv-ic { font-size: 1.3rem; flex: none; }
.pcv-lb { flex: 1; font-weight: 700; font-size: 0.9rem; }
.pcv-pr { font-weight: 800; color: var(--brand-dark); }
/* Square pay step (Steven 2026-11-10): the Web Payments SDK injects its
   own card iframe into #card-container. */
#card-container { min-height: 96px; margin: 0.8rem 0; }
#pay-card .cta { width: 100%; }
#pay-card .btn { width: 100%; }
/* Square pay step (Steven 2026-11-10): the Web Payments SDK injects its
   own card iframe into #card-container. */
#card-container { min-height: 96px; margin: 0.8rem 0; }
#pay-card .cta { width: 100%; }
#pay-card .btn { width: 100%; }
.preset-card.square {
  aspect-ratio: 1 / 1; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; gap: 0.35rem; padding: 0.6rem 0.4rem;
}
.pc-badge.lg { font-size: 1.1rem; padding: 0.5rem 0.65rem; }
.pc-sq-name { font-weight: 700; font-size: 0.8rem; line-height: 1.2; }
.pc-sq-count { color: var(--muted); font-size: 0.72rem; }
.preset-card {
  position: relative; display: flex; align-items: center; gap: 0.8rem;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px;
  padding: 0.7rem 0.9rem; margin-top: 0; cursor: pointer; font: inherit; color: inherit;
  width: 100%; min-width: 0; text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.preset-card:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.preset-card.selected { border-color: var(--brand); background: #eaf3fe; box-shadow: 0 2px 12px rgba(37,99,235,0.16); }
.preset-card.selected::after {
  content: "✓"; position: absolute; top: -0.55rem; right: -0.35rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 0.85rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.pc-badge {
  flex: 0 0 auto; min-width: 3.1rem; text-align: center;
  background: #111827; color: #fbbf24; font-weight: 800; letter-spacing: 0.08em;
  font-size: 0.92rem; padding: 0.45rem 0.5rem; border-radius: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.pc-badge.pin { background: #e0f2fe; color: #0369a1; font-family: inherit; letter-spacing: 0; }
.pc-price { flex: 0 0 auto; text-align: right; }
.pc-price b { display: block; font-size: 1.2rem; color: var(--brand-dark); }
.pc-price span { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
#preset-empty { margin-top: 0.4rem; }

/* ── Extras checkboxes ── */
.extra-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0 0 0.5rem;
  cursor: pointer;
  font-weight: 400;
}
.extra-check input { width: auto; margin: 0; }

/* ── 3-column rows (e.g. date / passengers / luggage) ── */
@media (min-width: 640px) { .row.row-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ── New trip-progression status badges ── */
.badge.accepted { background: #e0edff; color: #0b4fc4; }
.badge.in_route { background: #e6f0ff; color: #0b4fc4; }
.badge.at_location { background: #fff3d6; color: #8a5a00; }
.badge.picked_up { background: #e6f0ff; color: #0b4fc4; }

/* ── Trip status timeline (dispatch live view) ── */
.timeline {
  display: flex;
  gap: 0.35rem;
  margin: 0.6rem 0;
  flex-wrap: wrap;
}
.t-step {
  flex: 1 1 0;
  min-width: 86px;
  text-align: center;
  font-size: 0.78rem;
  padding: 0.5rem 0.3rem;
  border-radius: 10px;
  background: #eef2f7;
  color: var(--muted);
}
.t-step .t-dot { display: block; font-size: 1.05rem; line-height: 1.3; }
.t-step .t-time { font-size: 0.72rem; font-weight: 400; }
.t-step.done { background: #e6f6ee; color: var(--ok); font-weight: 700; }
.t-step.current { background: #e0edff; color: #0b4fc4; font-weight: 700; outline: 2px solid var(--brand); }

/* ── Driver↔dispatch chat ── */
.chat-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  background: #fafbfc;
  margin-top: 0.6rem;
}
.chat-msgs {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.msg {
  max-width: 85%;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  background: #eef2f7;
  font-size: 0.9rem;
  align-self: flex-start;
  overflow-wrap: break-word;
}
.msg.own { background: #dbeafe; align-self: flex-end; }
.msg-meta { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.15rem; }
.chat-input-row { display: flex; gap: 0.5rem; }
.chat-input-row input { margin: 0; }
.chat-input-row .btn { margin-top: 0; white-space: nowrap; }
/* Round location-share button in the driver chat input row */
.chat-loc-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}
.chat-loc-btn:hover { background: #eef3fa; }
.chat-loc-btn:disabled { opacity: 0.5; cursor: default; }
/* Photo / camera / file picker buttons in chat input rows */
.attach-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}
.attach-btn:hover { background: #eef3fa; }
.attach-btn:disabled { opacity: 0.5; cursor: default; }
/* Pending-attachment chip above the input + file links inside bubbles */
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eef3fa;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.82rem;
  color: var(--ink);
  text-decoration: none;
  margin: 0.25rem 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.attach-chip:hover { background: #e2ecf9; }
.attach-chip-x {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 0 0 0.2rem;
  color: var(--muted);
}
.attach-pending-row { padding: 0.25rem 0.6rem 0; }
/* History page */
.hist-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.8rem 0; }
.hist-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.hist-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.hist-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.hist-filters input, .hist-filters select { margin: 0; }
.hist-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.7rem;
}
.hist-card-head { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; cursor: pointer; }
.hist-detail { margin-top: 0.6rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.hist-kv { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; font-size: 0.88rem; margin: 0.4rem 0; }
.hist-kv dt { color: var(--muted); }
.hist-kv dd { margin: 0; }
.hist-event { padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.hist-event:last-child { border-bottom: none; }
/* Links inside chat bubbles (e.g. shared map links) */
.msg a { color: #0b6de0; text-decoration: underline; overflow-wrap: break-word; }
.msg.own a { color: #fff; }

/* ── Location line / note ── */
.loc-line { font-size: 0.9rem; margin: 0.4rem 0; }
.loc-note { min-height: 1.2em; margin-top: 0.4rem; }

/* ── Misc ── */
.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.toolbar .field { flex: 1 1 140px; }
.toolbar label { margin-top: 0; }
.loading { opacity: 0.6; pointer-events: none; }
.empty { color: var(--muted); padding: 1.2rem 0; text-align: center; }
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.filters select, .filters input { width: auto; min-width: 130px; }
details summary { cursor: pointer; font-weight: 600; }

/* ── Chat box (dispatch hub + driver chat) ── */
/* Header message nav button (text link style) with unread badge */
.nav-link-btn {
  position: relative;
  background: none;
  border: none;
  color: #cfd9e6;
  font-size: 0.92rem;
  font-family: inherit;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  margin: 0;
  flex: 0 0 auto;
}
.nav-link-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-link-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #e5484d;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  line-height: 1;
}
.chat-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.chat-popup {
  position: fixed;
  right: 1rem;
  bottom: 5rem;
  z-index: 160;
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, calc(100dvh - 8rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(16,24,40,0.25);
  flex-direction: column;
  overflow: hidden;
}
.chat-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  background: var(--ink);
  color: #fff;
  flex-shrink: 0;
}
.chat-x {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}
.chat-popup .chat-msgs {
  flex: 1;
  max-height: none;
  min-height: 0;
  padding: 0.7rem;
  margin-bottom: 0;
}
.chat-popup .chat-input-row {
  padding: 0.6rem 0.7rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-popup-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#hub-list-view { overflow-y: auto; }
.conv-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.conv-row:hover { background: #f2f6fc; }
.conv-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e0edff;
  color: #0b4fc4;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.conv-main { flex: 1; min-width: 0; }
.conv-name { display: block; font-weight: 700; font-size: 0.95rem; }
.conv-preview {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}
.conv-time { font-size: 0.72rem; color: var(--muted); }
.unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.trip-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: #fff3d6;
  color: #8a5a00;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  margin-left: 0.3rem;
  vertical-align: middle;
}
.chat-thread-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

/* ── Homepage marketing chrome ── */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
#booking-form, #preset-section { scroll-margin-top: 76px; }

/* Nav polish (still sticky) */
.nav { box-shadow: 0 2px 12px rgba(0,0,0,0.25); }

/* Hero */
.hero {
  background: linear-gradient(135deg, #0a2540 0%, #0b6de0 60%, #0a9bde 100%);
  color: #fff;
  text-align: center;
  padding: 4rem 1.25rem 3.5rem;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.8rem;
}
.hero-sub {
  font-size: 1.08rem;
  color: #dbe7f7;
  margin: 0 auto 1.6rem;
  max-width: 34rem;
}
.hero-ctas {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-ctas .btn { margin-top: 0; text-decoration: none; }
.hero .btn:not(.btn-outline-light) { background: #fff; color: var(--brand-dark); }
.hero .btn:not(.btn-outline-light):hover { background: #eef4fd; }
.btn-outline-light {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.85);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.15); }
.trust-badges {
  list-style: none;
  padding: 0;
  margin: 1.8rem 0 0;
  display: flex;
  gap: 0.5rem 1.3rem;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: #dbe7f7;
}
.trust-badges li::before {
  content: "✓ ";
  color: #7ce3a8;
  font-weight: 800;
}

/* How it works */
.how-it-works { margin: 0 0 2.4rem; text-align: center; }
.how-it-works h2, .fleet h2 { font-size: 1.5rem; margin: 0 0 1.2rem; }
.steps {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr;
  text-align: left;
}
@media (min-width: 640px) { .steps { grid-template-columns: 1fr 1fr 1fr; } }
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: 0 1px 3px rgba(16,24,40,0.06);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #e0edff;
  color: var(--brand-dark);
  font-weight: 800;
  margin-bottom: 0.6rem;
}
.step h3 { margin: 0 0 0.35rem; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Fleet */
.fleet { margin: 0 0 2.4rem; text-align: center; }
.fleet-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr;
  text-align: left;
}
@media (min-width: 640px) { .fleet-grid { grid-template-columns: 1fr 1fr; } }
.fleet-card { margin-bottom: 0; }
.fleet-icon { font-size: 2rem; margin-bottom: 0.4rem; }
.fleet-card h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.fleet-card p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* Site footer */
.site-footer {
  background: var(--ink);
  color: #cfd9e6;
  text-align: center;
  padding: 2.2rem 1.25rem;
  font-size: 0.9rem;
}
.site-footer .footer-brand {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.3rem;
}
.site-footer p { margin: 0.25rem 0; }
.site-footer .footer-small { font-size: 0.8rem; color: #93a1b5; }
.site-footer a { color: #cfd9e6; }
.site-footer a:hover { color: #fff; }

/* ── Customer ↔ dispatch chat (2026-09-30) ── */
.cchat { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.cchat-head { padding: 0.6rem 0.8rem; background: #f4f7fc; border-bottom: 1px solid var(--line); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.cchat-res { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.cchat .cchat-msgs { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem; padding: 0.7rem; }
.cchat-input-row { display: flex; gap: 0.5rem; padding: 0.6rem 0.7rem; border-top: 1px solid var(--line); }
.cchat-input-row input { flex: 1; margin: 0; }
.cchat-input-row .btn { margin-top: 0; white-space: nowrap; }
.cchat-err { margin: 0 0.7rem 0.5rem; }
.conv-section { padding: 0.7rem 0.9rem 0.2rem; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.conv-avatar.cust { background: #e6f7ee; color: #0d7a3f; }
.res-link { display: inline-block; margin-top: 0.2rem; font-size: 0.8rem; font-weight: 700; color: #0b4fc4; background: #eef4ff; border: 1px solid #cfe0ff; border-radius: 999px; padding: 0.15rem 0.6rem; cursor: pointer; font-family: inherit; }
.res-link:hover { background: #dbe9ff; }
/* Steven 2026-10-05: reservation number is tap-to-copy — button styled as plain text */
.res-copy { background:none; border:none; padding:0; margin:0; font:inherit; color:inherit;
  cursor:pointer; text-align:left; }
.res-copy:active { opacity:0.55; }
.mr-card .mr-row1 { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.mr-detail { margin-top: 0.6rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }

/* Travel advisory notice */
.notice { border-radius: 12px; padding: 0.85rem 1rem; margin: 1rem 0; font-size: 0.92rem; line-height: 1.45; }
.notice p { margin: 0.3rem 0 0; }
.notice-warning { background: #fff8e6; border: 1px solid #f0d98c; border-left: 4px solid #d9a400; color: #5c4a00; }
.notice-warning strong { color: #7a5f00; }

/* ── Modern booking form (2026-09-30 redesign) ── */
.fcard { background: #fff; border-radius: 18px; padding: 1.1rem; margin-bottom: 1rem; box-shadow: 0 2px 12px rgba(11,31,58,0.07); border: 1px solid #eef2f7; }
.fstep { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: #5b6b7f; margin: 0 0 0.8rem; display: flex; align-items: center; gap: 0.45rem; }
.step-num { background: #0b1f3a; color: #fff; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; flex: none; }

/* Trip-type segmented cards */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.seg-btn { border: 2px solid #e2e8f0; background: #f8fafc; border-radius: 14px; padding: 0.9rem 0.5rem; font: inherit; cursor: pointer; text-align: center; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; color: inherit; }
.seg-btn .big { font-size: 1.6rem; display: block; margin-bottom: 0.2rem; }
.seg-btn .lbl { font-weight: 700; display: block; }
.seg-btn .sub { font-size: 0.78rem; color: #718096; display: block; margin-top: 0.15rem; }
.seg-btn.active { border-color: #0b1f3a; background: #eaf1ff; box-shadow: 0 0 0 3px rgba(11,31,58,0.12); }

/* Vehicle cards */
.veh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.veh-card { border: 2px solid #e2e8f0; border-radius: 14px; padding: 0.8rem 0.4rem; text-align: center; cursor: pointer; background: #f8fafc; font: inherit; color: inherit; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.veh-card .big { font-size: 1.8rem; display: block; }
.veh-card .lbl { font-weight: 700; font-size: 0.85rem; display: block; margin-top: 0.25rem; }
.veh-card .cap { font-size: 0.72rem; color: #718096; display: block; margin-top: 0.1rem; }
.veh-card.active { border-color: #16a34a; background: #f0fdf4; box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
/* Vehicle picker locked by a preset (Steven 2026-10-07): the preset's vehicle
   stays highlighted, the rest dim and ignore taps. */
.veh-grid.locked .veh-card { cursor: not-allowed; opacity: 0.45; }
.veh-grid.locked .veh-card.active { opacity: 1; }
@media (max-width: 420px) { .veh-grid { grid-template-columns: 1fr 1fr; } }

/* Route rows */
.addr-row { display: flex; gap: 0.5rem; align-items: center; }
.addr-row input { flex: 1; margin: 0; }
.addr-row .pin { font-size: 1.2rem; flex: none; }
.add-btn { border: 2px dashed #94a3b8; background: none; color: #475569; border-radius: 12px; padding: 0.6rem; width: 100%; font: inherit; margin-top: 0.6rem; cursor: pointer; }
.add-btn:hover { border-color: #14407c; color: #14407c; }
.link-btn { background: none; border: none; color: #14407c; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 0; }
.link-btn:hover { color: #0b1f3a; }

/* Return box */
.ret-box { background: #f0f7ff; border: 1.5px solid #bcd6f5; border-radius: 14px; padding: 0.9rem; margin-top: 0.9rem; }
.ret-box .ret-title { font-weight: 700; font-size: 0.9rem; color: #14407c; margin-bottom: 0.4rem; }
.edit-stops-btn { display: inline-flex; align-items: center; gap: 0.35rem; background: #fff; border: 2px solid #14407c; color: #14407c; border-radius: 999px; padding: 0.45rem 0.9rem; font: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.edit-stops-btn:hover { background: #eaf1ff; }
.count-badge { background: #14407c; color: #fff; border-radius: 999px; padding: 0.05rem 0.5rem; font-size: 0.75rem; }

/* Bottom-sheet modal for editing return stops */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(11,31,58,0.5); display: flex; align-items: flex-end; justify-content: center; z-index: 60; }
.sheet { background: #fff; border-radius: 20px 20px 0 0; padding: 1.2rem; width: 100%; max-width: 640px; max-height: 80vh; overflow-y: auto; }
.sheet h3 { margin: 0 0 0.4rem; }
.rstop { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.8rem; border: 2px solid #e2e8f0; border-radius: 12px; margin-bottom: 0.5rem; font-size: 0.92rem; cursor: pointer; }
.rstop.off { opacity: 0.45; border-style: dashed; }
.rstop .n { background: #eaf1ff; color: #14407c; font-weight: 800; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; flex: none; }
.rstop .a { flex: 1; }
.rstop .x-btn { margin: 0; }
.sheet-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.btn-primary { flex: 1; background: #0b1f3a; color: #fff; border: none; border-radius: 12px; padding: 0.8rem; font: inherit; font-weight: 700; cursor: pointer; }
.btn-ghost { background: #f1f5f9; border: none; border-radius: 12px; padding: 0.8rem 1rem; font: inherit; cursor: pointer; color: inherit; }

/* Sticky gradient price card + CTA */
.price-card { background: linear-gradient(135deg, #0b1f3a, #1e5aa8); color: #fff; border-radius: 18px; padding: 1.2rem; margin: 1rem 0; position: sticky; bottom: 0.75rem; box-shadow: 0 8px 24px rgba(11,31,58,0.35); z-index: 5; }
.price-card .price-label { font-size: 0.85rem; opacity: 0.8; }
.price-card .price-total { font-size: 2rem; font-weight: 800; line-height: 1.15; }
.price-card .price-note { font-size: 0.82rem; opacity: 0.85; margin-top: 0.3rem; }
.cta { display: block; width: 100%; background: #22c55e; color: #062a15; font: inherit; font-weight: 800; font-size: 1.05rem; border: none; border-radius: 14px; padding: 0.95rem; cursor: pointer; margin-top: 0.25rem; }
.cta:hover { background: #16a34a; color: #fff; }
.cta:disabled { opacity: 0.6; cursor: wait; }
label.req::after { content: " *"; color: #e11d48; font-weight: 700; }
.x-btn { border: none; background: #fee2e2; color: #b91c1c; width: 2.2rem; height: 2.2rem; border-radius: 50%; font-size: 1rem; cursor: pointer; flex: none; }

/* Powered-by footer */
.site-footer { text-align: center; padding: 1.4rem 1rem 2rem; }
.footer-powered { color: #5b6b7f; font-size: 0.9rem; margin: 0; }
.footer-powered a { color: inherit; text-decoration: none; font-weight: inherit; }
.footer-powered a:hover { text-decoration: underline; }

/* Phone country flag (js/phone.js) — just the flag emoji before the number */
.ph-country {
  display: inline-block;
  font-size: 1.05em;
  margin-right: 0.15rem;
  vertical-align: baseline;
}
.wa-link {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-left: 0.25rem;
  white-space: nowrap;
  vertical-align: middle;
  text-decoration: none;
}
.wa-link:hover { background: #bbf7d0; }
.dbtn.wa-link { color: #15803d; }
