:root {
  --p: #1a56db;
  --p2: #1e429f;
  --p-lt: #ebf5ff;
  --p-glow: rgba(26,86,219,0.18);
  --ok: #057a55;
  --ok-lt: #def7ec;
  --warn: #c27803;
  --warn-lt: #fdf6b2;
  --danger: #c81e1e;
  --danger-lt: #fde8e8;
  --amber: #d97706;
  --amber-lt: #fffbeb;
  --purple: #6c2bd9;
  --purple-lt: #f0ebff;
  --teal: #0694a2;
  --teal-lt: #d5f5f6;

  --bg: #f0f4f8;
  --bg2: #e8edf2;
  --surf: #ffffff;
  --surf2: #f8fafc;
  --bdr: #dde3ec;
  --bdr2: #c8d0db;

  --tx1: #0d1b2a;
  --tx2: #3d4f61;
  --tx3: #6b7c8f;
  --tx4: #9faab5;

  --sh0: 0 1px 2px rgba(13,27,42,0.04);
  --sh1: 0 2px 8px rgba(13,27,42,0.07), 0 1px 3px rgba(13,27,42,0.04);
  --sh2: 0 6px 24px rgba(13,27,42,0.10), 0 2px 8px rgba(13,27,42,0.05);
  --sh3: 0 16px 48px rgba(13,27,42,0.14), 0 4px 16px rgba(13,27,42,0.07);

  --r4: 4px; --r8: 8px; --r12: 12px; --r16: 16px; --r20: 20px; --r24: 24px; --r99: 999px;
  --nav-h: 68px;
  --top-h: 60px;

  --font: 'Plus Jakarta Sans', sans-serif;
  --font2: 'Instrument Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  background: #1a2332;
  color: var(--tx1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════
   APP SHELL
══════════════════════════════ */
.app {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(0,0,0,0.5);
}

@media (min-width: 700px) {
  body { display: flex; align-items: center; justify-content: center; }
  .app { max-width: 420px; height: min(100dvh, 900px); border-radius: 24px; }
}

/* ══════════════════════════════
   TOP BAR
══════════════════════════════ */
.top-bar {
  flex-shrink: 0;
  height: var(--top-h);
  background: var(--surf);
  border-bottom: 1px solid var(--bdr);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  position: relative;
  z-index: 50;
  box-shadow: var(--sh0);
}

.logo {
  font-size: 19px;
  font-weight: 900;
  color: var(--p);
  text-decoration: none;
  letter-spacing: -0.6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font);
}

.logo-icon {
  width: 28px; height: 28px;
  background: var(--p);
  border-radius: var(--r8);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 13px;
}

.logo span { color: var(--tx1); }

.search-wrap {
  flex: 1;
  position: relative;
}

.search-wrap input {
  width: 100%;
  height: 38px;
  border-radius: var(--r99);
  border: 1.5px solid var(--bdr);
  background: var(--bg);
  padding: 0 14px 0 36px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--tx1);
  outline: none;
  transition: border-color .15s, background .15s;
}

.search-wrap input:focus { border-color: var(--p); background: white; }
.search-wrap input::placeholder { color: var(--tx4); }

.search-ico {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--tx4);
  font-size: 14px;
  pointer-events: none;
}

.top-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--tx2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 17px;
  position: relative;
  transition: background .15s, color .15s, transform .1s;
  flex-shrink: 0;
}

.top-btn:active { transform: scale(0.92); }
.top-btn:hover { background: var(--p-lt); color: var(--p); }

.top-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 9px; height: 9px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surf);
}

.ava {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--font);
  border: 2px solid transparent;
  transition: border-color .15s;
}

.ava:hover { border-color: var(--p); }

/* ══════════════════════════════
   SCROLL AREA
══════════════════════════════ */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.scroll-area::-webkit-scrollbar { width: 0; }

/* ══════════════════════════════
   BOTTOM NAV
══════════════════════════════ */
.bottom-nav {
  flex-shrink: 0;
  height: var(--nav-h);
  background: var(--surf);
  border-top: 1px solid var(--bdr);
  display: flex;
  align-items: stretch;
  padding: 0 2px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: relative;
  z-index: 50;
  box-shadow: 0 -2px 16px rgba(13,27,42,0.06);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--tx4);
  cursor: pointer;
  transition: color .15s;
  padding: 8px 4px;
  border-radius: var(--r8);
  position: relative;
  min-width: 0;
}

.nav-btn i {
  font-size: 21px;
  line-height: 1;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}

.nav-btn span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
  transition: color .15s;
}

.nav-btn.active { color: var(--p); }
.nav-btn.active i { transform: scale(1.12); }

.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 3px;
  background: var(--p);
  border-radius: 0 0 3px 3px;
}

.nav-notif {
  position: absolute;
  top: 7px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surf);
}

/* Center post button */
.nav-post-btn {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--p), var(--p2));
  border: none;
  color: white;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--p-glow);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  margin-bottom: 2px;
}

.nav-post-btn:active { transform: scale(0.92) rotate(45deg); }
.nav-post-btn:hover { transform: scale(1.06); box-shadow: 0 6px 24px rgba(26,86,219,0.35); }

/* ══════════════════════════════
   PANELS
══════════════════════════════ */
.panel { display: none; animation: panelIn .22s ease; }
.panel.active { display: block; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════
   HOME: HERO
══════════════════════════════ */
.hero {
  background: linear-gradient(145deg, #0f2569 0%, var(--p) 55%, #1a7fc1 100%);
  padding: 16px 16px 20px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  right: -30px; top: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  right: 50px; bottom: -60px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}

.hero-greeting { font-size: 12px; color: rgba(255,255,255,0.7); font-weight: 500; margin-bottom: 2px; }

.hero-title {
  font-size: 18px;
  font-weight: 800;
  color: white;
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: relative; z-index: 2;
}

.hero-stat {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r12);
  padding: 10px 8px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.hero-stat-n { font-size: 20px; font-weight: 900; color: white; line-height: 1; }
.hero-stat-l { font-size: 10px; color: rgba(255,255,255,0.7); margin-top: 2px; font-weight: 500; }

/* ══════════════════════════════
   FILTER STRIP
══════════════════════════════ */
.filter-strip {
  background: var(--surf);
  padding: 10px 14px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--bdr);
  position: sticky;
  top: 0;
  z-index: 30;
}

.filter-strip::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 13px;
  border-radius: var(--r99);
  border: 1.5px solid var(--bdr);
  background: var(--surf);
  color: var(--tx2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}

.chip.on, .chip:active { background: var(--p); border-color: var(--p); color: white; }

/* ══════════════════════════════
   SECTION HEADER
══════════════════════════════ */
.sec-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 8px;
}

.sec-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--tx1);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.2px;
}

.sec-title i { color: var(--p); font-size: 15px; }

.see-all {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--p);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ══════════════════════════════
   HOT ROUTES SCROLL
══════════════════════════════ */
.routes-scroll {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.routes-scroll::-webkit-scrollbar { display: none; }

.route-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r12);
  background: var(--surf);
  border: 1.5px solid var(--bdr);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
  box-shadow: var(--sh0);
}

.route-pill:hover { border-color: var(--p); background: var(--p-lt); }

.route-pill-name { font-size: 12px; font-weight: 700; color: var(--tx1); }
.route-pill-count { font-size: 10px; color: var(--tx3); }

.hot-dot {
  width: 6px; height: 6px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.7); }
}

/* ══════════════════════════════
   FEED TABS
══════════════════════════════ */
.feed-tabs {
  display: flex;
  padding: 0 14px;
  gap: 4px;
  border-bottom: 1.5px solid var(--bdr);
}

.feed-tab {
  flex: 1;
  padding: 10px 6px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tx3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: color .15s;
}

.feed-tab.on { color: var(--p); border-bottom-color: var(--p); }

.tab-cnt {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--r99);
  background: var(--bg2);
  color: var(--tx3);
}

.feed-tab.on .tab-cnt { background: var(--p); color: white; }

/* ══════════════════════════════
   LOGISTICS CARDS
══════════════════════════════ */
.feed-wrap { padding: 10px 12px; }

.lcard {
  background: var(--surf);
  border-radius: var(--r16);
  border: 1px solid var(--bdr);
  box-shadow: var(--sh1);
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  position: relative;
}

.lcard:hover { box-shadow: var(--sh2); transform: translateY(-1px); }
.lcard:active { transform: scale(0.985); box-shadow: var(--sh0); }

/* Urgent glow pulse */
.lcard.urgent-card {
  border-color: #fca5a5;
  animation: urgentPulse 2.5s infinite;
}

@keyframes urgentPulse {
  0%, 100% { box-shadow: var(--sh1); }
  50% { box-shadow: 0 0 0 3px rgba(220,38,38,0.1), var(--sh1); }
}

.lcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 0;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-ava {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  color: white;
  flex-shrink: 0;
  font-family: var(--font);
}

.u-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx1);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.u-name .vb { color: var(--p); font-size: 12px; }
.u-meta { font-size: 11px; color: var(--tx3); margin-top: 1px; display: flex; align-items: center; gap: 4px; }

.stars { color: var(--amber); font-size: 10px; }

/* Status badges */
.sbadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: var(--r99);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1px;
  flex-shrink: 0;
}

.sb-ok { background: var(--ok-lt); color: var(--ok); }
.sb-warn { background: var(--warn-lt); color: var(--warn); }
.sb-danger { background: var(--danger-lt); color: var(--danger); }
.sb-purple { background: var(--purple-lt); color: var(--purple); }
.sb-teal { background: var(--teal-lt); color: var(--teal); }

/* Route */
.route-row {
  display: flex;
  align-items: center;
  padding: 12px 12px 8px;
  gap: 0;
}

.city {
  font-size: 17px;
  font-weight: 900;
  color: var(--tx1);
  letter-spacing: -0.4px;
  flex: 1;
  font-family: var(--font);
}

.city.right { text-align: right; }

.route-mid {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 10px;
}

.route-line {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--p);
}

.r-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 2px solid var(--p);
  background: white;
}

.r-dash {
  width: 28px; height: 1.5px;
  background: linear-gradient(to right, var(--p), var(--p));
  position: relative;
}

.r-arrow { color: var(--p); font-size: 14px; }
.route-via { font-size: 9px; color: var(--tx4); margin-top: 2px; font-weight: 500; }

/* Details grid */
.dg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 12px 10px;
}

.di {
  background: var(--bg);
  border-radius: var(--r8);
  padding: 7px 8px;
}

.di-l { font-size: 9.5px; color: var(--tx4); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.di-v {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx1);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.di-v i { font-size: 11px; color: var(--p); }
.di-v.ok { color: var(--ok); }
.di-v.warn { color: var(--warn); }

/* Capacity bar */
.cap-bar-wrap { padding: 0 12px 10px; }
.cap-bar-hdr { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--tx3); font-weight: 600; margin-bottom: 5px; }
.cap-bar { height: 5px; background: var(--bg2); border-radius: 3px; overflow: hidden; }
.cap-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.cap-ok { background: linear-gradient(to right, var(--ok), #34d399); }
.cap-warn { background: linear-gradient(to right, var(--warn), #fbbf24); }
.cap-danger { background: linear-gradient(to right, var(--danger), #f87171); }

/* Action row */
.card-acts {
  display: flex;
  gap: 7px;
  padding: 0 12px 12px;
}

.ca-btn {
  flex: 1;
  height: 38px;
  border-radius: var(--r10, 10px);
  border: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 5px;
  transition: all .15s;
  border-radius: var(--r8);
}

.ca-btn:active { transform: scale(0.94); }
.ca-btn i { font-size: 13px; }

.ca-p { background: var(--p); color: white; }
.ca-p:hover { background: var(--p2); }
.ca-g { background: var(--ok); color: white; }
.ca-g:hover { background: #046c47; }
.ca-o { background: var(--bg2); color: var(--tx2); border: 1.5px solid var(--bdr); }
.ca-o:hover { border-color: var(--p); color: var(--p); background: var(--p-lt); }
.ca-ico { flex: 0 0 38px; }

/* Time label */
.posted-time { font-size: 10px; color: var(--tx4); padding: 0 12px 10px; font-weight: 500; }

/* ══════════════════════════════
   MATCH BANNER
══════════════════════════════ */
.match-banner {
  margin: 10px 12px;
  background: linear-gradient(135deg, #f0fdf4, #d1fae5);
  border: 1.5px solid #6ee7b7;
  border-radius: var(--r16);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: box-shadow .15s;
}

.match-banner:hover { box-shadow: var(--sh1); }

.match-ico {
  width: 38px; height: 38px;
  background: var(--ok);
  border-radius: var(--r10, 10px);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  border-radius: var(--r8);
}

.match-txt h5 { font-size: 13px; font-weight: 800; color: #065f46; margin-bottom: 2px; }
.match-txt p { font-size: 11.5px; color: #047857; }

/* ══════════════════════════════
   LEAVING SOON strip
══════════════════════════════ */
.soon-scroll {
  display: flex;
  gap: 8px;
  padding: 0 12px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.soon-scroll::-webkit-scrollbar { display: none; }

.soon-card {
  flex-shrink: 0;
  width: 160px;
  background: var(--surf);
  border-radius: var(--r12);
  border: 1.5px solid var(--bdr);
  padding: 11px 12px;
  cursor: pointer;
  transition: all .15s;
  box-shadow: var(--sh0);
}

.soon-card:hover { border-color: var(--p); box-shadow: var(--sh1); }

.soon-route { font-size: 13px; font-weight: 800; color: var(--tx1); margin-bottom: 4px; }
.soon-time { font-size: 11px; color: var(--danger); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.soon-meta { font-size: 10.5px; color: var(--tx3); margin-top: 4px; font-weight: 500; }

/* ══════════════════════════════
   MESSAGES LIST
══════════════════════════════ */
.msg-search {
  padding: 12px 14px;
  background: var(--surf);
  border-bottom: 1px solid var(--bdr);
}

.msg-search input {
  width: 100%;
  height: 38px;
  border-radius: var(--r99);
  border: 1.5px solid var(--bdr);
  background: var(--bg);
  padding: 0 14px 0 36px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--tx1);
  outline: none;
}

.msg-search input:focus { border-color: var(--p); background: white; }
.msg-search input::placeholder { color: var(--tx4); }
.msg-search .si { position: absolute; left: 25px; top: 50%; transform: translateY(-50%); color: var(--tx4); font-size: 14px; }

.msg-search-wrap { position: relative; }

.chat-list-wrap { padding: 6px 0; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}

.conv-item:active { background: var(--bg); }

.conv-ava {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  color: white;
  flex-shrink: 0;
  position: relative;
  font-family: var(--font);
}

.on-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 13px; height: 13px;
  background: var(--ok);
  border-radius: 50%;
  border: 2px solid var(--surf);
}

.conv-body { flex: 1; min-width: 0; }

.conv-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.conv-name { font-size: 14px; font-weight: 700; color: var(--tx1); }
.conv-time { font-size: 11px; color: var(--tx4); }

.conv-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.conv-msg { font-size: 12.5px; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.conv-msg.bold { font-weight: 600; color: var(--tx2); }

.unread-badge {
  background: var(--p);
  color: white;
  border-radius: var(--r99);
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.deal-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r4);
  flex-shrink: 0;
}

.deal-neg { background: var(--warn-lt); color: var(--warn); }
.deal-agreed { background: var(--ok-lt); color: var(--ok); }
.deal-transit { background: var(--p-lt); color: var(--p); }
.deal-done { background: var(--bg2); color: var(--tx3); }

/* Pinned */
.conv-item.pinned { background: linear-gradient(to right, rgba(26,86,219,0.03), transparent); }
.pin-ico { position: absolute; right: 14px; top: 10px; color: var(--p); font-size: 11px; }

/* ══════════════════════════════
   CHAT SCREEN
══════════════════════════════ */
.chat-screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}

.chat-screen.open { transform: translateX(0); }

/* Chat top bar */
.chat-top {
  flex-shrink: 0;
  background: var(--surf);
  border-bottom: 1px solid var(--bdr);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--sh0);
}

.chat-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--tx2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: background .12s;
}

.chat-back:active { background: var(--p-lt); color: var(--p); }

.chat-top-ava {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  color: white;
  flex-shrink: 0;
  position: relative;
  font-family: var(--font);
}

.chat-top-info { flex: 1; min-width: 0; }
.chat-top-name { font-size: 14px; font-weight: 800; color: var(--tx1); }
.chat-top-status { font-size: 11.5px; color: var(--ok); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.chat-top-status i { font-size: 8px; }

.chat-top-acts { display: flex; gap: 4px; }

/* Context card */
.context-card {
  flex-shrink: 0;
  background: linear-gradient(135deg, #0f2569, var(--p));
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.context-card::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.ctx-ico {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--r8);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.ctx-body { flex: 1; min-width: 0; }
.ctx-route { font-size: 14px; font-weight: 900; color: white; letter-spacing: -0.3px; }
.ctx-meta { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 1px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.ctx-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r99);
  background: rgba(255,255,255,0.18);
  color: white;
}

/* Deal status timeline */
.deal-timeline {
  flex-shrink: 0;
  background: var(--surf);
  border-bottom: 1px solid var(--bdr);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 0;
}

.tl-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}

.tl-step::after {
  content: '';
  position: absolute;
  top: 9px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--bdr);
}

.tl-step:last-child::after { display: none; }

.tl-step.done::after { background: var(--p); }

.tl-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg2);
  border: 2px solid var(--bdr);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  position: relative;
  z-index: 1;
  transition: all .2s;
}

.tl-step.done .tl-dot { background: var(--p); border-color: var(--p); color: white; }
.tl-step.cur .tl-dot { background: var(--warn); border-color: var(--warn); color: white; animation: pulse-tl .8s infinite alternate; }

@keyframes pulse-tl {
  from { box-shadow: 0 0 0 0 rgba(201,120,3,0.4); }
  to { box-shadow: 0 0 0 5px rgba(201,120,3,0); }
}

.tl-lbl { font-size: 9px; font-weight: 700; color: var(--tx4); text-align: center; line-height: 1.2; }
.tl-step.done .tl-lbl, .tl-step.cur .tl-lbl { color: var(--tx2); }

/* Messages area */
.msgs-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}

.msgs-area::-webkit-scrollbar { width: 0; }

/* Date separator */
.date-sep {
  text-align: center;
  font-size: 11px;
  color: var(--tx4);
  font-weight: 600;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-sep::before, .date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bdr);
}

/* Bubble */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin: 2px 0;
}

.msg-row.out { flex-direction: row-reverse; }

.msg-mini-ava {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800;
  color: white;
  flex-shrink: 0;
  font-family: var(--font);
  align-self: flex-end;
}

.bubble {
  max-width: 76%;
  padding: 9px 12px;
  border-radius: 18px;
  position: relative;
  line-height: 1.45;
}

.bubble-in {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-bottom-left-radius: 4px;
  color: var(--tx1);
}

.bubble-out {
  background: var(--p);
  border-bottom-right-radius: 4px;
  color: white;
}

.bubble-txt { font-size: 13.5px; }

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
}

.bubble-time { font-size: 10.5px; opacity: 0.65; }

.read-ico { font-size: 13px; }
.read-ico.sent { color: rgba(255,255,255,0.6); }
.read-ico.delivered { color: rgba(255,255,255,0.7); }
.read-ico.read { color: #93c5fd; }

/* Deal bubble */
.deal-bubble {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
  border-radius: var(--r12);
  padding: 11px 13px;
  max-width: 82%;
  margin: 6px auto;
  text-align: center;
}

.deal-bubble-ico { font-size: 20px; margin-bottom: 4px; }
.deal-bubble-txt { font-size: 13px; font-weight: 700; color: var(--ok); }
.deal-bubble-sub { font-size: 11px; color: #065f46; margin-top: 2px; }

/* Image bubble */
.img-bubble {
  max-width: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg2);
}

.img-bubble img { width: 100%; display: block; }

/* Quote/reply */
.reply-preview {
  background: rgba(0,0,0,0.07);
  border-left: 3px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 5px;
  font-size: 11.5px;
  opacity: 0.85;
}

/* ──── QUICK ACTIONS ──── */
.quick-actions {
  flex-shrink: 0;
  background: var(--surf);
  border-top: 1px solid var(--bdr);
  padding: 10px 12px 0;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar { display: none; }

.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: var(--r99);
  border: 1.5px solid var(--bdr);
  background: var(--surf);
  color: var(--tx2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  font-family: var(--font);
}

.qa-btn:active { transform: scale(0.94); }
.qa-btn.qa-ok { border-color: var(--ok); color: var(--ok); background: var(--ok-lt); }
.qa-btn.qa-p { border-color: var(--p); color: var(--p); background: var(--p-lt); }
.qa-btn.qa-warn { border-color: var(--warn); color: var(--warn); background: var(--warn-lt); }
.qa-btn.qa-danger { border-color: var(--danger); color: var(--danger); background: var(--danger-lt); }

/* Quick replies */
.quick-replies {
  flex-shrink: 0;
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surf);
}

.quick-replies::-webkit-scrollbar { display: none; }

.qr-pill {
  padding: 6px 11px;
  border-radius: var(--r99);
  border: 1px solid var(--bdr2);
  background: var(--bg);
  color: var(--tx2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .12s;
  font-family: var(--font);
}

.qr-pill:active { background: var(--p); border-color: var(--p); color: white; transform: scale(0.93); }

/* Input bar */
.chat-input-bar {
  flex-shrink: 0;
  background: var(--surf);
  border-top: 1px solid var(--bdr);
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.attach-btn, .send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 17px;
  flex-shrink: 0;
  transition: all .15s;
}

.attach-btn { background: var(--bg2); color: var(--tx3); }
.attach-btn:hover { background: var(--bg2); color: var(--tx1); }

.send-btn {
  background: var(--p);
  color: white;
  box-shadow: 0 2px 10px var(--p-glow);
}

.send-btn:hover { background: var(--p2); transform: scale(1.05); }
.send-btn:active { transform: scale(0.92); }

.msg-input-wrap {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--bdr);
  border-radius: 20px;
  padding: 9px 14px;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: border-color .15s;
}

.msg-input-wrap:focus-within { border-color: var(--p); background: white; }

.msg-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  color: var(--tx1);
  outline: none;
  resize: none;
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
}

.msg-input::placeholder { color: var(--tx4); }

/* ══════════════════════════════
   NOTIFICATIONS PANEL
══════════════════════════════ */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--bdr);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}

.notif-item:hover { background: var(--surf2); }
.notif-item.unread { background: var(--p-lt); }
.notif-item.unread::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--p); border-radius: 0 2px 2px 0; }

.notif-ico {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.notif-body h6 { font-size: 13px; font-weight: 700; color: var(--tx1); margin-bottom: 3px; }
.notif-body p { font-size: 12px; color: var(--tx3); line-height: 1.4; }
.notif-body small { font-size: 10.5px; color: var(--tx4); margin-top: 4px; display: block; }

/* ══════════════════════════════
   PROFILE PANEL
══════════════════════════════ */
.profile-hero {
  background: linear-gradient(150deg, #0f2569 0%, var(--p) 100%);
  padding: 28px 20px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.ph-ava {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900;
  color: white;
  margin: 0 auto 12px;
  font-family: var(--font);
}

.ph-name { font-size: 20px; font-weight: 900; color: white; letter-spacing: -0.4px; }
.ph-role { font-size: 12.5px; color: rgba(255,255,255,0.75); margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 5px; }

.profile-stats-card {
  margin: -52px 14px 16px;
  background: var(--surf);
  border-radius: var(--r16);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--bdr);
  box-shadow: var(--sh2);
  position: relative; z-index: 5;
}

.ps-col {
  text-align: center;
  padding: 0 6px;
  border-right: 1px solid var(--bdr);
}

.ps-col:last-child { border-right: none; }
.ps-n { font-size: 22px; font-weight: 900; color: var(--p); }
.ps-l { font-size: 10.5px; color: var(--tx4); font-weight: 600; margin-top: 2px; }

.profile-menu { padding: 0 12px; }

.pm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border-radius: var(--r12);
  cursor: pointer;
  transition: background .12s;
  margin-bottom: 3px;
}

.pm-item:hover { background: var(--bg); }
.pm-item:active { background: var(--bg2); }

.pm-ico {
  width: 40px; height: 40px;
  border-radius: var(--r10, 10px);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  border-radius: var(--r8);
}

.pm-txt { flex: 1; }
.pm-title { font-size: 14px; font-weight: 700; color: var(--tx1); }
.pm-sub { font-size: 11.5px; color: var(--tx4); margin-top: 1px; }
.pm-arr { color: var(--tx4); font-size: 16px; }

/* ══════════════════════════════
   TRIPS PANEL
══════════════════════════════ */
.my-trips-hdr {
  background: var(--surf);
  border-bottom: 1px solid var(--bdr);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ══════════════════════════════
   POST MODAL
══════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,18,30,0.6);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.show { display: flex; }

.modal-sheet {
  width: 100%;
  max-width: 430px;
  background: var(--surf);
  border-radius: 24px 24px 0 0;
  padding: 20px 18px 32px;
  max-height: 93dvh;
  overflow-y: auto;
  animation: sheetUp .3s cubic-bezier(.34,1.26,.64,1);
}

.modal-sheet::-webkit-scrollbar { width: 0; }

@keyframes sheetUp {
  from { transform: translateY(60%); opacity: 0.5; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 38px; height: 4px;
  background: var(--bdr2);
  border-radius: 2px;
  margin: 0 auto 18px;
}

.sheet-title { font-size: 18px; font-weight: 900; color: var(--tx1); margin-bottom: 4px; letter-spacing: -0.3px; }
.sheet-sub { font-size: 13px; color: var(--tx3); margin-bottom: 18px; }

.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }

.type-card {
  border: 2px solid var(--bdr);
  border-radius: var(--r16);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: var(--bg);
}

.type-card:hover, .type-card.sel {
  border-color: var(--p);
  background: var(--p-lt);
}

.type-card i { font-size: 26px; color: var(--p); display: block; margin-bottom: 7px; }
.type-card b { font-size: 13.5px; font-weight: 800; color: var(--tx1); display: block; }
.type-card small { font-size: 11px; color: var(--tx3); }

.form-lbl {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tx3);
  margin-bottom: 6px;
}

.form-inp {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--bdr);
  border-radius: var(--r10, 10px);
  background: var(--bg);
  padding: 0 13px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--tx1);
  outline: none;
  transition: border-color .15s, background .15s;
  appearance: none;
  border-radius: var(--r8);
  margin-bottom: 13px;
}

.form-inp:focus { border-color: var(--p); background: white; box-shadow: 0 0 0 3px rgba(26,86,219,0.07); }

.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.form-ta {
  width: 100%;
  border: 1.5px solid var(--bdr);
  border-radius: var(--r8);
  background: var(--bg);
  padding: 11px 13px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--tx1);
  outline: none;
  resize: none;
  height: 75px;
  transition: border-color .15s;
  margin-bottom: 13px;
}

.form-ta:focus { border-color: var(--p); background: white; }

.pub-btn {
  width: 100%;
  height: 50px;
  border-radius: var(--r12);
  border: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: all .15s;
  margin-top: 14px;
  letter-spacing: -0.2px;
}

.pub-btn:active { transform: scale(0.97); }
.pub-btn.primary { background: var(--p); color: white; box-shadow: 0 4px 16px var(--p-glow); }
.pub-btn.primary:hover { background: var(--p2); }
.pub-btn.success { background: var(--ok); color: white; }
.pub-btn.cancel { background: var(--bg2); color: var(--tx2); margin-top: 8px; }

/* ══════════════════════════════
   TOAST
══════════════════════════════ */
.toast-host {
  position: fixed;
  top: calc(var(--top-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
  width: calc(100% - 28px);
  max-width: 400px;
}

.toast-pill {
  background: var(--tx1);
  color: white;
  border-radius: var(--r99);
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: var(--sh3);
  animation: toastIn .25s cubic-bezier(.34,1.26,.64,1) forwards;
  opacity: 0;
}

.toast-pill i { font-size: 15px; }

@keyframes toastIn {
  from { transform: translateY(-10px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ══════════════════════════════
   SKELETON LOADER
══════════════════════════════ */
.skel {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bdr) 37%, var(--bg2) 63%);
  background-size: 400% 100%;
  animation: skel-shimmer 1.4s ease infinite;
  border-radius: var(--r8);
}

@keyframes skel-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ══════════════════════════════
   MISC
══════════════════════════════ */
.divider { height: 8px; background: var(--bg2); border-top: 1px solid var(--bdr); border-bottom: 1px solid var(--bdr); margin: 4px 0; }

.empty-st {
  text-align: center;
  padding: 40px 24px;
  color: var(--tx4);
}

.empty-st i { font-size: 44px; display: block; margin-bottom: 12px; opacity: 0.4; }
.empty-st h4 { font-size: 15px; color: var(--tx2); font-weight: 700; margin-bottom: 6px; }
.empty-st p { font-size: 13px; }

/* Subtle new-post animation */
@keyframes newPost {
  from { background: rgba(26,86,219,0.07); }
  to { background: transparent; }
}

.lcard.new-post { animation: newPost 1.5s ease forwards, urgentPulse 0s; }

/* Typing indicator */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 10px 14px;
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--tx4);
  animation: typingAnim 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }

@keyframes typingAnim {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* FAB */
.fab {
  position: absolute;
  bottom: calc(var(--nav-h) + 14px);
  right: 14px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p), var(--p2));
  border: none;
  color: white;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(26,86,219,0.4);
  cursor: pointer;
  z-index: 40;
  transition: all .2s cubic-bezier(.34,1.56,.64,1);
}

.fab:hover { transform: scale(1.1); box-shadow: 0 10px 32px rgba(26,86,219,0.5); }
.fab:active { transform: scale(0.93) rotate(45deg); }

/* Image placeholder for cargo */
.cargo-img-placeholder {
  background: linear-gradient(135deg, var(--bg2), var(--bdr));
  border-radius: var(--r8);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx4);
  font-size: 36px;
  margin-bottom: 8px;
}

/* Map preview stub */
.map-stub {
  background: linear-gradient(135deg, #e8f4fd, #dbeafe);
  border: 1.5px solid var(--p-lt);
  border-radius: var(--r12);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--p);
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  cursor: pointer;
  margin: 0 12px 12px;
}

/* Swipe hint */
.swipe-hint {
  font-size: 10px;
  color: var(--tx4);
  text-align: center;
  padding: 4px 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 500;
}

.swipe-hint span { display: flex; align-items: center; gap: 3px; }
