/* =========================================================
   1. VARIABLES
========================================================= */
/* Reserve space for the vertical scrollbar when content grows so layout width
   doesn’t jump on Chrome (e.g. expanding “Routes” cards crossing the viewport). */
html {
  scrollbar-gutter: stable;
}

:root {
  --primary: #0f172a;
  --primary-light: #334155;

  --secondary: #339af0;
  --success: #059669;
  --success-hover: #047857;
  --danger: #fa5252;

  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #333;
  --muted: #777;
  --border: #ddd;

  --shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 10px 25px rgba(0, 0, 0, 0.18);

  --radius: 12px;
  --radius-lg: 18px;

  --font: "Segoe UI", Arial, sans-serif;

  --auth-main: #1f2937;
  --auth-accent: #374151;
  --auth-soft: rgba(31, 41, 55, 0.15);

  /* Fixed header — keep .page top in sync (must be ≥ actual .header height) */
  --header-offset: 92px;
}

/* Dark theme tokens — inherited by all descendants */
body.dark-mode {
  --bg: #0b0d11;
  --card: #151922;
  --text: #e8eaed;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.14);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  /* Dark header strip — tune to match raster canvas in logo2.png (dark) */
  --header-bar-bg: #0f172a;
}

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

.reduce-motion .pickup-pin {
  animation: none !important;
}

/*
 * Reduce-motion nukes animations via `.reduce-motion *` above.
 * Keep live map location rings readable — subtle looping pulse only on these nodes.
 */
.reduce-motion .user-location .pulse {
  animation: userPulse 1.75s ease-out infinite none !important;
}

.reduce-motion .driver-live-marker .pulse,
.reduce-motion .marshal-live-marker .pulse {
  animation: livePulse 2s ease-out infinite none !important;
}

.reduce-motion .dot-container .pulse {
  animation: pulseAnim 1.65s ease-out infinite none !important;
}

/* =========================================================
   2. GLOBAL
========================================================= */
body {
  font-family: var(--font);
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

* {
  box-sizing: border-box;
}

body,
.header,
.card,
.setting-card,
input {
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

#loginPage .container {
  margin-top: 60px;
}

.dropdown-item .icon {
  width: 20px;
  display: inline-flex;
  justify-content: center;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.subtitle {
  font-size: 13px;
  color: #9ca3af;
  margin-top: 2px;
  letter-spacing: 0.2px;
}

.primary-btn {
  width: 100%;
  background: #2563eb;
  color: white;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  border: none;
}

.sidebar,
.side-panel,
.menu-panel {
  z-index: 9999 !important;
}

/* =========================================================
   3. HEADER
========================================================= */
.header {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  background: var(--card);
  padding: 14px 16px;
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.07),
    0 3px 11px rgba(15, 23, 42, 0.08);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  overflow: visible;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  :root {
    /*
      Desktop nav is a single row (no wrap): header is shorter than the old wrapped two-line bar.
      Tighter offset so maps / sheets sit correctly under tablet–laptop widths.
    */
    --header-offset: 104px;
  }

  .header {
    padding: 10px 24px;
    min-height: 0;
    box-sizing: border-box;
  }
}

/* Wide single-line header — tighter offset once there’s room for one nav row */
@media (min-width: 1320px) {
  :root {
    /* Matches ~65px logo + vertical header padding (~10px each side) */
    --header-offset: 92px;
  }
}

/* Startup splash is always light — avoids dark flash when OS/app theme is dark */
#appLoader {
  position: fixed;
  inset: 0;
  color-scheme: light;
  background: linear-gradient(155deg, #ffffff 0%, #f4f7ff 38%, #fafbfc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.35s ease;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-family: var(--font);
  color: #1e293b;
  padding: 32px 40px 30px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: loaderContentIn 0.45s ease-out both;
}

body.dark-mode #appLoader .loader-content {
  /* Same light card even when app theme is dark */
  color: #1e293b;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
}

.loader-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: 168px;
  margin: 0 auto;
  object-fit: contain;
}

.loader-spinner {
  width: 34px;
  height: 34px;
  margin: 22px auto 18px;
  border-radius: 50%;
  background: conic-gradient(
    var(--secondary) 0%,
    var(--secondary) 22%,
    rgba(51, 154, 240, 0.12) 22%,
    rgba(51, 154, 240, 0.12) 100%
  );
  animation: loaderSpin 0.85s linear infinite;
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 3px),
    #000 calc(100% - 2px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 3px),
    #000 calc(100% - 2px)
  );
}

.loader-sub {
  margin: 0;
  max-width: 220px;
  line-height: 1.45;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.02em;
}

body.dark-mode #appLoader .loader-sub {
  color: #64748b;
}

@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loaderContentIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-content {
    animation: none;
  }

  .loader-spinner {
    animation: none;
    background: var(--secondary);
    opacity: 0.35;
    -webkit-mask: none;
    mask: none;
    width: 10px;
    height: 10px;
    margin-bottom: 14px;
  }

  .taxi-icon-wrap {
    animation: none !important;
  }

  .taxi-exhaust-shell {
    display: none !important;
  }
}

.reduce-motion .loader-spinner {
  animation: none !important;
  background: var(--secondary);
  opacity: 0.35;
  -webkit-mask: none;
  mask: none;
  width: 10px;
  height: 10px;
}

.reduce-motion .taxi-exhaust-shell {
  display: none !important;
}

.reduce-motion .taxi-icon-wrap {
  animation: none !important;
}

.empty-state {
  font-size: 10px;
}

/* Hint copy directly under the home map */
.empty-state--below-map {
  margin-top: 12px;
  padding: 0 10px 2px;
  text-align: center;
}

.empty-state--below-map p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--muted);
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.header h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.taxi-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 0;
  cursor: inherit;
}

.taxi-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 34px;
  min-width: 34px;
  height: 30px;
  margin-right: 1px;
  flex-shrink: 0;
  vertical-align: middle;
  overflow: visible;
  cursor: pointer;
  transform-origin: 52% 58%;
  /* Drive in + brake + ~10s idle + fade out + ~2s hidden (~14s loop, linear spacing) */
  animation: taxiVanHeaderCycle 14s linear infinite;
}

/*
 * Small tailpipe + tight puff cluster aligned to the rear of the van glyph.
 * Keeps fumes compact (straight from the muffler), not billboard-sized glows.
 */
.taxi-exhaust-shell {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.taxi-exhaust-pipe {
  position: absolute;
  left: 12px;
  top: calc(50% + 9px);
  width: 5px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(21, 128, 61, 0.95),
    rgba(74, 222, 128, 0.9)
  );
  opacity: 0;
  transform-origin: center center;
  animation-name: taxiExhaustTiny;
  animation-duration: 14s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.taxi-exhaust-cluster {
  position: absolute;
  left: 6px;
  top: calc(50% + 7px);
  width: 6px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at 58% 45%,
    rgba(247, 254, 250, 0.96) 0%,
    rgba(167, 243, 208, 1) 40%,
    rgba(74, 222, 128, 0.85) 70%,
    rgba(34, 197, 94, 0.45) 100%
  );
  /* Tiny scalloped lumps (outline-style icon vibes) plus a light halo */
  box-shadow:
    -3px 0 0 -1px rgba(52, 211, 153, 0.9),
    -5px -1px 0 -1px rgba(167, 243, 208, 0.85),
    -2px -3px 0 -2px rgba(74, 222, 128, 0.55),
    0 0 2px rgba(52, 211, 153, 0.4);
  transform-origin: right center;
  animation-name: taxiExhaustTiny;
  animation-duration: 14s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes taxiExhaustTiny {
  0%,
  30%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }

  3% {
    opacity: 1;
    transform: translate3d(-0.5px, 0.5px, 0);
  }

  14% {
    opacity: 0.96;
    transform: translate3d(-11px, -2px, 0);
  }

  23% {
    opacity: 0.42;
    transform: translate3d(-16px, -3px, 0);
  }

  29% {
    opacity: 0;
    transform: translate3d(-19px, -4px, 0);
  }
}

.taxi-icon.fa-solid {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 22px;
  line-height: 1;
  color: var(--success, #059669);
  object-fit: unset;
}

@keyframes taxiVanHeaderCycle {
  0%,
  82%,
  100% {
    opacity: 0;
    transform: translate3d(-56px, 0, 0) rotate(-2.75deg);
  }

  2% {
    opacity: 0.22;
    transform: translate3d(-50px, 0, 0) rotate(-2.35deg);
  }

  4% {
    opacity: 1;
    transform: translate3d(-44px, 0, 0) rotate(-2deg);
  }

  8% {
    opacity: 1;
    transform: translate3d(-30px, 0, 0) rotate(-1.25deg);
  }

  12% {
    opacity: 1;
    transform: translate3d(-18px, 0, 0) rotate(-0.75deg);
  }

  15.5% {
    opacity: 1;
    transform: translate3d(-8px, 0, 0) rotate(-0.35deg);
  }

  18.5% {
    opacity: 1;
    transform: translate3d(-2px, 0, 0) rotate(-0.08deg);
  }

  21%,
  72% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  73% {
    opacity: 0.9;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  76% {
    opacity: 0.38;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  80% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

.dark-mode .taxi-exhaust-cluster {
  background: radial-gradient(
    circle at 58% 45%,
    rgba(236, 253, 245, 0.94) 0%,
    rgba(167, 243, 208, 0.98) 44%,
    rgba(74, 222, 128, 0.82) 72%,
    rgba(52, 211, 153, 0.5) 100%
  );
  box-shadow:
    -3px 0 0 -1px rgba(110, 231, 183, 0.85),
    -5px -1px 0 -1px rgba(167, 243, 208, 0.75),
    -2px -3px 0 -2px rgba(52, 211, 153, 0.5),
    0 0 2px rgba(74, 222, 128, 0.45);
}

.dark-mode .taxi-exhaust-pipe {
  background: linear-gradient(
    90deg,
    rgba(236, 253, 245, 0.7),
    rgba(74, 222, 128, 0.9)
  );
}

@media (max-width: 640px) {
  .taxi-exhaust-cluster {
    left: 5px;
    width: 7px;
    height: 6px;
    box-shadow:
      -3px 0 0 -1px rgba(52, 211, 153, 0.92),
      -6px -1px 0 -1px rgba(167, 243, 208, 0.82),
      -2px -3px 0 -2px rgba(74, 222, 128, 0.62),
      0 0 3px rgba(52, 211, 153, 0.45);
  }

  .taxi-exhaust-pipe {
    left: 12px;
    top: calc(50% + 10px);
    width: 6px;
    height: 2px;
  }
}

.dark-mode .taxi-icon.fa-solid {
  color: #34d399;
}

.navo-logo {
  height: 65px;
  object-fit: contain;
}

/* Theme logos: logo.png (light) / logo2.png (dark) — no filter hack */
.navo-logo-light {
  display: block;
}

.navo-logo-dark {
  display: none;
}

body.dark-mode .navo-logo-light {
  display: none;
}

body.dark-mode .navo-logo-dark {
  display: block;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  min-width: 0;
  overflow: visible;
}

.header-center {
  position: static;
  transform: none;
  left: auto;
  justify-self: center;
  cursor: pointer;
  max-width: min(200px, 44vw);
  flex-shrink: 0;
}

.header-center .navo-logo-light,
.header-center .navo-logo-dark {
  width: auto;
  max-width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-self: end;
  min-width: 0;
}

/* Phones: compact header icons — tighter gaps so logo/center breathe on narrow widths */
@media (max-width: 767px) {
  .header {
    padding: 11px 8px;
    column-gap: 6px;
  }

  .header-right {
    gap: 0 2px;
    flex-wrap: nowrap;
  }

  .header-right .chat-icon,
  .header-right .notif-bell,
  .header-right .menu-btn {
    box-sizing: border-box;
    min-width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .header-right .chat-icon i {
    font-size: 17px;
  }

  .header-right .notif-bell {
    font-size: 15px;
  }

  .header-right .menu-btn {
    display: inline-flex;
    font-size: 18px;
  }

  /* Keep unread badges readable without widening the tap column */
  .header-right #chatCount {
    top: 1px;
    right: 1px;
    font-size: 9px;
    padding: 1px 5px;
  }

  .header-right .notif-bell span {
    top: -2px;
    right: -2px;
    font-size: 9px;
    padding: 1px 5px;
  }
}

#locationBtn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #f2f2f2;
  cursor: pointer;
}

#locationBtn i {
  font-size: 16px;
  line-height: 1;
  display: block;
}

.featured-section,
.sponsored-section,
.food-section {
  margin-top: 30px;
  background: var(--card);
  padding: 14px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
/* =========================================================
   4. MAP
========================================================= */

/*
 * Avoid filtering the entire #map wrapper — that composites oddly on mobile Safari when
 * the navigation sheet opens (soft tiles). Clip rounded corners on .map-container instead.
 * Dimming matches old brightness(0.88) via Leaflet panes (tiles, routes, markers).
 * Popups/tooltips stay unfiltered so they stay readable.
 */
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin-top: 0;
  border-radius: 0;
  box-shadow: none;
}

/*
 * Phones: Leaflet sets touch-action: none so the browser cannot scroll while a finger slides on #map.
 * While cooperative mode is inactive (classes managed in attachCooperativeMapTouch), prefer page scroll +
 * pinch-zoom; briefly add .leaflet-cooperative-drag-armed after hold-to-drag to restore full Leaflet gestures.
 */
@media (pointer: coarse) {
  #map.leaflet-container:not(.leaflet-cooperative-drag-armed) {
    touch-action: pan-x pan-y pinch-zoom !important;
  }

  #map.leaflet-container.leaflet-cooperative-drag-armed {
    touch-action: none !important;
  }
}

/* Same visual as former #map { filter: brightness(0.88) } — scoped to reduce mobile blur */
#map .leaflet-tile-pane,
#map .leaflet-overlay-pane,
#map .leaflet-shadow-pane,
#map .leaflet-marker-pane {
  filter: brightness(0.88);
}

.map-container:not(.fullscreen) {
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

.map-container {
  height: 400px;
  width: 100%;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.map-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.map-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2100;
  overflow: visible;
  border-radius: 0;
  box-shadow: none;
}

.map-container.fullscreen .map-stage {
  flex: 1 1 auto;
  min-height: 0;
}

.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-controls button {
  color: white;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  border: 1px solid #00000099;
  background: #00000099;
  backdrop-filter: blur(6px);
}

.map-controls button:hover {
  background: #000000d9;
}

/* ================= PICKUP STOP PIN ================= */

.pickup-stop-marker {
  background: transparent;
  border: none;
}

.pickup-pin {
  width: 14px;
  height: 14px;
  background: linear-gradient(180deg, #ff5a5a, #dc2626);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: relative;
  box-shadow:
    0 3px 8px rgba(220, 38, 38, 0.4),
    0 0 0 2px rgba(255, 255, 255, 0.9);
  animation: pickupPulse 2s infinite;
}
.pickup-inner {
  width: 5px;
  height: 5px;
  top: 4px;
  left: 4px;
  background: white;
  border-radius: 50%;
  position: absolute;
}

@keyframes pickupPulse {
  0% {
    transform: rotate(-45deg) scale(1);
  }

  50% {
    transform: rotate(-45deg) scale(1.08);
  }

  100% {
    transform: rotate(-45deg) scale(1);
  }
}

/* =========================================================
   5. USER LOCATION
========================================================= */
.user-location {
  background: transparent;
  border: none;
  position: relative;
}
.user-location .dot {
  width: 14px;
  height: 14px;
  background: #111827;
  border-radius: 50%;
  border: 3px solid white;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 0 10px rgba(17, 24, 39, 0.7);
  z-index: 2;
}

.user-location .pulse {
  width: 24px;
  height: 24px;
  background: rgba(17, 24, 39, 0.32);
  border-radius: 50%;
  position: absolute;
  top: -2px;
  left: -2px;
  transform-origin: center center;
  will-change: transform, opacity;
  animation: userPulse 1.5s ease-out infinite;
  z-index: 1;
}

.user-location .heading-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  /* Match pickup stop pins (#dc2626) — reads clearly over dark route polylines */
  border-bottom: 8px solid #dc2626;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.92));
  top: -2px;
  left: 6px;
  transform-origin: 10px 13px;
  transition:
    transform 0.35s ease,
    opacity 0.25s ease;
  z-index: 3;
}

@keyframes userPulse {
  0%,
  100% {
    transform: scale(0.62);
    opacity: 0.62;
  }

  45% {
    transform: scale(2);
    opacity: 0;
  }
}

/* =========================================================
    resetPage
========================================================= */
.input-error {
  border: 1px solid #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
  animation: shake 0.25s linear;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-3px);
  }

  75% {
    transform: translateX(3px);
  }
}

/* =========================================================
   6. DRIVER UI
========================================================= */
.live-route-glow {
  .live-route-glow {
    filter: drop-shadow(0 0 3px rgba(17, 24, 39, 0.18))
      drop-shadow(0 0 8px rgba(17, 24, 39, 0.12));
  }

  transition:
    opacity 0.35s ease,
    filter 0.35s ease;
}

.driver-live-marker,
.marshal-live-marker {
  background: transparent;
  border: none;
  position: relative;
}

/* DRIVER */
.driver-live-marker .pulse {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 50%;
  position: absolute;
  top: -3px;
  left: -3px;
  transform-origin: center center;
  will-change: transform, opacity;
  animation: livePulse 1.8s ease-out infinite;
}

.driver-live-marker .dot {
  width: 14px;
  height: 14px;
  background: #111;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  border: 2px solid #ffffff;
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.35),
    0 0 16px rgba(255, 255, 255, 0.12);
}

/* MARSHAL */
.marshal-live-marker .pulse {
  width: 24px;
  height: 24px;
  background: rgba(30, 58, 138, 0.35);
  border-radius: 50%;
  position: absolute;
  top: -3px;
  left: -3px;
  transform-origin: center center;
  will-change: transform, opacity;
  animation: livePulse 1.8s ease-out infinite;
}

.marshal-live-marker .dot {
  width: 14px;
  height: 14px;
  background: #1e3a8a;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  border: 2px solid #ffffff;
  box-shadow:
    0 0 10px rgba(30, 58, 138, 0.8),
    0 0 20px rgba(30, 58, 138, 0.45);
}

@keyframes livePulse {
  0%,
  100% {
    transform: scale(0.65);
    opacity: 0.5;
  }

  50% {
    transform: scale(2.15);
    opacity: 0;
  }
}

/* =========================================================
   7. MARSHAL UI
========================================================= */
.hidden {
  display: none !important;
}
#chatPanel {
  display: none;
}

#chatPanel.active {
  display: flex !important;
}
.tracking-status-card {
  margin-top: 18px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.04)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeSlideUp 0.25s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.tracking-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tracking-top strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #ffffff;
}

.tracking-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.tracking-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 rgba(34, 197, 94, 0.6);
  animation: trackingPulse 1.6s infinite;
}
#driverDistance {
  font-weight: 600;
  color: #22c55e;
}

@keyframes trackingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   8. CHAT
========================================================= */
#chatCount,
#notifCount {
  opacity: 0;
  transform: scale(0.8);

  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.badge-visible {
  opacity: 1;
  transform: scale(1);
}

.chat-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: #111;
  color: white;

  font-size: 18px;
  font-weight: bold;

  cursor: pointer;
  z-index: 999999;

  pointer-events: auto;
}

/* =========================================================
   NOTIFICATIONS
========================================================= */

/* =========================================================
   ROUTES PAGE
========================================================= */

.routes-page-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 18px 36px;
  box-sizing: border-box;
}

/* Scroll only inside Routes — document body stays fixed-height; avoids scrollbar / anchoring fights */
#routesPage.routes-page {
  --routes-page-top: var(--header-offset);
  --routes-page-pad-bottom: 70px;
  top: var(--routes-page-top);
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  padding-bottom: var(--routes-page-pad-bottom);
  box-sizing: border-box;
  overflow: hidden;
  flex-direction: column;
  min-height: 0;
}

.routes-page-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
  #routesPage.routes-page {
    --routes-page-top: var(--header-offset);
    --routes-page-pad-bottom: 80px;
  }
}

.routes-hero {
  text-align: left;
  margin-bottom: 8px;
  padding: 22px 20px 24px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(5, 150, 105, 0.07),
    rgba(37, 99, 235, 0.05)
  );
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 40px rgba(15, 23, 42, 0.06);
}

.routes-hero__kicker {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--success, #059669);
  opacity: 0.95;
}

.routes-hero__brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.routes-hero__headlines {
  flex: 1;
  min-width: 0;
}

.routes-hero-icon {
  width: 52px;
  height: 52px;
  margin: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(145deg, var(--success, #059669), #0d9488);
  border: none;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 22px rgba(5, 150, 105, 0.28);
}

.routes-title {
  font-size: clamp(1.35rem, 4.2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--text);
}

.routes-subtitle {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  font-weight: 400;
  margin: 0;
  max-width: 36rem;
  letter-spacing: 0.01em;
}

.routes-subtitle strong {
  color: var(--text);
  font-weight: 700;
}

.routes-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
  /* Prevent Chrome scroll-anchoring from “helpfully” jumping when card height changes */
  overflow-anchor: none;
}

/*
 * Flex items default to min-width: auto — on mobile Safari that can fight
 * intrinsic sizing and occasionally shrink descendants oddly (pill buttons
 * with border-radius: 999px then look like huge circles).
 */
.routes-grid > .route-card {
  min-width: 0;
  width: 100%;
}

/* ---------- Rank cards: native <details (polished, restrained) ---------- */

.route-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  background: var(--card);
  border-radius: 18px;
  padding: 17px 18px 17px 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 14px 36px rgba(15, 23, 42, 0.07);
  text-align: left;
  overflow-anchor: none;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.route-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(5, 150, 105, 0.85),
    rgba(37, 99, 235, 0.35)
  );
  opacity: 0.45;
  pointer-events: none;
}

.route-card:has(details[open]) {
  border-color: rgba(5, 150, 105, 0.25);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 16px 42px rgba(5, 150, 105, 0.12);
}

.route-card:has(details[open])::before {
  opacity: 1;
}

.route-card__disclosure {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
}

.route-card__summary {
  display: block;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.route-card__summary::-webkit-details-marker {
  display: none;
}

.route-card__summary:focus {
  outline: none;
}

.route-card__summary:focus-visible {
  outline: 2px solid rgba(5, 150, 105, 0.5);
  outline-offset: 2px;
  border-radius: 10px;
}

.route-summary-toggle {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  flex-shrink: 0;
  border: 1px solid rgba(5, 150, 105, 0.2);
  background: linear-gradient(
    180deg,
    rgba(5, 150, 105, 0.08),
    rgba(5, 150, 105, 0.03)
  );
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #065f46;
  line-height: 1.25;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.route-summary-toggle:active {
  background: rgba(5, 150, 105, 0.12);
}

details.route-card__disclosure[open] .route-summary-toggle {
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.35);
  color: #064e3b;
}

.route-summary-toggle__shut {
  display: none;
}

details.route-card__disclosure[open] .route-summary-toggle__open {
  display: none;
}

details.route-card__disclosure[open] .route-summary-toggle__shut {
  display: inline;
}

.route-summary-chevron {
  font-size: 10px;
  opacity: 0.55;
  color: #64748b;
  transition: transform 0.2s ease;
}

details.route-card__disclosure[open] .route-summary-chevron {
  transform: rotate(180deg);
  color: var(--success, #059669);
  opacity: 0.9;
}

.route-details-body {
  margin: 0;
  padding: 0;
}

details.route-card__disclosure[open] .route-details-body {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.route-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding-bottom: 0;
}

.route-card__lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.route-card__pin {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 17px;
  color: var(--success, #059669);
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.18);
}

.route-rank {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.route-distance {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(5, 150, 105, 0.12),
    rgba(5, 150, 105, 0.05)
  );
  border: 1px solid rgba(5, 150, 105, 0.22);
}

.route-distance__ico {
  font-size: 14px;
  color: var(--success, #059669);
  opacity: 0.92;
}

.route-extra__label {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
}

.route-extra__empty {
  margin: 0;
  text-align: left;
  color: #64748b;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.route-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: flex-start;
}

.route-pill {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  background: rgba(5, 150, 105, 0.06);
  color: #0f172a;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid rgba(5, 150, 105, 0.18);
}

.routes-state {
  text-align: center;
  padding: 36px 24px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 18px 48px rgba(15, 23, 42, 0.08);
}

.routes-state__icon-wrap {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.18);
}

.routes-state__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}

.routes-state__hint {
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  color: var(--muted) !important;
}

.routes-state__ico {
  font-size: 24px;
  margin-bottom: 0;
  opacity: 0.9;
}

.routes-state--loading .routes-state__ico {
  margin-bottom: 0;
}

.routes-state--loading .routes-state__ring {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid rgba(5, 150, 105, 0.22);
  border-top-color: var(--success, #059669);
  animation: routesSpin 0.85s linear infinite;
  display: block;
}

.routes-state--warning .routes-state__icon-wrap {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.22);
}

.routes-state--warning .routes-state__ico {
  color: #d97706;
}

.routes-state--empty .routes-state__icon-wrap {
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.2);
}

.routes-state--empty .routes-state__ico {
  color: #64748b;
}

@keyframes routesSpin {
  to {
    transform: rotate(360deg);
  }
}

.reduce-motion .route-summary-chevron {
  transition: none;
}

.reduce-motion .route-card {
  transition: none;
}

.reduce-motion .routes-state--loading .routes-state__ring {
  animation: none;
  border-top-color: rgba(5, 150, 105, 0.55);
}

@media (max-width: 420px) {
  .routes-hero {
    padding: 18px 16px 20px;
  }

  .routes-hero__brand {
    flex-direction: column;
    align-items: stretch;
  }

  .routes-hero-icon {
    align-self: flex-start;
  }

  .route-header {
    flex-wrap: wrap;
  }

  .route-distance {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .route-card {
    padding: 15px 14px 15px 18px;
  }

  .route-rank {
    font-size: 15px;
  }

  .route-pill {
    font-size: 11px;
    padding: 6px 10px;
  }
}

/* ---------- Routes · dark mode ---------- */

.dark-mode .routes-hero {
  background: linear-gradient(
    135deg,
    rgba(5, 150, 105, 0.14),
    rgba(37, 99, 235, 0.1)
  );
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 16px 48px rgba(0, 0, 0, 0.42);
}

.dark-mode .routes-hero__kicker {
  color: #34d399;
}

.dark-mode .routes-hero-icon {
  color: #fff;
  background: linear-gradient(145deg, #059669, #0d9488);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.12) inset,
    0 10px 28px rgba(5, 150, 105, 0.4);
}

.dark-mode .routes-subtitle {
  color: var(--muted);
}

.dark-mode .routes-title {
  color: var(--text);
}

.dark-mode .routes-state {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.dark-mode .routes-state__icon-wrap {
  background: rgba(5, 150, 105, 0.14);
  border-color: rgba(52, 211, 153, 0.24);
}

.dark-mode .routes-state--warning .routes-state__icon-wrap {
  background: rgba(217, 119, 6, 0.16);
  border-color: rgba(251, 191, 36, 0.28);
}

.dark-mode .routes-state--empty .routes-state__icon-wrap {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.22);
}

.dark-mode .routes-state--warning .routes-state__ico {
  color: #fbbf24;
}

.dark-mode .routes-state--empty .routes-state__ico {
  color: var(--muted);
}

.dark-mode .route-card {
  background: rgba(22, 27, 38, 0.95);
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.dark-mode .route-card:has(details[open]) {
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 14px 42px rgba(5, 150, 105, 0.22);
}

.dark-mode .route-card__pin {
  color: #34d399;
  background: rgba(5, 150, 105, 0.15);
  border-color: rgba(52, 211, 153, 0.28);
}

.dark-mode .route-rank {
  color: var(--text);
}

.dark-mode .route-distance {
  color: var(--text);
  background: linear-gradient(
    180deg,
    rgba(5, 150, 105, 0.22),
    rgba(5, 150, 105, 0.08)
  );
  border-color: rgba(52, 211, 153, 0.32);
}

.dark-mode .route-distance__ico {
  color: #34d399;
}

.dark-mode .route-summary-toggle {
  background: linear-gradient(
    180deg,
    rgba(5, 150, 105, 0.16),
    rgba(5, 150, 105, 0.06)
  );
  border-color: rgba(52, 211, 153, 0.28);
  color: #a7f3d0;
}

.dark-mode .route-summary-toggle:active {
  background: rgba(5, 150, 105, 0.22);
}

.dark-mode details.route-card__disclosure[open] .route-summary-toggle {
  background: rgba(5, 150, 105, 0.22);
  border-color: rgba(52, 211, 153, 0.42);
  color: #d1fae5;
}

.dark-mode details.route-card__disclosure[open] .route-details-body {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .route-summary-chevron {
  color: #94a3b8;
}

.dark-mode details.route-card__disclosure[open] .route-summary-chevron {
  color: #34d399;
}

.dark-mode .route-extra__label {
  color: #94a3b8;
}

.dark-mode .route-extra__empty {
  color: var(--muted);
}

.dark-mode .route-pill {
  background: rgba(5, 150, 105, 0.12);
  color: #e2e8f0;
  border-color: rgba(52, 211, 153, 0.28);
}

/* =========================================================
   11. SETTINGS
========================================================= */

/* =========================================================
   12. DARK MODE
========================================================= */

/* =========================================================
   13. MEDIA QUERIES
========================================================= */

.section-divider {
  width: 85%;
  height: 1px;

  background: linear-gradient(
    to right,
    transparent,
    var(--border),
    transparent
  );

  margin: 16px auto 12px;
}

/* =========================================================
  14 HOME BUSINESS REDESIGN
========================================================= */

.featured-section,
.sponsored-section,
.food-section {
  margin-top: 10px;
}

/* ================= HEADERS ================= */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
  padding: 0 4px;
}

.section-header h3 {
  margin: 0;
  font-size: clamp(20px, 5vw, 24px);
  line-height: 1.1;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.4px;

  flex: 1;
  min-width: 0;

  word-break: break-word;
}

.section-header span {
  font-size: clamp(10px, 3vw, 12px);
  color: #6b7280;
  font-weight: 600;

  text-align: right;
  line-height: 1.2;

  max-width: 90px;
  flex-shrink: 0;
}

/* ================= SCROLL LAYOUT ================= */

.featured-scroll,
.sponsored-scroll,
.food-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 10px;
}

.featured-scroll::-webkit-scrollbar,
.sponsored-scroll::-webkit-scrollbar,
.food-scroll::-webkit-scrollbar {
  display: none;
}

/* ================= DESKTOP HORIZONTAL SCROLL ================= */

@media (min-width: 768px) {
  .featured-scroll,
  .sponsored-scroll,
  .food-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
    cursor: grab;
  }

  .featured-scroll::-webkit-scrollbar,
  .sponsored-scroll::-webkit-scrollbar,
  .food-scroll::-webkit-scrollbar {
    display: block;
    height: 8px;
  }

  .featured-scroll::-webkit-scrollbar-thumb,
  .sponsored-scroll::-webkit-scrollbar-thumb,
  .food-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 999px;
  }

  .featured-scroll:active,
  .sponsored-scroll:active,
  .food-scroll:active {
    cursor: grabbing;
  }
}

/* ===================FEATURED MODERN CARD==================== */

.featured-card-modern {
  position: relative;
  flex: 0 0 240px;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.08),
    0 4px 10px rgba(0, 0, 0, 0.04);
  transition: 0.25s ease;
  border: 1px solid rgba(0, 0, 0, 0.07);
}

.featured-card-modern:hover {
  transform: translateY(-4px);
}

/* Fast-food placeholders (no promo photos — icon + tint only) */

.featured-thumb {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px 20px 0 0;
  font-size: 52px;
  color: rgba(255, 255, 255, 0.95);
}

.featured-thumb i {
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.2));
}

.featured-thumb--mcd {
  background: linear-gradient(145deg, #fbbf24 0%, #eab308 40%, #d97706 100%);
}

.featured-thumb--kfc {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 55%, #1c1917 100%);
}

.featured-thumb--nandos {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 45%, #9a3412 100%);
}

.featured-thumb--steers {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #b45309 100%);
}

.featured-thumb--debonairs {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 42%, #4c1d95 100%);
}

.featured-thumb--wimpy {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 45%, #b45309 100%);
}

.featured-thumb--bk {
  background: linear-gradient(135deg, #f97316 0%, #dc2626 40%, #1d4ed8 100%);
}

.featured-thumb--hungrylion {
  background: linear-gradient(145deg, #facc15 0%, #f59e0b 52%, #b45309 100%);
  color: #1f2937;
}

.featured-thumb--hungrylion i {
  filter: drop-shadow(0 1px 6px rgba(255, 255, 255, 0.35));
}

/* CONTENT AREA */

.featured-overlay {
  position: relative;
  background: #ffffff;
  padding: 14px;
}

/* BADGE */

.featured-badge {
  position: absolute;
  top: 10px;
  left: 10px;

  background: #22c55e;
  color: white;

  padding: 5px 10px;
  border-radius: 999px;

  font-size: 10px;
  font-weight: 700;

  z-index: 2;
}

/* TEXT */

.featured-title {
  color: #111827;
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}

.featured-meta {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 12px;
}

/* BUTTONS */

.featured-actions {
  display: flex;
  gap: 8px;
}

.featured-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.featured-btn.primary {
  background: #22c55e;
  color: white;
}

.featured-btn.secondary {
  background: #f3f4f6;
  color: #111827;
}

/* DARK MODE */

.dark-mode .featured-card-modern {
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dark-mode .featured-overlay {
  background: #1f2937;
}

.dark-mode .featured-title {
  color: white;
}

.dark-mode .featured-meta {
  color: #9ca3af;
}

.dark-mode .featured-btn.secondary {
  background: #374151;
  color: white;
}

/* =========================================================
   SPONSORED ROUTE
========================================================= */

.sponsored-route-card {
  position: relative;
  flex: 0 0 320px;
  border-radius: 28px;
  padding: 24px;
  overflow: hidden;
  scroll-snap-align: start;
  isolation: isolate;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.sponsored-route-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.24);
}

.sponsored-route-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  top: -80px;
  right: -50px;
  z-index: 0;
  pointer-events: none;
}

.sponsored-route-card > * {
  position: relative;
  z-index: 1;
}

.route-sponsored-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f97316;
  color: white;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 18px;
}

.route-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.2;
}

.route-sub {
  font-size: 14px;
  opacity: 0.82;
  margin-bottom: 18px;
  line-height: 1.5;
}

.route-offer {
  font-size: 14px;
  color: #4ade80;
  font-weight: 700;
  margin-bottom: 20px;
}

.route-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: white;
  color: #111827;
  font-weight: 700;
  cursor: pointer;
}

/* =========================================================
   FOOD MINI CARDS
========================================================= */

.food-mini-card {
  flex: 0 0 145px;
  background: white;
  border-radius: 18px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgba(0, 0, 0, 0.06);

  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.04);

  transition: 0.25s ease;
}

.food-mini-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.14);
}

/* Placeholder strip (real photo when `advertiserImage` is set on the spot) */
.food-thumb {
  width: 100%;
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px 18px 0 0;
  font-size: 30px;
  color: rgba(255, 255, 255, 0.95);
}

.food-thumb i {
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.18));
}

.food-thumb--golden {
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 50%, #b45309 100%);
}

.food-thumb--brew {
  background: linear-gradient(135deg, #78350f 0%, #92400e 45%, #451a03 100%);
}

.food-thumb--kota {
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 48%, #9a3412 100%);
}

.food-thumb--grill {
  background: linear-gradient(135deg, #57534e 0%, #44403c 40%, #1c1917 100%);
}

.food-thumb--spice {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 45%, #14532d 100%);
}

.food-thumb--patty {
  background: linear-gradient(135deg, #a16207 0%, #854d0e 50%, #713f12 100%);
}

.food-thumb--poultry {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 50%, #7f1d1d 100%);
}

.food-thumb--sweet {
  background: linear-gradient(135deg, #fda4af 0%, #f472b6 45%, #be185d 100%);
  color: #431407;
}

.food-thumb--sweet i {
  filter: drop-shadow(0 1px 4px rgba(255, 255, 255, 0.4));
}

.food-mini-card__photo {
  width: 100%;
  height: 95px;
  object-fit: cover;
  display: block;
  border-radius: 18px 18px 0 0;
}

.food-mini-body {
  padding: 10px;
  text-align: left;
}

.food-mini-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 5px;
  color: #111827;
}

.food-mini-distance {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

/* =========================================================
   DARK MODE
========================================================= */

.dark-mode .section-header h3 {
  color: white;
}

.dark-mode .section-header span {
  color: #9ca3af;
}

.dark-mode .food-mini-card {
  background: #1f2937;
}

.dark-mode .food-mini-title {
  color: white;
}

.dark-mode .food-mini-distance {
  color: #9ca3af;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 480px) {
  .section-header {
    align-items: flex-start;
    gap: 10px;
  }

  .section-header span {
    max-width: 75px;
  }
  .featured-card-modern {
    flex: 0 0 180px;
    border-radius: 18px;
  }

  .featured-thumb {
    height: 130px;
    font-size: 44px;
  }

  .featured-overlay {
    padding: 10px;
  }

  .featured-title {
    font-size: 14px;
  }

  .featured-meta {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .featured-btn {
    padding: 6px 10px;
    font-size: 10px;
  }
}

/* =========================================================
   TOAST
========================================================= */

.toast {
  position: fixed;

  left: 50%;
  bottom: 95px;

  transform: translateX(-50%) translateY(20px);

  min-width: 220px;
  max-width: 90%;

  padding: 14px 18px;

  border-radius: 18px;

  background: rgba(17, 24, 39, 0.92);

  color: #ffffff;

  font-size: 14px;
  font-weight: 600;
  text-align: center;

  backdrop-filter: blur(14px);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.12);

  opacity: 0;
  visibility: hidden;

  z-index: 99999;

  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0.28s;
}

.toast.show {
  opacity: 1;
  visibility: visible;

  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

.toast.error {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.toast.warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);

  color: #111827;
}

.toast.info {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.dark-mode .toast {
  background: rgba(30, 41, 59, 0.94);

  color: #f8fafc;

  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ================= CONTAINER ================= */
.container {
  padding: 20px 16px 5px;
  text-align: center;
}

h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 14px;
}

h3 {
  margin-bottom: 10px;
}

/* ---------- Home · search hero ---------- */

.home-search-title {
  margin: 0 auto 18px;
  max-width: 520px;
  padding: 0 12px;
  font-size: clamp(1.35rem, 4vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #0f172a;
  outline: none;
}

.dark-mode .home-search-title {
  color: var(--text);
}

/* ================= INPUT ================= */
.search-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px;
}

.search-box input {
  width: 100%;
  padding: 15px 58px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  outline: none;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  box-sizing: border-box;
  background: var(--card);
  color: var(--text);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.search-box input::placeholder {
  font-size: 13px;
  font-weight: 400;
  color: #94a3b8;
  opacity: 1;
}

.search-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

.mic-icon {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  z-index: 2;
  transition: color 0.15s ease;
}

.mic-icon:hover {
  color: #2563eb;
}

.mic-icon:active {
  transform: translateY(-50%) scale(0.94);
}

.search-box input:focus {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.14),
    0 1px 3px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.dark-mode .search-box input::placeholder {
  color: rgba(148, 163, 184, 0.75);
}

.dark-mode .search-box input {
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark-mode .search-box input:focus {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark-mode .mic-icon:hover {
  color: #93c5fd;
}
/* ================= SUGGESTIONS ================= */
#suggestions {
  width: 90%;
  margin: 10px auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  transition: 0.2s;
}

/* ================= BUTTONS ================= */
/*
 * Mobile: `.home-top-grid__lead` uses `display: contents` + flex `order` → map then Share/How below.
 * Desktop: CTAs are nested in `.home-top-grid__lead` under Get a Taxi (desktop-layout.css).
 */
.home-secondary-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 14px auto 0;
  box-sizing: border-box;
}

.home-secondary-actions > div {
  width: 90%;
  flex: 0 0 auto;
  min-width: 0;
}

.home-secondary-actions .share-btn,
.home-secondary-actions .how-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 115px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.35;
}

.find-btn {
  width: 90%;
  padding: 10px 14px;
  border-radius: 115px;
  margin-top: 14px;
  border: none;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, var(--success), #3ecf5e);
  color: #ffffff;
  margin-bottom: 0;
}

.share-btn {
  display: block;
  min-height: 0;
  margin-top: 0;
  border: none;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.35;
  color: #ffffff;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.12s ease;
  background: linear-gradient(135deg, #c96410 0%, #e08424 52%, #d67d28 100%);
}

.share-btn:active {
  transform: scale(0.98);
}

.auth-btn,
.how-btn {
  border: none;
  background: linear-gradient(135deg, var(--auth-main), var(--auth-accent));
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.4px;
  transition: all 0.25s ease;
}

.auth-btn:hover,
.how-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px var(--auth-soft);
}

.auth-btn:active,
.how-btn:active {
  transform: translateY(0);
}

/*
 * Home extras row: shares the Coming Soon modal “OK” button surface (.auth-btn).
 */
.how-btn {
  display: block;
  min-height: 0;
  margin-top: 0;
  box-sizing: border-box;
  cursor: pointer;
  line-height: 1.35;
}

/* ================= selector ================= */
.area-selector {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  margin: 0;
  background: rgba(248, 250, 252, 0.96);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  z-index: 3;
}

.dark-mode .area-selector {
  background: rgba(21, 25, 34, 0.72);
  border-bottom-color: rgba(148, 163, 184, 0.14);
}

.area-selector select {
  flex: 1;
  min-width: 120px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.area-selector select:focus {
  border-color: #999;
  background: #fafafa;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.05),
    0 0 0 2px rgba(51, 154, 240, 0.22);
}

@media (max-width: 420px) {
  .area-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .area-selector select,
  #customAreaInput {
    width: 100%;
    min-width: 0;
  }
}

/* ================= ADMIN AREA SEARCH ================= */

#customAreaInput {
  flex: 1;
  min-width: 120px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: #0f172a;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

#customAreaInput::placeholder {
  color: rgba(15, 23, 42, 0.45);
}

#customAreaInput:focus {
  border-color: #999;
  background: #fafafa;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.05),
    0 0 0 2px rgba(51, 154, 240, 0.22);
}

/* ================= SEARCH AUTOFILL DROPDOWN ================= */

#customAreaInput:-webkit-autofill,
#customAreaInput:-webkit-autofill:hover,
#customAreaInput:-webkit-autofill:focus,
#customAreaInput:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #f5f5f5 inset !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 1px solid #ccc !important;
  transition: background-color 9999s ease-in-out 0s;
}

.dark-mode #customAreaInput:-webkit-autofill,
.dark-mode #customAreaInput:-webkit-autofill:hover,
.dark-mode #customAreaInput:-webkit-autofill:focus,
.dark-mode #customAreaInput:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px rgba(21, 25, 34, 0.96) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

/* ================= AUTOCOMPLETE POPUP ================= */
input:-webkit-autofill {
  filter: none;
}

/* ================= MOBILE AREA CONTROLS ================= */
@media (max-width: 768px) {
  .area-selector select,
  #customAreaInput {
    min-height: 36px;
  }
}

/* ================= route popup soft + transparent ================= */
.leaflet-popup-content-wrapper {
  background: rgba(176, 88, 88, 0.418);
  backdrop-filter: blur(6px);
  border-radius: 12px;
}

.leaflet-popup-content {
  font-size: 13px;
  color: #333333f5;
}

.leaflet-popup-tip {
  background: #ffffffbf;
}

.leaflet-popup-content-wrapper {
  padding: 4px 8px;
}

/* Invisible anchors for navigation walk bubbles (no stacked blue Leaflet pin) */
.leaflet-div-icon.nav-walk-anchor {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.nav-walk-anchor__inner {
  display: block;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Walking time — match pickup-stop red pin (compact) */
.leaflet-container .leaflet-popup.nav-walk-popup .leaflet-popup-content-wrapper {
  background: linear-gradient(180deg, #ff5a5a, #dc2626);
  box-shadow:
    0 3px 12px rgba(220, 38, 38, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.88);
  backdrop-filter: none;
  border: none;
  border-radius: 9px;
  /* Close control + compact label */
  padding: 6px 28px 7px 10px;
}

/* Smaller tail so it doesn’t sit on top of the stop pin */
.leaflet-container .leaflet-popup.nav-walk-popup .leaflet-popup-tip {
  width: 7px !important;
  height: 7px !important;
  padding: 0 !important;
  margin: -3px auto 0 !important;
  background: #dc2626;
  box-shadow: none !important;
}

.leaflet-container .leaflet-popup.nav-walk-popup .leaflet-popup-content {
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.33;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.leaflet-container .leaflet-popup.nav-walk-popup a.leaflet-popup-close-button {
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.leaflet-container .leaflet-popup.nav-walk-popup a.leaflet-popup-close-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.suggestion-item:hover {
  background: #f1f3f5;
}

#suggestions {
  transition: opacity 0.2s ease;
}

.leaflet-control-attribution {
  display: none !important;
}

/* ================= MAP TILE FIX ================= */

.leaflet-container {
  background: #dfe7ef;
}

.leaflet-tile {
  image-rendering: auto;
}

/* ============= SPONSORED ============== */
.center-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ================= ROUTE CHIP ================= */
.route-chip {
  margin: 12px auto;
  width: 90%;
  background: #e3f2fd;
  color: #1565c0;
  padding: 10px;
  border-radius: 20px;
  font-size: 14px;
}

/* ================= CARDS ================= */
.card {
  background: var(--card);
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  text-align: left;
}

.card h4 {
  margin-bottom: 6px;
}

.card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.role-select {
  margin: 0;
  text-align: left;
}

.role-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--muted);
}

.role-options {
  display: flex;
  gap: 8px;
}

.role-dropdown {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.98);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.role-dropdown:focus {
  background-color: #fff;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.12),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

/* ================= AUTH (login / signup / reset) ================= */
.auth-page {
  box-sizing: border-box;
  min-height: calc(100dvh - 60px);
  padding: 14px 14px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

@media (min-width: 480px) {
  .auth-page {
    padding-top: 20px;
    justify-content: center;
  }
}

.auth-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 18px 16px 16px;
  background: var(--card);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 22px 48px -18px rgba(15, 23, 42, 0.16),
    0 8px 20px rgba(15, 23, 42, 0.05);
  text-align: center;
  animation: fadeIn 0.45s ease;
}

.auth-title {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 4.5vw, 1.625rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text);
}

.auth-sub {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.48;
  color: var(--muted);
}

#resetPage .auth-sub--12 {
  font-size: 12px;
  line-height: 1.42;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.auth-form > .password-strength {
  margin-top: -6px;
  margin-bottom: 0;
}

.input-group {
  position: relative;
  margin-bottom: 0;
}

.input-group--peek .auth-input {
  padding-right: 42px;
}

.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.98);
  font-size: 14px;
  color: var(--text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.auth-input:hover {
  border-color: rgba(15, 23, 42, 0.14);
}

.auth-input:focus {
  background: #fff;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.14),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 5px;
  margin: -5px -3px -5px 0;
  border-radius: 8px;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.input-icon:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.auth-btn {
  width: 100%;
  margin-top: 2px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  font-size: 13px;
  line-height: 1.35;
}

.auth-links span {
  color: var(--secondary);
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
}

.auth-links span:hover {
  opacity: 0.92;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.password-strength {
  font-size: 12px;
  text-align: left;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 2px;
}

.password-weak {
  color: var(--danger);
}

.password-medium {
  color: #f59f00;
}

.password-strong {
  color: var(--success);
}

.auth-switch {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.auth-switch span {
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
}

.auth-switch span:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-legal-consent {
  text-align: left;
  margin: 2px 0 2px;
  padding: 11px 12px 10px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.04);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.auth-legal-consent__check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.47;
  color: var(--text);
  text-align: left;
}

.auth-legal-consent__copy {
  flex: 1;
}

.auth-legal-consent__check input[type="checkbox"] {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--secondary);
  cursor: pointer;
}

.auth-legal-consent__links {
  margin: 12px 0 0;
  padding: 0 0 0 27px;
  font-size: 12px;
  line-height: 1.55;
}

.auth-legal-consent__sep {
  opacity: 0.45;
  margin: 0 0.3em;
}

.auth-text-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: underline;
  cursor: pointer;
  text-underline-offset: 2px;
}

.auth-text-link:hover {
  opacity: 0.9;
}

.legal-page .legal-prose .how-block__intro,
.legal-page .legal-paragraph {
  text-align: left;
}

.legal-list,
.legal-bullet-list {
  text-align: left;
  padding-left: 1.25rem;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #223;
}

.legal-list li + li,
.legal-bullet-list li + li {
  margin-top: 8px;
}

.legal-page__actions {
  margin-top: 6px;
}

.activation-card {
  margin: 25px 15px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.activation-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.activation-text {
  font-size: 14px;
  color: #555;
  margin-bottom: 15px;
}

.activation-price {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #000;
}

.activation-btn {
  padding: 6px 8px;
  background: var(--success);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.activation-btn:hover {
  background: #0a8f32;
}

.menu-section {
  margin: 12px 10px 6px;
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark-mode .menu-section {
  color: rgba(167, 243, 208, 0.88);
  font-weight: 700;
}

.menu-btn {
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.side-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 270px;
  height: 100%;
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--card), var(--bg));
  box-shadow: -6px 0 25px rgba(0, 0, 0, 0.15);
  transition: all 0.35s ease;
  /* Above `.bottom-nav` (9999) when open */
  z-index: 10100;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 0 0 20px;
}

.side-menu.active {
  right: 0;
}

.menu-overlay.active {
  display: block;
}

.menu-section:not(:first-of-type) {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* ================= SETTINGS ================= */
.settings-page {
  background: var(--bg);
  min-height: calc(100vh - var(--header-offset) - 12px);
}

.settings-inner {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 16px 96px;
}

.settings-hero {
  text-align: left;
  margin-bottom: 20px;
}

.settings-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings-heading {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.settings-lede {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.settings-panel {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.07);
  padding: 6px 0 12px;
  margin-bottom: 16px;
}

.settings-panel-body {
  padding: 0 16px 4px;
}

.settings-panel-body .billing_intro {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.dark-mode .settings-panel-body .billing_intro {
  color: #e5e7eb;
}

.settings-panel-body .billing_subnote {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.settings-panel-body .billing_caption {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #556070;
}

.dark-mode .settings-panel-body .billing_caption {
  color: #94a3b8;
}

.settings-panel-body .billing_caption_spaced {
  margin-top: 18px;
}

.settings-panel-body .billing_value {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.settings-panel-body .billing_value_last {
  margin-bottom: 4px;
}

/* Billing tiles: stacks and variants scoped so Styles elsewhere cannot collide. */

.settings-panel-body .billing_stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.settings-panel-body .billing_plan_stack {
  margin-top: 0;
}

.settings-panel-body .billing_pay_stack {
  margin-top: 0;
}

/* Shared button shell only; sizing and accents live per modifier. */

.settings-panel-body .billing_pick {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  margin: 0;
  flex: 0 0 auto;
  min-height: 0;
  box-sizing: border-box;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.settings-panel-body .billing_pick:hover {
  border-color: rgba(99, 102, 241, 0.55);
}

.settings-panel-body .billing_pick:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.55);
  outline-offset: 2px;
}

.settings-panel-body .billing_pick_active {
  border-color: rgba(99, 102, 241, 0.9);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.dark-mode .settings-panel-body .billing_pick_active {
  background: rgba(129, 140, 248, 0.15);
}

.settings-panel-body .billing_pick_secondary {
  opacity: 0.94;
}

.settings-panel-body .billing_pick_title {
  font-size: 14px;
  font-weight: 700;
}

.settings-panel-body .billing_pick_meta {
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

/* --- Plan renewal row (weekly / monthly / clear) --- */

.settings-panel-body .billing_pick--plan-weekly {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: var(--bg);
}

.settings-panel-body .billing_pick--plan-monthly {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 233, 0.25);
  background: linear-gradient(
    to bottom right,
    rgba(14, 165, 233, 0.04),
    var(--bg)
  );
}

.settings-panel-body .billing_pick--plan-clear {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(100, 116, 139, 0.55);
  background: rgba(148, 163, 184, 0.07);
}

.settings-panel-body .billing_pick_meta--plan-weekly {
  max-width: 32em;
}

.settings-panel-body .billing_pick_meta--plan-monthly {
  max-width: 32em;
}

.settings-panel-body .billing_pick_meta--plan-clear {
  max-width: 36em;
  line-height: 1.4;
}

/* --- Payment path row (card / EFT / later) --- */

.settings-panel-body .billing_pick--pay-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.04);
}

.settings-panel-body .billing_pick--pay-eft {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
}

.settings-panel-body .billing_pick--pay-later {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.45);
  background: rgba(148, 163, 184, 0.08);
}

.settings-panel-body .billing_pick_meta--pay-card {
  max-width: 34em;
}

.settings-panel-body .billing_pick_meta--pay-eft {
  max-width: 34em;
}

.settings-panel-body .billing_pick_meta--pay-later {
  max-width: 34em;
  line-height: 1.4;
}

.dark-mode .settings-panel-body .billing_pick--plan-clear,
.dark-mode .settings-panel-body .billing_pick--pay-later {
  background: rgba(30, 41, 59, 0.45);
}

.dark-mode .settings-panel-body .billing_pick--plan-weekly,
.dark-mode .settings-panel-body .billing_pick--plan-monthly,
.dark-mode .settings-panel-body .billing_pick--pay-card,
.dark-mode .settings-panel-body .billing_pick--pay-eft {
  border-color: rgba(148, 163, 184, 0.32);
}

.dark-mode .settings-panel-body .billing_pick:hover {
  border-color: rgba(129, 140, 248, 0.55);
}

.settings-panel-title {
  margin: 0;
  padding: 14px 16px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #556070;
}

.dark-mode .settings-panel-title {
  color: #94a3b8;
}

.profile-panel {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.profile-avatar-wrap {
  position: relative;
}

.settings-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(51, 65, 85, 0.35);
  background: var(--bg);
}

/* After a real photo loads, drop the grey ring so the avatar reads clean */
.profile-section .profile-avatar-img.profile-avatar-img--shown,
.settings-avatar.profile-avatar-img--shown {
  border: none;
  box-sizing: border-box;
}

.profile-panel-copy {
  width: 100%;
}

.profile-panel .profile-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.profile-panel .profile-sub {
  margin-top: 4px;
}

.profile-actions {
  margin-top: 12px;
}

.settings-upload-btn {
  margin-top: 0;
}

.profile-panel .file-name {
  margin-top: 6px;
  line-height: 1.25;
}

.profile-panel .file-name--placeholder {
  font-size: 10px;
  color: var(--muted);
}

.profile-panel .file-name:not(.file-name--placeholder) {
  font-size: 11px;
  color: var(--muted);
}

.settings-rows {
  padding: 0 8px 8px;
}

/* Guest-only CTA: author `display:flex` on .settings-row can trump [hidden]; drive visibility explicitly. */
#settingsGuestAuthRow {
  display: none !important;
}

#settingsGuestAuthRow.settings-guest-auth-row--shown {
  display: flex !important;
  align-items: center;
}

.settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 8px;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
  border-radius: 12px;
}

.settings-row--static {
  cursor: default;
}

.settings-row--divider {
  border-top: 1px solid var(--border);
  border-radius: 0;
}

.settings-row--action {
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.settings-row--action:hover {
  background: rgba(51, 65, 85, 0.06);
}

.settings-row--action:active {
  transform: scale(0.992);
}

.settings-row-body--stretch {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Account email: keep address on one line — shrink type as row narrows (see @container below). */
#settingsEmailRow.settings-row {
  container-type: inline-size;
  container-name: settings-email-row;
}

#settingsEmailRow.settings-row .settings-row-body {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 46%;
}

#settingsEmailRow.settings-row .settings-row-value.settings-row-value--email {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  word-break: normal;
}

.settings-row-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
  color: var(--primary-light);
  background: rgba(51, 65, 85, 0.08);
  border: 1px solid rgba(51, 65, 85, 0.06);
  align-self: center;
}

.settings-row-icon--moon {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
}

.settings-row-icon--motion {
  color: #0d9488;
  background: rgba(13, 148, 136, 0.12);
}

.settings-row-icon--mic {
  color: #ea580c;
  background: rgba(234, 88, 12, 0.12);
}

.settings-row-icon--clear {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
}

.settings-row-icon--help {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
}

.settings-row-icon--legal {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.1);
}

.settings-row-icon--report {
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.9);
  border-color: rgba(220, 38, 38, 0.12);
}

.dark-mode .settings-row-icon {
  border-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .settings-row-icon--report {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}

.settings-row-icon--auth {
  color: #0369a1;
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.2);
}

.dark-mode .settings-row-icon--auth {
  color: #7dd3fc;
  background: rgba(125, 211, 252, 0.1);
  border-color: rgba(125, 211, 252, 0.15);
}

.settings-row-icon--email {
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.14);
}

.dark-mode .settings-row-icon--email {
  color: #a5b4fc;
  background: rgba(129, 140, 248, 0.12);
}

.settings-panel-about .settings-about-copy {
  margin: 0 16px 14px;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #556070;
}

.settings-about-version-line {
  margin: 0 16px 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-about-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.settings-about-version {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.settings-row-value--email {
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@container settings-email-row (max-width: 340px) {
  .settings-row-value--email {
    font-size: 11px;
  }
}

@container settings-email-row (max-width: 280px) {
  .settings-row-value--email {
    font-size: 10px;
  }
}

@container settings-email-row (max-width: 220px) {
  .settings-row-value--email {
    font-size: 9px;
    letter-spacing: -0.015em;
  }
}

/* Fallback when container queries are unavailable */
@media (max-width: 420px) {
  #settingsPage .settings-row-value--email {
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  #settingsPage .settings-row-value--email {
    font-size: 10px;
  }
}

@media (max-width: 300px) {
  #settingsPage .settings-row-value--email {
    font-size: 9px;
    letter-spacing: -0.015em;
  }
}

.dark-mode .settings-panel-about .settings-about-copy {
  color: #a8b3c4;
}

.dark-mode .settings-about-label {
  color: #94a3b8;
}

.dark-mode .settings-about-version {
  color: #f1f5f9;
}

.settings-moderation-intro {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #4b5563;
}

.dark-mode .settings-moderation-intro {
  color: #a8b3c4;
}

.settings-moderation-intro code {
  font-size: 12px;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: rgba(51, 65, 85, 0.08);
  border: 1px solid rgba(51, 65, 85, 0.08);
}

.dark-mode .settings-moderation-intro code {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.settings-moderation-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.moderation-inline-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.settings-moderation-field,
.settings-moderation-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.35;
  background: #f9fafb;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.settings-moderation-field:hover,
.settings-moderation-textarea:hover {
  border-color: rgba(148, 163, 184, 0.85);
}

.settings-moderation-field:focus,
.settings-moderation-textarea:focus {
  outline: none;
}

.settings-moderation-field:focus-visible,
.settings-moderation-textarea:focus-visible {
  border-color: rgba(51, 130, 246, 0.65);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.18),
    0 1px 2px rgba(15, 23, 42, 0.05);
  background: var(--card);
}

.settings-moderation-textarea {
  border-radius: 12px;
  min-height: 92px;
  resize: vertical;
}

.settings-moderation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 6px;
}

.moderation-chip {
  appearance: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.moderation-chip:active {
  transform: scale(0.98);
}

.moderation-chip--danger {
  color: #fff;
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
  border-color: rgba(127, 29, 29, 0.45);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 2px 6px rgba(185, 28, 28, 0.25);
}

.moderation-chip--danger:hover {
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 4px 12px rgba(185, 28, 28, 0.3);
}

.moderation-chip--ghost {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.moderation-chip--ghost:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.moderation-chip--warn {
  background: transparent;
  border-color: rgba(217, 119, 6, 0.45);
  color: #b45309;
  box-shadow: none;
}

.moderation-chip--warn:hover {
  background: rgba(254, 243, 199, 0.45);
  border-color: rgba(217, 119, 6, 0.65);
}

.settings-moderation-footnote {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #5c6778;
}

.dark-mode .settings-moderation-footnote {
  color: #94a3b8;
}

.dark-mode .settings-moderation-field,
.dark-mode .settings-moderation-textarea {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode .settings-moderation-field:hover,
.dark-mode .settings-moderation-textarea:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

.dark-mode .settings-moderation-field:focus-visible,
.dark-mode .settings-moderation-textarea:focus-visible {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.dark-mode .moderation-chip--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.35);
}

.dark-mode .moderation-chip--warn:hover {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.4);
}

.dark-mode .moderation-chip--danger:hover {
  filter: brightness(1.08);
}

.settings-row-body {
  flex: 1;
  min-width: 0;
}

.settings-row-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.settings-row-meta {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.42;
  color: #616a7b;
}

.dark-mode .settings-row-meta {
  color: var(--muted);
}

.settings-row-meta strong {
  color: var(--text);
  font-weight: 600;
}

.settings-row-value {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-light);
  max-width: 42%;
  text-align: right;
  word-break: break-word;
}

.settings-row-value--badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.08);
  color: var(--text);
  max-width: none;
}

.settings-row-chevron {
  flex-shrink: 0;
  align-self: center;
  opacity: 0.4;
  font-size: 13px;
  color: var(--muted);
}

.settings-panel--danger {
  padding: 12px;
  text-align: center;
  border-style: dashed;
}

.settings-logout-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(250, 82, 82, 0.35);
  background: rgba(250, 82, 82, 0.08);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.settings-logout-btn:hover {
  background: rgba(250, 82, 82, 0.14);
  border-color: rgba(250, 82, 82, 0.55);
}

.settings-logout-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch--settings {
  right: auto;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  background: #cbd5e1;
  border-radius: 40px;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transition: 0.25s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: #ffffff;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  transition: 0.25s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

input:checked + .slider {
  background: linear-gradient(135deg, #10b981, #059669);
}

input:checked + .slider::before {
  transform: translateX(20px);
}

.dark-mode .slider {
  background: rgba(148, 163, 184, 0.28);
}

.dark-mode .settings-row--action:hover {
  background: rgba(255, 255, 255, 0.06);
}

.dark-mode .settings-row-value--badge {
  background: rgba(255, 255, 255, 0.06);
}

.driver-online .switch,
.marshal-online .switch {
  width: 42px;
  height: 22px;
}

.driver-online .slider::before,
.marshal-online .slider::before {
  width: 18px;
  height: 18px;
  top: 2px;
  left: 2px;
}

.driver-online input:checked + .slider::before,
.marshal-online input:checked + .slider::before {
  transform: translateX(18px);
}

.profile-section {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  align-content: center;
  column-gap: 12px;
  padding: 16px 4px 16px;
  margin-bottom: 6px;
  border-bottom: none;
}

.profile-section .profile-avatar-img {
  grid-column: 1;
  grid-row: 1;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(51, 65, 85, 0.35);
  background: var(--bg);
  margin-bottom: 0;
  box-sizing: border-box;
}

.profile-section .profile-heading-block {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  text-align: left;
}

.profile-section .profile-heading-block #profileName {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  padding: 0;
  color: var(--text);
  text-align: left;
  line-height: 1.35;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.menu-profile-role {
  margin: 4px 0 0;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.menu-profile-role--guest {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
}

.profile-avatar-img {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-avatar-img.profile-avatar-img--shown {
  opacity: 1;
}

.reduce-motion .profile-avatar-img {
  transition: none;
}

.profile-sub {
  font-size: 12px;
  color: var(--muted);
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8f9fa;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.upload-btn:focus {
  outline: none;
}

.upload-btn:hover {
  background: #eef2f6;
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.14);
}

.upload-btn:active {
  background: #e2e8f0;
}

.upload-btn:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.dark-mode .upload-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--text);
}

.dark-mode .upload-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.dark-mode .upload-btn:active {
  background: rgba(255, 255, 255, 0.12);
}

.menu-item {
  padding: 8px 10px;
  margin: 3px 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.menu-item:hover {
  background: #f1f3f5;
  transform: translateX(-2px);
}

.menu-item.active {
  background: #fff4e6;
  color: var(--primary-light);
  font-weight: 600;
}

.menu-item:last-child {
  color: var(--danger);
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 10099;
}

.menu-overlay.active {
  display: block;
}

/* ================= DRIVER UI (headers shared with Marshal below) ================= */
.marshal-header,
.driver-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 18px;
  padding: 18px 18px 20px;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(5, 150, 105, 0.14),
    rgba(37, 99, 235, 0.09)
  );
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
}

.marshal-header .page-title,
.driver-header .page-title {
  margin: 0;
  font-size: clamp(1.2rem, 3.6vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.marshal-header .subtitle,
.driver-header .subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(148, 163, 184, 0.95);
  max-width: 36rem;
}

.live-badge {
  background: #28a745;
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
}

.driver-location-btn {
  width: 100%;
  padding: 6px 8px;
  border-radius: 12px;
  background: #1e3a8a;
  color: white;
  border: none;
  margin: 10px 0;
}

.driver-summary {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.summary-card {
  background: #111827;
  color: white;
  padding: 10px 18px;
  border-radius: 12px;
  text-align: center;
}

.driver-list .card {
  border-left: 4px solid #3b82f6;
}

/* ================= DRIVER DARK UI ================= */
.driver-ui {
  background: linear-gradient(180deg, #020617 0%, #0f172a 42%, #0b1120 100%);
  color: white;
  min-height: 100vh;
  padding: 16px;
}

.driver-header h2 {
  margin-bottom: 4px;
}

.live-text {
  color: #22c55e;
  font-size: 13px;
  margin-top: 4px;
}

.marshal-location-card,
.driver-location-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: linear-gradient(
    180deg,
    rgba(17, 24, 39, 0.98),
    rgba(15, 23, 42, 0.99)
  );
  color: white;
  padding: 16px 16px;
  border-radius: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.location-hint {
  font-size: 11px;
  color: #9ca3af;
  margin: 8px 0 0;
  line-height: 1.4;
}

.driver-location-card p,
.marshal-location-card p {
  font-size: 12px;
  color: #9ca3af;
}

.marshal-location-card .primary-btn,
.driver-location-card .primary-btn {
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 10px 14px;
  background: linear-gradient(135deg, #059669, #2563eb);
  border: none;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.28);
}

.marshal-location-card strong,
.driver-location-card strong {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #f1f5f9;
}

.driver-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 7px 13px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.filter:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(255, 255, 255, 0.16);
}

.filter.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: rgba(147, 197, 253, 0.35);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.driver-list .card {
  background: #111827;
  color: white;
  border-radius: 12px;
  border-left: 4px solid #22c55e;
}

.driver-online {
  margin-top: 14px;
  background: linear-gradient(
    135deg,
    rgba(20, 83, 45, 0.95),
    rgba(22, 163, 74, 0.92)
  );
  padding: 16px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(134, 239, 172, 0.25);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.15);
}

.driver-online.offline {
  background: linear-gradient(135deg, #374151, #1f2937);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.signal-card-ui {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.92);
  padding: 14px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(51, 65, 85, 0.75);
  border-left: 4px solid #22c55e;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.signal-left {
  margin-right: 10px;
}

.signal-icon {
  font-size: 12px;
}

.signal-body {
  flex: 1;
}

.signal-body strong {
  font-size: 14px;
}

.signal-body p {
  font-size: 12px;
  color: #9ca3af;
  margin: 2px 0 0;
}

.signal-right {
  text-align: right;
  font-size: 11px;
  color: #9ca3af;
}

.signal-card-ui.need_taxi {
  border-left-color: #22c55e;
}
.signal-card-ui.full_load {
  border-left-color: #3b82f6;
}
.signal-card-ui.urgent {
  border-left-color: #ef4444;
}

.signal-card-ui.new {
  animation: pulse 0.4s ease;
}

.driver-map-card,
.marshal-map-card {
  position: relative;
}

.mini-map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-map-controls button {
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  border: 1px solid #00000099;
  background: #00000099;
  color: #ffffff;
}

.mini-fullscreen #marshalMiniMap,
.mini-fullscreen #driverMiniMap {
  height: 100vh !important;
}

.mini-fullscreen.marshal-map-card,
.mini-fullscreen.driver-map-card {
  height: 100vh !important;
}

.mini-fullscreen {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999;
  background: black;
}

.mini-fullscreen #driverMiniMap {
  height: 100% !important;
}

.mini-map-controls button:hover {
  background: #000000cc;
}

/* ================= CHAT PANEL ================= */
.chat-icon {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-icon i {
  position: relative;
  font-size: 18px;
  right: 0;
}

#chatCount {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 50%;
}

#chatCount {
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% {
    transform: scale(0.5);
  }
  100% {
    transform: scale(1);
  }
}

.chat-panel {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  height: min(52vh, 520px);
  max-height: 85dvh;
  color: #f3f4f6;
  display: flex;
  flex-direction: column;
  transition:
    bottom 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
  border-radius: 22px 22px 0 0;
  box-shadow:
    0 -16px 48px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 10000;
  background: linear-gradient(
    165deg,
    rgba(24, 27, 36, 0.97) 0%,
    rgba(17, 19, 26, 0.98) 45%,
    rgba(14, 17, 24, 0.99) 100%
  );
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.chat-panel.active {
  bottom: 0;
}

.reduce-motion .chat-panel {
  transition-duration: 0.05s;
}

.chat-panel::before {
  content: "";
  display: block;
  height: 4px;
  width: 42px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(52, 211, 153, 0.35),
    rgba(56, 189, 248, 0.55),
    rgba(52, 211, 153, 0.35)
  );
  opacity: 0.85;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 12px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
}

.chat-header span:first-of-type {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: rgba(243, 244, 246, 0.82);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 18px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.chat-close:active {
  transform: scale(0.96);
}

.chat-box {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.chat-box::-webkit-scrollbar {
  width: 8px;
}

.chat-box::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.msg {
  max-width: 82%;
  padding: 11px 14px;
  margin: 0;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.22s ease;
}

.msg.other {
  background: rgba(39, 42, 52, 0.92);
  color: #e5e7eb;
  margin-right: auto;
  border-bottom-left-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.msg.me {
  margin-left: auto;
  border-bottom-right-radius: 6px;
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.92),
    rgba(5, 150, 105, 0.95)
  );
  color: #ecfdf5;
  border: 1px solid rgba(167, 243, 208, 0.35);
  box-shadow:
    0 10px 26px rgba(16, 185, 129, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 14, 20, 0.92);
}

.chat-input input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  outline: none;
  font-size: 14px;
  background: rgba(30, 33, 43, 0.95);
  color: #f9fafb;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.chat-input input:focus {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.chat-input input::placeholder {
  color: rgba(156, 163, 175, 0.85);
}

.chat-input button {
  flex-shrink: 0;
  padding: 11px 16px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: #052e26;
  cursor: pointer;
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow:
    0 10px 22px rgba(16, 185, 129, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}

.chat-input button:hover {
  filter: brightness(1.06);
}

.chat-input button:active {
  transform: scale(0.97);
}

.dark-mode .chat-panel {
  background: linear-gradient(
    165deg,
    rgba(18, 21, 28, 0.97),
    rgba(10, 12, 18, 0.99)
  );
}

.dark-mode .msg.other {
  background: rgba(32, 36, 48, 0.96);
}

.reduce-motion .msg {
  animation: none;
}

.m-card.sent {
  opacity: 0.6;
  transform: scale(0.98);
  transition: 0.2s;
}

/* =============== chat display improvement ============== */
.msg-name {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.72;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.msg-time {
  font-size: 10px;
  opacity: 0.62;
  margin-top: 6px;
  align-self: flex-end;
}

.msg-text {
  font-size: 14px;
  word-wrap: break-word;
}

/* ================= Chat Preview Panel  ================= */
#chatPreviewPanel {
  position: fixed;
  top: 62px;
  right: 12px;
  width: min(92vw, 340px);
  max-height: min(440px, 72vh);
  background: linear-gradient(
    155deg,
    rgba(22, 26, 38, 0.94),
    rgba(15, 18, 28, 0.96)
  );
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(16, 185, 129, 0.08);
  border-radius: 18px;
  color: #f8fafc;
  padding: 12px;
  z-index: 9999;
  animation: slideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  scrollbar-width: thin;
}

.reduce-motion #chatPreviewPanel {
  animation-duration: 0.05s;
}

.chat-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 12px;
  margin-bottom: 4px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-preview-header span {
  background: linear-gradient(90deg, #ecfdf5, #a7f3d0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.chat-preview-item {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.chat-preview-item:hover {
  background: rgba(52, 211, 153, 0.09);
  border-color: rgba(52, 211, 153, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.reduce-motion .chat-preview-item {
  transition-duration: 0.05s;
}

.reduce-motion .chat-preview-item:hover {
  transform: none;
}

.chat-preview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.chat-preview-name {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}

.chat-preview-time {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.95);
  flex-shrink: 0;
}

.chat-preview-text {
  font-size: 13px;
  color: rgba(203, 213, 225, 0.95);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-preview-badge {
  margin-top: 6px;
  align-self: flex-end;
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: white;

  font-size: 10px;
  padding: 2px 6px;
  border-radius: 20px;
}

.chat-preview-empty {
  text-align: center;
  font-size: 13px;
  color: rgba(148, 163, 184, 0.95);
  padding: 22px 14px;
}

.chat-empty {
  padding: 28px 18px;
  text-align: center;
  opacity: 0.72;
  font-size: 13px;
  color: rgba(148, 163, 184, 0.95);
}

.chat-loading {
  padding: 28px;
  text-align: center;
  font-size: 13px;
  opacity: 0.72;
}

.chat-preview-content {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
}
/* ================= Notifications ================= */
.notif-bell {
  position: relative;
  right: 0;
  font-size: 16px;
  cursor: pointer;
  display: none;
}

.notif-bell span {
  position: absolute;
  top: -5px;
  right: -10px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 50%;
}

.notif-panel {
  position: fixed;
  top: var(--header-offset);
  right: 10px;
  width: 90%;
  max-width: 320px;
  background: linear-gradient(180deg, #020617, #111827);
  color: #ffffff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
  z-index: 9999;
  animation: slideIn 0.25s ease;
}

.notif-list {
  max-height: 300px;
  overflow-y: auto;
}

.hidden {
  display: none;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 10px;
}

.clear-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 12px;
  cursor: pointer;
}

.clear-btn:hover {
  color: #ef4444;
}

.notif-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111827;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  border: 1px solid #1f2937;
}

.notif-text {
  flex: 1;
  padding-right: 8px;
}

.notif-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 14px;
  cursor: pointer;
}

.notif-close:hover {
  color: #ef4444;
}

.empty {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= MARSHAL DARK UI ================= */
.marshal-ui {
  background: linear-gradient(180deg, #020617 0%, #0f172a 42%, #0b1120 100%);
  color: white;
  min-height: 100vh;
  padding: 16px;
}

.location-status {
  background: #022c22;
  color: #22c55e;
  border: 1px solid #22c55e;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
}

.marshal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.m-card {
  padding: 14px;
  border-radius: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.m-card {
  transition: 0.2s ease;
}

.m-card h4 {
  margin: 6px 0;
}

.m-card small {
  color: #555;
}

.m-card.green {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid #22c55e;
}

.m-card.blue {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid #3b82f6;
}

.m-card.red {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
}

.m-card.gray {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid #64748b;
}

.m-card small {
  color: #9ca3af;
}

.m-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.m-card.green:hover,
.m-card.blue:hover,
.m-card.red:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* ================= MINI MAP ================= */
#driverMiniMap,
#marshalMiniMap {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  filter: brightness(0.85) contrast(1.05);
}

.driver-map-card,
.marshal-map-card {
  height: 220px;
  border-radius: 16px;
  overflow: hidden;
  background: #0a0f1a;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

/* ================= MARSHAL UI ================= */
.location-card {
  display: flex;
  justify-content: space-between;
  background: #f1f5f9;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 15px;
}

.signal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.signal-card {
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.signal-card:hover {
  transform: scale(1.05);
}

.signal-card.need {
  background: #dcfce7;
}
.signal-card.full {
  background: #dbeafe;
}
.signal-card.urgent {
  background: #fee2e2;
}
.signal-card.stop {
  background: #e5e7eb;
}

.status-card {
  margin-top: 15px;
  padding: 12px;
  background: #111827;
  color: white;
  border-radius: 12px;
}

.signal-actions {
  display: flex;
  gap: 6px;
}

.accept-btn {
  background: #22c55e;
  border: none;
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
}

.decline-btn {
  background: #ef4444;
  border: none;
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
}

/* ================= TIPS ================= */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tips-empty {
  text-align: center;
  padding: 36px 20px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px dashed var(--border);
  color: var(--muted);
}

.tips-empty__icon {
  font-size: 36px;
  color: var(--primary);
  opacity: 0.85;
  margin-bottom: 12px;
}

.tips-empty__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.tips-empty__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

/* ================= TIPS PAGE (layout + hero) ================= */
.tips-page-wrap {
  text-align: left;
  padding: 12px 18px 32px;
  box-sizing: border-box;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.tips-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tips-hero {
  text-align: left;
  margin-bottom: 20px;
  padding: 22px 20px 24px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.07),
    rgba(5, 150, 105, 0.06)
  );
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 40px rgba(15, 23, 42, 0.06);
}

.tips-hero__kicker {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #2563eb;
  opacity: 0.95;
}

.tips-hero__brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.tips-hero__headlines {
  flex: 1;
  min-width: 0;
}

.tips-hero-icon {
  width: 52px;
  height: 52px;
  margin: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(145deg, #2563eb, #0d9488);
  border: none;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 22px rgba(37, 99, 235, 0.28);
}

.tips-main-title {
  font-size: clamp(1.35rem, 4.2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--primary);
  text-align: left;
}

.tips-hero__sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  font-weight: 400;
  margin: 0;
  max-width: 36rem;
}

.tips-hero__sub strong {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 420px) {
  .tips-hero {
    padding: 18px 16px 20px;
  }

  .tips-hero__brand {
    flex-direction: column;
    align-items: stretch;
  }

  .tips-hero-icon {
    align-self: flex-start;
  }
}

/* —— Community tips feed —— */
.tip-feed-card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px 18px 16px;
  margin-bottom: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 36px rgba(15, 23, 42, 0.06);
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.tip-feed-card:hover {
  border-color: rgba(5, 150, 105, 0.2);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 16px 44px rgba(15, 23, 42, 0.08);
}

.tip-feed-card__top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.tip-feed-card__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    rgba(52, 211, 153, 0.2),
    rgba(5, 150, 105, 0.12)
  );
  border: 1px solid rgba(52, 211, 153, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #059669;
  flex-shrink: 0;
  font-size: 16px;
}

.tip-feed-card__headline {
  flex: 1;
  min-width: 0;
}

.tip-feed-card__name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.tip-feed-card__name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.tip-feed-card__pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
}

.tip-feed-card__pill--pickup {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.tip-feed-card__pill--rank {
  background: rgba(168, 85, 247, 0.12);
  color: #7c3aed;
}

.tip-feed-card__pill--robot {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.tip-feed-card__pill--smart {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.035em;
  padding: 2px 7px;
  text-transform: none;
}

.tip-feed-card__pill--tip {
  background: rgba(100, 116, 139, 0.15);
  color: var(--muted);
}

.tip-feed-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 12px;
  color: var(--muted);
}

.tip-feed-card__meta i {
  margin-right: 4px;
  opacity: 0.85;
}

.tip-feed-card__body {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}

.tip-feed-card__engage {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tip-feed-card__action-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  align-content: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  flex: 0 0 auto;
  flex-shrink: 0;
  padding: 10px 0 0;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  contain: layout style;
}

.tip-feed-card__action {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  align-self: center;
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  line-height: 1.2;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  contain: content;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.tip-feed-card__action--comments {
  flex: 1 1 0;
  align-self: center;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
}

.tip-feed-card__action:hover:not(:disabled) {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.06);
}

.tip-feed-card__action:disabled {
  opacity: 0.75;
  cursor: default;
}

.tip-feed-card__action--comments[aria-expanded="true"] {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.1);
  color: var(--text);
}

.tip-feed-card__action--like.is-liked {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.1);
  color: var(--text);
}

.tip-feed-card__count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  opacity: 0.9;
}

.tip-feed-card__thread {
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  margin-top: 12px;
  padding: 14px 14px 16px;
  border-radius: 14px;
  background: rgba(5, 150, 105, 0.05);
  border: 1px solid rgba(5, 150, 105, 0.16);
  box-sizing: border-box;
}

.tip-feed-card__thread.hidden {
  display: none !important;
}

.tip-feed-card__thread:not(.hidden) {
  animation: tipThreadIn 0.2s ease-out;
}

@keyframes tipThreadIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reduce-motion .tip-feed-card__thread:not(.hidden) {
  animation: none;
}

@media (max-width: 380px) {
  .tip-feed-card__action-bar {
    flex-wrap: wrap;
    contain: layout style;
    min-height: 0;
  }

  .tip-feed-card__action,
  .tip-feed-card__action--comments {
    flex: 1 1 calc(50% - 4px);
    min-height: 44px;
    height: auto;
    max-height: none;
    white-space: normal;
  }
}

.dark-mode .tips-hero {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.14),
    rgba(5, 150, 105, 0.1)
  );
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 16px 48px rgba(0, 0, 0, 0.42);
}

.dark-mode .tips-hero__kicker {
  color: #93c5fd;
}

.dark-mode .tips-hero-icon {
  color: #fff;
  background: linear-gradient(145deg, #2563eb, #0d9488);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.1) inset,
    0 10px 28px rgba(37, 99, 235, 0.4);
}

.dark-mode .tips-main-title {
  color: #f1f5f9;
}

.dark-mode .tip-feed-card__engage {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .tip-feed-card__thread {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(52, 211, 153, 0.24);
}

.dark-mode .tip-comment-like {
  border-color: rgba(52, 211, 153, 0.22);
}

.dark-mode .tip-comment-like.is-liked {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(5, 150, 105, 0.14);
}

.dark-mode .tip-feed-card__action--comments[aria-expanded="true"] {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(5, 150, 105, 0.16);
}

.tip-comments-list {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 2px;
}

.tip-comments-placeholder,
.tip-comments-loading,
.tip-comments-empty,
.tip-comments-error {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}

.tip-comments-error code {
  font-size: 11px;
}

.tip-comment-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.tip-comment-row:last-child {
  border-bottom: none;
}

.tip-comment-row__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.tip-comment-row__who {
  font-weight: 700;
  color: var(--text);
}

.tip-comment-row__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.tip-comment-row__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.tip-comment-like {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 10px;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  line-height: 1.2;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.tip-comment-like:hover:not(:disabled) {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.06);
}

.tip-comment-like.is-liked {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.1);
  color: var(--text);
}

.tip-comment-like:disabled {
  opacity: 0.75;
  cursor: default;
}

.tip-comment-like__count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  opacity: 0.9;
}

.tip-comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tip-comment-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 44px;
  font-family: inherit;
  box-sizing: border-box;
}

.tip-comment-input:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.tip-comment-post {
  align-self: flex-end;
  min-height: 0;
  padding: 5px 12px;
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
  cursor: pointer;
  background: linear-gradient(135deg, #34d399, #059669);
  color: #ffffff;
}

.tip-comments-signin-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}

.tips-card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.tips-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.tips-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}

.tips-title span {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.tips-card button {
  background: #f1f3f5;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.top-tip {
  border: 1px solid #ffd43b;
  background: #fff9db;
}

.tip-text small {
  color: var(--muted);
  font-size: 11px;
}

.top-badge {
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--primary);
  font-weight: bold;
}

.tip-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
  background: #e7f5ff;
  color: #1971c2;
}

.tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.tip-icon {
  font-size: 18px;
  margin-top: 2px;
}

#tips {
  text-align: left;
}

.tip-text {
  flex: 1;
  line-height: 1.5;
  font-size: 14px;
  text-align: left;
}

.tip-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: left;
  justify-content: flex-start;
}

.tip-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.tip-actions button {
  background: #f1f3f5;
  border: none;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.tip-actions button:hover {
  background: var(--primary-light);
  color: white;
}

/*  DESKTOP FIX FOR TIPS */
@media (min-width: 768px) {
  #tips.tips-feed {
    max-width: 700px;
    margin: 0 auto;
  }

  .tips-card {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ================= COMING SOON ================= */
.coming-card #map {
  height: 200px !important;
  border-radius: 12px;
}

.coming-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.coming-modal.hidden {
  display: none;
}

.coming-card {
  width: 90%;
  max-width: 80vh;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-strong);
  animation: fadeIn 0.25s ease;
}

.coming-icon {
  font-size: 30px;
  margin-bottom: 10px;
}

.coming-card h3 {
  margin: 10px 0;
}

.coming-card p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.coming-card .auth-btn {
  width: auto;
  align-self: center;
  min-width: 132px;
  min-height: 44px;
  margin-top: 0;
}

/* ================= APP PROMPT MODAL ================= */
.app-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 10150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.app-prompt-modal.hidden {
  display: none !important;
}

.app-prompt-modal__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(8, 10, 15, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.app-prompt-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 22px 22px 18px;
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-strong);
  animation: fadeIn 0.22s ease;
}

.app-prompt-modal__title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.app-prompt-modal__message {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  white-space: pre-line;
}

.app-prompt-modal__field {
  margin-bottom: 10px;
}

.app-prompt-modal__input,
.app-prompt-modal__select {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

body.dark-mode .app-prompt-modal__input,
body.dark-mode .app-prompt-modal__select {
  background: rgba(255, 255, 255, 0.04);
}

.app-prompt-modal__input:focus,
.app-prompt-modal__select:focus {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.app-prompt-modal__error {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
}

.app-prompt-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.app-prompt-modal__actions--solo {
  justify-content: stretch;
}

.app-prompt-modal__actions--solo .app-prompt-modal__btn--primary,
.app-prompt-modal__actions--solo .app-prompt-modal__btn--danger {
  flex: 1 1 auto;
  min-width: min(280px, 100%);
}

.app-prompt-modal__btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.app-prompt-modal__btn:active {
  transform: scale(0.98);
}

.app-prompt-modal__btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.app-prompt-modal__btn--ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.app-prompt-modal__btn--primary {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #052e26;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.22);
}

.app-prompt-modal__btn--primary:hover {
  filter: brightness(1.05);
}

.app-prompt-modal__btn--danger {
  background: linear-gradient(135deg, #f87171, #dc2626);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.28);
}

.app-prompt-modal__btn--danger:hover {
  filter: brightness(1.06);
}

.reduce-motion .app-prompt-modal__panel {
  animation: none;
}

/* ================= STEPS ================= */
.steps-card {
  text-align: left;
  margin-top: 10px;
}

.step {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}

/* ================= BACK BUTTON ================= */

.back-btn {
  width: 90%;
  margin: 30px auto 0;
  display: block;
  background: var(--secondary);
  color: var(--card);
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
}

.marshal-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  margin-top: 10px;
}

#selectedRoute {
  display: none !important;
}

.marshal-btn.need {
  background: #e7f5ff;
  color: #0a8f32;
}

.marshal-btn.full {
  background: #e7f5ff;
  color: #1971c2;
}

.marshal-btn.urgent {
  background: #fff5f5;
  color: var(--danger);
}

.marshal-btn.stop {
  background: #f1f3f5;
  color: var(--text);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= NAV (IMPROVED) ================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 9999;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 58px;
  padding: 4px 6px;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.bottom-nav div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  gap: 2px;
  cursor: pointer;
  transition: 0.2s ease;
}

.bottom-nav i {
  font-size: 18px;
}

.bottom-nav div.active {
  color: var(--primary);
}

.hidden {
  display: none !important;
}

/* ================= PAGE ================= */
.page {
  display: none;
  position: absolute;
  width: 100%;
  top: var(--header-offset);
  padding-bottom: 70px;
  box-sizing: border-box;
}

.page.active {
  display: block;
}

/*
 * Transparent .page shells sit below the fixed header using --header-offset.
 * Marshal/Driver skins are full-bleed dark — a slight over-estimated offset showed
 * a strip of body (white) before the gradient; nudge upward only on those pages.
 */
#marshalPage.page,
#driverPage.page {
  top: calc(var(--header-offset) - 6px);
}

/* crosshair pointer for accuracy*/
.crosshair {
  width: 12px;
  height: 12px;
  position: relative;
}
.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: #000;
}
.crosshair::before {
  width: 2px;
  height: 12px;
  left: 5px;
  top: 0;
}
.crosshair::after {
  height: 2px;
  width: 12px;
  top: 5px;
  left: 0;
}

/* Map-aligned admin placement crosshair (matches Leaflet container pixels / latlng) */
.map-crosshair-preview,
.map-crosshair-placement {
  width: 48px;
  height: 48px;
  box-sizing: border-box;
}

.map-crosshair-preview::before,
.map-crosshair-preview::after,
.map-crosshair-placement::before,
.map-crosshair-placement::after {
  content: "";
  position: absolute;
  background: rgba(239, 68, 68, 0.92);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.map-crosshair-preview::before,
.map-crosshair-placement::before {
  width: 2px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.map-crosshair-preview::after,
.map-crosshair-placement::after {
  height: 2px;
  width: 100%;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.map-crosshair-preview::before,
.map-crosshair-preview::after {
  opacity: 0.82;
}

.map-crosshair-placement::before,
.map-crosshair-placement::after {
  background: rgba(220, 38, 38, 1);
}

.reduce-motion .map-crosshair-preview::before,
.reduce-motion .map-crosshair-preview::after,
.reduce-motion .map-crosshair-placement::before,
.reduce-motion .map-crosshair-placement::after {
  box-shadow: none;
}

/* Live location: pulses scale past the 20×20 icon box — don’t clip them */
.leaflet-marker-pane .leaflet-marker-icon.leaflet-div-icon.user-location,
.leaflet-marker-icon.leaflet-div-icon.user-location,
.leaflet-marker-icon.leaflet-div-icon.driver-live-marker,
.leaflet-marker-icon.leaflet-div-icon.marshal-live-marker {
  overflow: visible !important;
}

.leaflet-marker-icon.leaflet-div-icon:has(.dot-container) {
  overflow: visible !important;
}

.dot-container {
  position: relative;
  width: 20px;
  height: 20px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 2;
  border: 3px solid white;
}

.pulse {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: absolute;
  top: -2px;
  left: -2px;
  opacity: 0.35;
  transform-origin: center center;
  will-change: transform, opacity;
  animation: pulseAnim 1.5s ease-out infinite;
}

.user-dot .dot,
.user-dot .pulse {
  background: #111827;
}

.driver-dot .dot,
.driver-dot .pulse {
  background: #2563eb;
}

.marshal-dot .dot,
.marshal-dot .pulse {
  background: #16a34a;
}

@keyframes pulseAnim {
  0%,
  100% {
    transform: scale(0.58);
    opacity: 0.65;
  }

  48% {
    transform: scale(2);
    opacity: 0;
  }
}

#userInfo {
  font-size: 12px;
  font-weight: 600;
  background: #f1f3f5;
  padding: 5px 10px;
  border-radius: 20px;
}

#logoutBtn {
  background: #ffe3e3;
  color: var(--danger);
  border: none;
  font-weight: 600;
}

/* ================= BOTTOM SHEET ================= */
.bottom-sheet {
  position: fixed;
  bottom: 58px;
  left: 0;
  width: 100%;
  max-width: 100%;
  transform: translateY(100%);
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease;
  background: linear-gradient(180deg, #fdfdfd 0%, #f8fafc 100%);
  border-radius: 22px 22px 0 0;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-bottom: none;
  box-shadow:
    0 -4px 24px rgba(15, 23, 42, 0.06),
    0 -24px 48px rgba(15, 23, 42, 0.05);
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.bottom-sheet.active {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(15, 23, 42, 0.12);
  border-radius: 100px;
  margin: 4px auto 14px;
  flex-shrink: 0;
}

.sheet-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  text-align: left;
}

.sheet-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
}

.sheet-row--tips {
  padding-bottom: 6px;
}

.sheet-row--tips .sheet-icon {
  margin-top: 3px;
}

.sheet-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  color: #0f172a;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  margin-top: 2px;
}

.sheet-icon--location {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.12);
}

.sheet-icon--route {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.07);
  border-color: rgba(37, 99, 235, 0.12);
}

.sheet-icon--tips {
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.18);
}

.sheet-copy {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.sheet-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
  text-align: left;
}

.sheet-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  color: #0f172a;
  letter-spacing: -0.01em;
  text-align: left;
}

.pickup-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  text-align: left;
}

.pickup-line--primary {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  color: #0f172a;
  text-align: left;
}

.pickup-line--secondary {
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  color: #64748b;
  text-align: left;
}

.sheet-body--route {
  font-weight: 600;
  font-size: 15px;
  color: #0f172a;
  text-align: left;
}

.sheet-tips-host {
  text-align: left;
}

.sheet-tips-host .sheet-tips-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 400;
  color: #475569;
  text-align: left;
}

.sheet-tips-host .sheet-tips-list li {
  margin-bottom: 8px;
  padding-left: 0;
  position: relative;
  text-align: left;
}

.sheet-tips-host .sheet-tips-list li:last-child {
  margin-bottom: 0;
}

.sheet-divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.07);
  margin: 0 0 0 52px;
}

.confirm-btn.sheet-cta {
  width: 100%;
  padding: 15px 18px;
  margin-top: 8px;
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 20px rgba(5, 150, 105, 0.28);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.confirm-btn.sheet-cta:active:not(:disabled) {
  transform: scale(0.985);
}

.confirm-btn.sheet-cta:disabled {
  opacity: 0.65;
  box-shadow: none;
  cursor: not-allowed;
}

@media (hover: hover) {
  .confirm-btn.sheet-cta:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--success-hover) 0%, #065f46 100%);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.14) inset,
      0 10px 26px rgba(5, 150, 105, 0.34);
  }
}

/* ================= HOW PAGE (modern) ================= */
.how-page {
  hyphens: none;
  -webkit-hyphens: none;
}

.how-page__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  /* .container globally centers text — step cards must stay left-aligned */
  text-align: left;
}

.how-hero {
  text-align: center;
  padding: 8px 4px 4px;
}

.how-hero__kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #059669;
}

.how-hero__title {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.how-hero__lede {
  margin: 0 auto;
  max-width: 40rem;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.how-hero__lede strong {
  color: var(--text);
  font-weight: 700;
}

.how-block__head {
  text-align: center;
  margin-bottom: 16px;
}

.how-block__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.how-block__intro {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.how-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: howstep;
}

.how-flow__step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 16px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  counter-increment: howstep;
}

.how-flow__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #065f46;
  background: linear-gradient(
    145deg,
    rgba(52, 211, 153, 0.2),
    rgba(5, 150, 105, 0.1)
  );
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.how-flow__body {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.how-flow__step-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  text-align: left;
}

.how-flow__body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  text-align: left;
}

.how-flow__pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #059669, #3ecf5e);
  vertical-align: baseline;
  text-align: center;
}

@media (max-width: 520px) {
  .how-page__inner {
    padding: 12px 14px 22px;
    gap: 22px;
  }

  .how-hero {
    padding: 4px 2px 0;
  }

  .how-hero__kicker {
    margin: 0 0 6px;
    font-size: 10px;
    letter-spacing: 0.11em;
  }

  .how-hero__title {
    margin: 0 0 8px;
    font-size: clamp(1.22rem, 5.2vw, 1.42rem);
    line-height: 1.12;
  }

  .how-hero__lede {
    font-size: 13px;
    line-height: 1.48;
    max-width: 100%;
    padding: 0 2px;
  }

  .how-block__title {
    font-size: 1rem;
  }

  .how-block__intro {
    font-size: 12px;
    line-height: 1.42;
  }

  .how-page__actions {
    padding-top: 0;
  }

  .how-flow {
    gap: 10px;
  }

  .how-flow__step {
    gap: 12px;
    padding: 14px 13px;
    align-items: flex-start;
    border-radius: 14px;
  }

  .how-flow__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 16px;
    margin-top: 2px;
    align-self: flex-start;
  }

  .how-flow__step-title {
    font-size: 14px;
    letter-spacing: -0.01em;
  }

  .how-flow__body p {
    font-size: 13px;
    line-height: 1.52;
  }

  .how-block__head {
    margin-bottom: 14px;
    padding: 0 2px;
  }

  .how-feature-card {
    padding: 14px 13px 12px;
  }

  .how-feature-card__title {
    font-size: 13px;
  }

  .how-feature-card p {
    font-size: 12px;
  }

  .how-pro__inner {
    padding: 14px 14px;
  }

  .how-pro__title {
    font-size: 14px;
  }

  .how-pro__list {
    font-size: 13px;
  }
}

.how-feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .how-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

.how-feature-card {
  padding: 16px 16px 14px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.how-feature-card__icon {
  display: flex;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 16px;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.how-feature-card__title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.how-feature-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.how-pro {
  border-radius: var(--radius-lg);
  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.12),
    rgba(245, 158, 11, 0.06)
  );
  border: 1px solid rgba(217, 119, 6, 0.22);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.08);
}

.how-pro__inner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 18px;
}

.how-pro__inner > div {
  flex: 1;
  min-width: 0;
}

.how-pro__icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 18px;
  color: #b45309;
  background: rgba(251, 191, 36, 0.35);
}

.how-pro__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.how-pro__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.how-pro__list li {
  margin-bottom: 8px;
}

.how-pro__list li:last-child {
  margin-bottom: 0;
}

.how-page__actions {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.how-back-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-sizing: border-box;
  min-height: 36px;
  min-width: 9.25rem;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(135deg, var(--success), #3ecf5e);
  box-shadow:
    0 4px 12px rgba(5, 150, 105, 0.2),
    0 1px 2px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

.how-back-primary:hover {
  filter: brightness(1.05);
}

.how-back-primary:active {
  transform: scale(0.98);
}

.tips-title span:first-of-type {
  color: var(--primary);
}

.dark-mode .how-flow__icon {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.25);
}

.dark-mode .how-feature-card {
  border-color: var(--border);
  box-shadow: none;
}

.dark-mode .how-feature-card__icon {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.2);
}

.dark-mode .how-pro {
  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.08),
    rgba(245, 158, 11, 0.04)
  );
  border-color: rgba(251, 191, 36, 0.25);
}

.dark-mode .how-pro__icon {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.15);
}

.dark-mode .how-hero__kicker {
  color: #34d399;
}

/* ================= DARK MODE ================= */
.dark-mode .step:hover {
  background: rgba(255, 255, 255, 0.05);
}

.back-btn {
  padding: 6px 8px;
  width: 50px;
  background-color: transparent;
  color: black;
  border: 1px solid #ccc;
  cursor: pointer;
  margin-top: 60px;
}

/* 💻 DESKTOP ONLY */
@media (min-width: 768px) {
  .menu-btn {
    display: none;
  }

  .side-menu {
    display: none;
  }

  .menu-overlay {
    display: none !important;
  }

  .header h2 {
    font-size: 16px;
  }

  .header button span {
    display: inline;
  }

  .header button {
    padding: 6px 10px;
  }

  /* One row: icons + nav — avoid chat floating on a separate line */
  .header-right {
    flex-wrap: nowrap;
    gap: 6px 8px;
    align-items: center;
  }
}

.desktop-menu {
  display: none;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.desktop-menu span {
  cursor: pointer;
}

.desktop-menu span:hover {
  color: var(--primary);
}

/* Dropdown — click-to-toggle only (hover + gap caused clicks to fall through to the map) */
.desktop-dropdown {
  position: relative;
  z-index: 10001;
}

.desktop-dropdown__trigger {
  cursor: pointer;
  user-select: none;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: 6px 0;
  min-width: 180px;
  z-index: 10002;
  margin-top: 0;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Invisible bridge so the pointer path from the trigger to the panel stays “inside” the menu */
.dropdown-content::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 14px;
}

.desktop-dropdown.desktop-dropdown--open .dropdown-content {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: 0.2s;
}

.dropdown-item .icon {
  width: 24px;
  text-align: center;
  margin-right: 10px;
  flex-shrink: 0;
}

#desktopAuth {
  padding: 0;
  margin: 0;
  display: block;
  width: 100%;
}

#desktopAuth .dropdown-item {
  width: 100%;
}
.dropdown-content div {
  padding: 10px;
  cursor: pointer;
}

.dropdown-content hr {
  margin: 8px 0;
}

.dropdown-content div:hover {
  background: #f1f3f5;
}

.dark-mode .dropdown-content {
  background: var(--card);
  border: 1px solid var(--border);
}

.dark-mode .dropdown-content div:hover {
  background: rgba(148, 163, 184, 0.12);
}

@media (min-width: 768px) {
  /* Top bar replaces bottom tabs — never show both */
  .bottom-nav {
    display: none !important;
  }

  .page {
    padding-bottom: 28px;
  }

  #routesPage.routes-page {
    --routes-page-pad-bottom: 22px;
  }

  .desktop-menu {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
    row-gap: 0;
    column-gap: 8px;
    justify-content: flex-end;
  }

  /* Same line / box as nav pills — includes “More ▾” */
  .desktop-menu .desktop-dropdown {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
  }

  .desktop-menu > span,
  .desktop-menu .desktop-dropdown__trigger {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 10px;
    transition:
      background 0.15s ease,
      color 0.15s ease,
      box-shadow 0.15s ease;
    font-size: 14px;
    line-height: 1.25;
    box-sizing: border-box;
    margin: 0;
  }

  /* Mid widths: tighter pills so Home…More stay one row beside chat/notifications */
  @media (max-width: 1199px) {
    .desktop-menu {
      column-gap: 6px;
    }

    .desktop-menu > span,
    .desktop-menu .desktop-dropdown__trigger {
      padding: 5px 7px;
      font-size: 13px;
    }
  }

  .desktop-menu > span:hover,
  .desktop-menu .desktop-dropdown__trigger:hover {
    background: rgba(15, 23, 42, 0.06);
  }

  body.dark-mode .desktop-menu > span:hover,
  body.dark-mode .desktop-menu .desktop-dropdown__trigger:hover {
    background: rgba(16, 185, 129, 0.14);
    color: #d1fae5;
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.14);
  }

  body.dark-mode .desktop-menu > span:active,
  body.dark-mode .desktop-menu .desktop-dropdown__trigger:active {
    background: rgba(16, 185, 129, 0.22);
    color: #ecfdf5;
  }

  body.dark-mode .desktop-menu > span:focus-visible,
  body.dark-mode .desktop-menu .desktop-dropdown__trigger:focus-visible {
    outline: none;
    background: rgba(16, 185, 129, 0.18);
    color: #ecfdf5;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.45);
  }

  /* Reset mobile offsets so icons align with desktop nav row */
  .chat-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .chat-icon i {
    right: 0;
  }

  #chatCount {
    top: 4px;
    right: 4px;
  }

  .notif-bell {
    right: 0;
    align-self: center;
  }

  .header-right {
    align-items: center;
  }
}

/*
 * Narrow desktop / tablet-wide (768–1199): inline nav + logo need the width;
 * chat + bell crowd the centred brand. Hide header icons here only — they stay
 * on mobile (<768 hamburger layout) and on wider viewports where the bar fits.
 */
@media (min-width: 768px) and (max-width: 1199px) {
  .header-right .chat-icon,
  .header-right .notif-bell {
    display: none !important;
  }
}

/* =================  PRO DARK MODE ================= */
.dark-mode {
  background: var(--bg);
  color: var(--text);
}

.dark-mode .bottom-sheet {
  background: linear-gradient(180deg, #1e222b 0%, #171a21 100%);
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.45),
    0 -2px 12px rgba(0, 0, 0, 0.25);
  text-align: left;
}

.dark-mode .sheet-handle {
  background: rgba(255, 255, 255, 0.14);
}

.dark-mode .sheet-label {
  color: #94a3b8;
}

.dark-mode .sheet-body,
.dark-mode .pickup-line--primary,
.dark-mode .sheet-body--route {
  color: #f1f5f9;
}

.dark-mode .pickup-line--secondary {
  color: #94a3b8;
}

.dark-mode .sheet-divider {
  background: rgba(255, 255, 255, 0.08);
}

.dark-mode .sheet-icon {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.dark-mode .sheet-icon--location {
  color: #5eead4;
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.18);
}

.dark-mode .sheet-icon--route {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.18);
}

.dark-mode .sheet-icon--tips {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.15);
}

.dark-mode .sheet-tips-host .sheet-tips-list {
  color: #cbd5e1;
}

.dark-mode .confirm-btn.sheet-cta {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 8px 22px rgba(16, 185, 129, 0.35);
}

.dark-mode .header,
.dark-mode .card,
.dark-mode .settings-panel,
.dark-mode .side-menu,
.dark-mode .bottom-nav,
.dark-mode #suggestions {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

.dark-mode .header {
  background: var(--header-bar-bg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 2px 10px rgba(0, 0, 0, 0.44),
    0 5px 16px rgba(0, 0, 0, 0.3);
}

.dark-mode .side-menu {
  background: linear-gradient(195deg, #171c26 0%, #10141c 100%);
  border-left: 1px solid rgba(52, 211, 153, 0.12);
}

.dark-mode .menu-section:not(:first-of-type) {
  border-top-color: rgba(52, 211, 153, 0.14);
}

.dark-mode .menu-profile-role {
  color: rgba(110, 231, 183, 0.78);
}

.dark-mode .menu-profile-role--guest {
  color: rgba(148, 163, 184, 0.95);
}

.dark-mode .tips-card,
.dark-mode .tip-feed-card,
.dark-mode .route-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.dark-mode .setting-sub,
.dark-mode .profile-sub,
.dark-mode .routes-subtitle,
.dark-mode .tip-meta {
  color: var(--muted);
}

.dark-mode input,
.dark-mode .auth-input,
.dark-mode .search-box input {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.dark-mode input::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

.dark-mode .find-btn {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
}

.dark-mode .share-btn {
  background: linear-gradient(135deg, #a24a0c 0%, #c46216 48%, #b86a22 100%);
  color: #ffffff;
}

.dark-mode .auth-btn,
.dark-mode .how-btn {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
  color: #f9fafb;
}

.dark-mode .auth-btn:hover,
.dark-mode .how-btn:hover {
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.45),
    0 10px 24px rgba(15, 23, 42, 0.35);
}

.dark-mode .auth-legal-consent {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}

.dark-mode .auth-container {
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 50px -20px rgba(0, 0, 0, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.32);
}

.dark-mode .auth-links {
  border-top-color: rgba(148, 163, 184, 0.12);
}

.dark-mode .auth-switch {
  border-top-color: rgba(148, 163, 184, 0.12);
}

.dark-mode .role-dropdown {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
}

.dark-mode .role-dropdown:focus {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.2);
}

.dark-mode .auth-input:focus {
  background: rgba(15, 23, 42, 0.55);
}

.dark-mode .input-icon:hover {
  background: rgba(255, 255, 255, 0.06);
}

.dark-mode .auth-legal-consent__check {
  color: var(--text);
}

.dark-mode .legal-list li,
.dark-mode .legal-bullet-list li,
.dark-mode .legal-paragraph {
  color: rgba(226, 232, 240, 0.92);
}

.dark-mode .route-tags span {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.dark-mode .menu-item {
  color: rgba(248, 250, 252, 0.96) !important;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.dark-mode .menu-item i {
  color: rgba(209, 250, 229, 0.55);
  transition: color 0.18s ease;
}

.dark-mode .menu-item:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.28);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.08);
  transform: translateX(-3px);
  color: #ecfdf5 !important;
}

.dark-mode .menu-item:hover i {
  color: #6ee7b7;
}

.dark-mode .menu-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.42);
}

.dark-mode .menu-item.active {
  background: rgba(5, 150, 105, 0.24);
  border-color: rgba(52, 211, 153, 0.4);
  color: #bbf7d0 !important;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(167, 243, 208, 0.12);
}

.dark-mode .menu-item.active i {
  color: #6ee7b7;
}

.dark-mode .menu-item:last-child {
  color: #fca5a5 !important;
}

.dark-mode .menu-item:last-child i {
  color: rgba(252, 165, 165, 0.95);
}

.dark-mode .menu-item:last-child:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.32);
  box-shadow: none;
  color: #fecaca !important;
  transform: translateX(-3px);
}

.dark-mode .menu-item:last-child:hover i {
  color: #fca5a5;
}

.dark-mode .menu-item:last-child:focus-visible {
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.45);
}

.dark-mode .area-selector select {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.dark-mode .area-selector select:focus {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.dark-mode #customAreaInput {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.dark-mode #customAreaInput::placeholder {
  color: var(--muted);
}

.dark-mode #customAreaInput:focus {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.dark-mode .leaflet-container {
  background: #141920 !important;
}

/* Passenger dark mode still uses light Carto tiles — gutter color matches basemap */
.dark-mode #map[data-tile-scheme="light"] .leaflet-container {
  background: #dfe7ef !important;
}

.dark-mode .leaflet-popup-content-wrapper {
  background: rgba(28, 33, 42, 0.94);
  color: var(--text);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-mode .leaflet-popup-content {
  color: var(--text);
}

.dark-mode .leaflet-popup-tip {
  background: rgba(28, 33, 42, 0.94);
}

/* Keep walk-time popup on brand red — same light/dark styling */
.dark-mode .leaflet-container .leaflet-popup.nav-walk-popup .leaflet-popup-content-wrapper {
  background: linear-gradient(180deg, #ff5a5a, #dc2626);
  border: none;
  box-shadow:
    0 4px 16px rgba(220, 38, 38, 0.5),
    0 0 0 2px rgba(255, 255, 255, 0.9);
}

.dark-mode .leaflet-container .leaflet-popup.nav-walk-popup .leaflet-popup-tip {
  width: 7px !important;
  height: 7px !important;
  margin: -3px auto 0 !important;
  background: #dc2626;
}

.dark-mode .leaflet-container .leaflet-popup.nav-walk-popup .leaflet-popup-content {
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
}

.dark-mode .map-controls button {
  background: rgba(22, 27, 36, 0.92);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.dark-mode .map-controls button:hover {
  background: rgba(38, 46, 60, 0.96);
}

.dark-mode .mini-map-controls button {
  background: rgba(22, 27, 36, 0.92);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.dark-mode .route-chip {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.dark-mode .suggestion-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.dark-mode #passengerHomeTop .container h2 {
  color: var(--text);
}

.dark-mode .empty-state p,
.dark-mode .empty-state--below-map p {
  color: var(--muted);
}



.dark-mode .section-divider {
  background: linear-gradient(to right, transparent, #333, transparent);
}

.dark-mode .featured-overlay,
.dark-mode .food-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.dark-mode .card:hover,
.dark-mode .tips-card:hover,
.dark-mode .tip-feed-card:hover,
.dark-mode .route-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* ================= MOBILE PRO UI FIX ================= */
@media (max-width: 600px) {
  .container,
  .driver-ui,
  .marshal-ui {
    max-width: 500px;
    margin: 0 auto;
  }

  .driver-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .driver-header-top {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
  }

  .live-text {
    font-size: 12px;
    color: #22c55e;
  }

  .page {
    padding-bottom: 80px;
    /* Keep clearing the real fixed header height — a hardcoded 55px top hides content (e.g. Tips kicker) under the bar */
    top: var(--header-offset);
  }

  .driver-ui {
    padding: 10px;
  }

  .driver-header h2 {
    font-size: 20px;
  }

  .live-text {
    font-size: 12px;
  }

  .driver-map-card,
  .marshal-map-card {
    height: 200px;
    border-radius: 12px;
    margin-bottom: 8px;
  }

  .driver-filters {
    display: flex;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .driver-online {
    margin-top: 8px;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
  }

  .driver-filters::-webkit-scrollbar {
    display: none;
  }

  .filter {
    font-size: 11px;
    padding: 5px 10px;
    white-space: nowrap;
    border-radius: 16px;
  }

  .driver-list .card {
    padding: 12px;
    font-size: 13px;
    border-radius: 10px;
  }

  .driver-online {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    padding: 12px;
  }

  .switch {
    align-self: flex-end;
  }

  .m-card {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 8px;
  }

  .m-card h4 {
    font-size: 15px;
  }

  .m-card small {
    font-size: 11px;
  }

  .marshal-ui {
    padding: 10px;
  }

  .marshal-location-card {
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    margin-bottom: 10px;
  }

  .location-status {
    align-self: flex-start;
    font-size: 11px;
  }

  .marshal-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .m-card {
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
  }

  .m-card h4 {
    font-size: 15px;
  }

  .m-card small {
    font-size: 11px;
  }

  .marshal-active-card {
    font-size: 13px;
    padding: 12px;
  }

  .marshal-location-card p {
    font-size: 13px;
  }
}
