:root {
  --green: #0b6e4f;
  --green-dark: #08583f;
  --blue: #1a73e8;
  --red: #c5221f;
  --text: #1d2433;
  --muted: #667085;
  --line: #e3e7ee;
  --bg: #f3f5f8;
  --card: #fff;
  --radius: 10px;
  color-scheme: light; /* keep form controls (and Google address boxes) light in phone dark mode */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--blue); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 10px 20px; background: var(--green); color: #fff;
}
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.1rem; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-left: auto; }
.topbar-tools { display: flex; align-items: center; gap: 12px; }
.menu-btn {
  display: none; background: none; color: #fff; cursor: pointer; font-size: 1.3rem; line-height: 1;
  border: 1px solid rgba(255,255,255,.6); border-radius: 6px; padding: 5px 11px; min-width: 44px;
}
.topbar nav a { opacity: .9; }
.topbar nav a:hover { opacity: 1; text-decoration: underline; }
.lang { border: 1px solid rgba(255,255,255,.6); border-radius: 4px; padding: 0 6px; font-size: .85rem; }
/* Phones: links collapse behind the ☰ button and open as a full-width list. */
@media (max-width: 720px) {
  .topbar { padding: 10px 16px; }
  .menu-btn { display: inline-block; }
  .topbar nav { display: none; order: 3; width: 100%; margin-left: 0; flex-direction: column; gap: 0; }
  .topbar.open nav { display: flex; }
  .topbar nav a { padding: 12px 4px; font-size: 1.05rem; border-top: 1px solid rgba(255,255,255,.2); opacity: 1; }
}

main { max-width: 900px; margin: 20px auto; padding: 0 16px; overflow-wrap: anywhere; }
main.wide { max-width: 1300px; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px; }

/* Cards & layout */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.card.narrow { max-width: 440px; margin: 40px auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.card-head h1, .card-head h2, .card-head h3 { margin: 0; }
.book-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.map-col { position: sticky; top: 16px; }
/* minmax(0, 1fr) + min-width: 0 let columns shrink below their content on narrow phones. */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.book-grid > *, .grid2 > *, .row2 > *, .row3 > *, .stats > * { min-width: 0; }
.row3 > div:nth-child(2):last-child { grid-column: span 2; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat strong { font-size: 1.4rem; display: block; }
.stat.alert { background: #fdecea; }
@media (max-width: 900px) {
  .book-grid, .grid2, .stats { grid-template-columns: minmax(0, 1fr); }
  .map-col { position: static; order: -1; }
}
@media (max-width: 560px) {
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .row3 > div:nth-child(2):last-child { grid-column: auto; }
  main { padding: 0 10px; }
  .card { padding: 16px; }
}

/* Map */
.map { width: 100%; height: 420px; border-radius: var(--radius); background: #dde3ea; }
.map.tall { height: calc(100vh - 140px); min-height: 380px; max-height: 760px; }
@media (max-width: 900px) { .map.tall { height: 340px; min-height: 0; } }
.pin {
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; border: 2px solid #fff;
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.35); background: var(--blue);
}
.pin.origin { background: var(--green); }
.pin.dest { background: var(--red); }
.pin.me { background: #fff; border-color: var(--text); }
.car svg { display: block; transition: transform .6s ease; filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }

/* Forms */
fieldset { min-width: 0; border: 0; border-top: 1px solid var(--line); padding: 12px 0 4px; margin: 0; }
legend { font-weight: 700; padding-right: 8px; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; color: var(--text); font-size: .95rem; }
input, select, textarea {
  width: 100%; min-width: 0; max-width: 100%; font: inherit; padding: 9px 10px; border: 1px solid #cfd5df; border-radius: 6px; background: #fff; color: var(--text);
}
input[type=radio], input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(26,115,232,.35); border-color: var(--blue); }
input:disabled { background: #f2f4f7; color: var(--muted); }
.unit-row { display: flex; gap: 6px; }
.unit-row input { flex: 1 1 0; }
.unit-row select { flex: 0 0 auto; width: auto; }
.ac-wrap gmp-place-autocomplete, .ac-wrap gmp-placeautocomplete {
  display: block; width: 100%; color-scheme: light; background: #fff; color: var(--text);
  border: 1px solid #cfd5df; border-radius: 6px;
}
.notice { background: #fff8e6; border: 1px solid #f3d38a; border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.notice p { margin: 0 0 6px; }
.accept-box { margin-bottom: 10px; }
.eta-form { margin: 12px 0; }
.eta-form label { margin: 0; flex-basis: 100%; }
.picked { font-size: .85rem; color: var(--green-dark); min-height: 1.2em; margin-top: 4px; }
.hint { font-size: .85rem; color: var(--muted); }
label.req::after, .req-mark { content: " *"; color: var(--red); font-weight: 700; }
.opt { font-weight: 400; }
/* Missing / invalid fields after clicking the booking button. */
.invalid, .ac-wrap.invalid gmp-place-autocomplete, .ac-wrap.invalid gmp-placeautocomplete {
  border-color: var(--red) !important; background: #fff5f5; box-shadow: 0 0 0 2px rgba(197,34,31,.18);
}
.ac-wrap.invalid, .notice.invalid { border-radius: 6px; }
.notice.invalid { border: 2px solid var(--red); }
.muted { color: var(--muted); }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }
.copy { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 180px; }
.switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: 1rem; }
.switch input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; position: relative; cursor: pointer;
  width: 46px; min-width: 46px; height: 26px; padding: 0; margin: 0; border: 0; border-radius: 13px;
  background: #cfd5df; transition: background .2s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .2s;
}
.switch input:checked { background: var(--green); }
.switch input:checked::after { left: 23px; }
.switch input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.avail-form { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }

/* Buttons */
.btn {
  display: inline-block; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 6px; cursor: pointer;
  border: 1px solid #cfd5df; background: #fff; color: var(--text); text-decoration: none; margin-top: 10px;
}
.btn:hover { background: #f6f7f9; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.danger { color: var(--red); border-color: #f1b8b5; }
.btn.danger.big { background: var(--red); color: #fff; border-color: var(--red); }
.btn.big { padding: 13px 24px; font-size: 1.05rem; width: 100%; }
.btn.small { padding: 5px 10px; font-size: .85rem; margin-top: 0; }
.btn.small.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions { margin-top: 12px; }
.actions form { flex: 0 0 auto; margin: 0; }
.actions .btn { margin-top: 0; }

/* Messages */
.flash { padding: 12px 14px; border-radius: 8px; margin: 0 0 16px; background: #e6f4ea; color: #0d652d; }
.flash.error { background: #fdecea; color: var(--red); }
.flash.warn { background: #fff4e5; color: #8a4b00; border: 1px solid #f3d38a; font-weight: 600; }
label.inline.disabled { color: var(--muted); text-decoration: line-through; }
.error-text { color: var(--red); }
.hidden { display: none !important; }
.status-help { font-size: 1.05rem; }

/* Quote */
.quote { background: #f6faf8; border: 1px solid #cfe9df; border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
.quote h3 { margin-top: 0; }
table.price { width: 100%; border-collapse: collapse; }
table.price td { padding: 4px 0; }
table.price td:last-child { text-align: right; white-space: nowrap; }
table.price tr.total td { border-top: 1px solid var(--line); font-weight: 700; font-size: 1.1rem; padding-top: 8px; }

/* Tables & lists */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 6px 8px; }
table.list td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
table.details { width: 100%; border-collapse: collapse; }
table.details th { text-align: left; color: var(--muted); font-weight: 500; padding: 5px 12px 5px 0; vertical-align: top; width: 32%; }
table.details td { padding: 5px 0; }
.addr { font-size: .9rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 4px 0; border-left: 2px solid var(--line); padding-left: 12px; }
.offer { display: block; padding: 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; color: var(--text); text-decoration: none; }
.offer:hover { border-color: var(--blue); }
.steps li { margin-bottom: 8px; }
.admin-box { border-top: 1px dashed var(--line); margin-top: 16px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 6px 12px; border-radius: 6px; text-decoration: none; color: var(--text); }
.tabs a.active { background: var(--green); color: #fff; }
code { background: #f2f4f7; padding: 2px 6px; border-radius: 4px; }

/* Status badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: .8rem; font-weight: 600; background: #eef1f5; color: var(--text); white-space: nowrap; }
.s-searching, .s-unconfirmed { background: #fff4e5; color: #8a4b00; }
.s-no_driver { background: #fdecea; color: var(--red); }
.s-awaiting_payment { background: #e8f0fe; color: #174ea6; }
.s-paid, .s-picked_up { background: #e6f4ea; color: #0d652d; }
.s-delivered { background: var(--green); color: #fff; }
.s-cancelled { background: #eef1f5; color: var(--muted); }
