:root {
  /* Brand palette */
  --cream: #FAF2EA;
  --ivory: #FFF4E2;
  --blush: #EFDAC7;
  --sand: #E3D5B6;
  --tan: #D5B597;
  /* Text + accents (dark brown for readable contrast) */
  --ink: #3A2A1F;
  --ink-2: #6B5444;
  --brown: #5A3E2B;
  --line: #E0CDB8;
  /* Safety colours stay strong so they're obvious in an emergency */
  --sos: #B3261E;
  --sos-dark: #8C1D17;
  --ok: #2E7D4F;
  --warn-bg: #FFF0D1;
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font: inherit; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brown); color: var(--ivory);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: .5px;
}
.logo-text { font-weight: 800; font-size: 19px; letter-spacing: -.3px; }
.mode-pill { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--sand); color: var(--brown); padding: 4px 10px; border-radius: 999px; }
.icon-btn { background: var(--blush); border: 0; border-radius: 10px; width: 38px; height: 38px; font-size: 18px; color: var(--ink); cursor: pointer; }

main { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.screen { display: flex; flex-direction: column; gap: 12px; }

h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.8px; margin: 8px 0 6px; font-weight: 800; }
h2 { font-size: 24px; letter-spacing: -.5px; margin: 4px 0; font-weight: 800; }
h3 { font-size: 16px; margin: 14px 0 0; font-weight: 700; }
p { margin: 0; }
.hero p { color: var(--ink-2); }
.step { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .6px; }
.hint { font-size: 13px; color: var(--ink-2); }
.muted { color: var(--ink-2); font-size: 13px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 16px;
  border: 1.5px solid var(--tan); border-radius: var(--radius);
  background: var(--ivory); color: var(--ink);
  font: 600 16px var(--font); text-decoration: none; text-align: center;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brown); border-color: var(--brown); color: var(--ivory); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--sos); border-color: var(--sos); color: #fff; }
.btn.danger-outline { background: transparent; border-color: var(--sos); color: var(--sos); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brown); text-decoration: underline; text-underline-offset: 3px; }
.btn.big { min-height: 60px; font-size: 18px; font-weight: 700; }
.btn.small { min-height: 40px; font-size: 14px; padding: 8px 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.file-btn { position: relative; }

.row { display: flex; gap: 10px; }
.row > .btn { flex: 1; }
.row.wrap { flex-wrap: wrap; }
.row.wrap > .btn { flex: 1 1 140px; }

.card { background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card.subtle { background: var(--blush); border-color: transparent; }
.card.warn { background: var(--warn-bg); border-color: #E8C98E; }
.card.ok { background: #E3F1E7; border-color: #B9DCC5; color: #1F5A38; }
.card summary { font-weight: 600; cursor: pointer; }
details.card[open] summary { margin-bottom: 4px; }

.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.kv span { color: var(--ink-2); }
.kv b { text-align: right; overflow-wrap: anywhere; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=url], input[type=email], input[type=search], input:not([type]), input[inputmode] {
  font: 500 16px var(--font); color: var(--ink);
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  width: 100%;
}
input:focus { outline: 2px solid var(--tan); outline-offset: 1px; }
.plate-input { font-size: 26px !important; font-weight: 800 !important; letter-spacing: 2px; text-transform: uppercase; text-align: center; background: #FFFBEF !important; border: 3px solid var(--ink) !important; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--brown); }

.seg { display: flex; background: var(--blush); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 9px; font: 600 15px var(--font); color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--ivory); color: var(--ink); box-shadow: 0 1px 3px rgba(58,42,31,.15); }

.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; background: var(--ivory); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.item .grow { flex: 1; min-width: 0; }
.item small { display: block; color: var(--ink-2); font-size: 12px; overflow-wrap: anywhere; }
.item button { flex: none; }
.result { font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.result .good { color: var(--ok); font-weight: 600; }
.result .bad { color: var(--sos); font-weight: 600; }

.how { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }

.preview { width: 100%; max-height: 220px; object-fit: contain; border-radius: 12px; background: var(--sand); }
.search { display: flex; gap: 8px; }
.search .btn { flex: none; }
.map { height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--sand); }
.map.tall { height: 42vh; min-height: 260px; }
.dest-info { font-weight: 600; }

.status-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #DDEFE3; color: #1F5A38; }
.pill.off { background: #FBE0DE; color: var(--sos-dark); }
.pill.queued { background: var(--warn-bg); color: #7A5410; }
#battInfo { margin-left: auto; }

.sos {
  position: relative; overflow: hidden;
  min-height: 72px; border-radius: var(--radius); border: 0;
  background: var(--sos); color: #fff; font: 800 20px var(--font); letter-spacing: .3px;
  cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.sos-fill { position: absolute; inset: 0; width: 0; background: var(--sos-dark); }
.sos-label { position: relative; }

.demo-tools { background: var(--blush); border-style: dashed; border-color: var(--tan); }

.alert-head { background: var(--sos); color: #fff; border-radius: var(--radius); padding: 18px; }
.alert-head p { opacity: .95; margin-top: 4px; }
.alert-head.calm { background: var(--ok); }

.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(58,42,31,.55); display: grid; place-items: center; padding: 16px; }
.modal-box { background: var(--cream); border-radius: 20px; padding: 20px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; text-align: center; max-height: 90vh; overflow: auto; }
.modal-box .list { text-align: left; }
.countdown { font-size: 64px; font-weight: 800; color: var(--sos); line-height: 1; }
#checkModal .modal-box { border: 4px solid var(--sos); }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--ivory); padding: 12px 16px; border-radius: 12px; font-size: 14px; z-index: 3000; max-width: calc(100% - 32px); }

.leaflet-container { font-family: var(--font); }
.dot { width: 18px; height: 18px; border-radius: 50%; background: var(--brown); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--brown); }
.dot.dest { background: var(--ok); box-shadow: 0 0 0 2px var(--ok); }

/* ---------- Assistant chat ---------- */
#chatModal { place-items: end center; padding: 0; }
.chat-box {
  background: var(--cream); width: 100%; max-width: 560px; height: min(88vh, 720px);
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column; overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--ivory); }
.chat-head small { display: block; color: var(--ink-2); font-size: 12px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.msg.bot { background: var(--ivory); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--brown); color: var(--ivory); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg a { color: inherit; }
.msg .good { color: var(--ok); font-weight: 600; display: block; }
.msg .bad { color: var(--sos); font-weight: 600; display: block; }
.msg .list { margin-top: 8px; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg-actions .btn { flex: 0 1 auto; }
.msg-edit { width: 100%; margin-top: 8px; font: 500 14px var(--font); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: vertical; }
.small-check { font-size: 13px; margin-top: 8px; }
.chat-chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px; scrollbar-width: none; }
.chip { flex: none; border: 1.5px solid var(--tan); background: var(--ivory); color: var(--ink); border-radius: 999px; padding: 7px 12px; font: 600 13px var(--font); cursor: pointer; white-space: nowrap; }
.chat-input { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--ivory); }
.chat-input input { flex: 1; min-width: 0; }
.chat-input .btn { flex: none; min-height: 46px; }

/* ---------- Getting started guide ---------- */
.guide-box { text-align: left; }
.guide-body { display: flex; flex-direction: column; gap: 10px; }
.guide-body .good { color: var(--ok); font-weight: 600; }
.guide-body .bad { color: var(--sos); font-weight: 600; }
.guide-dots { display: flex; gap: 6px; justify-content: center; }
.guide-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--sand); }
.guide-dots span.done { background: var(--tan); }
.guide-dots span.on { background: var(--brown); width: 22px; border-radius: 4px; }
#guideModal .modal-box { max-width: 460px; }

/* ---------- Vehicle check ---------- */
.card.danger-card { background: #FBE0DE; border-color: #E9A9A4; }
ul.checks { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
ul.checks li.danger { color: var(--sos-dark); font-weight: 600; }
ul.checks li.caution { color: #7A5410; }
ul.checks li.info { color: var(--ink-2); }
.card .ask { margin-top: 4px; font-size: 16px; }
.field.grow { flex: 1 1 200px; }
select { font: 500 16px var(--font); color: var(--ink); padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; width: 100%; }

/* reviews */
.stars { display: flex; gap: 6px; margin-top: 8px; }
.stars button { font-size: 30px; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--sand); padding: 2px; }
.stars button.on { color: #C98A1B; }
.chips.wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.on { background: var(--brown); color: #fff; border-color: var(--brown); }
.chip.bad.on { background: var(--sos, #B3261E); border-color: var(--sos, #B3261E); }
#reviewComment { width: 100%; margin-top: 10px; }
.record { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--ivory); border: 1px solid var(--sand); }
.record .issues li { color: #8A1F18; }
details.card summary { cursor: pointer; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
#lookupInput { flex: 1; text-transform: uppercase; }
.ok-text { color: #1F5A38; margin: 8px 0 0; }

/* accounts */
.acc-card { text-align: left; }
.acc-card h2 { margin: 0; }
.big-code { font: 800 64px/1 var(--font); letter-spacing: 4px; text-align: center; padding: 18px; background: var(--ivory); border: 2px solid var(--brown); border-radius: 18px; color: var(--brown); }
.code-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.code-pick .btn { font-size: 30px; font-weight: 800; padding: 18px 0; }
.qr-box { background: #fff; border-radius: 16px; padding: 12px; width: min(280px, 100%); margin: 0 auto; }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-video { width: 100%; border-radius: 16px; background: #000; aspect-ratio: 1; object-fit: cover; }
#accountBox .row input { min-width: 0; flex: 1; }

/* =====================================================================
   SafeRide look: warm grey background, charcoal cards, orange accent,
   big rounded cards and pill buttons.
   ===================================================================== */
:root {
  --cream: #ECE8E4;      /* page */
  --ivory: #F8F6F3;      /* light cards */
  --blush: #E1DBD5;
  --sand: #D3CBC3;
  --tan: #C2B8AE;
  --ink: #1F1B18;
  --ink-2: #7A716A;
  --brown: #2B2623;      /* charcoal */
  --line: #DDD6CF;
  --accent: #EF6C35;     /* orange */
  --accent-dark: #D9561F;
  --dark: #2B2623;
  --dark-2: #3A3430;
  --sos: #D93A2B;
  --sos-dark: #B02A1E;
  --ok: #2E8B57;
  --warn-bg: #FFF1E6;
  --radius: 24px;
}
body { background: linear-gradient(180deg, #E4DFDA 0%, #ECE8E4 240px); }
main { padding-top: 8px; }
.screen { gap: 14px; }
h1, h2 { letter-spacing: -.6px; font-weight: 700; }
h2 { font-size: 28px; }

/* header: avatar + greeting */
.topbar { background: rgba(236,232,228,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 0; padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: 12px; }
.avatar { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 0; padding: 0; background: var(--dark); color: #fff; font: 700 17px var(--font); cursor: pointer; overflow: visible; flex: none; }
.avatar img, .avatar span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; object-fit: cover; }
.avatar::after { content: "SR"; position: absolute; right: -4px; bottom: -4px; background: var(--accent); color: #fff; font: 800 9px/1 var(--font); padding: 3px 5px; border-radius: 999px; border: 2px solid var(--cream); }
.greet { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.greet b { font-size: 20px; font-weight: 700; letter-spacing: -.4px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.greet small { font-size: 12px; color: var(--ink-2); }
.mode-pill { margin-left: 0; background: var(--dark); color: #fff; font-weight: 600; padding: 5px 10px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--ivory); box-shadow: 0 1px 2px rgba(31,27,24,.08); }
@media (max-width: 380px) { .mode-pill { display: none; } }

/* buttons: pills */
.btn { border-radius: 999px; border: 1.5px solid var(--line); background: var(--ivory); min-height: 50px; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-dark); }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn.ghost { color: var(--ink); }
.btn.danger-outline { border-color: var(--sos); }
.seg { background: var(--blush); border-radius: 999px; }
.seg button { border-radius: 999px; }
.seg button.on { background: var(--dark); color: #fff; box-shadow: none; }

/* cards */
.card { border-radius: var(--radius); border: 0; background: var(--ivory); padding: 18px; box-shadow: 0 1px 2px rgba(31,27,24,.05); }
.card.subtle { background: var(--blush); }
.card.dark { background: var(--dark); color: #fff; }
.card.dark .muted, .card.dark .hint { color: #B9AFA8; }
.item { border-radius: 18px; border: 0; background: var(--ivory); padding: 12px 14px; }
input[type=text], input[type=url], input[type=email], input[type=search], input[type=password], input:not([type]), input[inputmode], select, textarea {
  border-radius: 16px; border: 1.5px solid var(--line); background: #fff; font: 500 16px var(--font); color: var(--ink); padding: 12px 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check input { accent-color: var(--accent); }

/* home: dark hero card */
.hero-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  min-height: 190px; padding: 20px; border: 0; border-radius: 28px; cursor: pointer; color: #fff; font: inherit;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(239,108,53,.35) 0%, rgba(239,108,53,0) 55%),
    linear-gradient(160deg, #3A3430 0%, #221E1B 100%);
  box-shadow: 0 10px 30px rgba(31,27,24,.18);
}
.hero-card:active { transform: scale(.99); }
.hero-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: auto; }
.chip-dark { background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; }
.hero-title { font-size: 30px; font-weight: 700; letter-spacing: -.8px; margin-top: 28px; }
.hero-sub { font-size: 14px; color: #CFC6BF; max-width: 80%; }
.hero-go { position: absolute; right: 18px; bottom: 18px; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 700; }

/* home: tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 128px; padding: 16px; border: 0; border-radius: 24px; background: var(--ivory); color: var(--ink); font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(31,27,24,.05); }
.tile:active { transform: scale(.98); }
.tile b { font-size: 16px; margin-top: auto; }
.tile small { font-size: 12px; color: var(--ink-2); }
.tile-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--blush); display: grid; place-items: center; font-size: 19px; }
.tile-sos { background: var(--sos); color: #fff; }
.tile-sos small { color: #FFD9D4; }
.tile-sos .tile-ico { background: rgba(255,255,255,.2); }

/* trip screens */
.sos { border-radius: 28px; min-height: 78px; }
.alert-head { border-radius: 28px; padding: 22px; }
.map { border-radius: 24px; border: 0; }
.pill { border-radius: 999px; }

/* modals & chat */
.modal { background: rgba(31,27,24,.6); }
.modal-box { border-radius: 28px; background: var(--ivory); }
.chat-box { background: var(--cream); border-radius: 28px 28px 0 0; }
.chat-head, .chat-input { background: var(--ivory); border-color: var(--line); }
.msg.bot { background: var(--ivory); border: 0; }
.msg.me { background: var(--dark); color: #fff; }
.chip { border-color: var(--line); background: var(--ivory); }
.chip.on { background: var(--dark); border-color: var(--dark); }
.toast { background: var(--dark); color: #fff; border-radius: 999px; padding: 12px 18px; }
.guide-dots span.on { background: var(--accent); }

/* contacts & accounts */
.contact-item { flex-wrap: wrap; }
.contact-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.contact-btns .btn { min-height: 38px; padding: 6px 12px; }
.me-row { display: flex; align-items: center; gap: 12px; }
.me-row small { display: block; color: var(--ink-2); font-size: 13px; }
.me-av { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--dark); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.mini-av { width: 38px; height: 38px; border-radius: 50%; background: var(--dark); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; overflow: hidden; }
.mini-av img { width: 100%; height: 100%; object-fit: cover; }
.mini-av.big { width: 88px; height: 88px; font-size: 32px; margin: 0 auto; }
.photo-pick { display: flex; gap: 12px; align-items: center; margin: 6px 0; }
.photo-circle { width: 72px; height: 72px; border-radius: 50%; background: var(--blush); display: grid; place-items: center; font-size: 26px; flex: none; overflow: hidden; }
.photo-circle img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick .btn { margin-top: 6px; width: fit-content; }
.big-code { border-radius: 28px; border: 0; background: var(--dark); color: #fff; }
.code-pick .btn { border-radius: 22px; }

.mode-pill { white-space: nowrap; }
.greet small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 440px) { .mode-pill { display: none; } }
#accountBox .row > .btn { flex: none; padding-left: 22px; padding-right: 22px; }
#accountBox .row.wrap > .btn { flex: 1 1 140px; }

/* Font: Outfit (rounded geometric, like the reference design). Light, large headings. */
:root { --font: "Outfit", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { letter-spacing: 0; }
h1 { font-weight: 500; letter-spacing: -.5px; }
h2 { font-weight: 500; letter-spacing: -.4px; }
h3 { font-weight: 600; }
.greet b { font-weight: 500; font-size: 22px; letter-spacing: -.2px; }
.hero-title { font-weight: 400; font-size: 32px; letter-spacing: -.3px; }
.tile b { font-weight: 500; }
.btn { font-weight: 500; }
.btn.big { font-weight: 600; }
.big-code, .code-pick .btn, .countdown { font-weight: 300; }
.big-code { font-size: 72px; }
.alert-head h2 { font-weight: 500; }
.kv b { font-weight: 600; }

/* ---------- Messages side chat ---------- */
.icon-btn { position: relative; }
.msg-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 11px/18px var(--font); text-align: center; }
.tile { position: relative; }
.tile-wide { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; gap: 12px; }
.tile-wide b { margin-top: 0; display: block; }
.tile-wide small { display: block; }
.tile-dark { background: var(--dark); color: #fff; }
.tile-dark small { color: #CFC6BF; }
.tile-dark .tile-ico { background: rgba(255,255,255,.12); flex: none; }
.tile .msg-badge { top: 12px; right: 12px; }
body.no-scroll { overflow: hidden; }
.side-chat { position: fixed; inset: 0; z-index: 2500; }
.side-scrim { position: absolute; inset: 0; background: rgba(31,27,24,.45); }
.side-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--cream); display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(31,27,24,.25); animation: slideIn .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
@keyframes slideIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.side-head { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; background: var(--ivory); }
.side-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-title b { display: block; font-size: 18px; font-weight: 500; }
.side-title small { display: block; color: var(--ink-2); font-size: 12px; }
.side-title > b + small { margin-left: 0; }
.side-title:has(> b) { flex-direction: column; align-items: flex-start; gap: 0; }
.side-body { flex: 1; overflow-y: auto; }
.side-empty { padding: 24px 18px; display: flex; flex-direction: column; gap: 10px; }
.thread-list { display: flex; flex-direction: column; padding: 8px; gap: 4px; }
.thread { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 18px; background: transparent; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.thread:hover, .thread:active { background: var(--ivory); }
.thread .grow { flex: 1; min-width: 0; }
.thread small { display: block; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.unread { background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 7px; }
.msgs { display: flex; flex-direction: column; gap: 8px; padding: 14px; min-height: 100%; }
.bubble-row { display: flex; }
.bubble-row.me { justify-content: flex-end; }
.bubble { max-width: 80%; background: var(--ivory); padding: 10px 12px; border-radius: 18px 18px 18px 6px; overflow-wrap: anywhere; }
.bubble-row.me .bubble { background: var(--dark); color: #fff; border-radius: 18px 18px 6px 18px; }
.bubble time, .alert-bubble time { display: block; font-size: 11px; opacity: .6; margin-top: 4px; }
.alert-bubble { width: min(320px, 90%); background: var(--ivory); border-left: 4px solid var(--accent); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.alert-bubble.urgent { background: #FBE3DF; border-color: var(--sos); }
.alert-bubble.okay { background: #E3F1E7; border-color: var(--ok); }
.alert-bubble small { color: var(--ink-2); }
.alert-bubble .row { margin-top: 6px; }
.alert-bubble .btn.small { min-height: 34px; padding: 4px 12px; font-size: 13px; }
.live-card { margin-top: 6px; }
.live-map { height: 170px; border-radius: 14px; overflow: hidden; background: var(--sand); }
.live-status { display: block; margin-top: 4px; font-weight: 600; color: var(--ink) !important; }
.side-input { display: flex; gap: 8px; padding: 10px 12px; background: var(--ivory); }
.side-input input { flex: 1; min-width: 0; }
.side-input .btn { flex: none; width: 50px; padding: 0; }
.sr-badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 600; }
#reviewOther { margin-top: 8px; }

.speed-row b { font-size: 20px; font-weight: 600; }

body:not(.dev) .dev-only { display: none !important; }

/* pop-up banners */
.pop-wrap { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(440px, calc(100% - 24px)); z-index: 4000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.pop { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 22px; background: var(--dark); color: #fff; box-shadow: 0 12px 30px rgba(31,27,24,.3); transform: translateY(-20px); opacity: 0; transition: transform .25s ease, opacity .25s ease; cursor: pointer; }
.pop.in { transform: none; opacity: 1; }
.pop-ico { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 18px; flex: none; }
.pop-text { flex: 1; min-width: 0; }
.pop-text b { display: block; font-weight: 600; }
.pop-text small { display: block; color: #D8CFC8; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pop-x { background: none; border: 0; color: #B9AFA8; font-size: 16px; cursor: pointer; padding: 6px; }
.pop-sent .pop-ico { background: var(--ok); }
.pop-alert { background: var(--sos); animation: popShake .5s ease 2; }
.pop-alert .pop-text small { color: #FFE1DC; }
@keyframes popShake { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.gmap { width: 100%; border: 0; display: block; background: var(--sand); }
.map.gmap { height: 300px; }
.map.tall.gmap { height: 42vh; min-height: 260px; }
.map-tabs { margin-bottom: -4px; }
.live-gmap { width: 100%; height: 170px; border: 0; border-radius: 14px; display: block; }

/* navigation arrow */
.nav-wrap { position: relative; width: 44px; height: 44px; }
.nav-halo { position: absolute; inset: 4px; border-radius: 50%; background: rgba(26,115,232,.18); animation: navPulse 2s ease-out infinite; }
.nav-arrow { position: absolute; inset: 7px; display: grid; place-items: center; transition: transform .5s ease; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
@keyframes navPulse { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* ---------- easier navigation ---------- */
main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.bottom-nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 1500; width: min(520px, calc(100% - 20px)); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--dark); border-radius: 26px; padding: 6px; box-shadow: 0 10px 30px rgba(31,27,24,.28); }
.bottom-nav button { position: relative; border: 0; background: transparent; color: #CFC6BF; font: 500 11px var(--font); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 20px; cursor: pointer; }
.bottom-nav button span { font-size: 19px; line-height: 1; }
.bottom-nav button b { font-weight: 500; }
.bottom-nav button.on { background: var(--accent); color: #fff; }
.bottom-nav .msg-badge { top: 2px; right: 16%; font-style: normal; }
.back-btn { font-size: 26px; line-height: 1; flex: none; }
.auth-btn { flex: none; border: 0; background: var(--accent); color: #fff; font: 600 13px var(--font); padding: 9px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
@media (max-width: 400px) { .auth-btn { padding: 8px 10px; font-size: 12px; } .greet small { display: none; } }
.pw-rule.ok-text { color: #1F5A38; }
.side-chat { z-index: 2600; }
